aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2011-01-05 16:06:25 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-01-05 16:06:25 -0500
commitc96e96354a6c9456cdf1f150eca504e2ea35301e (patch)
tree751bec601fb8152116b8e31e0f1f83d687a37d6f /include/net
parentdbbe68bb12b34f3e450da7a73c20e6fa1f85d63a (diff)
parent33af88138b859f515b365a074e0a014d7cdbf846 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
Conflicts: net/bluetooth/Makefile
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/bluetooth.h1
-rw-r--r--include/net/bluetooth/hci.h4
-rw-r--r--include/net/bluetooth/hci_core.h9
-rw-r--r--include/net/bluetooth/mgmt.h87
4 files changed, 100 insertions, 1 deletions
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index d81ea7997701..0c5e72503b77 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -144,6 +144,7 @@ struct bt_skb_cb {
144 __u8 tx_seq; 144 __u8 tx_seq;
145 __u8 retries; 145 __u8 retries;
146 __u8 sar; 146 __u8 sar;
147 unsigned short channel;
147}; 148};
148#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) 149#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))
149 150
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index f3c5ed6d7bda..29a7a8ca0438 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -934,9 +934,13 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb)
934struct sockaddr_hci { 934struct sockaddr_hci {
935 sa_family_t hci_family; 935 sa_family_t hci_family;
936 unsigned short hci_dev; 936 unsigned short hci_dev;
937 unsigned short hci_channel;
937}; 938};
938#define HCI_DEV_NONE 0xffff 939#define HCI_DEV_NONE 0xffff
939 940
941#define HCI_CHANNEL_RAW 0
942#define HCI_CHANNEL_CONTROL 1
943
940struct hci_filter { 944struct hci_filter {
941 unsigned long type_mask; 945 unsigned long type_mask;
942 unsigned long event_mask[2]; 946 unsigned long event_mask[2];
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 9c08625617a1..a29feb01854e 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -129,6 +129,7 @@ struct hci_dev {
129 wait_queue_head_t req_wait_q; 129 wait_queue_head_t req_wait_q;
130 __u32 req_status; 130 __u32 req_status;
131 __u32 req_result; 131 __u32 req_result;
132 __u16 req_last_cmd;
132 133
133 struct inquiry_cache inq_cache; 134 struct inquiry_cache inq_cache;
134 struct hci_conn_hash conn_hash; 135 struct hci_conn_hash conn_hash;
@@ -660,6 +661,11 @@ void hci_si_event(struct hci_dev *hdev, int type, int dlen, void *data);
660/* ----- HCI Sockets ----- */ 661/* ----- HCI Sockets ----- */
661void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb); 662void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb);
662 663
664/* Management interface */
665int mgmt_control(struct sock *sk, struct msghdr *msg, size_t len);
666int mgmt_index_added(u16 index);
667int mgmt_index_removed(u16 index);
668
663/* HCI info for socket */ 669/* HCI info for socket */
664#define hci_pi(sk) ((struct hci_pinfo *) sk) 670#define hci_pi(sk) ((struct hci_pinfo *) sk)
665 671
@@ -668,6 +674,7 @@ struct hci_pinfo {
668 struct hci_dev *hdev; 674 struct hci_dev *hdev;
669 struct hci_filter filter; 675 struct hci_filter filter;
670 __u32 cmsg_mask; 676 __u32 cmsg_mask;
677 unsigned short channel;
671}; 678};
672 679
673/* HCI security filter */ 680/* HCI security filter */
@@ -687,6 +694,6 @@ struct hci_sec_filter {
687#define hci_req_lock(d) mutex_lock(&d->req_lock) 694#define hci_req_lock(d) mutex_lock(&d->req_lock)
688#define hci_req_unlock(d) mutex_unlock(&d->req_lock) 695#define hci_req_unlock(d) mutex_unlock(&d->req_lock)
689 696
690void hci_req_complete(struct hci_dev *hdev, int result); 697void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result);
691 698
692#endif /* __HCI_CORE_H */ 699#endif /* __HCI_CORE_H */
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
new file mode 100644
index 000000000000..ca29c1367ffd
--- /dev/null
+++ b/include/net/bluetooth/mgmt.h
@@ -0,0 +1,87 @@
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3
4 Copyright (C) 2010 Nokia Corporation
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as
8 published by the Free Software Foundation;
9
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
11 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
13 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
14 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
15 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
19 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
20 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
21 SOFTWARE IS DISCLAIMED.
22*/
23
24struct mgmt_hdr {
25 __le16 opcode;
26 __le16 len;
27} __packed;
28#define MGMT_HDR_SIZE 4
29
30#define MGMT_OP_READ_VERSION 0x0001
31struct mgmt_rp_read_version {
32 __u8 version;
33 __le16 revision;
34} __packed;
35
36#define MGMT_OP_READ_INDEX_LIST 0x0003
37struct mgmt_rp_read_index_list {
38 __le16 num_controllers;
39 __le16 index[0];
40} __packed;
41
42#define MGMT_OP_READ_INFO 0x0004
43struct mgmt_cp_read_info {
44 __le16 index;
45} __packed;
46struct mgmt_rp_read_info {
47 __le16 index;
48 __u8 type;
49 __u8 powered;
50 __u8 discoverable;
51 __u8 pairable;
52 __u8 sec_mode;
53 bdaddr_t bdaddr;
54 __u8 dev_class[3];
55 __u8 features[8];
56 __u16 manufacturer;
57 __u8 hci_ver;
58 __u16 hci_rev;
59} __packed;
60
61#define MGMT_EV_CMD_COMPLETE 0x0001
62struct mgmt_ev_cmd_complete {
63 __le16 opcode;
64 __u8 data[0];
65} __packed;
66
67#define MGMT_EV_CMD_STATUS 0x0002
68struct mgmt_ev_cmd_status {
69 __u8 status;
70 __le16 opcode;
71} __packed;
72
73#define MGMT_EV_CONTROLLER_ERROR 0x0003
74struct mgmt_ev_controller_error {
75 __le16 index;
76 __u8 error_code;
77} __packed;
78
79#define MGMT_EV_INDEX_ADDED 0x0004
80struct mgmt_ev_index_added {
81 __le16 index;
82} __packed;
83
84#define MGMT_EV_INDEX_REMOVED 0x0005
85struct mgmt_ev_index_removed {
86 __le16 index;
87} __packed;