Skip to contentSkip to conversation

Bluetooth: mgmt: Add support for Set Link Security command

PATCH New [email protected] 1 participant 2 messages Feb 16, 2012

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

PATCH v2 1/2 Bluetooth: mgmt: Add support for Set Link Security command

From: Johan Hedberg <[email protected]>

The Set Link Security mgmt command is used to enable or disable link level security, also known as Security Mode 3. This is rarely enabled in modern systems but the command needs to be available for completeness, qualification purposes and those few systems that actually want to enable it.

---
v2: Added missing check for HCI_UP

 include/net/bluetooth/hci_core.h |    1 +
 net/bluetooth/hci_event.c        |    3 +
 net/bluetooth/mgmt.c             |   87 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 91 insertions(+), 0 deletions(-)
include/net/bluetooth/hci_core.h +1 -0
index b20d990..66f84ad 100644
@@ -994,6 +994,7 @@ int mgmt_user_passkey_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
 					u8 link_type, u8 addr_type, u8 status);
 int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
 						u8 addr_type, u8 status);
+int mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status);
 int mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status);
 int mgmt_read_local_oob_data_reply_complete(struct hci_dev *hdev, u8 *hash,
 						u8 *randomizer, u8 status);
net/bluetooth/hci_event.c +3 -0
index b0784ee..239e9fb 100644
@@ -254,6 +254,9 @@ static void hci_cc_write_auth_enable(struct hci_dev *hdev, struct sk_buff *skb)
 			clear_bit(HCI_AUTH, &hdev->flags);
 	}
 
+	if (test_bit(HCI_MGMT, &hdev->dev_flags))
+		mgmt_auth_enable_complete(hdev, status);
+
 	hci_req_complete(hdev, HCI_OP_WRITE_AUTH_ENABLE, status);
 }
 
net/bluetooth/mgmt.c +87 -0

105 lines not on this page · raw message

Signature · 1 line
1.7.9
#1 lore raw

PATCH v2 2/2 Bluetooth: mgmt: Add support for Set SSP command

From: Johan Hedberg <[email protected]>

The Set SSP mgmt command can be used for enabling and disabling Secure Simple Pairing support for controllers that support it.

---
v2: Added missing check for HCI_UP

 include/net/bluetooth/hci_core.h |    1 +
 net/bluetooth/hci_event.c        |    6 ++-
 net/bluetooth/mgmt.c             |   85 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 91 insertions(+), 1 deletions(-)
include/net/bluetooth/hci_core.h +1 -0
index 66f84ad..43e0b1e 100644
@@ -995,6 +995,7 @@ int mgmt_user_passkey_neg_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr,
 int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
 						u8 addr_type, u8 status);
 int mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status);
+int mgmt_ssp_enable_complete(struct hci_dev *hdev, u8 status);
 int mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status);
 int mgmt_read_local_oob_data_reply_complete(struct hci_dev *hdev, u8 *hash,
 						u8 *randomizer, u8 status);
net/bluetooth/hci_event.c +5 -1
index 239e9fb..179d127 100644
@@ -447,7 +447,7 @@ static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb)
 	BT_DBG("%s status 0x%x", hdev->name, status);
 
 	if (status)
-		return;
+		goto done;
 
 	sent = hci_sent_cmd_data(hdev, HCI_OP_WRITE_SSP_MODE);
 	if (!sent)
@@ -457,6 +457,10 @@ static void hci_cc_write_ssp_mode(struct hci_dev *hdev, struct sk_buff *skb)
 		set_bit(HCI_SSP_ENABLED, &hdev->dev_flags);
 	else
 		clear_bit(HCI_SSP_ENABLED, &hdev->dev_flags);
+
+done:
+	if (test_bit(HCI_MGMT, &hdev->dev_flags))
+		mgmt_ssp_enable_complete(hdev, status);
 }
 
 static u8 hci_get_inquiry_mode(struct hci_dev *hdev)
net/bluetooth/mgmt.c +85 -0

103 lines not on this page · raw message

Signature · 1 line
1.7.9