diff options
Diffstat (limited to 'include/net/bluetooth')
| -rw-r--r-- | include/net/bluetooth/hci.h | 9 | ||||
| -rw-r--r-- | include/net/bluetooth/hci_core.h | 16 | ||||
| -rw-r--r-- | include/net/bluetooth/l2cap.h | 69 | ||||
| -rw-r--r-- | include/net/bluetooth/mgmt.h | 10 |
4 files changed, 65 insertions, 39 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 499b7b7c7c9a..0c20227e57f6 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
| @@ -246,6 +246,15 @@ enum { | |||
| 246 | #define HCI_AT_GENERAL_BONDING 0x04 | 246 | #define HCI_AT_GENERAL_BONDING 0x04 |
| 247 | #define HCI_AT_GENERAL_BONDING_MITM 0x05 | 247 | #define HCI_AT_GENERAL_BONDING_MITM 0x05 |
| 248 | 248 | ||
| 249 | /* Link Key types */ | ||
| 250 | #define HCI_LK_COMBINATION 0x00 | ||
| 251 | #define HCI_LK_LOCAL_UNIT 0x01 | ||
| 252 | #define HCI_LK_REMOTE_UNIT 0x02 | ||
| 253 | #define HCI_LK_DEBUG_COMBINATION 0x03 | ||
| 254 | #define HCI_LK_UNAUTH_COMBINATION 0x04 | ||
| 255 | #define HCI_LK_AUTH_COMBINATION 0x05 | ||
| 256 | #define HCI_LK_CHANGED_COMBINATION 0x06 | ||
| 257 | |||
| 249 | /* ----- HCI Commands ---- */ | 258 | /* ----- HCI Commands ---- */ |
| 250 | #define HCI_OP_NOP 0x0000 | 259 | #define HCI_OP_NOP 0x0000 |
| 251 | 260 | ||
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 4093133c1283..14cc3249c1eb 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
| @@ -126,6 +126,8 @@ struct hci_dev { | |||
| 126 | __u16 sniff_min_interval; | 126 | __u16 sniff_min_interval; |
| 127 | __u16 sniff_max_interval; | 127 | __u16 sniff_max_interval; |
| 128 | 128 | ||
| 129 | unsigned int auto_accept_delay; | ||
| 130 | |||
| 129 | unsigned long quirks; | 131 | unsigned long quirks; |
| 130 | 132 | ||
| 131 | atomic_t cmd_cnt; | 133 | atomic_t cmd_cnt; |
| @@ -226,6 +228,7 @@ struct hci_conn { | |||
| 226 | __u16 pkt_type; | 228 | __u16 pkt_type; |
| 227 | __u16 link_policy; | 229 | __u16 link_policy; |
| 228 | __u32 link_mode; | 230 | __u32 link_mode; |
| 231 | __u8 key_type; | ||
| 229 | __u8 auth_type; | 232 | __u8 auth_type; |
| 230 | __u8 sec_level; | 233 | __u8 sec_level; |
| 231 | __u8 pending_sec_level; | 234 | __u8 pending_sec_level; |
| @@ -245,6 +248,7 @@ struct hci_conn { | |||
| 245 | 248 | ||
| 246 | struct timer_list disc_timer; | 249 | struct timer_list disc_timer; |
| 247 | struct timer_list idle_timer; | 250 | struct timer_list idle_timer; |
| 251 | struct timer_list auto_accept_timer; | ||
| 248 | 252 | ||
| 249 | struct work_struct work_add; | 253 | struct work_struct work_add; |
| 250 | struct work_struct work_del; | 254 | struct work_struct work_del; |
| @@ -511,8 +515,8 @@ int hci_uuids_clear(struct hci_dev *hdev); | |||
| 511 | 515 | ||
| 512 | int hci_link_keys_clear(struct hci_dev *hdev); | 516 | int hci_link_keys_clear(struct hci_dev *hdev); |
| 513 | struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); | 517 | struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); |
| 514 | int hci_add_link_key(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr, | 518 | int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, |
| 515 | u8 *key, u8 type, u8 pin_len); | 519 | bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len); |
| 516 | int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); | 520 | int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); |
| 517 | 521 | ||
| 518 | int hci_remote_oob_data_clear(struct hci_dev *hdev); | 522 | int hci_remote_oob_data_clear(struct hci_dev *hdev); |
| @@ -771,15 +775,16 @@ int mgmt_index_removed(u16 index); | |||
| 771 | int mgmt_powered(u16 index, u8 powered); | 775 | int mgmt_powered(u16 index, u8 powered); |
| 772 | int mgmt_discoverable(u16 index, u8 discoverable); | 776 | int mgmt_discoverable(u16 index, u8 discoverable); |
| 773 | int mgmt_connectable(u16 index, u8 connectable); | 777 | int mgmt_connectable(u16 index, u8 connectable); |
| 774 | int mgmt_new_key(u16 index, struct link_key *key, u8 old_key_type); | 778 | int mgmt_new_key(u16 index, struct link_key *key, u8 persistent); |
| 775 | int mgmt_connected(u16 index, bdaddr_t *bdaddr); | 779 | int mgmt_connected(u16 index, bdaddr_t *bdaddr); |
| 776 | int mgmt_disconnected(u16 index, bdaddr_t *bdaddr); | 780 | int mgmt_disconnected(u16 index, bdaddr_t *bdaddr); |
| 777 | int mgmt_disconnect_failed(u16 index); | 781 | int mgmt_disconnect_failed(u16 index); |
| 778 | int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status); | 782 | int mgmt_connect_failed(u16 index, bdaddr_t *bdaddr, u8 status); |
| 779 | int mgmt_pin_code_request(u16 index, bdaddr_t *bdaddr); | 783 | int mgmt_pin_code_request(u16 index, bdaddr_t *bdaddr, u8 secure); |
| 780 | int mgmt_pin_code_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status); | 784 | int mgmt_pin_code_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status); |
| 781 | int mgmt_pin_code_neg_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status); | 785 | int mgmt_pin_code_neg_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status); |
| 782 | int mgmt_user_confirm_request(u16 index, bdaddr_t *bdaddr, __le32 value); | 786 | int mgmt_user_confirm_request(u16 index, bdaddr_t *bdaddr, __le32 value, |
| 787 | u8 confirm_hint); | ||
| 783 | int mgmt_user_confirm_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status); | 788 | int mgmt_user_confirm_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status); |
| 784 | int mgmt_user_confirm_neg_reply_complete(u16 index, bdaddr_t *bdaddr, | 789 | int mgmt_user_confirm_neg_reply_complete(u16 index, bdaddr_t *bdaddr, |
| 785 | u8 status); | 790 | u8 status); |
| @@ -790,6 +795,7 @@ int mgmt_read_local_oob_data_reply_complete(u16 index, u8 *hash, u8 *randomizer, | |||
| 790 | int mgmt_device_found(u16 index, bdaddr_t *bdaddr, u8 *dev_class, s8 rssi, | 795 | int mgmt_device_found(u16 index, bdaddr_t *bdaddr, u8 *dev_class, s8 rssi, |
| 791 | u8 *eir); | 796 | u8 *eir); |
| 792 | int mgmt_remote_name(u16 index, bdaddr_t *bdaddr, u8 *name); | 797 | int mgmt_remote_name(u16 index, bdaddr_t *bdaddr, u8 *name); |
| 798 | int mgmt_discovering(u16 index, u8 discovering); | ||
| 793 | 799 | ||
| 794 | /* HCI info for socket */ | 800 | /* HCI info for socket */ |
| 795 | #define hci_pi(sk) ((struct hci_pinfo *) sk) | 801 | #define hci_pi(sk) ((struct hci_pinfo *) sk) |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 7a215a7f9e39..c34b1c126363 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
| @@ -284,6 +284,25 @@ struct srej_list { | |||
| 284 | 284 | ||
| 285 | struct l2cap_chan { | 285 | struct l2cap_chan { |
| 286 | struct sock *sk; | 286 | struct sock *sk; |
| 287 | |||
| 288 | struct l2cap_conn *conn; | ||
| 289 | |||
| 290 | __le16 psm; | ||
| 291 | __u16 dcid; | ||
| 292 | __u16 scid; | ||
| 293 | |||
| 294 | __u16 imtu; | ||
| 295 | __u16 omtu; | ||
| 296 | __u16 flush_to; | ||
| 297 | __u8 mode; | ||
| 298 | |||
| 299 | __le16 sport; | ||
| 300 | |||
| 301 | __u8 sec_level; | ||
| 302 | __u8 role_switch; | ||
| 303 | __u8 force_reliable; | ||
| 304 | __u8 flushable; | ||
| 305 | |||
| 287 | __u8 ident; | 306 | __u8 ident; |
| 288 | 307 | ||
| 289 | __u8 conf_req[64]; | 308 | __u8 conf_req[64]; |
| @@ -291,6 +310,15 @@ struct l2cap_chan { | |||
| 291 | __u8 num_conf_req; | 310 | __u8 num_conf_req; |
| 292 | __u8 num_conf_rsp; | 311 | __u8 num_conf_rsp; |
| 293 | 312 | ||
| 313 | __u8 fcs; | ||
| 314 | |||
| 315 | __u8 tx_win; | ||
| 316 | __u8 max_tx; | ||
| 317 | __u16 retrans_timeout; | ||
| 318 | __u16 monitor_timeout; | ||
| 319 | __u16 mps; | ||
| 320 | |||
| 321 | __u8 conf_state; | ||
| 294 | __u16 conn_state; | 322 | __u16 conn_state; |
| 295 | 323 | ||
| 296 | __u8 next_tx_seq; | 324 | __u8 next_tx_seq; |
| @@ -360,32 +388,6 @@ struct l2cap_conn { | |||
| 360 | 388 | ||
| 361 | struct l2cap_pinfo { | 389 | struct l2cap_pinfo { |
| 362 | struct bt_sock bt; | 390 | struct bt_sock bt; |
| 363 | __le16 psm; | ||
| 364 | __u16 dcid; | ||
| 365 | __u16 scid; | ||
| 366 | |||
| 367 | __u16 imtu; | ||
| 368 | __u16 omtu; | ||
| 369 | __u16 flush_to; | ||
| 370 | __u8 mode; | ||
| 371 | |||
| 372 | __u8 fcs; | ||
| 373 | __u8 sec_level; | ||
| 374 | __u8 role_switch; | ||
| 375 | __u8 force_reliable; | ||
| 376 | __u8 flushable; | ||
| 377 | |||
| 378 | __u8 conf_state; | ||
| 379 | |||
| 380 | __u8 tx_win; | ||
| 381 | __u8 max_tx; | ||
| 382 | __u16 retrans_timeout; | ||
| 383 | __u16 monitor_timeout; | ||
| 384 | __u16 mps; | ||
| 385 | |||
| 386 | __le16 sport; | ||
| 387 | |||
| 388 | struct l2cap_conn *conn; | ||
| 389 | struct l2cap_chan *chan; | 391 | struct l2cap_chan *chan; |
| 390 | }; | 392 | }; |
| 391 | 393 | ||
| @@ -439,21 +441,20 @@ static inline int l2cap_tx_window_full(struct l2cap_chan *ch) | |||
| 439 | #define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START) | 441 | #define __is_sar_start(ctrl) (((ctrl) & L2CAP_CTRL_SAR) == L2CAP_SDU_START) |
| 440 | 442 | ||
| 441 | extern int disable_ertm; | 443 | extern int disable_ertm; |
| 442 | extern const struct proto_ops l2cap_sock_ops; | ||
| 443 | extern struct bt_sock_list l2cap_sk_list; | 444 | extern struct bt_sock_list l2cap_sk_list; |
| 444 | 445 | ||
| 445 | int l2cap_init_sockets(void); | 446 | int l2cap_init_sockets(void); |
| 446 | void l2cap_cleanup_sockets(void); | 447 | void l2cap_cleanup_sockets(void); |
| 447 | 448 | ||
| 448 | void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, void *data); | 449 | void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, void *data); |
| 449 | void __l2cap_connect_rsp_defer(struct sock *sk); | 450 | void __l2cap_connect_rsp_defer(struct l2cap_chan *chan); |
| 450 | int __l2cap_wait_ack(struct sock *sk); | 451 | int __l2cap_wait_ack(struct sock *sk); |
| 451 | 452 | ||
| 452 | struct sk_buff *l2cap_create_connless_pdu(struct sock *sk, struct msghdr *msg, size_t len); | 453 | struct sk_buff *l2cap_create_connless_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len); |
| 453 | struct sk_buff *l2cap_create_basic_pdu(struct sock *sk, struct msghdr *msg, size_t len); | 454 | struct sk_buff *l2cap_create_basic_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len); |
| 454 | struct sk_buff *l2cap_create_iframe_pdu(struct sock *sk, struct msghdr *msg, size_t len, u16 control, u16 sdulen); | 455 | struct sk_buff *l2cap_create_iframe_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len, u16 control, u16 sdulen); |
| 455 | int l2cap_sar_segment_sdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len); | 456 | int l2cap_sar_segment_sdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len); |
| 456 | void l2cap_do_send(struct sock *sk, struct sk_buff *skb); | 457 | void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb); |
| 457 | void l2cap_streaming_send(struct l2cap_chan *chan); | 458 | void l2cap_streaming_send(struct l2cap_chan *chan); |
| 458 | int l2cap_ertm_send(struct l2cap_chan *chan); | 459 | int l2cap_ertm_send(struct l2cap_chan *chan); |
| 459 | 460 | ||
| @@ -465,7 +466,9 @@ void l2cap_sock_init(struct sock *sk, struct sock *parent); | |||
| 465 | struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, | 466 | struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock, |
| 466 | int proto, gfp_t prio); | 467 | int proto, gfp_t prio); |
| 467 | void l2cap_send_disconn_req(struct l2cap_conn *conn, struct l2cap_chan *chan, int err); | 468 | void l2cap_send_disconn_req(struct l2cap_conn *conn, struct l2cap_chan *chan, int err); |
| 469 | struct l2cap_chan *l2cap_chan_alloc(struct sock *sk); | ||
| 468 | void l2cap_chan_del(struct l2cap_chan *chan, int err); | 470 | void l2cap_chan_del(struct l2cap_chan *chan, int err); |
| 469 | int l2cap_do_connect(struct sock *sk); | 471 | void l2cap_chan_free(struct l2cap_chan *chan); |
| 472 | int l2cap_chan_connect(struct l2cap_chan *chan); | ||
| 470 | 473 | ||
| 471 | #endif /* __L2CAP_H */ | 474 | #endif /* __L2CAP_H */ |
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h index 6b6ff92ab499..4899286ed4e4 100644 --- a/include/net/bluetooth/mgmt.h +++ b/include/net/bluetooth/mgmt.h | |||
| @@ -195,6 +195,10 @@ struct mgmt_cp_remove_remote_oob_data { | |||
| 195 | bdaddr_t bdaddr; | 195 | bdaddr_t bdaddr; |
| 196 | } __packed; | 196 | } __packed; |
| 197 | 197 | ||
| 198 | #define MGMT_OP_START_DISCOVERY 0x001B | ||
| 199 | |||
| 200 | #define MGMT_OP_STOP_DISCOVERY 0x001C | ||
| 201 | |||
| 198 | #define MGMT_EV_CMD_COMPLETE 0x0001 | 202 | #define MGMT_EV_CMD_COMPLETE 0x0001 |
| 199 | struct mgmt_ev_cmd_complete { | 203 | struct mgmt_ev_cmd_complete { |
| 200 | __le16 opcode; | 204 | __le16 opcode; |
| @@ -226,8 +230,8 @@ struct mgmt_ev_controller_error { | |||
| 226 | 230 | ||
| 227 | #define MGMT_EV_NEW_KEY 0x000A | 231 | #define MGMT_EV_NEW_KEY 0x000A |
| 228 | struct mgmt_ev_new_key { | 232 | struct mgmt_ev_new_key { |
| 233 | __u8 store_hint; | ||
| 229 | struct mgmt_key_info key; | 234 | struct mgmt_key_info key; |
| 230 | __u8 old_key_type; | ||
| 231 | } __packed; | 235 | } __packed; |
| 232 | 236 | ||
| 233 | #define MGMT_EV_CONNECTED 0x000B | 237 | #define MGMT_EV_CONNECTED 0x000B |
| @@ -249,11 +253,13 @@ struct mgmt_ev_connect_failed { | |||
| 249 | #define MGMT_EV_PIN_CODE_REQUEST 0x000E | 253 | #define MGMT_EV_PIN_CODE_REQUEST 0x000E |
| 250 | struct mgmt_ev_pin_code_request { | 254 | struct mgmt_ev_pin_code_request { |
| 251 | bdaddr_t bdaddr; | 255 | bdaddr_t bdaddr; |
| 256 | __u8 secure; | ||
| 252 | } __packed; | 257 | } __packed; |
| 253 | 258 | ||
| 254 | #define MGMT_EV_USER_CONFIRM_REQUEST 0x000F | 259 | #define MGMT_EV_USER_CONFIRM_REQUEST 0x000F |
| 255 | struct mgmt_ev_user_confirm_request { | 260 | struct mgmt_ev_user_confirm_request { |
| 256 | bdaddr_t bdaddr; | 261 | bdaddr_t bdaddr; |
| 262 | __u8 confirm_hint; | ||
| 257 | __le32 value; | 263 | __le32 value; |
| 258 | } __packed; | 264 | } __packed; |
| 259 | 265 | ||
| @@ -281,3 +287,5 @@ struct mgmt_ev_remote_name { | |||
| 281 | bdaddr_t bdaddr; | 287 | bdaddr_t bdaddr; |
| 282 | __u8 name[MGMT_MAX_NAME_LENGTH]; | 288 | __u8 name[MGMT_MAX_NAME_LENGTH]; |
| 283 | } __packed; | 289 | } __packed; |
| 290 | |||
| 291 | #define MGMT_EV_DISCOVERING 0x0014 | ||
