diff options
author | John W. Linville <linville@tuxdriver.com> | 2011-12-06 16:02:05 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-12-06 16:02:05 -0500 |
commit | 5f779bbd472cdb2046ff8b672ad8c5b62b61cd19 (patch) | |
tree | 151dc07e9a69dd48e38251ba88811490ca16969a /include/net/bluetooth | |
parent | d7a4858c0fde8383f7aa494eda0fba6bef3f2fec (diff) | |
parent | 5a13b09531420d230616bd524b68a5b0c23cd487 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-next
Diffstat (limited to 'include/net/bluetooth')
-rw-r--r-- | include/net/bluetooth/bluetooth.h | 5 | ||||
-rw-r--r-- | include/net/bluetooth/hci.h | 38 | ||||
-rw-r--r-- | include/net/bluetooth/hci_core.h | 28 | ||||
-rw-r--r-- | include/net/bluetooth/l2cap.h | 2 | ||||
-rw-r--r-- | include/net/bluetooth/mgmt.h | 49 |
5 files changed, 109 insertions, 13 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 835f3b229b84..980e59f37d4f 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -36,6 +36,11 @@ | |||
36 | #define PF_BLUETOOTH AF_BLUETOOTH | 36 | #define PF_BLUETOOTH AF_BLUETOOTH |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | /* Bluetooth versions */ | ||
40 | #define BLUETOOTH_VER_1_1 1 | ||
41 | #define BLUETOOTH_VER_1_2 2 | ||
42 | #define BLUETOOTH_VER_2_0 3 | ||
43 | |||
39 | /* Reserv for core and drivers use */ | 44 | /* Reserv for core and drivers use */ |
40 | #define BT_SKB_RESERVE 8 | 45 | #define BT_SKB_RESERVE 8 |
41 | 46 | ||
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 139ce2aa6eee..67ad98430348 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -88,6 +88,14 @@ enum { | |||
88 | HCI_RESET, | 88 | HCI_RESET, |
89 | }; | 89 | }; |
90 | 90 | ||
91 | /* | ||
92 | * BR/EDR and/or LE controller flags: the flags defined here should represent | ||
93 | * states from the controller. | ||
94 | */ | ||
95 | enum { | ||
96 | HCI_LE_SCAN, | ||
97 | }; | ||
98 | |||
91 | /* HCI ioctl defines */ | 99 | /* HCI ioctl defines */ |
92 | #define HCIDEVUP _IOW('H', 201, int) | 100 | #define HCIDEVUP _IOW('H', 201, int) |
93 | #define HCIDEVDOWN _IOW('H', 202, int) | 101 | #define HCIDEVDOWN _IOW('H', 202, int) |
@@ -453,6 +461,14 @@ struct hci_rp_user_confirm_reply { | |||
453 | 461 | ||
454 | #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d | 462 | #define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d |
455 | 463 | ||
464 | #define HCI_OP_USER_PASSKEY_REPLY 0x042e | ||
465 | struct hci_cp_user_passkey_reply { | ||
466 | bdaddr_t bdaddr; | ||
467 | __le32 passkey; | ||
468 | } __packed; | ||
469 | |||
470 | #define HCI_OP_USER_PASSKEY_NEG_REPLY 0x042f | ||
471 | |||
456 | #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 | 472 | #define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430 |
457 | struct hci_cp_remote_oob_data_reply { | 473 | struct hci_cp_remote_oob_data_reply { |
458 | bdaddr_t bdaddr; | 474 | bdaddr_t bdaddr; |
@@ -669,6 +685,12 @@ struct hci_rp_read_local_oob_data { | |||
669 | 685 | ||
670 | #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 | 686 | #define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 |
671 | 687 | ||
688 | #define HCI_OP_READ_FLOW_CONTROL_MODE 0x0c66 | ||
689 | struct hci_rp_read_flow_control_mode { | ||
690 | __u8 status; | ||
691 | __u8 mode; | ||
692 | } __packed; | ||
693 | |||
672 | #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d | 694 | #define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d |
673 | struct hci_cp_write_le_host_supported { | 695 | struct hci_cp_write_le_host_supported { |
674 | __u8 le; | 696 | __u8 le; |
@@ -760,6 +782,15 @@ struct hci_rp_le_read_buffer_size { | |||
760 | __u8 le_max_pkt; | 782 | __u8 le_max_pkt; |
761 | } __packed; | 783 | } __packed; |
762 | 784 | ||
785 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b | ||
786 | struct hci_cp_le_set_scan_param { | ||
787 | __u8 type; | ||
788 | __le16 interval; | ||
789 | __le16 window; | ||
790 | __u8 own_address_type; | ||
791 | __u8 filter_policy; | ||
792 | } __packed; | ||
793 | |||
763 | #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c | 794 | #define HCI_OP_LE_SET_SCAN_ENABLE 0x200c |
764 | struct hci_cp_le_set_scan_enable { | 795 | struct hci_cp_le_set_scan_enable { |
765 | __u8 enable; | 796 | __u8 enable; |
@@ -1076,6 +1107,11 @@ struct hci_ev_user_confirm_req { | |||
1076 | __le32 passkey; | 1107 | __le32 passkey; |
1077 | } __packed; | 1108 | } __packed; |
1078 | 1109 | ||
1110 | #define HCI_EV_USER_PASSKEY_REQUEST 0x34 | ||
1111 | struct hci_ev_user_passkey_req { | ||
1112 | bdaddr_t bdaddr; | ||
1113 | } __packed; | ||
1114 | |||
1079 | #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 | 1115 | #define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35 |
1080 | struct hci_ev_remote_oob_data_request { | 1116 | struct hci_ev_remote_oob_data_request { |
1081 | bdaddr_t bdaddr; | 1117 | bdaddr_t bdaddr; |
@@ -1331,4 +1367,6 @@ struct hci_inquiry_req { | |||
1331 | }; | 1367 | }; |
1332 | #define IREQ_CACHE_FLUSH 0x0001 | 1368 | #define IREQ_CACHE_FLUSH 0x0001 |
1333 | 1369 | ||
1370 | extern int enable_hs; | ||
1371 | |||
1334 | #endif /* __HCI_H */ | 1372 | #endif /* __HCI_H */ |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index f333e7682607..ea4395f1d260 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -170,6 +170,8 @@ struct hci_dev { | |||
170 | __u32 amp_max_flush_to; | 170 | __u32 amp_max_flush_to; |
171 | __u32 amp_be_flush_to; | 171 | __u32 amp_be_flush_to; |
172 | 172 | ||
173 | __u8 flow_ctl_mode; | ||
174 | |||
173 | unsigned int auto_accept_delay; | 175 | unsigned int auto_accept_delay; |
174 | 176 | ||
175 | unsigned long quirks; | 177 | unsigned long quirks; |
@@ -250,6 +252,8 @@ struct hci_dev { | |||
250 | 252 | ||
251 | struct module *owner; | 253 | struct module *owner; |
252 | 254 | ||
255 | unsigned long dev_flags; | ||
256 | |||
253 | int (*open)(struct hci_dev *hdev); | 257 | int (*open)(struct hci_dev *hdev); |
254 | int (*close)(struct hci_dev *hdev); | 258 | int (*close)(struct hci_dev *hdev); |
255 | int (*flush)(struct hci_dev *hdev); | 259 | int (*flush)(struct hci_dev *hdev); |
@@ -917,11 +921,13 @@ int mgmt_connectable(struct hci_dev *hdev, u8 connectable); | |||
917 | int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status); | 921 | int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status); |
918 | int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, | 922 | int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, |
919 | u8 persistent); | 923 | u8 persistent); |
920 | int mgmt_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 924 | int mgmt_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
921 | int mgmt_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 925 | u8 addr_type); |
922 | int mgmt_disconnect_failed(struct hci_dev *hdev); | 926 | int mgmt_disconnected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
923 | int mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type, | 927 | u8 addr_type); |
924 | u8 status); | 928 | int mgmt_disconnect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 status); |
929 | int mgmt_connect_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, | ||
930 | u8 addr_type, u8 status); | ||
925 | int mgmt_pin_code_request(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 secure); | 931 | int mgmt_pin_code_request(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 secure); |
926 | int mgmt_pin_code_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, | 932 | int mgmt_pin_code_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, |
927 | u8 status); | 933 | u8 status); |
@@ -933,14 +939,20 @@ int mgmt_user_confirm_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, | |||
933 | u8 status); | 939 | u8 status); |
934 | int mgmt_user_confirm_neg_reply_complete(struct hci_dev *hdev, | 940 | int mgmt_user_confirm_neg_reply_complete(struct hci_dev *hdev, |
935 | bdaddr_t *bdaddr, u8 status); | 941 | bdaddr_t *bdaddr, u8 status); |
942 | int mgmt_user_passkey_request(struct hci_dev *hdev, bdaddr_t *bdaddr); | ||
943 | int mgmt_user_passkey_reply_complete(struct hci_dev *hdev, bdaddr_t *bdaddr, | ||
944 | u8 status); | ||
945 | int mgmt_user_passkey_neg_reply_complete(struct hci_dev *hdev, | ||
946 | bdaddr_t *bdaddr, u8 status); | ||
936 | int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 status); | 947 | int mgmt_auth_failed(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 status); |
937 | int mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status); | 948 | int mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status); |
938 | int mgmt_read_local_oob_data_reply_complete(struct hci_dev *hdev, u8 *hash, | 949 | int mgmt_read_local_oob_data_reply_complete(struct hci_dev *hdev, u8 *hash, |
939 | u8 *randomizer, u8 status); | 950 | u8 *randomizer, u8 status); |
940 | int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type, | 951 | int mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, |
941 | u8 *dev_class, s8 rssi, u8 *eir); | 952 | u8 addr_type, u8 *dev_class, s8 rssi, u8 *eir); |
942 | int mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *name); | 953 | int mgmt_remote_name(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *name); |
943 | int mgmt_inquiry_failed(struct hci_dev *hdev, u8 status); | 954 | int mgmt_start_discovery_failed(struct hci_dev *hdev, u8 status); |
955 | int mgmt_stop_discovery_failed(struct hci_dev *hdev, u8 status); | ||
944 | int mgmt_discovering(struct hci_dev *hdev, u8 discovering); | 956 | int mgmt_discovering(struct hci_dev *hdev, u8 discovering); |
945 | int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr); | 957 | int mgmt_device_blocked(struct hci_dev *hdev, bdaddr_t *bdaddr); |
946 | int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr); | 958 | int mgmt_device_unblocked(struct hci_dev *hdev, bdaddr_t *bdaddr); |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 875021ad0675..30719eb2e77c 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -792,7 +792,6 @@ static inline __u8 __ctrl_size(struct l2cap_chan *chan) | |||
792 | } | 792 | } |
793 | 793 | ||
794 | extern int disable_ertm; | 794 | extern int disable_ertm; |
795 | extern int enable_hs; | ||
796 | 795 | ||
797 | int l2cap_init_sockets(void); | 796 | int l2cap_init_sockets(void); |
798 | void l2cap_cleanup_sockets(void); | 797 | void l2cap_cleanup_sockets(void); |
@@ -810,5 +809,6 @@ int l2cap_chan_connect(struct l2cap_chan *chan); | |||
810 | int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, | 809 | int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, |
811 | u32 priority); | 810 | u32 priority); |
812 | void l2cap_chan_busy(struct l2cap_chan *chan, int busy); | 811 | void l2cap_chan_busy(struct l2cap_chan *chan, int busy); |
812 | int l2cap_chan_check_security(struct l2cap_chan *chan); | ||
813 | 813 | ||
814 | #endif /* __L2CAP_H */ | 814 | #endif /* __L2CAP_H */ |
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index 3e320c9cae8f..3b6880690a78 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h | |||
@@ -23,6 +23,23 @@ | |||
23 | 23 | ||
24 | #define MGMT_INDEX_NONE 0xFFFF | 24 | #define MGMT_INDEX_NONE 0xFFFF |
25 | 25 | ||
26 | #define MGMT_STATUS_SUCCESS 0x00 | ||
27 | #define MGMT_STATUS_UNKNOWN_COMMAND 0x01 | ||
28 | #define MGMT_STATUS_NOT_CONNECTED 0x02 | ||
29 | #define MGMT_STATUS_FAILED 0x03 | ||
30 | #define MGMT_STATUS_CONNECT_FAILED 0x04 | ||
31 | #define MGMT_STATUS_AUTH_FAILED 0x05 | ||
32 | #define MGMT_STATUS_NOT_PAIRED 0x06 | ||
33 | #define MGMT_STATUS_NO_RESOURCES 0x07 | ||
34 | #define MGMT_STATUS_TIMEOUT 0x08 | ||
35 | #define MGMT_STATUS_ALREADY_CONNECTED 0x09 | ||
36 | #define MGMT_STATUS_BUSY 0x0a | ||
37 | #define MGMT_STATUS_REJECTED 0x0b | ||
38 | #define MGMT_STATUS_NOT_SUPPORTED 0x0c | ||
39 | #define MGMT_STATUS_INVALID_PARAMS 0x0d | ||
40 | #define MGMT_STATUS_DISCONNECTED 0x0e | ||
41 | #define MGMT_STATUS_NOT_POWERED 0x0f | ||
42 | |||
26 | struct mgmt_hdr { | 43 | struct mgmt_hdr { |
27 | __le16 opcode; | 44 | __le16 opcode; |
28 | __le16 index; | 45 | __le16 index; |
@@ -119,6 +136,10 @@ struct mgmt_cp_remove_keys { | |||
119 | bdaddr_t bdaddr; | 136 | bdaddr_t bdaddr; |
120 | __u8 disconnect; | 137 | __u8 disconnect; |
121 | } __packed; | 138 | } __packed; |
139 | struct mgmt_rp_remove_keys { | ||
140 | bdaddr_t bdaddr; | ||
141 | __u8 status; | ||
142 | }; | ||
122 | 143 | ||
123 | #define MGMT_OP_DISCONNECT 0x000F | 144 | #define MGMT_OP_DISCONNECT 0x000F |
124 | struct mgmt_cp_disconnect { | 145 | struct mgmt_cp_disconnect { |
@@ -126,11 +147,12 @@ struct mgmt_cp_disconnect { | |||
126 | } __packed; | 147 | } __packed; |
127 | struct mgmt_rp_disconnect { | 148 | struct mgmt_rp_disconnect { |
128 | bdaddr_t bdaddr; | 149 | bdaddr_t bdaddr; |
150 | __u8 status; | ||
129 | } __packed; | 151 | } __packed; |
130 | 152 | ||
131 | #define MGMT_ADDR_BREDR 0x00 | 153 | #define MGMT_ADDR_BREDR 0x00 |
132 | #define MGMT_ADDR_LE 0x01 | 154 | #define MGMT_ADDR_LE_PUBLIC 0x01 |
133 | #define MGMT_ADDR_BREDR_LE 0x02 | 155 | #define MGMT_ADDR_LE_RANDOM 0x02 |
134 | #define MGMT_ADDR_INVALID 0xff | 156 | #define MGMT_ADDR_INVALID 0xff |
135 | 157 | ||
136 | struct mgmt_addr_info { | 158 | struct mgmt_addr_info { |
@@ -167,11 +189,11 @@ struct mgmt_cp_set_io_capability { | |||
167 | 189 | ||
168 | #define MGMT_OP_PAIR_DEVICE 0x0014 | 190 | #define MGMT_OP_PAIR_DEVICE 0x0014 |
169 | struct mgmt_cp_pair_device { | 191 | struct mgmt_cp_pair_device { |
170 | bdaddr_t bdaddr; | 192 | struct mgmt_addr_info addr; |
171 | __u8 io_cap; | 193 | __u8 io_cap; |
172 | } __packed; | 194 | } __packed; |
173 | struct mgmt_rp_pair_device { | 195 | struct mgmt_rp_pair_device { |
174 | bdaddr_t bdaddr; | 196 | struct mgmt_addr_info addr; |
175 | __u8 status; | 197 | __u8 status; |
176 | } __packed; | 198 | } __packed; |
177 | 199 | ||
@@ -210,6 +232,9 @@ struct mgmt_cp_remove_remote_oob_data { | |||
210 | } __packed; | 232 | } __packed; |
211 | 233 | ||
212 | #define MGMT_OP_START_DISCOVERY 0x001B | 234 | #define MGMT_OP_START_DISCOVERY 0x001B |
235 | struct mgmt_cp_start_discovery { | ||
236 | __u8 type; | ||
237 | } __packed; | ||
213 | 238 | ||
214 | #define MGMT_OP_STOP_DISCOVERY 0x001C | 239 | #define MGMT_OP_STOP_DISCOVERY 0x001C |
215 | 240 | ||
@@ -228,6 +253,17 @@ struct mgmt_cp_set_fast_connectable { | |||
228 | __u8 enable; | 253 | __u8 enable; |
229 | } __packed; | 254 | } __packed; |
230 | 255 | ||
256 | #define MGMT_OP_USER_PASSKEY_REPLY 0x0020 | ||
257 | struct mgmt_cp_user_passkey_reply { | ||
258 | bdaddr_t bdaddr; | ||
259 | __le32 passkey; | ||
260 | } __packed; | ||
261 | |||
262 | #define MGMT_OP_USER_PASSKEY_NEG_REPLY 0x0021 | ||
263 | struct mgmt_cp_user_passkey_neg_reply { | ||
264 | bdaddr_t bdaddr; | ||
265 | } __packed; | ||
266 | |||
231 | #define MGMT_EV_CMD_COMPLETE 0x0001 | 267 | #define MGMT_EV_CMD_COMPLETE 0x0001 |
232 | struct mgmt_ev_cmd_complete { | 268 | struct mgmt_ev_cmd_complete { |
233 | __le16 opcode; | 269 | __le16 opcode; |
@@ -322,3 +358,8 @@ struct mgmt_ev_device_blocked { | |||
322 | struct mgmt_ev_device_unblocked { | 358 | struct mgmt_ev_device_unblocked { |
323 | bdaddr_t bdaddr; | 359 | bdaddr_t bdaddr; |
324 | } __packed; | 360 | } __packed; |
361 | |||
362 | #define MGMT_EV_USER_PASSKEY_REQUEST 0x0017 | ||
363 | struct mgmt_ev_user_passkey_request { | ||
364 | bdaddr_t bdaddr; | ||
365 | } __packed; | ||