aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-04-07 15:30:53 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-07 15:30:53 -0400
commitf3b3e36f4ecad9fd7b0ae04d7400f2153a7834eb (patch)
tree94417c101111e299fecd93ff41b2304e47e59e2c /include/net
parentb0006e69615868f3dfdfe2bd64eb11973f1208fc (diff)
parentdb940cb0db7c69a217661ecd49e1e6b0d680a6cc (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/bluetooth-next-2.6
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/hci.h42
-rw-r--r--include/net/bluetooth/hci_core.h25
-rw-r--r--include/net/bluetooth/l2cap.h2
-rw-r--r--include/net/bluetooth/mgmt.h47
4 files changed, 110 insertions, 6 deletions
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index ec6acf2f1c0b..6138e313d175 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -84,6 +84,8 @@ enum {
84 HCI_SERVICE_CACHE, 84 HCI_SERVICE_CACHE,
85 HCI_LINK_KEYS, 85 HCI_LINK_KEYS,
86 HCI_DEBUG_KEYS, 86 HCI_DEBUG_KEYS,
87
88 HCI_RESET,
87}; 89};
88 90
89/* HCI ioctl defines */ 91/* HCI ioctl defines */
@@ -426,6 +428,18 @@ struct hci_rp_user_confirm_reply {
426 428
427#define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d 429#define HCI_OP_USER_CONFIRM_NEG_REPLY 0x042d
428 430
431#define HCI_OP_REMOTE_OOB_DATA_REPLY 0x0430
432struct hci_cp_remote_oob_data_reply {
433 bdaddr_t bdaddr;
434 __u8 hash[16];
435 __u8 randomizer[16];
436} __packed;
437
438#define HCI_OP_REMOTE_OOB_DATA_NEG_REPLY 0x0433
439struct hci_cp_remote_oob_data_neg_reply {
440 bdaddr_t bdaddr;
441} __packed;
442
429#define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434 443#define HCI_OP_IO_CAPABILITY_NEG_REPLY 0x0434
430struct hci_cp_io_capability_neg_reply { 444struct hci_cp_io_capability_neg_reply {
431 bdaddr_t bdaddr; 445 bdaddr_t bdaddr;
@@ -535,15 +549,17 @@ struct hci_cp_delete_stored_link_key {
535 __u8 delete_all; 549 __u8 delete_all;
536} __packed; 550} __packed;
537 551
552#define HCI_MAX_NAME_LENGTH 248
553
538#define HCI_OP_WRITE_LOCAL_NAME 0x0c13 554#define HCI_OP_WRITE_LOCAL_NAME 0x0c13
539struct hci_cp_write_local_name { 555struct hci_cp_write_local_name {
540 __u8 name[248]; 556 __u8 name[HCI_MAX_NAME_LENGTH];
541} __packed; 557} __packed;
542 558
543#define HCI_OP_READ_LOCAL_NAME 0x0c14 559#define HCI_OP_READ_LOCAL_NAME 0x0c14
544struct hci_rp_read_local_name { 560struct hci_rp_read_local_name {
545 __u8 status; 561 __u8 status;
546 __u8 name[248]; 562 __u8 name[HCI_MAX_NAME_LENGTH];
547} __packed; 563} __packed;
548 564
549#define HCI_OP_WRITE_CA_TIMEOUT 0x0c16 565#define HCI_OP_WRITE_CA_TIMEOUT 0x0c16
@@ -600,6 +616,14 @@ struct hci_cp_host_buffer_size {
600 616
601#define HCI_OP_WRITE_INQUIRY_MODE 0x0c45 617#define HCI_OP_WRITE_INQUIRY_MODE 0x0c45
602 618
619#define HCI_MAX_EIR_LENGTH 240
620
621#define HCI_OP_WRITE_EIR 0x0c52
622struct hci_cp_write_eir {
623 uint8_t fec;
624 uint8_t data[HCI_MAX_EIR_LENGTH];
625} __packed;
626
603#define HCI_OP_READ_SSP_MODE 0x0c55 627#define HCI_OP_READ_SSP_MODE 0x0c55
604struct hci_rp_read_ssp_mode { 628struct hci_rp_read_ssp_mode {
605 __u8 status; 629 __u8 status;
@@ -611,6 +635,13 @@ struct hci_cp_write_ssp_mode {
611 __u8 mode; 635 __u8 mode;
612} __packed; 636} __packed;
613 637
638#define HCI_OP_READ_LOCAL_OOB_DATA 0x0c57
639struct hci_rp_read_local_oob_data {
640 __u8 status;
641 __u8 hash[16];
642 __u8 randomizer[16];
643} __packed;
644
614#define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 645#define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58
615 646
616#define HCI_OP_READ_LOCAL_VERSION 0x1001 647#define HCI_OP_READ_LOCAL_VERSION 0x1001
@@ -745,7 +776,7 @@ struct hci_ev_auth_complete {
745struct hci_ev_remote_name { 776struct hci_ev_remote_name {
746 __u8 status; 777 __u8 status;
747 bdaddr_t bdaddr; 778 bdaddr_t bdaddr;
748 __u8 name[248]; 779 __u8 name[HCI_MAX_NAME_LENGTH];
749} __packed; 780} __packed;
750 781
751#define HCI_EV_ENCRYPT_CHANGE 0x08 782#define HCI_EV_ENCRYPT_CHANGE 0x08
@@ -953,6 +984,11 @@ struct hci_ev_user_confirm_req {
953 __le32 passkey; 984 __le32 passkey;
954} __packed; 985} __packed;
955 986
987#define HCI_EV_REMOTE_OOB_DATA_REQUEST 0x35
988struct hci_ev_remote_oob_data_request {
989 bdaddr_t bdaddr;
990} __packed;
991
956#define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36 992#define HCI_EV_SIMPLE_PAIR_COMPLETE 0x36
957struct hci_ev_simple_pair_complete { 993struct hci_ev_simple_pair_complete {
958 __u8 status; 994 __u8 status;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 441dadbf6a89..4093133c1283 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -82,6 +82,13 @@ struct link_key {
82 u8 pin_len; 82 u8 pin_len;
83}; 83};
84 84
85struct oob_data {
86 struct list_head list;
87 bdaddr_t bdaddr;
88 u8 hash[16];
89 u8 randomizer[16];
90};
91
85#define NUM_REASSEMBLY 4 92#define NUM_REASSEMBLY 4
86struct hci_dev { 93struct hci_dev {
87 struct list_head list; 94 struct list_head list;
@@ -94,7 +101,8 @@ struct hci_dev {
94 __u8 bus; 101 __u8 bus;
95 __u8 dev_type; 102 __u8 dev_type;
96 bdaddr_t bdaddr; 103 bdaddr_t bdaddr;
97 __u8 dev_name[248]; 104 __u8 dev_name[HCI_MAX_NAME_LENGTH];
105 __u8 eir[HCI_MAX_EIR_LENGTH];
98 __u8 dev_class[3]; 106 __u8 dev_class[3];
99 __u8 major_class; 107 __u8 major_class;
100 __u8 minor_class; 108 __u8 minor_class;
@@ -169,6 +177,8 @@ struct hci_dev {
169 177
170 struct list_head link_keys; 178 struct list_head link_keys;
171 179
180 struct list_head remote_oob_data;
181
172 struct hci_dev_stats stat; 182 struct hci_dev_stats stat;
173 183
174 struct sk_buff_head driver_init; 184 struct sk_buff_head driver_init;
@@ -505,6 +515,13 @@ int hci_add_link_key(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr,
505 u8 *key, u8 type, u8 pin_len); 515 u8 *key, u8 type, u8 pin_len);
506int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 516int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
507 517
518int hci_remote_oob_data_clear(struct hci_dev *hdev);
519struct oob_data *hci_find_remote_oob_data(struct hci_dev *hdev,
520 bdaddr_t *bdaddr);
521int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash,
522 u8 *randomizer);
523int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr);
524
508void hci_del_off_timer(struct hci_dev *hdev); 525void hci_del_off_timer(struct hci_dev *hdev);
509 526
510void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); 527void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
@@ -767,6 +784,12 @@ int mgmt_user_confirm_reply_complete(u16 index, bdaddr_t *bdaddr, u8 status);
767int mgmt_user_confirm_neg_reply_complete(u16 index, bdaddr_t *bdaddr, 784int mgmt_user_confirm_neg_reply_complete(u16 index, bdaddr_t *bdaddr,
768 u8 status); 785 u8 status);
769int mgmt_auth_failed(u16 index, bdaddr_t *bdaddr, u8 status); 786int mgmt_auth_failed(u16 index, bdaddr_t *bdaddr, u8 status);
787int mgmt_set_local_name_complete(u16 index, u8 *name, u8 status);
788int mgmt_read_local_oob_data_reply_complete(u16 index, u8 *hash, u8 *randomizer,
789 u8 status);
790int mgmt_device_found(u16 index, bdaddr_t *bdaddr, u8 *dev_class, s8 rssi,
791 u8 *eir);
792int mgmt_remote_name(u16 index, bdaddr_t *bdaddr, u8 *name);
770 793
771/* HCI info for socket */ 794/* HCI info for socket */
772#define hci_pi(sk) ((struct hci_pinfo *) sk) 795#define hci_pi(sk) ((struct hci_pinfo *) sk)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 4f4bff1eaed6..2b9ca0d5c4a0 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -280,7 +280,6 @@ struct l2cap_conn_param_update_rsp {
280struct l2cap_chan_list { 280struct l2cap_chan_list {
281 struct sock *head; 281 struct sock *head;
282 rwlock_t lock; 282 rwlock_t lock;
283 long num;
284}; 283};
285 284
286struct l2cap_conn { 285struct l2cap_conn {
@@ -302,7 +301,6 @@ struct l2cap_conn {
302 301
303 struct sk_buff *rx_skb; 302 struct sk_buff *rx_skb;
304 __u32 rx_len; 303 __u32 rx_len;
305 __u8 rx_ident;
306 __u8 tx_ident; 304 __u8 tx_ident;
307 305
308 __u8 disc_reason; 306 __u8 disc_reason;
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 5fabfa886b3e..6b6ff92ab499 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -41,6 +41,10 @@ struct mgmt_rp_read_index_list {
41 __le16 index[0]; 41 __le16 index[0];
42} __packed; 42} __packed;
43 43
44/* Reserve one extra byte for names in management messages so that they
45 * are always guaranteed to be nul-terminated */
46#define MGMT_MAX_NAME_LENGTH (HCI_MAX_NAME_LENGTH + 1)
47
44#define MGMT_OP_READ_INFO 0x0004 48#define MGMT_OP_READ_INFO 0x0004
45struct mgmt_rp_read_info { 49struct mgmt_rp_read_info {
46 __u8 type; 50 __u8 type;
@@ -55,6 +59,7 @@ struct mgmt_rp_read_info {
55 __u16 manufacturer; 59 __u16 manufacturer;
56 __u8 hci_ver; 60 __u8 hci_ver;
57 __u16 hci_rev; 61 __u16 hci_rev;
62 __u8 name[MGMT_MAX_NAME_LENGTH];
58} __packed; 63} __packed;
59 64
60struct mgmt_mode { 65struct mgmt_mode {
@@ -167,6 +172,29 @@ struct mgmt_rp_user_confirm_reply {
167 172
168#define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x0016 173#define MGMT_OP_USER_CONFIRM_NEG_REPLY 0x0016
169 174
175#define MGMT_OP_SET_LOCAL_NAME 0x0017
176struct mgmt_cp_set_local_name {
177 __u8 name[MGMT_MAX_NAME_LENGTH];
178} __packed;
179
180#define MGMT_OP_READ_LOCAL_OOB_DATA 0x0018
181struct mgmt_rp_read_local_oob_data {
182 __u8 hash[16];
183 __u8 randomizer[16];
184} __packed;
185
186#define MGMT_OP_ADD_REMOTE_OOB_DATA 0x0019
187struct mgmt_cp_add_remote_oob_data {
188 bdaddr_t bdaddr;
189 __u8 hash[16];
190 __u8 randomizer[16];
191} __packed;
192
193#define MGMT_OP_REMOVE_REMOTE_OOB_DATA 0x001A
194struct mgmt_cp_remove_remote_oob_data {
195 bdaddr_t bdaddr;
196} __packed;
197
170#define MGMT_EV_CMD_COMPLETE 0x0001 198#define MGMT_EV_CMD_COMPLETE 0x0001
171struct mgmt_ev_cmd_complete { 199struct mgmt_ev_cmd_complete {
172 __le16 opcode; 200 __le16 opcode;
@@ -234,3 +262,22 @@ struct mgmt_ev_auth_failed {
234 bdaddr_t bdaddr; 262 bdaddr_t bdaddr;
235 __u8 status; 263 __u8 status;
236} __packed; 264} __packed;
265
266#define MGMT_EV_LOCAL_NAME_CHANGED 0x0011
267struct mgmt_ev_local_name_changed {
268 __u8 name[MGMT_MAX_NAME_LENGTH];
269} __packed;
270
271#define MGMT_EV_DEVICE_FOUND 0x0012
272struct mgmt_ev_device_found {
273 bdaddr_t bdaddr;
274 __u8 dev_class[3];
275 __s8 rssi;
276 __u8 eir[HCI_MAX_EIR_LENGTH];
277} __packed;
278
279#define MGMT_EV_REMOTE_NAME 0x0013
280struct mgmt_ev_remote_name {
281 bdaddr_t bdaddr;
282 __u8 name[MGMT_MAX_NAME_LENGTH];
283} __packed;