Skip to contentSkip to conversation

Bluetooth: Make it clear that disabling LE disables advertising

PATCH Applied Marcel Holtmann 2 participants 2 messages Oct 6, 2013

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: Make it clear that disabling LE disables advertising

This is not a functional change, just change the code to make it easy to understand that advertising gets disabled before LE support will be turned off.

---
 net/bluetooth/mgmt.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
net/bluetooth/mgmt.c +5 -2
index 7196722..e09ceff 100644
@@ -1505,8 +1505,11 @@ static int set_le(struct sock *sk, struct hci_dev *hdev, void *data, u16 len)
 
 	hci_req_init(&req, hdev);
 
-	if (test_bit(HCI_ADVERTISING, &hdev->dev_flags) && !val)
-		hci_req_add(&req, HCI_OP_LE_SET_ADV_ENABLE, sizeof(val), &val);
+	if (test_bit(HCI_ADVERTISING, &hdev->dev_flags) && !val) {
+		u8 adv = 0x00;
+
+		hci_req_add(&req, HCI_OP_LE_SET_ADV_ENABLE, sizeof(adv), &adv);
+	}
 
 	hci_req_add(&req, HCI_OP_WRITE_LE_HOST_SUPPORTED, sizeof(hci_cp),
 		    &hci_cp);
Signature · 1 line
1.8.3.1
#1 lore raw

Hi Marcel,

Quoted 8 lines · Marcel Holtmann

This is not a functional change, just change the code to make it easy to understand that advertising gets disabled before LE support will be turned off.

---
 net/bluetooth/mgmt.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Applied. Thanks.

Johan