aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/bluetooth/hci.h6
-rw-r--r--net/bluetooth/hci_core.c5
-rw-r--r--net/bluetooth/hci_event.c14
3 files changed, 25 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 65cab137e19f..4e2f008d32e1 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -487,6 +487,12 @@ struct hci_cp_set_event_flt {
487#define HCI_CONN_SETUP_AUTO_OFF 0x01 487#define HCI_CONN_SETUP_AUTO_OFF 0x01
488#define HCI_CONN_SETUP_AUTO_ON 0x02 488#define HCI_CONN_SETUP_AUTO_ON 0x02
489 489
490#define HCI_OP_DELETE_STORED_LINK_KEY 0x0c12
491struct hci_cp_delete_stored_link_key {
492 bdaddr_t bdaddr;
493 __u8 delete_all;
494} __packed;
495
490#define HCI_OP_WRITE_LOCAL_NAME 0x0c13 496#define HCI_OP_WRITE_LOCAL_NAME 0x0c13
491struct hci_cp_write_local_name { 497struct hci_cp_write_local_name {
492 __u8 name[248]; 498 __u8 name[248];
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 183ce81f7a5c..cedb8a966df6 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -190,6 +190,7 @@ static void hci_reset_req(struct hci_dev *hdev, unsigned long opt)
190 190
191static void hci_init_req(struct hci_dev *hdev, unsigned long opt) 191static void hci_init_req(struct hci_dev *hdev, unsigned long opt)
192{ 192{
193 struct hci_cp_delete_stored_link_key cp;
193 struct sk_buff *skb; 194 struct sk_buff *skb;
194 __le16 param; 195 __le16 param;
195 __u8 flt_type; 196 __u8 flt_type;
@@ -260,6 +261,10 @@ static void hci_init_req(struct hci_dev *hdev, unsigned long opt)
260 /* Connection accept timeout ~20 secs */ 261 /* Connection accept timeout ~20 secs */
261 param = cpu_to_le16(0x7d00); 262 param = cpu_to_le16(0x7d00);
262 hci_send_cmd(hdev, HCI_OP_WRITE_CA_TIMEOUT, 2, &param); 263 hci_send_cmd(hdev, HCI_OP_WRITE_CA_TIMEOUT, 2, &param);
264
265 bacpy(&cp.bdaddr, BDADDR_ANY);
266 cp.delete_all = 1;
267 hci_send_cmd(hdev, HCI_OP_DELETE_STORED_LINK_KEY, sizeof(cp), &cp);
263} 268}
264 269
265static void hci_scan_req(struct hci_dev *hdev, unsigned long opt) 270static void hci_scan_req(struct hci_dev *hdev, unsigned long opt)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index cf3014ae00e4..49b387cdcc38 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -557,6 +557,16 @@ static void hci_cc_write_ca_timeout(struct hci_dev *hdev, struct sk_buff *skb)
557 hci_req_complete(hdev, HCI_OP_WRITE_CA_TIMEOUT, status); 557 hci_req_complete(hdev, HCI_OP_WRITE_CA_TIMEOUT, status);
558} 558}
559 559
560static void hci_cc_delete_stored_link_key(struct hci_dev *hdev,
561 struct sk_buff *skb)
562{
563 __u8 status = *((__u8 *) skb->data);
564
565 BT_DBG("%s status 0x%x", hdev->name, status);
566
567 hci_req_complete(hdev, HCI_OP_DELETE_STORED_LINK_KEY, status);
568}
569
560static inline void hci_cs_inquiry(struct hci_dev *hdev, __u8 status) 570static inline void hci_cs_inquiry(struct hci_dev *hdev, __u8 status)
561{ 571{
562 BT_DBG("%s status 0x%x", hdev->name, status); 572 BT_DBG("%s status 0x%x", hdev->name, status);
@@ -1402,6 +1412,10 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk
1402 hci_cc_write_ca_timeout(hdev, skb); 1412 hci_cc_write_ca_timeout(hdev, skb);
1403 break; 1413 break;
1404 1414
1415 case HCI_OP_DELETE_STORED_LINK_KEY:
1416 hci_cc_delete_stored_link_key(hdev, skb);
1417 break;
1418
1405 default: 1419 default:
1406 BT_DBG("%s opcode 0x%x", hdev->name, opcode); 1420 BT_DBG("%s opcode 0x%x", hdev->name, opcode);
1407 break; 1421 break;