Skip to contentSkip to conversation

Bluetooth: Connection parameter support

PATCH In review [email protected] 2 participants 12 messages Jul 2, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover Bluetooth: Connection parameter support

Hi,

Here's a v2 of my set with off-list feedback taken into account.

Johan

----------------------------------------------------------------
Johan Hedberg (10):
Bluetooth: Rename hci_conn_params_clear to hci_conn_params_clear_all
Bluetooth: Add specific connection parameter clear functions
Bluetooth: Add new auto_conn value matching mgmt action 0x00
Bluetooth: Remove only enabled entries with Remove Device command
Bluetooth: Add Load Connection Parameters command
Bluetooth: Fix missing update of conn params
Bluetooth: Make hci_le_conn_update return the store hint
Bluetooth: Pass store hint to mgmt_new_conn_param
Bluetooth: Make is_identity_address a global function
Bluetooth: Don't send connection parameters without identity address

 include/net/bluetooth/hci_core.h |  25 ++++++--
 include/net/bluetooth/mgmt.h     |  15 +++++
 net/bluetooth/hci_conn.c         |   9 ++-
 net/bluetooth/hci_core.c         |  51 ++++++++++-----
 net/bluetooth/hci_event.c        |  26 +++++++-
 net/bluetooth/l2cap_core.c       |   8 ++-
 net/bluetooth/mgmt.c             | 113 +++++++++++++++++++++++++++++++--
 7 files changed, 214 insertions(+), 33 deletions(-)
#1 lore raw

PATCH v2 1/10 Bluetooth: Rename hci_conn_params_clear to hci_conn_params_clear_all

From: Johan Hedberg <[email protected]>

We'll soon have specific clear functions for clearing enabled or disabled entries, so rename the function that removes everything to clear_all().

---
 include/net/bluetooth/hci_core.h | 2 +-
 net/bluetooth/hci_core.c         | 4 ++--
 net/bluetooth/mgmt.c             | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
include/net/bluetooth/hci_core.h +1 -1
index ee480a86e558..091934bcfd84 100644
@@ -861,7 +861,7 @@ struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev,
 int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type,
 			u8 auto_connect);
 void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type);
-void hci_conn_params_clear(struct hci_dev *hdev);
+void hci_conn_params_clear_all(struct hci_dev *hdev);
 
 struct bdaddr_list *hci_pend_le_conn_lookup(struct hci_dev *hdev,
 					    bdaddr_t *addr, u8 addr_type);
net/bluetooth/hci_core.c +2 -2
index 21a4c8dfb874..e6e169007fd2 100644
@@ -3580,7 +3580,7 @@ void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type)
 }
 
 /* This function requires the caller holds hdev->lock */
-void hci_conn_params_clear(struct hci_dev *hdev)
+void hci_conn_params_clear_all(struct hci_dev *hdev)
 {
 	struct hci_conn_params *params, *tmp;
 
@@ -4038,7 +4038,7 @@ void hci_unregister_dev(struct hci_dev *hdev)
 	hci_smp_irks_clear(hdev);
 	hci_remote_oob_data_clear(hdev);
 	hci_white_list_clear(hdev);
-	hci_conn_params_clear(hdev);
+	hci_conn_params_clear_all(hdev);
 	hci_dev_unlock(hdev);
 
 	hci_dev_put(hdev);
net/bluetooth/mgmt.c +1 -1
index 93cfefa260d5..29850e76ea3c 100644
@@ -5104,7 +5104,7 @@ static int remove_device(struct sock *sk, struct hci_dev *hdev,
 			goto unlock;
 		}
 
-		hci_conn_params_clear(hdev);
+		hci_conn_params_clear_all(hdev);
 	}
 
 	err = cmd_complete(sk, hdev->id, MGMT_OP_REMOVE_DEVICE,
Signature · 1 line
1.9.3
#2 lore raw

PATCH v2 2/10 Bluetooth: Add specific connection parameter clear functions

In reply to [email protected]

From: Johan Hedberg <[email protected]>

In some circumstances we'll need to either clear only the enabled parameters or only the disabled ones. This patch adds convenience functions for this purpose.

---
 include/net/bluetooth/hci_core.h |  2 ++
 net/bluetooth/hci_core.c         | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+)
