diff options
| -rw-r--r-- | include/net/bluetooth/hci.h | 11 | ||||
| -rw-r--r-- | net/bluetooth/hci_event.c | 33 |
2 files changed, 44 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 371e7d3f2e6f..fa2d12b0579b 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
| @@ -463,6 +463,17 @@ struct inquiry_info_with_rssi_and_pscan_mode { | |||
| 463 | __s8 rssi; | 463 | __s8 rssi; |
| 464 | } __attribute__ ((packed)); | 464 | } __attribute__ ((packed)); |
| 465 | 465 | ||
| 466 | #define HCI_EV_EXTENDED_INQUIRY_RESULT 0x2F | ||
| 467 | struct extended_inquiry_info { | ||
| 468 | bdaddr_t bdaddr; | ||
| 469 | __u8 pscan_rep_mode; | ||
| 470 | __u8 pscan_period_mode; | ||
| 471 | __u8 dev_class[3]; | ||
| 472 | __u16 clock_offset; | ||
| 473 | __s8 rssi; | ||
| 474 | __u8 data[240]; | ||
| 475 | } __attribute__ ((packed)); | ||
| 476 | |||
| 466 | #define HCI_EV_CONN_COMPLETE 0x03 | 477 | #define HCI_EV_CONN_COMPLETE 0x03 |
| 467 | struct hci_ev_conn_complete { | 478 | struct hci_ev_conn_complete { |
| 468 | __u8 status; | 479 | __u8 status; |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index d6da0939216d..b61b4e8e36fd 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
| @@ -558,6 +558,35 @@ static inline void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, struct | |||
| 558 | hci_dev_unlock(hdev); | 558 | hci_dev_unlock(hdev); |
| 559 | } | 559 | } |
| 560 | 560 | ||
| 561 | /* Extended Inquiry Result */ | ||
| 562 | static inline void hci_extended_inquiry_result_evt(struct hci_dev *hdev, struct sk_buff *skb) | ||
| 563 | { | ||
| 564 | struct inquiry_data data; | ||
| 565 | struct extended_inquiry_info *info = (struct extended_inquiry_info *) (skb->data + 1); | ||
| 566 | int num_rsp = *((__u8 *) skb->data); | ||
| 567 | |||
| 568 | BT_DBG("%s num_rsp %d", hdev->name, num_rsp); | ||
| 569 | |||
| 570 | if (!num_rsp) | ||
| 571 | return; | ||
| 572 | |||
| 573 | hci_dev_lock(hdev); | ||
| 574 | |||
| 575 | for (; num_rsp; num_rsp--) { | ||
| 576 | bacpy(&data.bdaddr, &info->bdaddr); | ||
| 577 | data.pscan_rep_mode = info->pscan_rep_mode; | ||
| 578 | data.pscan_period_mode = info->pscan_period_mode; | ||
| 579 | data.pscan_mode = 0x00; | ||
| 580 | memcpy(data.dev_class, info->dev_class, 3); | ||
| 581 | data.clock_offset = info->clock_offset; | ||
| 582 | data.rssi = info->rssi; | ||
| 583 | info++; | ||
| 584 | hci_inquiry_cache_update(hdev, &data); | ||
| 585 | } | ||
| 586 | |||
| 587 | hci_dev_unlock(hdev); | ||
| 588 | } | ||
| 589 | |||
| 561 | /* Connect Request */ | 590 | /* Connect Request */ |
| 562 | static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb) | 591 | static inline void hci_conn_request_evt(struct hci_dev *hdev, struct sk_buff *skb) |
| 563 | { | 592 | { |
| @@ -940,6 +969,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb) | |||
| 940 | hci_inquiry_result_with_rssi_evt(hdev, skb); | 969 | hci_inquiry_result_with_rssi_evt(hdev, skb); |
| 941 | break; | 970 | break; |
| 942 | 971 | ||
| 972 | case HCI_EV_EXTENDED_INQUIRY_RESULT: | ||
| 973 | hci_extended_inquiry_result_evt(hdev, skb); | ||
| 974 | break; | ||
| 975 | |||
| 943 | case HCI_EV_CONN_REQUEST: | 976 | case HCI_EV_CONN_REQUEST: |
| 944 | hci_conn_request_evt(hdev, skb); | 977 | hci_conn_request_evt(hdev, skb); |
| 945 | break; | 978 | break; |
