linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Florian Grandel <fgrandel@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v2] Bluetooth: hci_core/mgmt: Change adv inst to list.
Date: Thu, 9 Apr 2015 12:49:13 +0300	[thread overview]
Message-ID: <20150409094913.GB10676@t440s.lan> (raw)
In-Reply-To: <1428258080-6275-1-git-send-email-fgrandel@gmail.com>

Hi Florian,

On Sun, Apr 05, 2015, Florian Grandel wrote:
> As a preparatory step towards multi-instance advertising it is
> necessary to introduce a data structure that supports storing
> multiple advertising info data structures for a bluetooth device.
> 
> This is introduced by refactoring the existing adv_instance member
> of the hci_dev struct into a linked list and making the necessary
> changes in the code to support this list.
> 
> Signed-off-by: Florian Grandel <fgrandel@gmail.com>
> ---
> 
> v1 -> v2: add missing braces in read_adv_features()
> 
>  include/net/bluetooth/hci_core.h |  21 ++-
>  net/bluetooth/hci_core.c         | 118 ++++++++++++-
>  net/bluetooth/mgmt.c             | 345 +++++++++++++++++++++------------------
>  3 files changed, 316 insertions(+), 168 deletions(-)

It'd be really good if you could try to split this patch up a bit. It
really is going over the limits of individual patch sizes that we're
comfortable with. See if you can split this up logically into at least
two, preferably more (3-4) patches while still keeping something that
compiles during each step.

