diff options
Diffstat (limited to 'include/net/bluetooth/hci_core.h')
-rw-r--r-- | include/net/bluetooth/hci_core.h | 67 |
1 files changed, 36 insertions, 31 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index db1c5df45224..9fc7728f94e4 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -155,9 +155,14 @@ struct hci_dev { | |||
155 | __u16 hci_rev; | 155 | __u16 hci_rev; |
156 | __u8 lmp_ver; | 156 | __u8 lmp_ver; |
157 | __u16 manufacturer; | 157 | __u16 manufacturer; |
158 | __le16 lmp_subver; | 158 | __u16 lmp_subver; |
159 | __u16 voice_setting; | 159 | __u16 voice_setting; |
160 | __u8 io_capability; | 160 | __u8 io_capability; |
161 | __s8 inq_tx_power; | ||
162 | __u16 devid_source; | ||
163 | __u16 devid_vendor; | ||
164 | __u16 devid_product; | ||
165 | __u16 devid_version; | ||
161 | 166 | ||
162 | __u16 pkt_type; | 167 | __u16 pkt_type; |
163 | __u16 esco_type; | 168 | __u16 esco_type; |
@@ -250,9 +255,6 @@ struct hci_dev { | |||
250 | 255 | ||
251 | struct list_head remote_oob_data; | 256 | struct list_head remote_oob_data; |
252 | 257 | ||
253 | struct list_head adv_entries; | ||
254 | struct delayed_work adv_work; | ||
255 | |||
256 | struct hci_dev_stats stat; | 258 | struct hci_dev_stats stat; |
257 | 259 | ||
258 | struct sk_buff_head driver_init; | 260 | struct sk_buff_head driver_init; |
@@ -263,7 +265,6 @@ struct hci_dev { | |||
263 | 265 | ||
264 | struct dentry *debugfs; | 266 | struct dentry *debugfs; |
265 | 267 | ||
266 | struct device *parent; | ||
267 | struct device dev; | 268 | struct device dev; |
268 | 269 | ||
269 | struct rfkill *rfkill; | 270 | struct rfkill *rfkill; |
@@ -571,7 +572,7 @@ int hci_chan_del(struct hci_chan *chan); | |||
571 | void hci_chan_list_flush(struct hci_conn *conn); | 572 | void hci_chan_list_flush(struct hci_conn *conn); |
572 | 573 | ||
573 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, | 574 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, |
574 | __u8 sec_level, __u8 auth_type); | 575 | __u8 dst_type, __u8 sec_level, __u8 auth_type); |
575 | int hci_conn_check_link_mode(struct hci_conn *conn); | 576 | int hci_conn_check_link_mode(struct hci_conn *conn); |
576 | int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); | 577 | int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); |
577 | int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type); | 578 | int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type); |
@@ -673,8 +674,8 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, | |||
673 | bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len); | 674 | bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len); |
674 | struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]); | 675 | struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]); |
675 | int hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type, u8 type, | 676 | int hci_add_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 addr_type, u8 type, |
676 | int new_key, u8 authenticated, u8 tk[16], u8 enc_size, u16 ediv, | 677 | int new_key, u8 authenticated, u8 tk[16], u8 enc_size, |
677 | u8 rand[8]); | 678 | __le16 ediv, u8 rand[8]); |
678 | struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr, | 679 | struct smp_ltk *hci_find_ltk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr, |
679 | u8 addr_type); | 680 | u8 addr_type); |
680 | int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr); | 681 | int hci_remove_ltk(struct hci_dev *hdev, bdaddr_t *bdaddr); |
@@ -688,14 +689,6 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash, | |||
688 | u8 *randomizer); | 689 | u8 *randomizer); |
689 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); | 690 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); |
690 | 691 | ||
691 | #define ADV_CLEAR_TIMEOUT (3*60*HZ) /* Three minutes */ | ||
692 | int hci_adv_entries_clear(struct hci_dev *hdev); | ||
693 | struct adv_entry *hci_find_adv_entry(struct hci_dev *hdev, bdaddr_t *bdaddr); | ||
694 | int hci_add_adv_entry(struct hci_dev *hdev, | ||
695 | struct hci_ev_le_advertising_info *ev); | ||
696 | |||
697 | void hci_del_off_timer(struct hci_dev *hdev); | ||
698 | |||
699 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); | 692 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
700 | 693 | ||
701 | int hci_recv_frame(struct sk_buff *skb); | 694 | int hci_recv_frame(struct sk_buff *skb); |
@@ -709,7 +702,7 @@ void hci_conn_init_sysfs(struct hci_conn *conn); | |||
709 | void hci_conn_add_sysfs(struct hci_conn *conn); | 702 | void hci_conn_add_sysfs(struct hci_conn *conn); |
710 | void hci_conn_del_sysfs(struct hci_conn *conn); | 703 | void hci_conn_del_sysfs(struct hci_conn *conn); |
711 | 704 | ||
712 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->parent = (pdev)) | 705 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) |
713 | 706 | ||
714 | /* ----- LMP capabilities ----- */ | 707 | /* ----- LMP capabilities ----- */ |
715 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) | 708 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) |
@@ -933,6 +926,23 @@ static inline bool eir_has_data_type(u8 *data, size_t data_len, u8 type) | |||
933 | return false; | 926 | return false; |
934 | } | 927 | } |
935 | 928 | ||
929 | static inline size_t eir_get_length(u8 *eir, size_t eir_len) | ||
930 | { | ||
931 | size_t parsed = 0; | ||
932 | |||
933 | while (parsed < eir_len) { | ||
934 | u8 field_len = eir[0]; | ||
935 | |||
936 | if (field_len == 0) | ||
937 | return parsed; | ||
938 | |||
939 | parsed += field_len + 1; | ||
940 | eir += field_len + 1; | ||
941 | } | ||
942 | |||
943 | return eir_len; | ||
944 | } | ||
945 | |||
936 | static inline u16 eir_append_data(u8 *eir, u16 eir_len, u8 type, u8 *data, | 946 | static inline u16 eir_append_data(u8 *eir, u16 eir_len, u8 type, u8 *data, |
937 | u8 data_len) | 947 | u8 data_len) |
938 | { | 948 | { |
@@ -961,17 +971,12 @@ void hci_send_to_monitor(struct hci_dev *hdev, struct sk_buff *skb); | |||
961 | void hci_sock_dev_event(struct hci_dev *hdev, int event); | 971 | void hci_sock_dev_event(struct hci_dev *hdev, int event); |
962 | 972 | ||
963 | /* Management interface */ | 973 | /* Management interface */ |
964 | #define MGMT_ADDR_BREDR 0x00 | 974 | #define DISCOV_TYPE_BREDR (BIT(BDADDR_BREDR)) |
965 | #define MGMT_ADDR_LE_PUBLIC 0x01 | 975 | #define DISCOV_TYPE_LE (BIT(BDADDR_LE_PUBLIC) | \ |
966 | #define MGMT_ADDR_LE_RANDOM 0x02 | 976 | BIT(BDADDR_LE_RANDOM)) |
967 | #define MGMT_ADDR_INVALID 0xff | 977 | #define DISCOV_TYPE_INTERLEAVED (BIT(BDADDR_BREDR) | \ |
968 | 978 | BIT(BDADDR_LE_PUBLIC) | \ | |
969 | #define DISCOV_TYPE_BREDR (BIT(MGMT_ADDR_BREDR)) | 979 | BIT(BDADDR_LE_RANDOM)) |
970 | #define DISCOV_TYPE_LE (BIT(MGMT_ADDR_LE_PUBLIC) | \ | ||
971 | BIT(MGMT_ADDR_LE_RANDOM)) | ||
972 | #define DISCOV_TYPE_INTERLEAVED (BIT(MGMT_ADDR_BREDR) | \ | ||
973 | BIT(MGMT_ADDR_LE_PUBLIC) | \ | ||
974 | BIT(MGMT_ADDR_LE_RANDOM)) | ||
975 | 980 | ||
976 | int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); | 981 | int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len); |
977 | int mgmt_index_added(struct hci_dev *hdev); | 982 | int mgmt_index_added(struct hci_dev *hdev); |
@@ -1067,12 +1072,12 @@ void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, | |||
1067 | u16 latency, u16 to_multiplier); | 1072 | u16 latency, u16 to_multiplier); |
1068 | void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8], | 1073 | void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8], |
1069 | __u8 ltk[16]); | 1074 | __u8 ltk[16]); |
1070 | void hci_le_ltk_reply(struct hci_conn *conn, u8 ltk[16]); | ||
1071 | void hci_le_ltk_neg_reply(struct hci_conn *conn); | ||
1072 | |||
1073 | int hci_do_inquiry(struct hci_dev *hdev, u8 length); | 1075 | int hci_do_inquiry(struct hci_dev *hdev, u8 length); |
1074 | int hci_cancel_inquiry(struct hci_dev *hdev); | 1076 | int hci_cancel_inquiry(struct hci_dev *hdev); |
1075 | int hci_le_scan(struct hci_dev *hdev, u8 type, u16 interval, u16 window, | 1077 | int hci_le_scan(struct hci_dev *hdev, u8 type, u16 interval, u16 window, |
1076 | int timeout); | 1078 | int timeout); |
1079 | int hci_cancel_le_scan(struct hci_dev *hdev); | ||
1080 | |||
1081 | u8 bdaddr_to_le(u8 bdaddr_type); | ||
1077 | 1082 | ||
1078 | #endif /* __HCI_CORE_H */ | 1083 | #endif /* __HCI_CORE_H */ |