diff options
-rw-r--r-- | include/net/bluetooth/hci.h | 6 | ||||
-rw-r--r-- | net/bluetooth/hci_event.c | 22 |
2 files changed, 28 insertions, 0 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index cd075f197983..371e7d3f2e6f 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -593,6 +593,12 @@ struct hci_ev_clock_offset { | |||
593 | __u16 clock_offset; | 593 | __u16 clock_offset; |
594 | } __attribute__ ((packed)); | 594 | } __attribute__ ((packed)); |
595 | 595 | ||
596 | #define HCI_EV_PSCAN_REP_MODE 0x20 | ||
597 | struct hci_ev_pscan_rep_mode { | ||
598 | bdaddr_t bdaddr; | ||
599 | __u8 pscan_rep_mode; | ||
600 | } __attribute__ ((packed)); | ||
601 | |||
596 | /* Internal events generated by Bluetooth stack */ | 602 | /* Internal events generated by Bluetooth stack */ |
597 | #define HCI_EV_STACK_INTERNAL 0xFD | 603 | #define HCI_EV_STACK_INTERNAL 0xFD |
598 | struct hci_ev_stack_internal { | 604 | struct hci_ev_stack_internal { |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 632f7a9c2bcb..a004284c4d98 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
@@ -894,6 +894,24 @@ static inline void hci_clock_offset_evt(struct hci_dev *hdev, struct sk_buff *sk | |||
894 | hci_dev_unlock(hdev); | 894 | hci_dev_unlock(hdev); |
895 | } | 895 | } |
896 | 896 | ||
897 | /* Page Scan Repetition Mode */ | ||
898 | static inline void hci_pscan_rep_mode_evt(struct hci_dev *hdev, struct sk_buff *skb) | ||
899 | { | ||
900 | struct hci_ev_pscan_rep_mode *ev = (struct hci_ev_pscan_rep_mode *) skb->data; | ||
901 | struct inquiry_entry *ie; | ||
902 | |||
903 | BT_DBG("%s", hdev->name); | ||
904 | |||
905 | hci_dev_lock(hdev); | ||
906 | |||
907 | if ((ie = hci_inquiry_cache_lookup(hdev, &ev->bdaddr))) { | ||
908 | ie->data.pscan_rep_mode = ev->pscan_rep_mode; | ||
909 | ie->timestamp = jiffies; | ||
910 | } | ||
911 | |||
912 | hci_dev_unlock(hdev); | ||
913 | } | ||
914 | |||
897 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb) | 915 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb) |
898 | { | 916 | { |
899 | struct hci_event_hdr *hdr = (struct hci_event_hdr *) skb->data; | 917 | struct hci_event_hdr *hdr = (struct hci_event_hdr *) skb->data; |
@@ -966,6 +984,10 @@ void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb) | |||
966 | hci_clock_offset_evt(hdev, skb); | 984 | hci_clock_offset_evt(hdev, skb); |
967 | break; | 985 | break; |
968 | 986 | ||
987 | case HCI_EV_PSCAN_REP_MODE: | ||
988 | hci_pscan_rep_mode_evt(hdev, skb); | ||
989 | break; | ||
990 | |||
969 | case HCI_EV_CMD_STATUS: | 991 | case HCI_EV_CMD_STATUS: |
970 | cs = (struct hci_ev_cmd_status *) skb->data; | 992 | cs = (struct hci_ev_cmd_status *) skb->data; |
971 | skb_pull(skb, sizeof(cs)); | 993 | skb_pull(skb, sizeof(cs)); |