include/net/bluetooth/hci_core.h +2 -0
index 091934bcfd84..2091e0013b8c 100644
@@ -862,6 +862,8 @@ int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type,
 			u8 auto_connect);
 void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type);
 void hci_conn_params_clear_all(struct hci_dev *hdev);
+void hci_conn_params_clear_disabled(struct hci_dev *hdev);
+void hci_conn_params_clear_enabled(struct hci_dev *hdev);
 
 struct bdaddr_list *hci_pend_le_conn_lookup(struct hci_dev *hdev,
 					    bdaddr_t *addr, u8 addr_type);
net/bluetooth/hci_core.c +32 -0
index e6e169007fd2..7e46a7c6092f 100644
@@ -3580,6 +3580,38 @@ void hci_conn_params_del(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type)
 }
 
 /* This function requires the caller holds hdev->lock */
+void hci_conn_params_clear_disabled(struct hci_dev *hdev)
+{
+	struct hci_conn_params *params, *tmp;
+
+	list_for_each_entry_safe(params, tmp, &hdev->le_conn_params, list) {
+		if (params->auto_connect != HCI_AUTO_CONN_DISABLED)
+			continue;
+		list_del(&params->list);
+		kfree(params);
+	}
+
+	BT_DBG("All LE disabled connection parameters were removed");
+}
+
+/* This function requires the caller holds hdev->lock */
+void hci_conn_params_clear_enabled(struct hci_dev *hdev)
+{
+	struct hci_conn_params *params, *tmp;
+
+	list_for_each_entry_safe(params, tmp, &hdev->le_conn_params, list) {
+		if (params->auto_connect == HCI_AUTO_CONN_DISABLED)
+			continue;
+		list_del(&params->list);
+		kfree(params);
+	}
+
+	hci_pend_le_conns_clear(hdev);
+
+	BT_DBG("All enabled LE connection parameters were removed");
+}
+
+/* This function requires the caller holds hdev->lock */
 void hci_conn_params_clear_all(struct hci_dev *hdev)
 {
 	struct hci_conn_params *params, *tmp;
Signature · 1 line
1.9.3
#3 lore raw

PATCH v2 3/10 Bluetooth: Add new auto_conn value matching mgmt action 0x00

In reply to [email protected]

From: Johan Hedberg <[email protected]>

The 0x00 action value of mgmt means "scan and report" but do not connect. This is different from HCI_AUTO_CONN_DISABLED so we need a new value for it.

---
 include/net/bluetooth/hci_core.h | 1 +
 net/bluetooth/hci_core.c         | 1 +
 net/bluetooth/mgmt.c             | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)
