Bluetooth: Fix using advertising instance duration as timeout
Subsystems (2)
Luiz Augusto von Dentz
maintainerPATCH 1/2 Bluetooth: Fix using advertising instance duration as timeout
From: Luiz Augusto von Dentz <[email protected]>
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.
--- net/bluetooth/hci_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/hci_request.c +1 -1
@@ -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 );
Signature · 1 line
2.21.0
Luiz Augusto von Dentz
maintainerPATCH 2/2 Bluetooth: Fix not using LE_ADV_NONCONN_IND for instance 0
From: Luiz Augusto von Dentz <[email protected]>
Instance 0 is controlled by stack itself and always set the local name in the scan response.
--- net/bluetooth/hci_request.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/bluetooth/hci_request.c +4 -4
@@ -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)
Signature · 1 line
2.21.0
Marcel Holtmann
maintainerRe: [PATCH 2/2] Bluetooth: Fix not using LE_ADV_NONCONN_IND for instance 0
Hi Luiz,
Quoted 7 lines
Instance 0 is controlled by stack itself and always set the local name in the scan response.
Signed-off-by Luiz Augusto von Dentz <[email protected]>---
net/bluetooth/hci_request.c| 8 ++++----1 file changed, 4 insertions(+), 4 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
Marcel Holtmann
maintainerHi Luiz,
Quoted 9 lines
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_minandinterval_maxwhen setting the parameters.Signed-off-by Luiz Augusto von Dentz <[email protected]>---
net/bluetooth/hci_request.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel