Skip to contentSkip to conversation

Bluetooth: Update advertising data based on management commands

PATCH In review Marcel Holtmann 1 participant 1 message Oct 15, 2013

Subsystems (2)
lore
Share & tools
lore

Marcel Holtmann

author maintainer
#0 lore raw

PATCH 2/7 Bluetooth: Update advertising data based on management commands

Magically updating the advertising data when some random command enables advertising in the controller is not really a good idea. It also caused a bit of complicated code with the exported hci_udpate_ad function that is shared from many places.

This patch consolidates the advertising data update into the management core. It also makes sure that when powering on with LE enabled or later on enabling LE the controller has a good default for advertising data.

---
 include/net/bluetooth/hci_core.h |   2 -
 net/bluetooth/hci_core.c         |  87 +--------------------------
 net/bluetooth/hci_event.c        |   8 ---
 net/bluetooth/mgmt.c             | 126 +++++++++++++++++++++++++++++++++++----
 4 files changed, 116 insertions(+), 107 deletions(-)
include/net/bluetooth/hci_core.h +0 -2
index 4e20842..4a186ec 100644
@@ -1183,8 +1183,6 @@ struct hci_sec_filter {
 #define hci_req_lock(d)		mutex_lock(&d->req_lock)
 #define hci_req_unlock(d)	mutex_unlock(&d->req_lock)
 
-void hci_update_ad(struct hci_request *req);
-
 void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
 					u16 latency, u16 to_multiplier);
 void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8],
net/bluetooth/hci_core.c +1 -86

100 lines not on this page · raw message

net/bluetooth/hci_event.c +0 -8
index 5391469..7b133f0 100644
@@ -939,14 +939,6 @@ static void hci_cc_le_set_adv_enable(struct hci_dev *hdev, struct sk_buff *skb)
 			clear_bit(HCI_ADVERTISING, &hdev->dev_flags);
 	}
 
-	if (*sent && !test_bit(HCI_INIT, &hdev->flags)) {
-		struct hci_request req;
-
-		hci_req_init(&req, hdev);
-		hci_update_ad(&req);
-		hci_req_run(&req, NULL);
-	}
-
 	hci_dev_unlock(hdev);
 }
 
net/bluetooth/mgmt.c +115 -11

181 lines not on this page · raw message

Signature · 1 line
1.8.3.1