> +			if (err == 0)
> +				advertising_removed(sk, hdev,
> +						    adv_instance->instance);
> +		}
> +	} else {
> +		err = hci_remove_adv_instance(hdev, instance);
> +		if (err == 0)
> +			advertising_removed(sk, hdev, instance);

I think if (!err) is the more consistent convension.

> +	err = hci_add_adv_instance(hdev, cp->instance, flags,
> +					 cp->adv_data_len, cp->data,
> +					 cp->scan_rsp_len,
> +					 cp->data + cp->adv_data_len,
> +					 adv_timeout_expired, timeout);

The split lines don't look like they're correctly lined up. They should
start from one column after the opening '(' on the first line.

> +	// TODO: Trigger an advertising added event even when instance
> +	// advertising is already switched on?

Please stick to /* ... */ for comments.

Johan

  reply	other threads:[~2015-04-09  9:49 UTC|newest]

Thread overview: 172+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-04 15:43 [PATCH] Bluetooth: hci_core/mgmt: Change adv inst to list Florian Grandel
2015-04-05 18:21 ` [PATCH v2] " Florian Grandel
2015-04-09  9:49   ` Johan Hedberg [this message]
2015-04-09 10:28     ` Florian Grandel
2015-04-10  2:30     ` [PATCH v3 0/2] Bluetooth: Multi-Advertising Infrastructure Florian Grandel
2015-04-21  1:52       ` jerico.dev
2015-04-30 15:33       ` [PATCH v4 00/17] BlueZ/Bluetooth: Multi-advertising infrastructure Florian Grandel
2015-05-06 10:27         ` jerico.dev
2015-05-24 22:38         ` [PATCH v5 00/16] Bluetooth: " Florian Grandel
2015-05-25  0:52           ` Marcel Holtmann
2015-05-25  7:51             ` Florian Grandel
2015-05-26  0:34           ` [PATCH v6 " Florian Grandel
2015-05-27 19:23             ` Marcel Holtmann
2015-05-27 21:04               ` Florian Grandel
2015-05-31  1:20                 ` Johan Hedberg
2015-06-01 12:19                   ` Florian Grandel
2015-06-13  3:40             ` [PATCH v7 00/20] Bluetooth: Multi-advertising Florian Grandel
2015-06-18  1:16               ` [PATCH v8 00/20] Multi-advertising Florian Grandel
2015-06-18 16:58                 ` Marcel Holtmann
2015-06-18  1:16               ` [PATCH v8 01/20] Bluetooth: hci_core/mgmt: Introduce multi-adv list Florian Grandel
2015-06-18  1:16               ` [PATCH v8 02/20] Bluetooth: hci_core/mgmt: move adv timeout to hdev Florian Grandel
2015-06-18  1:16               ` [PATCH v8 03/20] Bluetooth: mgmt: dry update_scan_rsp_data() Florian Grandel
2015-06-18  1:16               ` [PATCH v8 04/20] Bluetooth: mgmt: rename update_*_data_for_instance() Florian Grandel
2015-06-18  1:16               ` [PATCH v8 05/20] Bluetooth: mgmt: multi adv for read_adv_features() Florian Grandel
2015-06-18  1:16               ` [PATCH v8 06/20] Bluetooth: mgmt: multi adv for get_current_adv_instance() Florian Grandel
2015-06-18  1:16               ` [PATCH v8 07/20] Bluetooth: mgmt: multi adv for get_adv_instance_flags() Florian Grandel
2015-06-18  1:16               ` [PATCH v8 08/20] Bluetooth: mgmt: improve get_adv_instance_flags() readability Florian Grandel
2015-06-18  1:16               ` [PATCH v8 09/20] Bluetooth: mgmt: multi adv for enable_advertising() Florian Grandel
2015-06-18  1:16               ` [PATCH v8 10/20] Bluetooth: mgmt: multi adv for create_instance_scan_rsp_data() Florian Grandel
2015-06-18  1:16               ` [PATCH v8 11/20] Bluetooth: mgmt: multi adv for create_instance_adv_data() Florian Grandel
2015-06-18  1:16               ` [PATCH v8 12/20] Bluetooth: mgmt: multi adv for set_advertising*() Florian Grandel
2015-06-18  1:16               ` [PATCH v8 13/20] Bluetooth: mgmt: multi adv for clear_adv_instances() Florian Grandel
2015-06-18  1:16               ` [PATCH v8 14/20] Bluetooth: mgmt/hci_core: multi-adv for add_advertising*() Florian Grandel
2015-06-18  1:16               ` [PATCH v8 15/20] Bluetooth: mgmt: multi adv for remove_advertising*() Florian Grandel
2015-06-18  1:16               ` [PATCH v8 16/20] Bluetooth: mgmt: program multi-adv on power on Florian Grandel
2015-06-18  1:16               ` [PATCH v8 17/20] Bluetooth: mgmt: multi-adv for trigger_le_scan() Florian Grandel
2015-06-18  1:16               ` [PATCH v8 18/20] Bluetooth: mgmt: multi-adv for mgmt_reenable_advertising() Florian Grandel
2015-06-18  1:16               ` [PATCH v8 19/20] Bluetooth: hci_core: remove obsolete adv_instance Florian Grandel
2015-06-18  1:16               ` [PATCH v8 20/20] Bluetooth: hci_core: increase max adv inst Florian Grandel
2015-06-13  3:40             ` [PATCH v7 01/20] Bluetooth: hci_core/mgmt: Introduce multi-adv list Florian Grandel
2015-06-13  3:40             ` [PATCH v7 02/20] Bluetooth: hci_core/mgmt: move adv timeout to hdev Florian Grandel
2015-06-13  3:40             ` [PATCH v7 03/20] Bluetooth: mgmt: dry update_scan_rsp_data() Florian Grandel
2015-06-13  3:40             ` [PATCH v7 04/20] Bluetooth: mgmt: rename update_*_data_for_instance() Florian Grandel
2015-06-13  3:40             ` [PATCH v7 05/20] Bluetooth: mgmt: multi adv for read_adv_features() Florian Grandel
2015-06-13  3:40             ` [PATCH v7 06/20] Bluetooth: mgmt: multi adv for get_current_adv_instance() Florian Grandel
2015-06-13  3:41             ` [PATCH v7 07/20] Bluetooth: mgmt: multi adv for get_adv_instance_flags() Florian Grandel
2015-06-13  3:41             ` [PATCH v7 08/20] Bluetooth: mgmt: improve get_adv_instance_flags() readability Florian Grandel
2015-06-13  3:41             ` [PATCH v7 09/20] Bluetooth: mgmt: multi adv for enable_advertising() Florian Grandel
2015-06-13  3:41             ` [PATCH v7 10/20] Bluetooth: mgmt: multi adv for create_instance_scan_rsp_data() Florian Grandel
2015-06-13  3:41             ` [PATCH v7 11/20] Bluetooth: mgmt: multi adv for create_instance_adv_data() Florian Grandel
2015-06-13  3:41             ` [PATCH v7 12/20] Bluetooth: mgmt: multi adv for set_advertising*() Florian Grandel
2015-06-13  3:41             ` [PATCH v7 13/20] Bluetooth: mgmt: multi adv for clear_adv_instances() Florian Grandel
2015-06-13  3:41             ` [PATCH v7 14/20] Bluetooth: mgmt/hci_core: multi-adv for add_advertising*() Florian Grandel
2015-06-13  3:41             ` [PATCH v7 15/20] Bluetooth: mgmt: multi adv for remove_advertising*() Florian Grandel
2015-06-13  3:41             ` [PATCH v7 16/20] Bluetooth: mgmt: program multi-adv on power on Florian Grandel
2015-06-13  3:41             ` [PATCH v7 17/20] Bluetooth: mgmt: multi-adv for trigger_le_scan() Florian Grandel
2015-06-13  3:41             ` [PATCH v7 18/20] Bluetooth: mgmt: multi-adv for mgmt_reenable_advertising() Florian Grandel
2015-06-13  3:41             ` [PATCH v7 19/20] Bluetooth: hci_core: remove obsolete adv_instance Florian Grandel
2015-06-13  3:41             ` [PATCH v7 20/20] Bluetooth: hci_core: increase max adv inst Florian Grandel
2015-05-26  0:34           ` [PATCH v6 01/16] Bluetooth: hci_core: Introduce multi-adv inst list Florian Grandel
2015-05-26  0:34           ` [PATCH v6 02/16] Bluetooth: mgmt: dry update_scan_rsp_data() Florian Grandel
2015-05-26  0:34           ` [PATCH v6 03/16] Bluetooth: mgmt: multi adv for read_adv_features() Florian Grandel
2015-05-26  0:34           ` [PATCH v6 04/16] Bluetooth: mgmt: multi adv for get_current_adv_instance() Florian Grandel
2015-05-26  0:34           ` [PATCH v6 05/16] Bluetooth: mgmt: multi adv for get_adv_instance_flags() Florian Grandel
2015-05-26  0:34           ` [PATCH v6 06/16] Bluetooth: mgmt: improve get_adv_instance_flags() readability Florian Grandel
2015-05-26  0:34           ` [PATCH v6 07/16] Bluetooth: mgmt: multi adv for enable_advertising() Florian Grandel
2015-05-26  0:34           ` [PATCH v6 08/16] Bluetooth: mgmt: use current adv instance in set_advertising() Florian Grandel
2015-05-26  0:34           ` [PATCH v6 09/16] Bluetooth: mgmt: multi adv for create_instance_scan_rsp_data() Florian Grandel
2015-05-26  0:34           ` [PATCH v6 10/16] Bluetooth: mgmt: multi adv for create_instance_adv_data() Florian Grandel
2015-05-26  0:34           ` [PATCH v6 11/16] Bluetooth: mgmt: refactor update_*_data() Florian Grandel
2015-05-26  0:34           ` [PATCH v6 12/16] Bluetooth: mgmt: multi adv for set_advertising_complete() Florian Grandel
2015-05-26  0:34           ` [PATCH v6 13/16] Bluetooth: mgmt: multi adv for add_advertising() Florian Grandel
2015-05-26  0:34           ` [PATCH v6 14/16] Bluetooth: mgmt: multi adv for clear_adv_instances() Florian Grandel
2015-05-26  0:34           ` [PATCH v6 15/16] Bluetooth: mgmt: multi adv for remove_advertising() Florian Grandel
2015-05-26  0:34           ` [PATCH v6 16/16] Bluetooth: hci_core: remove obsolete adv_instance Florian Grandel
2015-05-24 22:38         ` [PATCH v5 01/16] Bluetooth: hci_core: Introduce multi-adv inst list Florian Grandel
2015-05-24 22:39         ` [PATCH v5 02/16] Bluetooth: mgmt: dry update_scan_rsp_data() Florian Grandel
2015-05-24 22:39         ` [PATCH v5 03/16] Bluetooth: mgmt: multi adv for read_adv_features() Florian Grandel
2015-05-24 22:39         ` [PATCH v5 04/16] Bluetooth: mgmt: multi adv for get_current_adv_instance() Florian Grandel
2015-05-24 22:39         ` [PATCH v5 05/16] Bluetooth: mgmt: multi adv for get_adv_instance_flags() Florian Grandel
2015-05-24 22:39         ` [PATCH v5 06/16] Bluetooth: mgmt: improve get_adv_instance_flags() readability Florian Grandel
2015-05-24 22:39         ` [PATCH v5 07/16] Bluetooth: mgmt: multi adv for enable_advertising() Florian Grandel
2015-05-24 22:39         ` [PATCH v5 08/16] Bluetooth: mgmt: use current adv instance in set_advertising() Florian Grandel
2015-05-24 22:39         ` [PATCH v5 09/16] Bluetooth: mgmt: multi adv for create_instance_scan_rsp_data() Florian Grandel
2015-05-24 22:39         ` [PATCH v5 10/16] Bluetooth: mgmt: multi adv for create_instance_adv_data() Florian Grandel
2015-05-24 22:39         ` [PATCH v5 11/16] Bluetooth: mgmt: refactor update_*_data() Florian Grandel
2015-05-24 22:39         ` [PATCH v5 12/16] Bluetooth: mgmt: multi adv for set_advertising_complete() Florian Grandel
2015-05-25  0:25           ` Marcel Holtmann
2015-05-25  8:03             ` Florian Grandel
2015-05-24 22:39         ` [PATCH v5 13/16] Bluetooth: mgmt: multi adv for add_advertising() Florian Grandel
2015-05-24 22:39         ` [PATCH v5 14/16] Bluetooth: mgmt: multi adv for clear_adv_instances() Florian Grandel
2015-05-24 22:39         ` [PATCH v5 15/16] Bluetooth: mgmt: multi adv for remove_advertising() Florian Grandel
2015-05-24 22:39         ` [PATCH v5 16/16] Bluetooth: hci_core: remove obsolete adv_instance Florian Grandel
2015-05-24 22:40         ` [BlueZ v5] tools/mgmt_tester: expect 0 rp when removing all adv inst Florian Grandel
2015-05-25  0:52           ` Marcel Holtmann
2015-05-25  7:53             ` Florian Grandel
2015-05-26  0:35           ` [BlueZ v6 0/4] tools/mgmt-tester: multi-advertising additions Florian Grandel
2015-05-26  1:22             ` [BlueZ v7 " Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 00/15] doc/tests/btmgmt: multi-advertising Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 00/16] Multi-advertising Florian Grandel
2015-06-18  5:55                   ` Johan Hedberg
2015-06-18  7:11                     ` Johan Hedberg
2015-06-18 10:19                   ` Johan Hedberg
2015-06-18  1:17                 ` [BlueZ v9 01/16] doc/mgmt-api: multi-adv implementation details Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 02/16] doc/mgmt-api: fix typos Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 03/16] tools/btmgmt: make inst duration configurable Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 04/16] tools/mgmt-tester: error message when unexp params Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 05/16] tools/mgmt-tester: expect 0 rp when removing all adv inst Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 06/16] tools/mgmt-tester: comment add adv test setup Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 07/16] tools/mgmt-tester: rename add adv tests Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 08/16] tools/mgmt-tester: increase max adv inst Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 09/16] tools/mgmt-tester: keep instances on power cycle Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 10/16] tools/mgmt-tester: test adv inst override Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 11/16] tools/mgmt-tester: make test timeout configurable Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 12/16] tools/mgmt-tester: allow for event-only tests Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 13/16] tools/mgmt-tester: test advertising timeout Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 14/16] tools/mgmt-tester: test le off Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 15/16] tools/mgmt-tester: fix duplicate code Florian Grandel
2015-06-18  1:17                 ` [BlueZ v9 16/16] tools/mgmt-tester: test multi-adv Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 01/15] doc/mgmt-api: multi-adv implementation details Florian Grandel
2015-06-15 11:33                 ` Marcel Holtmann
2015-06-16  9:59                   ` Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 02/15] doc/mgmt-api: fix typos Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 03/15] tools/btmgmt: make inst duration configurable Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 04/15] tools/mgmt-tester: error message when unexp params Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 05/15] tools/mgmt-tester: expect 0 rp when removing all adv inst Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 06/15] tools/mgmt-tester: comment add adv test setup Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 07/15] tools/mgmt-tester: rename add adv tests Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 08/15] tools/mgmt-tester: increase max adv inst Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 09/15] tools/mgmt-tester: test adv inst override Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 10/15] tools/mgmt-tester: make test timeout configurable Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 11/15] tools/mgmt-tester: allow for event-only tests Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 12/15] tools/mgmt-tester: test advertising timeout Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 13/15] tools/mgmt-tester: test le off Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 14/15] tools/mgmt-tester: fix duplicate code Florian Grandel
2015-06-13  3:42               ` [BlueZ v8 15/15] tools/mgmt-tester: test multi-adv Florian Grandel
2015-05-26  1:22             ` [BlueZ v7 1/4] tools/mgmt_tester: expect 0 rp when removing all adv inst Florian Grandel
2015-05-26  1:22             ` [BlueZ v7 2/4] tools/mgmt-tester: comment add adv test setup Florian Grandel
2015-05-26  1:22             ` [BlueZ v7 3/4] tools/mgmt-tester: rename add adv tests Florian Grandel
2015-05-26  1:22             ` [BlueZ v7 4/4] tools/mgmt-tester: add an additional add adv test Florian Grandel
2015-05-26  0:35           ` [BlueZ v6 1/4] tools/mgmt_tester: expect 0 rp when removing all adv inst Florian Grandel
2015-05-26  0:35           ` [BlueZ v6 2/4] tools/mgmt-tester: comment add adv test setup Florian Grandel
2015-05-26  0:35           ` [BlueZ v6 3/4] tools/mgmt-tester: rename add adv tests Florian Grandel
2015-05-26  0:35           ` [BlueZ v6 4/4] tools/mgmt-tester: add an additional add adv test Florian Grandel
2015-04-30 15:33       ` [BlueZ v4 01/17] tools/mgmt_tester: expect 0 rp when removing all adv inst Florian Grandel
2015-04-30 15:33       ` [PATCH v4 02/17] Bluetooth: hci_core: Introduce multi-adv inst list Florian Grandel
2015-05-23 21:25         ` Marcel Holtmann
2015-05-24 21:50           ` Florian Grandel
2015-04-30 15:33       ` [PATCH v4 03/17] Bluetooth: mgmt: dry update_scan_rsp_data() Florian Grandel
2015-04-30 15:33       ` [PATCH v4 04/17] Bluetooth: mgmt: multi adv for read_adv_features() Florian Grandel
2015-05-23 21:25         ` Marcel Holtmann
2015-05-24 22:41           ` Florian Grandel
2015-04-30 15:33       ` [PATCH v4 05/17] Bluetooth: mgmt: multi adv for get_current_adv_instance() Florian Grandel
2015-04-30 15:33       ` [PATCH v4 06/17] Bluetooth: mgmt: multi adv for get_adv_instance_flags() Florian Grandel
2015-04-30 15:33       ` [PATCH v4 07/17] Bluetooth: mgmt: improve get_adv_instance_flags() readability Florian Grandel
2015-04-30 15:33       ` [PATCH v4 08/17] Bluetooth: mgmt: multi adv for enable_advertising() Florian Grandel
2015-04-30 15:33       ` [PATCH v4 09/17] Bluetooth: mgmt: use current adv instance in set_advertising() Florian Grandel
2015-04-30 15:33       ` [PATCH v4 10/17] Bluetooth: mgmt: multi adv for create_instance_scan_rsp_data() Florian Grandel
2015-04-30 15:33       ` [PATCH v4 11/17] Bluetooth: mgmt: multi adv for create_instance_adv_data() Florian Grandel
2015-04-30 15:33       ` [PATCH v4 12/17] Bluetooth: mgmt: refactor update_*_data() Florian Grandel
2015-04-30 15:33       ` [PATCH v4 13/17] Bluetooth: mgmt: multi adv for set_advertising_complete() Florian Grandel
2015-04-30 15:33       ` [PATCH v4 14/17] Bluetooth: mgmt: multi adv for add_advertising() Florian Grandel
2015-04-30 15:33       ` [PATCH v4 15/17] Bluetooth: mgmt: multi adv for clear_adv_instances() Florian Grandel
2015-04-30 15:33       ` [PATCH v4 16/17] Bluetooth: multi adv for remove_advertising() Florian Grandel
2015-04-30 15:33       ` [PATCH v4 17/17] Bluetooth: hci_core: Remove obsolete adv_instance Florian Grandel
2015-04-10  2:30     ` [PATCH v3 1/2] Bluetooth: hci_core: Introduce multi-adv inst list Florian Grandel
2015-04-24  0:37       ` Arman Uguray
2015-04-29 12:20         ` Florian Grandel
2015-04-10  2:30     ` [PATCH v3 2/2] Bluetooth: mgmt: Start using " Florian Grandel
2015-04-24  1:33       ` Arman Uguray
2015-04-24 11:43         ` Florian Grandel
2015-04-30 15:46         ` Florian Grandel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150409094913.GB10676@t440s.lan \
    --to=johan.hedberg@gmail.com \
    --cc=fgrandel@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).