aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/bluetooth/hci.h11
-rw-r--r--net/bluetooth/hci_event.c40
2 files changed, 51 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index efc8c555c182..79629ff40e3e 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -794,6 +794,17 @@ struct extended_inquiry_info {
794 __u8 data[240]; 794 __u8 data[240];
795} __attribute__ ((packed)); 795} __attribute__ ((packed));
796 796
797#define HCI_EV_IO_CAPA_REQUEST 0x31
798struct hci_ev_io_capa_request {
799 bdaddr_t bdaddr;
800} __attribute__ ((packed));
801
802#define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36
803struct hci_ev_simple_pair_complete {
804 __u8 status;
805 bdaddr_t bdaddr;
806} __attribute__ ((packed));
807
797/* Internal events generated by Bluetooth stack */ 808/* Internal events generated by Bluetooth stack */
798#define HCI_EV_STACK_INTERNAL 0xfd 809#define HCI_EV_STACK_INTERNAL 0xfd
799struct hci_ev_stack_internal { 810struct hci_ev_stack_internal {
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index e47676128bb5..7c9ac01cd8f9 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1464,6 +1464,38 @@ static inline void hci_extended_inquiry_result_evt(struct hci_dev *hdev, struct
1464 hci_dev_unlock(hdev); 1464 hci_dev_unlock(hdev);
1465} 1465}
1466 1466
1467static inline void hci_io_capa_request_evt(struct hci_dev *hdev, struct sk_buff *skb)
1468{
1469 struct hci_ev_io_capa_request *ev = (void *) skb->data;
1470 struct hci_conn *conn;
1471
1472 BT_DBG("%s", hdev->name);
1473
1474 hci_dev_lock(hdev);
1475
1476 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
1477 if (conn)
1478 hci_conn_hold(conn);
1479
1480 hci_dev_unlock(hdev);
1481}
1482
1483static inline void hci_simple_pair_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
1484{
1485 struct hci_ev_simple_pair_complete *ev = (void *) skb->data;
1486 struct hci_conn *conn;
1487
1488 BT_DBG("%s", hdev->name);
1489
1490 hci_dev_lock(hdev);
1491
1492 conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &ev->bdaddr);
1493 if (conn)
1494 hci_conn_put(conn);
1495
1496 hci_dev_unlock(hdev);
1497}
1498
1467void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb) 1499void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
1468{ 1500{
1469 struct hci_event_hdr *hdr = (void *) skb->data; 1501 struct hci_event_hdr *hdr = (void *) skb->data;
@@ -1588,6 +1620,14 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb)
1588 hci_extended_inquiry_result_evt(hdev, skb); 1620 hci_extended_inquiry_result_evt(hdev, skb);
1589 break; 1621 break;
1590 1622
1623 case HCI_EV_IO_CAPA_REQUEST:
1624 hci_io_capa_request_evt(hdev, skb);
1625 break;
1626
1627 case HCI_EV_SIMPLE_PAIR_COMPLETE:
1628 hci_simple_pair_complete_evt(hdev, skb);
1629 break;
1630
1591 default: 1631 default:
1592 BT_DBG("%s event 0x%x", hdev->name, event); 1632 BT_DBG("%s event 0x%x", hdev->name, event);
1593 break; 1633 break;