diff options
| author | David S. Miller <davem@davemloft.net> | 2008-07-19 03:30:39 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2008-07-19 03:30:39 -0400 |
| commit | 407d819cf0fd54c6fc1138a509225696aecafd15 (patch) | |
| tree | b653a5c8c09f7c316f5f98947be262e27a4ca33a /include | |
| parent | 7abbcd6a4c8d6179121f2915a761b1133bf1cd99 (diff) | |
| parent | b1235d79611e78a07629b4cbe53291c9cffd1834 (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/bluetooth/bluetooth.h | 1 | ||||
| -rw-r--r-- | include/net/bluetooth/hci.h | 68 | ||||
| -rw-r--r-- | include/net/bluetooth/hci_core.h | 19 | ||||
| -rw-r--r-- | include/net/bluetooth/rfcomm.h | 2 |
4 files changed, 80 insertions, 10 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 750648df13f4..6f8418bf4241 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -121,6 +121,7 @@ void bt_sock_link(struct bt_sock_list *l, struct sock *s); | |||
| 121 | void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); | 121 | void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); |
| 122 | int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags); | 122 | int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags); |
| 123 | uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); | 123 | uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); |
| 124 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | ||
| 124 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); | 125 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); |
| 125 | 126 | ||
| 126 | void bt_accept_enqueue(struct sock *parent, struct sock *sk); | 127 | void bt_accept_enqueue(struct sock *parent, struct sock *sk); |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index a8a9eb6af966..3cc294919312 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
| @@ -72,8 +72,6 @@ enum { | |||
| 72 | HCI_INQUIRY, | 72 | HCI_INQUIRY, |
| 73 | 73 | ||
| 74 | HCI_RAW, | 74 | HCI_RAW, |
| 75 | |||
| 76 | HCI_SECMGR | ||
| 77 | }; | 75 | }; |
| 78 | 76 | ||
| 79 | /* HCI ioctl defines */ | 77 | /* HCI ioctl defines */ |
| @@ -86,6 +84,7 @@ enum { | |||
| 86 | #define HCIGETDEVINFO _IOR('H', 211, int) | 84 | #define HCIGETDEVINFO _IOR('H', 211, int) |
| 87 | #define HCIGETCONNLIST _IOR('H', 212, int) | 85 | #define HCIGETCONNLIST _IOR('H', 212, int) |
| 88 | #define HCIGETCONNINFO _IOR('H', 213, int) | 86 | #define HCIGETCONNINFO _IOR('H', 213, int) |
| 87 | #define HCIGETAUTHINFO _IOR('H', 215, int) | ||
| 89 | 88 | ||
| 90 | #define HCISETRAW _IOW('H', 220, int) | 89 | #define HCISETRAW _IOW('H', 220, int) |
| 91 | #define HCISETSCAN _IOW('H', 221, int) | 90 | #define HCISETSCAN _IOW('H', 221, int) |
| @@ -97,8 +96,6 @@ enum { | |||
| 97 | #define HCISETACLMTU _IOW('H', 227, int) | 96 | #define HCISETACLMTU _IOW('H', 227, int) |
| 98 | #define HCISETSCOMTU _IOW('H', 228, int) | 97 | #define HCISETSCOMTU _IOW('H', 228, int) |
| 99 | 98 | ||
| 100 | #define HCISETSECMGR _IOW('H', 230, int) | ||
| 101 | |||
| 102 | #define HCIINQUIRY _IOR('H', 240, int) | 99 | #define HCIINQUIRY _IOR('H', 240, int) |
| 103 | 100 | ||
| 104 | /* HCI timeouts */ | 101 | /* HCI timeouts */ |
| @@ -137,6 +134,8 @@ enum { | |||
| 137 | #define ESCO_EV4 0x0010 | 134 | #define ESCO_EV4 0x0010 |
| 138 | #define ESCO_EV5 0x0020 | 135 | #define ESCO_EV5 0x0020 |
| 139 | 136 | ||
| 137 | #define SCO_ESCO_MASK (ESCO_HV1 | ESCO_HV2 | ESCO_HV3) | ||
| 138 | |||
| 140 | /* ACL flags */ | 139 | /* ACL flags */ |
| 141 | #define ACL_CONT 0x01 | 140 | #define ACL_CONT 0x01 |
| 142 | #define ACL_START 0x02 | 141 | #define ACL_START 0x02 |
| @@ -178,6 +177,8 @@ enum { | |||
| 178 | 177 | ||
| 179 | #define LMP_SNIFF_SUBR 0x02 | 178 | #define LMP_SNIFF_SUBR 0x02 |
| 180 | 179 | ||
| 180 | #define LMP_SIMPLE_PAIR 0x08 | ||
| 181 | |||
| 181 | /* Connection modes */ | 182 | /* Connection modes */ |
| 182 | #define HCI_CM_ACTIVE 0x0000 | 183 | #define HCI_CM_ACTIVE 0x0000 |
| 183 | #define HCI_CM_HOLD 0x0001 | 184 | #define HCI_CM_HOLD 0x0001 |
| @@ -199,6 +200,14 @@ enum { | |||
| 199 | #define HCI_LM_RELIABLE 0x0010 | 200 | #define HCI_LM_RELIABLE 0x0010 |
| 200 | #define HCI_LM_SECURE 0x0020 | 201 | #define HCI_LM_SECURE 0x0020 |
| 201 | 202 | ||
| 203 | /* Authentication types */ | ||
| 204 | #define HCI_AT_NO_BONDING 0x00 | ||
| 205 | #define HCI_AT_NO_BONDING_MITM 0x01 | ||
| 206 | #define HCI_AT_DEDICATED_BONDING 0x02 | ||
| 207 | #define HCI_AT_DEDICATED_BONDING_MITM 0x03 | ||
| 208 | #define HCI_AT_GENERAL_BONDING 0x04 | ||
| 209 | #define HCI_AT_GENERAL_BONDING_MITM 0x05 | ||
| 210 | |||
| 202 | /* ----- HCI Commands ---- */ | 211 | /* ----- HCI Commands ---- */ |
| 203 | #define HCI_OP_INQUIRY 0x0401 | 212 | #define HCI_OP_INQUIRY 0x0401 |
| 204 | struct hci_cp_inquiry { | 213 | struct hci_cp_inquiry { |
| @@ -402,6 +411,17 @@ struct hci_rp_write_link_policy { | |||
| 402 | __le16 handle; | 411 | __le16 handle; |
| 403 | } __attribute__ ((packed)); | 412 | } __attribute__ ((packed)); |
| 404 | 413 | ||
| 414 | #define HCI_OP_READ_DEF_LINK_POLICY 0x080e | ||
| 415 | struct hci_rp_read_def_link_policy { | ||
| 416 | __u8 status; | ||
| 417 | __le16 policy; | ||
| 418 | } __attribute__ ((packed)); | ||
| 419 | |||
| 420 | #define HCI_OP_WRITE_DEF_LINK_POLICY 0x080f | ||
| 421 | struct hci_cp_write_def_link_policy { | ||
| 422 | __le16 policy; | ||
| 423 | } __attribute__ ((packed)); | ||
| 424 | |||
| 405 | #define HCI_OP_SNIFF_SUBRATE 0x0811 | 425 | #define HCI_OP_SNIFF_SUBRATE 0x0811 |
| 406 | struct hci_cp_sniff_subrate { | 426 | struct hci_cp_sniff_subrate { |
| 407 | __le16 handle; | 427 | __le16 handle; |
| @@ -501,6 +521,17 @@ struct hci_cp_host_buffer_size { | |||
| 501 | __le16 sco_max_pkt; | 521 | __le16 sco_max_pkt; |
| 502 | } __attribute__ ((packed)); | 522 | } __attribute__ ((packed)); |
| 503 | 523 | ||
| 524 | #define HCI_OP_READ_SSP_MODE 0x0c55 | ||
| 525 | struct hci_rp_read_ssp_mode { | ||
| 526 | __u8 status; | ||
| 527 | __u8 mode; | ||
| 528 | } __attribute__ ((packed)); | ||
| 529 | |||
| 530 | #define HCI_OP_WRITE_SSP_MODE 0x0c56 | ||
| 531 | struct hci_cp_write_ssp_mode { | ||
| 532 | __u8 mode; | ||
| 533 | } __attribute__ ((packed)); | ||
| 534 | |||
| 504 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 | 535 | #define HCI_OP_READ_LOCAL_VERSION 0x1001 |
| 505 | struct hci_rp_read_local_version { | 536 | struct hci_rp_read_local_version { |
| 506 | __u8 status; | 537 | __u8 status; |
| @@ -696,6 +727,13 @@ struct hci_ev_clock_offset { | |||
| 696 | __le16 clock_offset; | 727 | __le16 clock_offset; |
| 697 | } __attribute__ ((packed)); | 728 | } __attribute__ ((packed)); |
| 698 | 729 | ||
| 730 | #define HCI_EV_PKT_TYPE_CHANGE 0x1d | ||
| 731 | struct hci_ev_pkt_type_change { | ||
| 732 | __u8 status; | ||
| 733 | __le16 handle; | ||
| 734 | __le16 pkt_type; | ||
| 735 | } __attribute__ ((packed)); | ||
| 736 | |||
| 699 | #define HCI_EV_PSCAN_REP_MODE 0x20 | 737 | #define HCI_EV_PSCAN_REP_MODE 0x20 |
| 700 | struct hci_ev_pscan_rep_mode { | 738 | struct hci_ev_pscan_rep_mode { |
| 701 | bdaddr_t bdaddr; | 739 | bdaddr_t bdaddr; |
| @@ -774,6 +812,23 @@ struct extended_inquiry_info { | |||
| 774 | __u8 data[240]; | 812 | __u8 data[240]; |
| 775 | } __attribute__ ((packed)); | 813 | } __attribute__ ((packed)); |
| 776 | 814 | ||
| 815 | #define HCI_EV_IO_CAPA_REQUEST 0x31 | ||
| 816 | struct hci_ev_io_capa_request { | ||
| 817 | bdaddr_t bdaddr; | ||
| 818 | } __attribute__ ((packed)); | ||
| 819 | |||
| 820 | #define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 | ||
| 821 | struct hci_ev_simple_pair_complete { | ||
| 822 | __u8 status; | ||
| 823 | bdaddr_t bdaddr; | ||
| 824 | } __attribute__ ((packed)); | ||
| 825 | |||
| 826 | #define HCI_EV_REMOTE_HOST_FEATURES 0x3d | ||
| 827 | struct hci_ev_remote_host_features { | ||
| 828 | bdaddr_t bdaddr; | ||
| 829 | __u8 features[8]; | ||
| 830 | } __attribute__ ((packed)); | ||
| 831 | |||
| 777 | /* Internal events generated by Bluetooth stack */ | 832 | /* Internal events generated by Bluetooth stack */ |
| 778 | #define HCI_EV_STACK_INTERNAL 0xfd | 833 | #define HCI_EV_STACK_INTERNAL 0xfd |
| 779 | struct hci_ev_stack_internal { | 834 | struct hci_ev_stack_internal { |
| @@ -951,6 +1006,11 @@ struct hci_conn_info_req { | |||
| 951 | struct hci_conn_info conn_info[0]; | 1006 | struct hci_conn_info conn_info[0]; |
| 952 | }; | 1007 | }; |
| 953 | 1008 | ||
| 1009 | struct hci_auth_info_req { | ||
| 1010 | bdaddr_t bdaddr; | ||
| 1011 | __u8 type; | ||
| 1012 | }; | ||
| 1013 | |||
| 954 | struct hci_inquiry_req { | 1014 | struct hci_inquiry_req { |
| 955 | __u16 dev_id; | 1015 | __u16 dev_id; |
| 956 | __u16 flags; | 1016 | __u16 flags; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index ea13baa3851b..cbf751094688 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
| @@ -40,6 +40,7 @@ struct inquiry_data { | |||
| 40 | __u8 dev_class[3]; | 40 | __u8 dev_class[3]; |
| 41 | __le16 clock_offset; | 41 | __le16 clock_offset; |
| 42 | __s8 rssi; | 42 | __s8 rssi; |
| 43 | __u8 ssp_mode; | ||
| 43 | }; | 44 | }; |
| 44 | 45 | ||
| 45 | struct inquiry_entry { | 46 | struct inquiry_entry { |
| @@ -75,6 +76,7 @@ struct hci_dev { | |||
| 75 | __u8 dev_class[3]; | 76 | __u8 dev_class[3]; |
| 76 | __u8 features[8]; | 77 | __u8 features[8]; |
| 77 | __u8 commands[64]; | 78 | __u8 commands[64]; |
| 79 | __u8 ssp_mode; | ||
| 78 | __u8 hci_ver; | 80 | __u8 hci_ver; |
| 79 | __u16 hci_rev; | 81 | __u16 hci_rev; |
| 80 | __u16 manufacturer; | 82 | __u16 manufacturer; |
| @@ -161,9 +163,12 @@ struct hci_conn { | |||
| 161 | __u8 attempt; | 163 | __u8 attempt; |
| 162 | __u8 dev_class[3]; | 164 | __u8 dev_class[3]; |
| 163 | __u8 features[8]; | 165 | __u8 features[8]; |
| 166 | __u8 ssp_mode; | ||
| 164 | __u16 interval; | 167 | __u16 interval; |
| 168 | __u16 pkt_type; | ||
| 165 | __u16 link_policy; | 169 | __u16 link_policy; |
| 166 | __u32 link_mode; | 170 | __u32 link_mode; |
| 171 | __u8 auth_type; | ||
| 167 | __u8 power_save; | 172 | __u8 power_save; |
| 168 | unsigned long pend; | 173 | unsigned long pend; |
| 169 | 174 | ||
| @@ -344,7 +349,7 @@ static inline void hci_conn_put(struct hci_conn *conn) | |||
| 344 | if (conn->state == BT_CONNECTED) { | 349 | if (conn->state == BT_CONNECTED) { |
| 345 | timeo = msecs_to_jiffies(HCI_DISCONN_TIMEOUT); | 350 | timeo = msecs_to_jiffies(HCI_DISCONN_TIMEOUT); |
| 346 | if (!conn->out) | 351 | if (!conn->out) |
| 347 | timeo *= 2; | 352 | timeo *= 5; |
| 348 | } else | 353 | } else |
| 349 | timeo = msecs_to_jiffies(10); | 354 | timeo = msecs_to_jiffies(10); |
| 350 | } else | 355 | } else |
| @@ -418,6 +423,7 @@ int hci_get_dev_list(void __user *arg); | |||
| 418 | int hci_get_dev_info(void __user *arg); | 423 | int hci_get_dev_info(void __user *arg); |
| 419 | int hci_get_conn_list(void __user *arg); | 424 | int hci_get_conn_list(void __user *arg); |
| 420 | int hci_get_conn_info(struct hci_dev *hdev, void __user *arg); | 425 | int hci_get_conn_info(struct hci_dev *hdev, void __user *arg); |
| 426 | int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); | ||
| 421 | int hci_inquiry(void __user *arg); | 427 | int hci_inquiry(void __user *arg); |
| 422 | 428 | ||
| 423 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); | 429 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
| @@ -459,6 +465,7 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
| 459 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) | 465 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) |
| 460 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | 466 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) |
| 461 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) | 467 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) |
| 468 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) | ||
| 462 | 469 | ||
| 463 | /* ----- HCI protocols ----- */ | 470 | /* ----- HCI protocols ----- */ |
| 464 | struct hci_proto { | 471 | struct hci_proto { |
| @@ -474,7 +481,7 @@ struct hci_proto { | |||
| 474 | int (*recv_acldata) (struct hci_conn *conn, struct sk_buff *skb, __u16 flags); | 481 | int (*recv_acldata) (struct hci_conn *conn, struct sk_buff *skb, __u16 flags); |
| 475 | int (*recv_scodata) (struct hci_conn *conn, struct sk_buff *skb); | 482 | int (*recv_scodata) (struct hci_conn *conn, struct sk_buff *skb); |
| 476 | int (*auth_cfm) (struct hci_conn *conn, __u8 status); | 483 | int (*auth_cfm) (struct hci_conn *conn, __u8 status); |
| 477 | int (*encrypt_cfm) (struct hci_conn *conn, __u8 status); | 484 | int (*encrypt_cfm) (struct hci_conn *conn, __u8 status, __u8 encrypt); |
| 478 | }; | 485 | }; |
| 479 | 486 | ||
| 480 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type) | 487 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type) |
| @@ -532,17 +539,17 @@ static inline void hci_proto_auth_cfm(struct hci_conn *conn, __u8 status) | |||
| 532 | hp->auth_cfm(conn, status); | 539 | hp->auth_cfm(conn, status); |
| 533 | } | 540 | } |
| 534 | 541 | ||
| 535 | static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status) | 542 | static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encrypt) |
| 536 | { | 543 | { |
| 537 | register struct hci_proto *hp; | 544 | register struct hci_proto *hp; |
| 538 | 545 | ||
| 539 | hp = hci_proto[HCI_PROTO_L2CAP]; | 546 | hp = hci_proto[HCI_PROTO_L2CAP]; |
| 540 | if (hp && hp->encrypt_cfm) | 547 | if (hp && hp->encrypt_cfm) |
| 541 | hp->encrypt_cfm(conn, status); | 548 | hp->encrypt_cfm(conn, status, encrypt); |
| 542 | 549 | ||
| 543 | hp = hci_proto[HCI_PROTO_SCO]; | 550 | hp = hci_proto[HCI_PROTO_SCO]; |
| 544 | if (hp && hp->encrypt_cfm) | 551 | if (hp && hp->encrypt_cfm) |
| 545 | hp->encrypt_cfm(conn, status); | 552 | hp->encrypt_cfm(conn, status, encrypt); |
| 546 | } | 553 | } |
| 547 | 554 | ||
| 548 | int hci_register_proto(struct hci_proto *hproto); | 555 | int hci_register_proto(struct hci_proto *hproto); |
| @@ -579,7 +586,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encr | |||
| 579 | { | 586 | { |
| 580 | struct list_head *p; | 587 | struct list_head *p; |
| 581 | 588 | ||
| 582 | hci_proto_encrypt_cfm(conn, status); | 589 | hci_proto_encrypt_cfm(conn, status, encrypt); |
| 583 | 590 | ||
| 584 | read_lock_bh(&hci_cb_list_lock); | 591 | read_lock_bh(&hci_cb_list_lock); |
| 585 | list_for_each(p, &hci_cb_list) { | 592 | list_for_each(p, &hci_cb_list) { |
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index 98ec7a320689..4dc8d92a4638 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
| @@ -180,7 +180,9 @@ struct rfcomm_dlc { | |||
| 180 | u8 addr; | 180 | u8 addr; |
| 181 | u8 priority; | 181 | u8 priority; |
| 182 | u8 v24_sig; | 182 | u8 v24_sig; |
| 183 | u8 remote_v24_sig; | ||
| 183 | u8 mscex; | 184 | u8 mscex; |
| 185 | u8 out; | ||
| 184 | 186 | ||
| 185 | u32 link_mode; | 187 | u32 link_mode; |
| 186 | 188 | ||