include/net/bluetooth/hci_core.h +1 -0
index 2091e0013b8c..f4a2f50f30b5 100644
@@ -449,6 +449,7 @@ struct hci_conn_params {
 
 	enum {
 		HCI_AUTO_CONN_DISABLED,
+		HCI_AUTO_CONN_REPORT,
 		HCI_AUTO_CONN_ALWAYS,
 		HCI_AUTO_CONN_LINK_LOSS,
 	} auto_connect;
net/bluetooth/hci_core.c +1 -0
index 7e46a7c6092f..a3cd0bbd3518 100644
@@ -3547,6 +3547,7 @@ int hci_conn_params_set(struct hci_dev *hdev, bdaddr_t *addr, u8 addr_type,
 
 	switch (auto_connect) {
 	case HCI_AUTO_CONN_DISABLED:
+	case HCI_AUTO_CONN_REPORT:
 	case HCI_AUTO_CONN_LINK_LOSS:
 		hci_pend_le_conn_del(hdev, addr, addr_type);
 		break;
net/bluetooth/mgmt.c +1 -1
index 29850e76ea3c..f7217f9eda03 100644
@@ -5034,7 +5034,7 @@ static int add_device(struct sock *sk, struct hci_dev *hdev,
 	if (cp->action)
 		auto_conn = HCI_AUTO_CONN_ALWAYS;
 	else
-		auto_conn = HCI_AUTO_CONN_DISABLED;
+		auto_conn = HCI_AUTO_CONN_REPORT;
 
 	/* If the connection parameters don't exist for this device,
 	 * they will be created and configured with defaults.
Signature · 1 line
1.9.3
#4 lore raw

PATCH v2 4/10 Bluetooth: Remove only enabled entries with Remove Device command

In reply to [email protected]

From: Johan Hedberg <[email protected]>

The Remove Device mgmt command is supposed to undo what the Add Device command does. An entry added by Add Device cannot have the HCI_AUTO_CONN_DISABLED auto_connect value, so we should treat this as an invalid entry to remove. This patch adds the necessary pieces to the Remove Device command handler so that it only removes entries which were added by Add Device.

---
 net/bluetooth/mgmt.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)
net/bluetooth/mgmt.c +21 -2
index f7217f9eda03..574dd9f7c39e 100644
@@ -5079,6 +5079,7 @@ static int remove_device(struct sock *sk, struct hci_dev *hdev,
 	hci_dev_lock(hdev);
 
 	if (bacmp(&cp->addr.bdaddr, BDADDR_ANY)) {
+		struct hci_conn_params *params;
 		u8 addr_type;
 
 		if (!bdaddr_type_is_le(cp->addr.type)) {
@@ -5093,7 +5094,25 @@ static int remove_device(struct sock *sk, struct hci_dev *hdev,
 		else
 			addr_type = ADDR_LE_DEV_RANDOM;
 
-		hci_conn_params_del(hdev, &cp->addr.bdaddr, addr_type);
+		params = hci_conn_params_lookup(hdev, &cp->addr.bdaddr,
+						addr_type);
+		if (!params) {
+			err = cmd_complete(sk, hdev->id, MGMT_OP_REMOVE_DEVICE,
+					   MGMT_STATUS_INVALID_PARAMS,
+					   &cp->addr, sizeof(cp->addr));
+			goto unlock;
+		}
+
+		if (params->auto_connect == HCI_AUTO_CONN_DISABLED) {
+			err = cmd_complete(sk, hdev->id, MGMT_OP_REMOVE_DEVICE,
+					   MGMT_STATUS_INVALID_PARAMS,
+					   &cp->addr, sizeof(cp->addr));
+			goto unlock;
+		}
+
+		hci_pend_le_conn_del(hdev, &cp->addr.bdaddr, addr_type);
+		list_del(&params->list);
+		kfree(params);
 
 		device_removed(sk, hdev, &cp->addr.bdaddr, cp->addr.type);
 	} else {
@@ -5104,7 +5123,7 @@ static int remove_device(struct sock *sk, struct hci_dev *hdev,
 			goto unlock;
 		}
 
-		hci_conn_params_clear_all(hdev);
+		hci_conn_params_clear_enabled(hdev);
 	}
 
 	err = cmd_complete(sk, hdev->id, MGMT_OP_REMOVE_DEVICE,
Signature · 1 line
1.9.3
#5 lore raw

PATCH v2 5/10 Bluetooth: Add Load Connection Parameters command

In reply to [email protected]

From: Johan Hedberg <[email protected]>

This patch implements the new Load Connection Parameters mgmt command that's intended to load the desired connection parameters for LE devices.

---
 include/net/bluetooth/mgmt.h | 15 +++++++++
 net/bluetooth/mgmt.c         | 79 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 94 insertions(+)
include/net/bluetooth/mgmt.h +15 -0
index 3c0f29614d1b..5b3e8009eddd 100644
@@ -449,6 +449,21 @@ struct mgmt_cp_remove_device {
 } __packed;
 #define MGMT_REMOVE_DEVICE_SIZE		MGMT_ADDR_INFO_SIZE
 
+struct mgmt_conn_param {
+	struct mgmt_addr_info addr;
+	__le16 min_interval;
+	__le16 max_interval;
+	__le16 latency;
+	__le16 timeout;
+} __packed;
+
+#define MGMT_OP_LOAD_CONN_PARAM		0x0035
+struct mgmt_cp_load_conn_param {
+	__le16 param_count;
+	struct mgmt_conn_param params[0];
+} __packed;
+#define MGMT_LOAD_CONN_PARAM_SIZE	2
+
 #define MGMT_EV_CMD_COMPLETE		0x0001
 struct mgmt_ev_cmd_complete {
 	__le16	opcode;
net/bluetooth/mgmt.c +79 -0

97 lines not on this page · raw message

Signature · 1 line
1.9.3
#6 lore raw

PATCH v2 6/10 Bluetooth: Fix missing update of conn params

In reply to [email protected]

From: Johan Hedberg <[email protected]>

We should update any stored connection parameters when we receive the LE Remote Connection Parameter Request HCI event. This patch adds the necessary code to the function that handles the event.

---
 net/bluetooth/hci_event.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
net/bluetooth/hci_event.c +17 -1
index ed49a065dd67..3ad2576fd3f1 100644
@@ -4429,9 +4429,25 @@ static void hci_le_remote_conn_param_req_evt(struct hci_dev *hdev,
 		return send_conn_param_neg_reply(hdev, handle,
 						 HCI_ERROR_INVALID_LL_PARAMS);
 
-	if (test_bit(HCI_CONN_MASTER, &hcon->flags))
+	if (test_bit(HCI_CONN_MASTER, &hcon->flags)) {
+		struct hci_conn_params *params;
+
+		hci_dev_lock(hdev);
+
+		params = hci_conn_params_lookup(hdev, &hcon->dst,
+						hcon->dst_type);
+		if (params) {
+			params->conn_min_interval = min;
+			params->conn_max_interval = max;
+			params->conn_latency = latency;
+			params->supervision_timeout = timeout;
+		}
+
+		hci_dev_unlock(hdev);
+
 		mgmt_new_conn_param(hdev, &hcon->dst, hcon->dst_type, min, max,
 				    latency, timeout);
+	}
 
 	cp.handle = ev->handle;
 	cp.interval_min = ev->interval_min;
Signature · 1 line
1.9.3
#7 lore raw

PATCH v2 7/10 Bluetooth: Make hci_le_conn_update return the store hint

In reply to [email protected]

From: Johan Hedberg <[email protected]>

The caller of hci_le_conn_update is directly interested in knowing what the best value is for the store_hint parameter of the corresponding mgmt event. Since hci_le_conn_update knows whether there were stored parameters that were updated or not we can have it return an initial store_hint value to the caller.

---
 include/net/bluetooth/hci_core.h | 4 ++--
 net/bluetooth/hci_conn.c         | 9 +++++++--
 2 files changed, 9 insertions(+), 4 deletions(-)
include/net/bluetooth/hci_core.h +2 -2
index f4a2f50f30b5..32c8e51f6b26 100644
@@ -1368,8 +1368,8 @@ 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_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
-					u16 latency, u16 to_multiplier);
+u8 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, __le64 rand,
 							__u8 ltk[16]);
 
net/bluetooth/hci_conn.c +7 -2
index d00aaf976efc..0d579d036833 100644
@@ -213,8 +213,8 @@ bool hci_setup_sync(struct hci_conn *conn, __u16 handle)
 	return true;
 }
 
-void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
-			u16 latency, u16 to_multiplier)
+u8 hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, u16 latency,
+		      u16 to_multiplier)
 {
 	struct hci_dev *hdev = conn->hdev;
 	struct hci_conn_params *params;
@@ -242,6 +242,11 @@ void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
 	cp.max_ce_len		= cpu_to_le16(0x0000);
 
 	hci_send_cmd(hdev, HCI_OP_LE_CONN_UPDATE, sizeof(cp), &cp);
+
+	if (params)
+		return 0x01;
+
+	return 0x00;
 }
 
 void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __le64 rand,
Signature · 1 line
1.9.3
#8 lore raw

PATCH v2 8/10 Bluetooth: Pass store hint to mgmt_new_conn_param

In reply to [email protected]

From: Johan Hedberg <[email protected]>

The calling functions of mgmt_new_conn_param have more information about the parameters, such as whether the kernel is tracking them or not. It makes therefore sense to have them pass an initial store_hint value to the mgmt_new_conn_param function.

---
 include/net/bluetooth/hci_core.h | 4 ++--
 net/bluetooth/hci_event.c        | 8 ++++++--
 net/bluetooth/l2cap_core.c       | 8 ++++++--
 net/bluetooth/mgmt.c             | 6 +++---
 4 files changed, 17 insertions(+), 9 deletions(-)
include/net/bluetooth/hci_core.h +2 -2
index 32c8e51f6b26..d0bca13843ce 100644
@@ -1335,8 +1335,8 @@ void mgmt_new_irk(struct hci_dev *hdev, struct smp_irk *irk);
 void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk,
 		   bool persistent);
 void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr,
-			 u8 bdaddr_type, u16 min_interval, u16 max_interval,
-			 u16 latency, u16 timeout);
+			 u8 bdaddr_type, u8 store_hint, u16 min_interval,
+			 u16 max_interval, u16 latency, u16 timeout);
 void mgmt_reenable_advertising(struct hci_dev *hdev);
 void mgmt_smp_complete(struct hci_conn *conn, bool complete);
 
net/bluetooth/hci_event.c +6 -2
index 3ad2576fd3f1..846f6a6af881 100644
@@ -4431,6 +4431,7 @@ static void hci_le_remote_conn_param_req_evt(struct hci_dev *hdev,
 
 	if (test_bit(HCI_CONN_MASTER, &hcon->flags)) {
 		struct hci_conn_params *params;
+		u8 store_hint;
 
 		hci_dev_lock(hdev);
 
@@ -4441,12 +4442,15 @@ static void hci_le_remote_conn_param_req_evt(struct hci_dev *hdev,
 			params->conn_max_interval = max;
 			params->conn_latency = latency;
 			params->supervision_timeout = timeout;
+			store_hint = 0x01;
+		} else{
+			store_hint = 0x00;
 		}
 
 		hci_dev_unlock(hdev);
 
-		mgmt_new_conn_param(hdev, &hcon->dst, hcon->dst_type, min, max,
-				    latency, timeout);
+		mgmt_new_conn_param(hdev, &hcon->dst, hcon->dst_type,
+				    store_hint, min, max, latency, timeout);
 	}
 
 	cp.handle = ev->handle;
net/bluetooth/l2cap_core.c +6 -2
index a6e276204ae9..dbef22d644e2 100644
@@ -5250,10 +5250,14 @@ static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn,
 		       sizeof(rsp), &rsp);
 
 	if (!err) {
+		u8 store_hint;
+
+		store_hint = hci_le_conn_update(hcon, min, max, latency,
+						to_multiplier);
 		mgmt_new_conn_param(hcon->hdev, &hcon->dst, hcon->dst_type,
-				    min, max, latency, to_multiplier);
+				    store_hint, min, max, latency,
+				    to_multiplier);
 
-		hci_le_conn_update(hcon, min, max, latency, to_multiplier);
 	}
 
 	return 0;
net/bluetooth/mgmt.c +3 -3
index 59bf1ac41429..fb1aa0cac137 100644
@@ -5790,15 +5790,15 @@ void mgmt_new_csrk(struct hci_dev *hdev, struct smp_csrk *csrk,
 }
 
 void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr,
-			 u8 bdaddr_type, u16 min_interval, u16 max_interval,
-			 u16 latency, u16 timeout)
+			 u8 bdaddr_type, u8 store_hint, u16 min_interval,
+			 u16 max_interval, u16 latency, u16 timeout)
 {
 	struct mgmt_ev_new_conn_param ev;
 
 	memset(&ev, 0, sizeof(ev));
 	bacpy(&ev.addr.bdaddr, bdaddr);
 	ev.addr.type = link_to_bdaddr(LE_LINK, bdaddr_type);
-	ev.store_hint = 0x00;
+	ev.store_hint = store_hint;
 	ev.min_interval = cpu_to_le16(min_interval);
 	ev.max_interval = cpu_to_le16(max_interval);
 	ev.latency = cpu_to_le16(latency);
Signature · 1 line
1.9.3
#9 lore raw

PATCH v2 9/10 Bluetooth: Make is_identity_address a global function

In reply to [email protected]

From: Johan Hedberg <[email protected]>

There are more places that can take advantage of is_identity_address() besides hci_core.c. This patch moves the function to hci_core.h and gives it the appropriate hci_ prefix.

---
 include/net/bluetooth/hci_core.h | 12 ++++++++++++
 net/bluetooth/hci_core.c         | 14 +-------------
 2 files changed, 13 insertions(+), 13 deletions(-)
include/net/bluetooth/hci_core.h +12 -0
index d0bca13843ce..92f1bad6e22d 100644
@@ -1179,6 +1179,18 @@ static inline bool hci_bdaddr_is_rpa(bdaddr_t *bdaddr, u8 addr_type)
 	return false;
 }
 
+static inline bool hci_is_identity_address(bdaddr_t *addr, u8 addr_type)
+{
+	if (addr_type == ADDR_LE_DEV_PUBLIC)
+		return true;
+
+	/* Check for Random Static address type */
+	if ((addr->b[5] & 0xc0) == 0xc0)
+		return true;
+
+	return false;
+}
+
 static inline struct smp_irk *hci_get_irk(struct hci_dev *hdev,
 					  bdaddr_t *bdaddr, u8 addr_type)
 {
net/bluetooth/hci_core.c +1 -13
index a3cd0bbd3518..1fff3d890f41 100644
@@ -3412,18 +3412,6 @@ static bool is_connected(struct hci_dev *hdev, bdaddr_t *addr, u8 type)
 	return true;
 }
 
-static bool is_identity_address(bdaddr_t *addr, u8 addr_type)
-{
-	if (addr_type == ADDR_LE_DEV_PUBLIC)
-		return true;
-
-	/* Check for Random Static address type */
-	if ((addr->b[5] & 0xc0) == 0xc0)
-		return true;
-
-	return false;
-}
-
 /* This function requires the caller holds hdev->lock */
 struct bdaddr_list *hci_pend_le_conn_lookup(struct hci_dev *hdev,
 					    bdaddr_t *addr, u8 addr_type)
@@ -3504,7 +3492,7 @@ struct hci_conn_params *hci_conn_params_add(struct hci_dev *hdev,
 {
 	struct hci_conn_params *params;
 
-	if (!is_identity_address(addr, addr_type))
+	if (!hci_is_identity_address(addr, addr_type))
 		return NULL;
 
 	params = hci_conn_params_lookup(hdev, addr, addr_type);
Signature · 1 line
1.9.3
#10 lore raw

PATCH v2 10/10 Bluetooth: Don't send connection parameters without identity address

In reply to [email protected]

From: Johan Hedberg <[email protected]>

If we don't have an identity address for connection parameters it doesn't really make sense to send them to user space. Instead just ignore them for now. Later we can add support for sending them when we eventually get the identity through pairing.

---
 net/bluetooth/mgmt.c | 3 +++
 1 file changed, 3 insertions(+)
net/bluetooth/mgmt.c +3 -0
index fb1aa0cac137..50a0a3ec50b0 100644
@@ -5795,6 +5795,9 @@ void mgmt_new_conn_param(struct hci_dev *hdev, bdaddr_t *bdaddr,
 {
 	struct mgmt_ev_new_conn_param ev;
 
+	if (!hci_is_identity_address(bdaddr, bdaddr_type))
+		return;
+
 	memset(&ev, 0, sizeof(ev));
 	bacpy(&ev.addr.bdaddr, bdaddr);
 	ev.addr.type = link_to_bdaddr(LE_LINK, bdaddr_type);
Signature · 1 line
1.9.3
maintainer
#11 lore raw
In reply to [email protected]

Hi Johan,

Quoted 17 lines

Here's a v2 of my set with off-list feedback taken into account.

Johan

----------------------------------------------------------------
Johan Hedberg (10):
Bluetooth: Rename hci_conn_params_clear to hci_conn_params_clear_all
Bluetooth: Add specific connection parameter clear functions
Bluetooth: Add new auto_conn value matching mgmt action 0x00
Bluetooth: Remove only enabled entries with Remove Device command
Bluetooth: Add Load Connection Parameters command
Bluetooth: Fix missing update of conn params
Bluetooth: Make hci_le_conn_update return the store hint
Bluetooth: Pass store hint to mgmt_new_conn_param
Bluetooth: Make is_identity_address a global function
Bluetooth: Don't send connection parameters without identity address

Quoted 8 lines
include/net/bluetooth/hci_core.h |  25 ++++++--
include/net/bluetooth/mgmt.h     |  15 +++++
net/bluetooth/hci_conn.c         |   9 ++-
net/bluetooth/hci_core.c         |  51 ++++++++++-----
net/bluetooth/hci_event.c        |  26 +++++++-
net/bluetooth/l2cap_core.c       |   8 ++-
net/bluetooth/mgmt.c             | 113 +++++++++++++++++++++++++++++++--
7 files changed, 214 insertions(+), 33 deletions(-)

all 10 patches have been applied to bluetooth-next tree.

Regards

Marcel