All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: Fix using advertising instance duration as timeout
@ 2019-10-24 13:15 Luiz Augusto von Dentz
  2019-10-24 13:15 ` [PATCH 2/2] Bluetooth: Fix not using LE_ADV_NONCONN_IND for instance 0 Luiz Augusto von Dentz
  2019-10-26  5:29 ` [PATCH 1/2] Bluetooth: Fix using advertising instance duration as timeout Marcel Holtmann
  0 siblings, 2 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2019-10-24 13:15 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

When using LE Set Extended Advertising Enable command the duration
refers to the lifetime of instance not the length which is actually
controlled by the interval_min and interval_max when setting the
parameters.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/hci_request.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index 7f6a581b5b7e..3a2ec34c2999 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -1690,7 +1690,7 @@ int __hci_req_enable_ext_advertising(struct hci_request *req, u8 instance)
 	 * scheduling it.
 	 */
 	if (adv_instance && adv_instance->duration) {
-		u16 duration = adv_instance->duration * MSEC_PER_SEC;
+		u16 duration = adv_instance->timeout * MSEC_PER_SEC;
 
 		/* Time = N * 10 ms */
 		adv_set->duration = cpu_to_le16(duration / 10);
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] Bluetooth: Fix not using LE_ADV_NONCONN_IND for instance 0
  2019-10-24 13:15 [PATCH 1/2] Bluetooth: Fix using advertising instance duration as timeout Luiz Augusto von Dentz
@ 2019-10-24 13:15 ` Luiz Augusto von Dentz
  2019-10-26  5:29   ` Marcel Holtmann
  2019-10-26  5:29 ` [PATCH 1/2] Bluetooth: Fix using advertising instance duration as timeout Marcel Holtmann
  1 sibling, 1 reply; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2019-10-24 13:15 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Instance 0 is controlled by stack itself and always set the local name
in the scan response.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/hci_request.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index 3a2ec34c2999..ba99c292cf04 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -904,9 +904,9 @@ static u8 get_adv_instance_scan_rsp_len(struct hci_dev *hdev, u8 instance)
 {
 	struct adv_info *adv_instance;
 
-	/* Ignore instance 0 */
+	/* Instance 0x00 always set local name */
 	if (instance == 0x00)
-		return 0;
+		return 1;
 
 	adv_instance = hci_find_adv_instance(hdev, instance);
 	if (!adv_instance)
@@ -923,9 +923,9 @@ static u8 get_cur_adv_instance_scan_rsp_len(struct hci_dev *hdev)
 	u8 instance = hdev->cur_adv_instance;
 	struct adv_info *adv_instance;
 
-	/* Ignore instance 0 */
+	/* Instance 0x00 always set local name */
 	if (instance == 0x00)
-		return 0;
+		return 1;
 
 	adv_instance = hci_find_adv_instance(hdev, instance);
 	if (!adv_instance)
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] Bluetooth: Fix using advertising instance duration as timeout
  2019-10-24 13:15 [PATCH 1/2] Bluetooth: Fix using advertising instance duration as timeout Luiz Augusto von Dentz
  2019-10-24 13:15 ` [PATCH 2/2] Bluetooth: Fix not using LE_ADV_NONCONN_IND for instance 0 Luiz Augusto von Dentz
@ 2019-10-26  5:29 ` Marcel Holtmann
  1 sibling, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2019-10-26  5:29 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

> When using LE Set Extended Advertising Enable command the duration
> refers to the lifetime of instance not the length which is actually
> controlled by the interval_min and interval_max when setting the
> parameters.
> 
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
> net/bluetooth/hci_request.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] Bluetooth: Fix not using LE_ADV_NONCONN_IND for instance 0
  2019-10-24 13:15 ` [PATCH 2/2] Bluetooth: Fix not using LE_ADV_NONCONN_IND for instance 0 Luiz Augusto von Dentz
@ 2019-10-26  5:29   ` Marcel Holtmann
  0 siblings, 0 replies; 4+ messages in thread
From: Marcel Holtmann @ 2019-10-26  5:29 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz,

> Instance 0 is controlled by stack itself and always set the local name
> in the scan response.
> 
> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> ---
> net/bluetooth/hci_request.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-10-26  5:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-24 13:15 [PATCH 1/2] Bluetooth: Fix using advertising instance duration as timeout Luiz Augusto von Dentz
2019-10-24 13:15 ` [PATCH 2/2] Bluetooth: Fix not using LE_ADV_NONCONN_IND for instance 0 Luiz Augusto von Dentz
2019-10-26  5:29   ` Marcel Holtmann
2019-10-26  5:29 ` [PATCH 1/2] Bluetooth: Fix using advertising instance duration as timeout Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.