diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nfc.h | 12 | ||||
-rw-r--r-- | include/linux/nl80211.h | 8 | ||||
-rw-r--r-- | include/linux/ssb/ssb.h | 1 | ||||
-rw-r--r-- | include/net/bluetooth/a2mp.h | 126 | ||||
-rw-r--r-- | include/net/bluetooth/bluetooth.h | 39 | ||||
-rw-r--r-- | include/net/bluetooth/hci.h | 99 | ||||
-rw-r--r-- | include/net/bluetooth/hci_core.h | 29 | ||||
-rw-r--r-- | include/net/bluetooth/l2cap.h | 205 | ||||
-rw-r--r-- | include/net/cfg80211.h | 45 | ||||
-rw-r--r-- | include/net/mac80211.h | 44 | ||||
-rw-r--r-- | include/net/nfc/hci.h | 3 | ||||
-rw-r--r-- | include/net/nfc/nfc.h | 14 | ||||
-rw-r--r-- | include/net/nfc/shdlc.h | 3 |
13 files changed, 389 insertions, 239 deletions
diff --git a/include/linux/nfc.h b/include/linux/nfc.h index 0ae9b5857c83..f4e6dd915b1c 100644 --- a/include/linux/nfc.h +++ b/include/linux/nfc.h | |||
@@ -56,6 +56,10 @@ | |||
56 | * %NFC_ATTR_PROTOCOLS) | 56 | * %NFC_ATTR_PROTOCOLS) |
57 | * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed | 57 | * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed |
58 | * (it sends %NFC_ATTR_DEVICE_INDEX) | 58 | * (it sends %NFC_ATTR_DEVICE_INDEX) |
59 | * @NFC_EVENT_TM_ACTIVATED: event emitted when the adapter is activated in | ||
60 | * target mode. | ||
61 | * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated | ||
62 | * from target mode. | ||
59 | */ | 63 | */ |
60 | enum nfc_commands { | 64 | enum nfc_commands { |
61 | NFC_CMD_UNSPEC, | 65 | NFC_CMD_UNSPEC, |
@@ -71,6 +75,8 @@ enum nfc_commands { | |||
71 | NFC_EVENT_DEVICE_ADDED, | 75 | NFC_EVENT_DEVICE_ADDED, |
72 | NFC_EVENT_DEVICE_REMOVED, | 76 | NFC_EVENT_DEVICE_REMOVED, |
73 | NFC_EVENT_TARGET_LOST, | 77 | NFC_EVENT_TARGET_LOST, |
78 | NFC_EVENT_TM_ACTIVATED, | ||
79 | NFC_EVENT_TM_DEACTIVATED, | ||
74 | /* private: internal use only */ | 80 | /* private: internal use only */ |
75 | __NFC_CMD_AFTER_LAST | 81 | __NFC_CMD_AFTER_LAST |
76 | }; | 82 | }; |
@@ -94,6 +100,8 @@ enum nfc_commands { | |||
94 | * @NFC_ATTR_TARGET_SENSF_RES: NFC-F targets extra information, max 18 bytes | 100 | * @NFC_ATTR_TARGET_SENSF_RES: NFC-F targets extra information, max 18 bytes |
95 | * @NFC_ATTR_COMM_MODE: Passive or active mode | 101 | * @NFC_ATTR_COMM_MODE: Passive or active mode |
96 | * @NFC_ATTR_RF_MODE: Initiator or target | 102 | * @NFC_ATTR_RF_MODE: Initiator or target |
103 | * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for | ||
104 | * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for | ||
97 | */ | 105 | */ |
98 | enum nfc_attrs { | 106 | enum nfc_attrs { |
99 | NFC_ATTR_UNSPEC, | 107 | NFC_ATTR_UNSPEC, |
@@ -109,6 +117,8 @@ enum nfc_attrs { | |||
109 | NFC_ATTR_COMM_MODE, | 117 | NFC_ATTR_COMM_MODE, |
110 | NFC_ATTR_RF_MODE, | 118 | NFC_ATTR_RF_MODE, |
111 | NFC_ATTR_DEVICE_POWERED, | 119 | NFC_ATTR_DEVICE_POWERED, |
120 | NFC_ATTR_IM_PROTOCOLS, | ||
121 | NFC_ATTR_TM_PROTOCOLS, | ||
112 | /* private: internal use only */ | 122 | /* private: internal use only */ |
113 | __NFC_ATTR_AFTER_LAST | 123 | __NFC_ATTR_AFTER_LAST |
114 | }; | 124 | }; |
@@ -118,6 +128,7 @@ enum nfc_attrs { | |||
118 | #define NFC_NFCID1_MAXSIZE 10 | 128 | #define NFC_NFCID1_MAXSIZE 10 |
119 | #define NFC_SENSB_RES_MAXSIZE 12 | 129 | #define NFC_SENSB_RES_MAXSIZE 12 |
120 | #define NFC_SENSF_RES_MAXSIZE 18 | 130 | #define NFC_SENSF_RES_MAXSIZE 18 |
131 | #define NFC_GB_MAXSIZE 48 | ||
121 | 132 | ||
122 | /* NFC protocols */ | 133 | /* NFC protocols */ |
123 | #define NFC_PROTO_JEWEL 1 | 134 | #define NFC_PROTO_JEWEL 1 |
@@ -135,6 +146,7 @@ enum nfc_attrs { | |||
135 | /* NFC RF modes */ | 146 | /* NFC RF modes */ |
136 | #define NFC_RF_INITIATOR 0 | 147 | #define NFC_RF_INITIATOR 0 |
137 | #define NFC_RF_TARGET 1 | 148 | #define NFC_RF_TARGET 1 |
149 | #define NFC_RF_NONE 2 | ||
138 | 150 | ||
139 | /* NFC protocols masks used in bitsets */ | 151 | /* NFC protocols masks used in bitsets */ |
140 | #define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL) | 152 | #define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL) |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index a6959f72745e..970afdf5a605 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -170,6 +170,8 @@ | |||
170 | * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, | 170 | * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, |
171 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, | 171 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, |
172 | * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. | 172 | * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. |
173 | * The channel to use can be set on the interface or be given using the | ||
174 | * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_CHANNEL_TYPE attrs. | ||
173 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP | 175 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP |
174 | * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface | 176 | * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface |
175 | * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP | 177 | * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP |
@@ -1520,6 +1522,8 @@ enum nl80211_attrs { | |||
1520 | #define NL80211_MAX_NR_CIPHER_SUITES 5 | 1522 | #define NL80211_MAX_NR_CIPHER_SUITES 5 |
1521 | #define NL80211_MAX_NR_AKM_SUITES 2 | 1523 | #define NL80211_MAX_NR_AKM_SUITES 2 |
1522 | 1524 | ||
1525 | #define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10 | ||
1526 | |||
1523 | /** | 1527 | /** |
1524 | * enum nl80211_iftype - (virtual) interface types | 1528 | * enum nl80211_iftype - (virtual) interface types |
1525 | * | 1529 | * |
@@ -2534,10 +2538,14 @@ enum nl80211_attr_cqm { | |||
2534 | * configured threshold | 2538 | * configured threshold |
2535 | * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the | 2539 | * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the |
2536 | * configured threshold | 2540 | * configured threshold |
2541 | * @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: The device experienced beacon loss. | ||
2542 | * (Note that deauth/disassoc will still follow if the AP is not | ||
2543 | * available. This event might get used as roaming event, etc.) | ||
2537 | */ | 2544 | */ |
2538 | enum nl80211_cqm_rssi_threshold_event { | 2545 | enum nl80211_cqm_rssi_threshold_event { |
2539 | NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, | 2546 | NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW, |
2540 | NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, | 2547 | NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH, |
2548 | NL80211_CQM_RSSI_BEACON_LOSS_EVENT, | ||
2541 | }; | 2549 | }; |
2542 | 2550 | ||
2543 | 2551 | ||
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index bc14bd738ade..bb674c02f306 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -243,6 +243,7 @@ struct ssb_bus_ops { | |||
243 | #define SSB_DEV_MINI_MACPHY 0x823 | 243 | #define SSB_DEV_MINI_MACPHY 0x823 |
244 | #define SSB_DEV_ARM_1176 0x824 | 244 | #define SSB_DEV_ARM_1176 0x824 |
245 | #define SSB_DEV_ARM_7TDMI 0x825 | 245 | #define SSB_DEV_ARM_7TDMI 0x825 |
246 | #define SSB_DEV_ARM_CM3 0x82A | ||
246 | 247 | ||
247 | /* Vendor-ID values */ | 248 | /* Vendor-ID values */ |
248 | #define SSB_VENDOR_BROADCOM 0x4243 | 249 | #define SSB_VENDOR_BROADCOM 0x4243 |
diff --git a/include/net/bluetooth/a2mp.h b/include/net/bluetooth/a2mp.h new file mode 100644 index 000000000000..6a76e0a0705e --- /dev/null +++ b/include/net/bluetooth/a2mp.h | |||
@@ -0,0 +1,126 @@ | |||
1 | /* | ||
2 | Copyright (c) 2010,2011 Code Aurora Forum. All rights reserved. | ||
3 | Copyright (c) 2011,2012 Intel Corp. | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License version 2 and | ||
7 | only version 2 as published by the Free Software Foundation. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | */ | ||
14 | |||
15 | #ifndef __A2MP_H | ||
16 | #define __A2MP_H | ||
17 | |||
18 | #include <net/bluetooth/l2cap.h> | ||
19 | |||
20 | #define A2MP_FEAT_EXT 0x8000 | ||
21 | |||
22 | struct amp_mgr { | ||
23 | struct l2cap_conn *l2cap_conn; | ||
24 | struct l2cap_chan *a2mp_chan; | ||
25 | struct kref kref; | ||
26 | __u8 ident; | ||
27 | __u8 handle; | ||
28 | unsigned long flags; | ||
29 | }; | ||
30 | |||
31 | struct a2mp_cmd { | ||
32 | __u8 code; | ||
33 | __u8 ident; | ||
34 | __le16 len; | ||
35 | __u8 data[0]; | ||
36 | } __packed; | ||
37 | |||
38 | /* A2MP command codes */ | ||
39 | #define A2MP_COMMAND_REJ 0x01 | ||
40 | struct a2mp_cmd_rej { | ||
41 | __le16 reason; | ||
42 | __u8 data[0]; | ||
43 | } __packed; | ||
44 | |||
45 | #define A2MP_DISCOVER_REQ 0x02 | ||
46 | struct a2mp_discov_req { | ||
47 | __le16 mtu; | ||
48 | __le16 ext_feat; | ||
49 | } __packed; | ||
50 | |||
51 | struct a2mp_cl { | ||
52 | __u8 id; | ||
53 | __u8 type; | ||
54 | __u8 status; | ||
55 | } __packed; | ||
56 | |||
57 | #define A2MP_DISCOVER_RSP 0x03 | ||
58 | struct a2mp_discov_rsp { | ||
59 | __le16 mtu; | ||
60 | __le16 ext_feat; | ||
61 | struct a2mp_cl cl[0]; | ||
62 | } __packed; | ||
63 | |||
64 | #define A2MP_CHANGE_NOTIFY 0x04 | ||
65 | #define A2MP_CHANGE_RSP 0x05 | ||
66 | |||
67 | #define A2MP_GETINFO_REQ 0x06 | ||
68 | struct a2mp_info_req { | ||
69 | __u8 id; | ||
70 | } __packed; | ||
71 | |||
72 | #define A2MP_GETINFO_RSP 0x07 | ||
73 | struct a2mp_info_rsp { | ||
74 | __u8 id; | ||
75 | __u8 status; | ||
76 | __le32 total_bw; | ||
77 | __le32 max_bw; | ||
78 | __le32 min_latency; | ||
79 | __le16 pal_cap; | ||
80 | __le16 assoc_size; | ||
81 | } __packed; | ||
82 | |||
83 | #define A2MP_GETAMPASSOC_REQ 0x08 | ||
84 | struct a2mp_amp_assoc_req { | ||
85 | __u8 id; | ||
86 | } __packed; | ||
87 | |||
88 | #define A2MP_GETAMPASSOC_RSP 0x09 | ||
89 | struct a2mp_amp_assoc_rsp { | ||
90 | __u8 id; | ||
91 | __u8 status; | ||
92 | __u8 amp_assoc[0]; | ||
93 | } __packed; | ||
94 | |||
95 | #define A2MP_CREATEPHYSLINK_REQ 0x0A | ||
96 | #define A2MP_DISCONNPHYSLINK_REQ 0x0C | ||
97 | struct a2mp_physlink_req { | ||
98 | __u8 local_id; | ||
99 | __u8 remote_id; | ||
100 | __u8 amp_assoc[0]; | ||
101 | } __packed; | ||
102 | |||
103 | #define A2MP_CREATEPHYSLINK_RSP 0x0B | ||
104 | #define A2MP_DISCONNPHYSLINK_RSP 0x0D | ||
105 | struct a2mp_physlink_rsp { | ||
106 | __u8 local_id; | ||
107 | __u8 remote_id; | ||
108 | __u8 status; | ||
109 | } __packed; | ||
110 | |||
111 | /* A2MP response status */ | ||
112 | #define A2MP_STATUS_SUCCESS 0x00 | ||
113 | #define A2MP_STATUS_INVALID_CTRL_ID 0x01 | ||
114 | #define A2MP_STATUS_UNABLE_START_LINK_CREATION 0x02 | ||
115 | #define A2MP_STATUS_NO_PHYSICAL_LINK_EXISTS 0x02 | ||
116 | #define A2MP_STATUS_COLLISION_OCCURED 0x03 | ||
117 | #define A2MP_STATUS_DISCONN_REQ_RECVD 0x04 | ||
118 | #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 | ||
119 | #define A2MP_STATUS_SECURITY_VIOLATION 0x06 | ||
120 | |||
121 | void amp_mgr_get(struct amp_mgr *mgr); | ||
122 | int amp_mgr_put(struct amp_mgr *mgr); | ||
123 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, | ||
124 | struct sk_buff *skb); | ||
125 | |||
126 | #endif /* __A2MP_H */ | ||
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 961669b648fd..565d4bee1e49 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | BlueZ - Bluetooth protocol stack for Linux | 2 | BlueZ - Bluetooth protocol stack for Linux |
3 | Copyright (C) 2000-2001 Qualcomm Incorporated | 3 | Copyright (C) 2000-2001 Qualcomm Incorporated |
4 | 4 | ||
@@ -12,22 +12,19 @@ | |||
12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 12 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. | 13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. |
14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY | 14 | IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY |
15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES | 15 | CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES |
16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | 16 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
19 | 19 | ||
20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, | 20 | ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, |
21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS | 21 | COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS |
22 | SOFTWARE IS DISCLAIMED. | 22 | SOFTWARE IS DISCLAIMED. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #ifndef __BLUETOOTH_H | 25 | #ifndef __BLUETOOTH_H |
26 | #define __BLUETOOTH_H | 26 | #define __BLUETOOTH_H |
27 | 27 | ||
28 | #include <asm/types.h> | ||
29 | #include <asm/byteorder.h> | ||
30 | #include <linux/list.h> | ||
31 | #include <linux/poll.h> | 28 | #include <linux/poll.h> |
32 | #include <net/sock.h> | 29 | #include <net/sock.h> |
33 | 30 | ||
@@ -168,8 +165,8 @@ typedef struct { | |||
168 | #define BDADDR_LE_PUBLIC 0x01 | 165 | #define BDADDR_LE_PUBLIC 0x01 |
169 | #define BDADDR_LE_RANDOM 0x02 | 166 | #define BDADDR_LE_RANDOM 0x02 |
170 | 167 | ||
171 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}}) | 168 | #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0} }) |
172 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff}}) | 169 | #define BDADDR_LOCAL (&(bdaddr_t) {{0, 0, 0, 0xff, 0xff, 0xff} }) |
173 | 170 | ||
174 | /* Copy, swap, convert BD Address */ | 171 | /* Copy, swap, convert BD Address */ |
175 | static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) | 172 | static inline int bacmp(bdaddr_t *ba1, bdaddr_t *ba2) |
@@ -215,7 +212,7 @@ int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
215 | struct msghdr *msg, size_t len, int flags); | 212 | struct msghdr *msg, size_t len, int flags); |
216 | int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | 213 | int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, |
217 | struct msghdr *msg, size_t len, int flags); | 214 | struct msghdr *msg, size_t len, int flags); |
218 | uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); | 215 | uint bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait); |
219 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | 216 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
220 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); | 217 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); |
221 | 218 | ||
@@ -225,12 +222,12 @@ struct sock *bt_accept_dequeue(struct sock *parent, struct socket *newsock); | |||
225 | 222 | ||
226 | /* Skb helpers */ | 223 | /* Skb helpers */ |
227 | struct l2cap_ctrl { | 224 | struct l2cap_ctrl { |
228 | unsigned int sframe : 1, | 225 | unsigned int sframe:1, |
229 | poll : 1, | 226 | poll:1, |
230 | final : 1, | 227 | final:1, |
231 | fcs : 1, | 228 | fcs:1, |
232 | sar : 2, | 229 | sar:2, |
233 | super : 2; | 230 | super:2; |
234 | __u16 reqseq; | 231 | __u16 reqseq; |
235 | __u16 txseq; | 232 | __u16 txseq; |
236 | __u8 retries; | 233 | __u8 retries; |
@@ -249,7 +246,8 @@ static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how) | |||
249 | { | 246 | { |
250 | struct sk_buff *skb; | 247 | struct sk_buff *skb; |
251 | 248 | ||
252 | if ((skb = alloc_skb(len + BT_SKB_RESERVE, how))) { | 249 | skb = alloc_skb(len + BT_SKB_RESERVE, how); |
250 | if (skb) { | ||
253 | skb_reserve(skb, BT_SKB_RESERVE); | 251 | skb_reserve(skb, BT_SKB_RESERVE); |
254 | bt_cb(skb)->incoming = 0; | 252 | bt_cb(skb)->incoming = 0; |
255 | } | 253 | } |
@@ -261,7 +259,8 @@ static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk, | |||
261 | { | 259 | { |
262 | struct sk_buff *skb; | 260 | struct sk_buff *skb; |
263 | 261 | ||
264 | if ((skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err))) { | 262 | skb = sock_alloc_send_skb(sk, len + BT_SKB_RESERVE, nb, err); |
263 | if (skb) { | ||
265 | skb_reserve(skb, BT_SKB_RESERVE); | 264 | skb_reserve(skb, BT_SKB_RESERVE); |
266 | bt_cb(skb)->incoming = 0; | 265 | bt_cb(skb)->incoming = 0; |
267 | } | 266 | } |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 3def64ba77fa..2a6b0b8b7120 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -30,6 +30,9 @@ | |||
30 | #define HCI_MAX_EVENT_SIZE 260 | 30 | #define HCI_MAX_EVENT_SIZE 260 |
31 | #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) | 31 | #define HCI_MAX_FRAME_SIZE (HCI_MAX_ACL_SIZE + 4) |
32 | 32 | ||
33 | #define HCI_LINK_KEY_SIZE 16 | ||
34 | #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) | ||
35 | |||
33 | /* HCI dev events */ | 36 | /* HCI dev events */ |
34 | #define HCI_DEV_REG 1 | 37 | #define HCI_DEV_REG 1 |
35 | #define HCI_DEV_UNREG 2 | 38 | #define HCI_DEV_UNREG 2 |
@@ -56,9 +59,12 @@ | |||
56 | #define HCI_BREDR 0x00 | 59 | #define HCI_BREDR 0x00 |
57 | #define HCI_AMP 0x01 | 60 | #define HCI_AMP 0x01 |
58 | 61 | ||
62 | /* First BR/EDR Controller shall have ID = 0 */ | ||
63 | #define HCI_BREDR_ID 0 | ||
64 | |||
59 | /* HCI device quirks */ | 65 | /* HCI device quirks */ |
60 | enum { | 66 | enum { |
61 | HCI_QUIRK_NO_RESET, | 67 | HCI_QUIRK_RESET_ON_CLOSE, |
62 | HCI_QUIRK_RAW_DEVICE, | 68 | HCI_QUIRK_RAW_DEVICE, |
63 | HCI_QUIRK_FIXUP_BUFFER_SIZE | 69 | HCI_QUIRK_FIXUP_BUFFER_SIZE |
64 | }; | 70 | }; |
@@ -133,10 +139,8 @@ enum { | |||
133 | #define HCIINQUIRY _IOR('H', 240, int) | 139 | #define HCIINQUIRY _IOR('H', 240, int) |
134 | 140 | ||
135 | /* HCI timeouts */ | 141 | /* HCI timeouts */ |
136 | #define HCI_CONNECT_TIMEOUT (40000) /* 40 seconds */ | ||
137 | #define HCI_DISCONN_TIMEOUT (2000) /* 2 seconds */ | 142 | #define HCI_DISCONN_TIMEOUT (2000) /* 2 seconds */ |
138 | #define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */ | 143 | #define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */ |
139 | #define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */ | ||
140 | #define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ | 144 | #define HCI_INIT_TIMEOUT (10000) /* 10 seconds */ |
141 | #define HCI_CMD_TIMEOUT (1000) /* 1 seconds */ | 145 | #define HCI_CMD_TIMEOUT (1000) /* 1 seconds */ |
142 | #define HCI_ACL_TX_TIMEOUT (45000) /* 45 seconds */ | 146 | #define HCI_ACL_TX_TIMEOUT (45000) /* 45 seconds */ |
@@ -371,7 +375,7 @@ struct hci_cp_reject_conn_req { | |||
371 | #define HCI_OP_LINK_KEY_REPLY 0x040b | 375 | #define HCI_OP_LINK_KEY_REPLY 0x040b |
372 | struct hci_cp_link_key_reply { | 376 | struct hci_cp_link_key_reply { |
373 | bdaddr_t bdaddr; | 377 | bdaddr_t bdaddr; |
374 | __u8 link_key[16]; | 378 | __u8 link_key[HCI_LINK_KEY_SIZE]; |
375 | } __packed; | 379 | } __packed; |
376 | 380 | ||
377 | #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c | 381 | #define HCI_OP_LINK_KEY_NEG_REPLY 0x040c |
@@ -523,6 +527,28 @@ struct hci_cp_io_capability_neg_reply { | |||
523 | __u8 reason; | 527 | __u8 reason; |
524 | } __packed; | 528 | } __packed; |
525 | 529 | ||
530 | #define HCI_OP_CREATE_PHY_LINK 0x0435 | ||
531 | struct hci_cp_create_phy_link { | ||
532 | __u8 phy_handle; | ||
533 | __u8 key_len; | ||
534 | __u8 key_type; | ||
535 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; | ||
536 | } __packed; | ||
537 | |||
538 | #define HCI_OP_ACCEPT_PHY_LINK 0x0436 | ||
539 | struct hci_cp_accept_phy_link { | ||
540 | __u8 phy_handle; | ||
541 | __u8 key_len; | ||
542 | __u8 key_type; | ||
543 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; | ||
544 | } __packed; | ||
545 | |||
546 | #define HCI_OP_DISCONN_PHY_LINK 0x0437 | ||
547 | struct hci_cp_disconn_phy_link { | ||
548 | __u8 phy_handle; | ||
549 | __u8 reason; | ||
550 | } __packed; | ||
551 | |||
526 | #define HCI_OP_SNIFF_MODE 0x0803 | 552 | #define HCI_OP_SNIFF_MODE 0x0803 |
527 | struct hci_cp_sniff_mode { | 553 | struct hci_cp_sniff_mode { |
528 | __le16 handle; | 554 | __le16 handle; |
@@ -818,6 +844,31 @@ struct hci_rp_read_local_amp_info { | |||
818 | __le32 be_flush_to; | 844 | __le32 be_flush_to; |
819 | } __packed; | 845 | } __packed; |
820 | 846 | ||
847 | #define HCI_OP_READ_LOCAL_AMP_ASSOC 0x140a | ||
848 | struct hci_cp_read_local_amp_assoc { | ||
849 | __u8 phy_handle; | ||
850 | __le16 len_so_far; | ||
851 | __le16 max_len; | ||
852 | } __packed; | ||
853 | struct hci_rp_read_local_amp_assoc { | ||
854 | __u8 status; | ||
855 | __u8 phy_handle; | ||
856 | __le16 rem_len; | ||
857 | __u8 frag[0]; | ||
858 | } __packed; | ||
859 | |||
860 | #define HCI_OP_WRITE_REMOTE_AMP_ASSOC 0x140b | ||
861 | struct hci_cp_write_remote_amp_assoc { | ||
862 | __u8 phy_handle; | ||
863 | __le16 len_so_far; | ||
864 | __le16 rem_len; | ||
865 | __u8 frag[0]; | ||
866 | } __packed; | ||
867 | struct hci_rp_write_remote_amp_assoc { | ||
868 | __u8 status; | ||
869 | __u8 phy_handle; | ||
870 | } __packed; | ||
871 | |||
821 | #define HCI_OP_LE_SET_EVENT_MASK 0x2001 | 872 | #define HCI_OP_LE_SET_EVENT_MASK 0x2001 |
822 | struct hci_cp_le_set_event_mask { | 873 | struct hci_cp_le_set_event_mask { |
823 | __u8 mask[8]; | 874 | __u8 mask[8]; |
@@ -1048,7 +1099,7 @@ struct hci_ev_link_key_req { | |||
1048 | #define HCI_EV_LINK_KEY_NOTIFY 0x18 | 1099 | #define HCI_EV_LINK_KEY_NOTIFY 0x18 |
1049 | struct hci_ev_link_key_notify { | 1100 | struct hci_ev_link_key_notify { |
1050 | bdaddr_t bdaddr; | 1101 | bdaddr_t bdaddr; |
1051 | __u8 link_key[16]; | 1102 | __u8 link_key[HCI_LINK_KEY_SIZE]; |
1052 | __u8 key_type; | 1103 | __u8 key_type; |
1053 | } __packed; | 1104 | } __packed; |
1054 | 1105 | ||
@@ -1196,6 +1247,39 @@ struct hci_ev_le_meta { | |||
1196 | __u8 subevent; | 1247 | __u8 subevent; |
1197 | } __packed; | 1248 | } __packed; |
1198 | 1249 | ||
1250 | #define HCI_EV_PHY_LINK_COMPLETE 0x40 | ||
1251 | struct hci_ev_phy_link_complete { | ||
1252 | __u8 status; | ||
1253 | __u8 phy_handle; | ||
1254 | } __packed; | ||
1255 | |||
1256 | #define HCI_EV_CHANNEL_SELECTED 0x41 | ||
1257 | struct hci_ev_channel_selected { | ||
1258 | __u8 phy_handle; | ||
1259 | } __packed; | ||
1260 | |||
1261 | #define HCI_EV_DISCONN_PHY_LINK_COMPLETE 0x42 | ||
1262 | struct hci_ev_disconn_phy_link_complete { | ||
1263 | __u8 status; | ||
1264 | __u8 phy_handle; | ||
1265 | __u8 reason; | ||
1266 | } __packed; | ||
1267 | |||
1268 | #define HCI_EV_LOGICAL_LINK_COMPLETE 0x45 | ||
1269 | struct hci_ev_logical_link_complete { | ||
1270 | __u8 status; | ||
1271 | __le16 handle; | ||
1272 | __u8 phy_handle; | ||
1273 | __u8 flow_spec_id; | ||
1274 | } __packed; | ||
1275 | |||
1276 | #define HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE 0x46 | ||
1277 | struct hci_ev_disconn_logical_link_complete { | ||
1278 | __u8 status; | ||
1279 | __le16 handle; | ||
1280 | __u8 reason; | ||
1281 | } __packed; | ||
1282 | |||
1199 | #define HCI_EV_NUM_COMP_BLOCKS 0x48 | 1283 | #define HCI_EV_NUM_COMP_BLOCKS 0x48 |
1200 | struct hci_comp_blocks_info { | 1284 | struct hci_comp_blocks_info { |
1201 | __le16 handle; | 1285 | __le16 handle; |
@@ -1296,7 +1380,6 @@ struct hci_sco_hdr { | |||
1296 | __u8 dlen; | 1380 | __u8 dlen; |
1297 | } __packed; | 1381 | } __packed; |
1298 | 1382 | ||
1299 | #include <linux/skbuff.h> | ||
1300 | static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) | 1383 | static inline struct hci_event_hdr *hci_event_hdr(const struct sk_buff *skb) |
1301 | { | 1384 | { |
1302 | return (struct hci_event_hdr *) skb->data; | 1385 | return (struct hci_event_hdr *) skb->data; |
@@ -1313,12 +1396,12 @@ static inline struct hci_sco_hdr *hci_sco_hdr(const struct sk_buff *skb) | |||
1313 | } | 1396 | } |
1314 | 1397 | ||
1315 | /* Command opcode pack/unpack */ | 1398 | /* Command opcode pack/unpack */ |
1316 | #define hci_opcode_pack(ogf, ocf) (__u16) ((ocf & 0x03ff)|(ogf << 10)) | 1399 | #define hci_opcode_pack(ogf, ocf) ((__u16) ((ocf & 0x03ff)|(ogf << 10))) |
1317 | #define hci_opcode_ogf(op) (op >> 10) | 1400 | #define hci_opcode_ogf(op) (op >> 10) |
1318 | #define hci_opcode_ocf(op) (op & 0x03ff) | 1401 | #define hci_opcode_ocf(op) (op & 0x03ff) |
1319 | 1402 | ||
1320 | /* ACL handle and flags pack/unpack */ | 1403 | /* ACL handle and flags pack/unpack */ |
1321 | #define hci_handle_pack(h, f) (__u16) ((h & 0x0fff)|(f << 12)) | 1404 | #define hci_handle_pack(h, f) ((__u16) ((h & 0x0fff)|(f << 12))) |
1322 | #define hci_handle(h) (h & 0x0fff) | 1405 | #define hci_handle(h) (h & 0x0fff) |
1323 | #define hci_flags(h) (h >> 12) | 1406 | #define hci_flags(h) (h >> 12) |
1324 | 1407 | ||
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 9fc7728f94e4..20fd57367ddc 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -25,7 +25,6 @@ | |||
25 | #ifndef __HCI_CORE_H | 25 | #ifndef __HCI_CORE_H |
26 | #define __HCI_CORE_H | 26 | #define __HCI_CORE_H |
27 | 27 | ||
28 | #include <linux/interrupt.h> | ||
29 | #include <net/bluetooth/hci.h> | 28 | #include <net/bluetooth/hci.h> |
30 | 29 | ||
31 | /* HCI priority */ | 30 | /* HCI priority */ |
@@ -65,7 +64,7 @@ struct discovery_state { | |||
65 | DISCOVERY_RESOLVING, | 64 | DISCOVERY_RESOLVING, |
66 | DISCOVERY_STOPPING, | 65 | DISCOVERY_STOPPING, |
67 | } state; | 66 | } state; |
68 | struct list_head all; /* All devices found during inquiry */ | 67 | struct list_head all; /* All devices found during inquiry */ |
69 | struct list_head unknown; /* Name state not known */ | 68 | struct list_head unknown; /* Name state not known */ |
70 | struct list_head resolve; /* Name needs to be resolved */ | 69 | struct list_head resolve; /* Name needs to be resolved */ |
71 | __u32 timestamp; | 70 | __u32 timestamp; |
@@ -105,7 +104,7 @@ struct link_key { | |||
105 | struct list_head list; | 104 | struct list_head list; |
106 | bdaddr_t bdaddr; | 105 | bdaddr_t bdaddr; |
107 | u8 type; | 106 | u8 type; |
108 | u8 val[16]; | 107 | u8 val[HCI_LINK_KEY_SIZE]; |
109 | u8 pin_len; | 108 | u8 pin_len; |
110 | }; | 109 | }; |
111 | 110 | ||
@@ -333,6 +332,7 @@ struct hci_conn { | |||
333 | void *l2cap_data; | 332 | void *l2cap_data; |
334 | void *sco_data; | 333 | void *sco_data; |
335 | void *smp_conn; | 334 | void *smp_conn; |
335 | struct amp_mgr *amp_mgr; | ||
336 | 336 | ||
337 | struct hci_conn *link; | 337 | struct hci_conn *link; |
338 | 338 | ||
@@ -360,7 +360,8 @@ extern int l2cap_connect_cfm(struct hci_conn *hcon, u8 status); | |||
360 | extern int l2cap_disconn_ind(struct hci_conn *hcon); | 360 | extern int l2cap_disconn_ind(struct hci_conn *hcon); |
361 | extern int l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason); | 361 | extern int l2cap_disconn_cfm(struct hci_conn *hcon, u8 reason); |
362 | extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt); | 362 | extern int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt); |
363 | extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags); | 363 | extern int l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, |
364 | u16 flags); | ||
364 | 365 | ||
365 | extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); | 366 | extern int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); |
366 | extern int sco_connect_cfm(struct hci_conn *hcon, __u8 status); | 367 | extern int sco_connect_cfm(struct hci_conn *hcon, __u8 status); |
@@ -429,8 +430,8 @@ enum { | |||
429 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) | 430 | static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) |
430 | { | 431 | { |
431 | struct hci_dev *hdev = conn->hdev; | 432 | struct hci_dev *hdev = conn->hdev; |
432 | return (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) && | 433 | return test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) && |
433 | test_bit(HCI_CONN_SSP_ENABLED, &conn->flags)); | 434 | test_bit(HCI_CONN_SSP_ENABLED, &conn->flags); |
434 | } | 435 | } |
435 | 436 | ||
436 | static inline void hci_conn_hash_init(struct hci_dev *hdev) | 437 | static inline void hci_conn_hash_init(struct hci_dev *hdev) |
@@ -640,6 +641,19 @@ static inline void hci_set_drvdata(struct hci_dev *hdev, void *data) | |||
640 | dev_set_drvdata(&hdev->dev, data); | 641 | dev_set_drvdata(&hdev->dev, data); |
641 | } | 642 | } |
642 | 643 | ||
644 | /* hci_dev_list shall be locked */ | ||
645 | static inline uint8_t __hci_num_ctrl(void) | ||
646 | { | ||
647 | uint8_t count = 0; | ||
648 | struct list_head *p; | ||
649 | |||
650 | list_for_each(p, &hci_dev_list) { | ||
651 | count++; | ||
652 | } | ||
653 | |||
654 | return count; | ||
655 | } | ||
656 | |||
643 | struct hci_dev *hci_dev_get(int index); | 657 | struct hci_dev *hci_dev_get(int index); |
644 | struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); | 658 | struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); |
645 | 659 | ||
@@ -661,7 +675,8 @@ int hci_get_conn_info(struct hci_dev *hdev, void __user *arg); | |||
661 | int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); | 675 | int hci_get_auth_info(struct hci_dev *hdev, void __user *arg); |
662 | int hci_inquiry(void __user *arg); | 676 | int hci_inquiry(void __user *arg); |
663 | 677 | ||
664 | struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr); | 678 | struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, |
679 | bdaddr_t *bdaddr); | ||
665 | int hci_blacklist_clear(struct hci_dev *hdev); | 680 | int hci_blacklist_clear(struct hci_dev *hdev); |
666 | int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 681 | int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
667 | int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); | 682 | int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 type); |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 1c7d1cd5e679..d80e3f0691b4 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -40,11 +40,11 @@ | |||
40 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ | 40 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ |
41 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ | 41 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ |
42 | #define L2CAP_DEFAULT_ACK_TO 200 | 42 | #define L2CAP_DEFAULT_ACK_TO 200 |
43 | #define L2CAP_LE_DEFAULT_MTU 23 | ||
44 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF | 43 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF |
45 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF | 44 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF |
46 | #define L2CAP_DEFAULT_ACC_LAT 0xFFFFFFFF | 45 | #define L2CAP_DEFAULT_ACC_LAT 0xFFFFFFFF |
47 | #define L2CAP_BREDR_MAX_PAYLOAD 1019 /* 3-DH5 packet */ | 46 | #define L2CAP_BREDR_MAX_PAYLOAD 1019 /* 3-DH5 packet */ |
47 | #define L2CAP_LE_MIN_MTU 23 | ||
48 | 48 | ||
49 | #define L2CAP_DISC_TIMEOUT msecs_to_jiffies(100) | 49 | #define L2CAP_DISC_TIMEOUT msecs_to_jiffies(100) |
50 | #define L2CAP_DISC_REJ_TIMEOUT msecs_to_jiffies(5000) | 50 | #define L2CAP_DISC_REJ_TIMEOUT msecs_to_jiffies(5000) |
@@ -52,6 +52,8 @@ | |||
52 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) | 52 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) |
53 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) | 53 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) |
54 | 54 | ||
55 | #define L2CAP_A2MP_DEFAULT_MTU 670 | ||
56 | |||
55 | /* L2CAP socket address */ | 57 | /* L2CAP socket address */ |
56 | struct sockaddr_l2 { | 58 | struct sockaddr_l2 { |
57 | sa_family_t l2_family; | 59 | sa_family_t l2_family; |
@@ -229,9 +231,14 @@ struct l2cap_conn_rsp { | |||
229 | __le16 status; | 231 | __le16 status; |
230 | } __packed; | 232 | } __packed; |
231 | 233 | ||
234 | /* protocol/service multiplexer (PSM) */ | ||
235 | #define L2CAP_PSM_SDP 0x0001 | ||
236 | #define L2CAP_PSM_RFCOMM 0x0003 | ||
237 | |||
232 | /* channel indentifier */ | 238 | /* channel indentifier */ |
233 | #define L2CAP_CID_SIGNALING 0x0001 | 239 | #define L2CAP_CID_SIGNALING 0x0001 |
234 | #define L2CAP_CID_CONN_LESS 0x0002 | 240 | #define L2CAP_CID_CONN_LESS 0x0002 |
241 | #define L2CAP_CID_A2MP 0x0003 | ||
235 | #define L2CAP_CID_LE_DATA 0x0004 | 242 | #define L2CAP_CID_LE_DATA 0x0004 |
236 | #define L2CAP_CID_LE_SIGNALING 0x0005 | 243 | #define L2CAP_CID_LE_SIGNALING 0x0005 |
237 | #define L2CAP_CID_SMP 0x0006 | 244 | #define L2CAP_CID_SMP 0x0006 |
@@ -271,6 +278,9 @@ struct l2cap_conf_rsp { | |||
271 | #define L2CAP_CONF_PENDING 0x0004 | 278 | #define L2CAP_CONF_PENDING 0x0004 |
272 | #define L2CAP_CONF_EFS_REJECT 0x0005 | 279 | #define L2CAP_CONF_EFS_REJECT 0x0005 |
273 | 280 | ||
281 | /* configuration req/rsp continuation flag */ | ||
282 | #define L2CAP_CONF_FLAG_CONTINUATION 0x0001 | ||
283 | |||
274 | struct l2cap_conf_opt { | 284 | struct l2cap_conf_opt { |
275 | __u8 type; | 285 | __u8 type; |
276 | __u8 len; | 286 | __u8 len; |
@@ -419,11 +429,6 @@ struct l2cap_seq_list { | |||
419 | #define L2CAP_SEQ_LIST_CLEAR 0xFFFF | 429 | #define L2CAP_SEQ_LIST_CLEAR 0xFFFF |
420 | #define L2CAP_SEQ_LIST_TAIL 0x8000 | 430 | #define L2CAP_SEQ_LIST_TAIL 0x8000 |
421 | 431 | ||
422 | struct srej_list { | ||
423 | __u16 tx_seq; | ||
424 | struct list_head list; | ||
425 | }; | ||
426 | |||
427 | struct l2cap_chan { | 432 | struct l2cap_chan { |
428 | struct sock *sk; | 433 | struct sock *sk; |
429 | 434 | ||
@@ -475,14 +480,12 @@ struct l2cap_chan { | |||
475 | __u16 expected_ack_seq; | 480 | __u16 expected_ack_seq; |
476 | __u16 expected_tx_seq; | 481 | __u16 expected_tx_seq; |
477 | __u16 buffer_seq; | 482 | __u16 buffer_seq; |
478 | __u16 buffer_seq_srej; | ||
479 | __u16 srej_save_reqseq; | 483 | __u16 srej_save_reqseq; |
480 | __u16 last_acked_seq; | 484 | __u16 last_acked_seq; |
481 | __u16 frames_sent; | 485 | __u16 frames_sent; |
482 | __u16 unacked_frames; | 486 | __u16 unacked_frames; |
483 | __u8 retry_count; | 487 | __u8 retry_count; |
484 | __u16 srej_queue_next; | 488 | __u16 srej_queue_next; |
485 | __u8 num_acked; | ||
486 | __u16 sdu_len; | 489 | __u16 sdu_len; |
487 | struct sk_buff *sdu; | 490 | struct sk_buff *sdu; |
488 | struct sk_buff *sdu_last_frag; | 491 | struct sk_buff *sdu_last_frag; |
@@ -515,7 +518,6 @@ struct l2cap_chan { | |||
515 | struct sk_buff_head srej_q; | 518 | struct sk_buff_head srej_q; |
516 | struct l2cap_seq_list srej_list; | 519 | struct l2cap_seq_list srej_list; |
517 | struct l2cap_seq_list retrans_list; | 520 | struct l2cap_seq_list retrans_list; |
518 | struct list_head srej_l; | ||
519 | 521 | ||
520 | struct list_head list; | 522 | struct list_head list; |
521 | struct list_head global_l; | 523 | struct list_head global_l; |
@@ -528,10 +530,14 @@ struct l2cap_chan { | |||
528 | struct l2cap_ops { | 530 | struct l2cap_ops { |
529 | char *name; | 531 | char *name; |
530 | 532 | ||
531 | struct l2cap_chan *(*new_connection) (void *data); | 533 | struct l2cap_chan *(*new_connection) (struct l2cap_chan *chan); |
532 | int (*recv) (void *data, struct sk_buff *skb); | 534 | int (*recv) (struct l2cap_chan * chan, |
533 | void (*close) (void *data); | 535 | struct sk_buff *skb); |
534 | void (*state_change) (void *data, int state); | 536 | void (*teardown) (struct l2cap_chan *chan, int err); |
537 | void (*close) (struct l2cap_chan *chan); | ||
538 | void (*state_change) (struct l2cap_chan *chan, | ||
539 | int state); | ||
540 | void (*ready) (struct l2cap_chan *chan); | ||
535 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, | 541 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, |
536 | unsigned long len, int nb); | 542 | unsigned long len, int nb); |
537 | }; | 543 | }; |
@@ -575,6 +581,7 @@ struct l2cap_conn { | |||
575 | #define L2CAP_CHAN_RAW 1 | 581 | #define L2CAP_CHAN_RAW 1 |
576 | #define L2CAP_CHAN_CONN_LESS 2 | 582 | #define L2CAP_CHAN_CONN_LESS 2 |
577 | #define L2CAP_CHAN_CONN_ORIENTED 3 | 583 | #define L2CAP_CHAN_CONN_ORIENTED 3 |
584 | #define L2CAP_CHAN_CONN_FIX_A2MP 4 | ||
578 | 585 | ||
579 | /* ----- L2CAP socket info ----- */ | 586 | /* ----- L2CAP socket info ----- */ |
580 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) | 587 | #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) |
@@ -597,6 +604,7 @@ enum { | |||
597 | CONF_EWS_RECV, | 604 | CONF_EWS_RECV, |
598 | CONF_LOC_CONF_PEND, | 605 | CONF_LOC_CONF_PEND, |
599 | CONF_REM_CONF_PEND, | 606 | CONF_REM_CONF_PEND, |
607 | CONF_NOT_COMPLETE, | ||
600 | }; | 608 | }; |
601 | 609 | ||
602 | #define L2CAP_CONF_MAX_CONF_REQ 2 | 610 | #define L2CAP_CONF_MAX_CONF_REQ 2 |
@@ -713,11 +721,7 @@ static inline bool l2cap_clear_timer(struct l2cap_chan *chan, | |||
713 | 721 | ||
714 | #define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t)) | 722 | #define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t)) |
715 | #define __clear_chan_timer(c) l2cap_clear_timer(c, &c->chan_timer) | 723 | #define __clear_chan_timer(c) l2cap_clear_timer(c, &c->chan_timer) |
716 | #define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \ | ||
717 | msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); | ||
718 | #define __clear_retrans_timer(c) l2cap_clear_timer(c, &c->retrans_timer) | 724 | #define __clear_retrans_timer(c) l2cap_clear_timer(c, &c->retrans_timer) |
719 | #define __set_monitor_timer(c) l2cap_set_timer(c, &c->monitor_timer, \ | ||
720 | msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO)); | ||
721 | #define __clear_monitor_timer(c) l2cap_clear_timer(c, &c->monitor_timer) | 725 | #define __clear_monitor_timer(c) l2cap_clear_timer(c, &c->monitor_timer) |
722 | #define __set_ack_timer(c) l2cap_set_timer(c, &chan->ack_timer, \ | 726 | #define __set_ack_timer(c) l2cap_set_timer(c, &chan->ack_timer, \ |
723 | msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); | 727 | msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); |
@@ -736,173 +740,17 @@ static inline __u16 __next_seq(struct l2cap_chan *chan, __u16 seq) | |||
736 | return (seq + 1) % (chan->tx_win_max + 1); | 740 | return (seq + 1) % (chan->tx_win_max + 1); |
737 | } | 741 | } |
738 | 742 | ||
739 | static inline int l2cap_tx_window_full(struct l2cap_chan *ch) | 743 | static inline struct l2cap_chan *l2cap_chan_no_new_connection(struct l2cap_chan *chan) |
740 | { | ||
741 | int sub; | ||
742 | |||
743 | sub = (ch->next_tx_seq - ch->expected_ack_seq) % 64; | ||
744 | |||
745 | if (sub < 0) | ||
746 | sub += 64; | ||
747 | |||
748 | return sub == ch->remote_tx_win; | ||
749 | } | ||
750 | |||
751 | static inline __u16 __get_reqseq(struct l2cap_chan *chan, __u32 ctrl) | ||
752 | { | ||
753 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
754 | return (ctrl & L2CAP_EXT_CTRL_REQSEQ) >> | ||
755 | L2CAP_EXT_CTRL_REQSEQ_SHIFT; | ||
756 | else | ||
757 | return (ctrl & L2CAP_CTRL_REQSEQ) >> L2CAP_CTRL_REQSEQ_SHIFT; | ||
758 | } | ||
759 | |||
760 | static inline __u32 __set_reqseq(struct l2cap_chan *chan, __u32 reqseq) | ||
761 | { | 744 | { |
762 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | 745 | return NULL; |
763 | return (reqseq << L2CAP_EXT_CTRL_REQSEQ_SHIFT) & | ||
764 | L2CAP_EXT_CTRL_REQSEQ; | ||
765 | else | ||
766 | return (reqseq << L2CAP_CTRL_REQSEQ_SHIFT) & L2CAP_CTRL_REQSEQ; | ||
767 | } | 746 | } |
768 | 747 | ||
769 | static inline __u16 __get_txseq(struct l2cap_chan *chan, __u32 ctrl) | 748 | static inline void l2cap_chan_no_teardown(struct l2cap_chan *chan, int err) |
770 | { | 749 | { |
771 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
772 | return (ctrl & L2CAP_EXT_CTRL_TXSEQ) >> | ||
773 | L2CAP_EXT_CTRL_TXSEQ_SHIFT; | ||
774 | else | ||
775 | return (ctrl & L2CAP_CTRL_TXSEQ) >> L2CAP_CTRL_TXSEQ_SHIFT; | ||
776 | } | 750 | } |
777 | 751 | ||
778 | static inline __u32 __set_txseq(struct l2cap_chan *chan, __u32 txseq) | 752 | static inline void l2cap_chan_no_ready(struct l2cap_chan *chan) |
779 | { | 753 | { |
780 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
781 | return (txseq << L2CAP_EXT_CTRL_TXSEQ_SHIFT) & | ||
782 | L2CAP_EXT_CTRL_TXSEQ; | ||
783 | else | ||
784 | return (txseq << L2CAP_CTRL_TXSEQ_SHIFT) & L2CAP_CTRL_TXSEQ; | ||
785 | } | ||
786 | |||
787 | static inline bool __is_sframe(struct l2cap_chan *chan, __u32 ctrl) | ||
788 | { | ||
789 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
790 | return ctrl & L2CAP_EXT_CTRL_FRAME_TYPE; | ||
791 | else | ||
792 | return ctrl & L2CAP_CTRL_FRAME_TYPE; | ||
793 | } | ||
794 | |||
795 | static inline __u32 __set_sframe(struct l2cap_chan *chan) | ||
796 | { | ||
797 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
798 | return L2CAP_EXT_CTRL_FRAME_TYPE; | ||
799 | else | ||
800 | return L2CAP_CTRL_FRAME_TYPE; | ||
801 | } | ||
802 | |||
803 | static inline __u8 __get_ctrl_sar(struct l2cap_chan *chan, __u32 ctrl) | ||
804 | { | ||
805 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
806 | return (ctrl & L2CAP_EXT_CTRL_SAR) >> L2CAP_EXT_CTRL_SAR_SHIFT; | ||
807 | else | ||
808 | return (ctrl & L2CAP_CTRL_SAR) >> L2CAP_CTRL_SAR_SHIFT; | ||
809 | } | ||
810 | |||
811 | static inline __u32 __set_ctrl_sar(struct l2cap_chan *chan, __u32 sar) | ||
812 | { | ||
813 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
814 | return (sar << L2CAP_EXT_CTRL_SAR_SHIFT) & L2CAP_EXT_CTRL_SAR; | ||
815 | else | ||
816 | return (sar << L2CAP_CTRL_SAR_SHIFT) & L2CAP_CTRL_SAR; | ||
817 | } | ||
818 | |||
819 | static inline bool __is_sar_start(struct l2cap_chan *chan, __u32 ctrl) | ||
820 | { | ||
821 | return __get_ctrl_sar(chan, ctrl) == L2CAP_SAR_START; | ||
822 | } | ||
823 | |||
824 | static inline __u32 __get_sar_mask(struct l2cap_chan *chan) | ||
825 | { | ||
826 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
827 | return L2CAP_EXT_CTRL_SAR; | ||
828 | else | ||
829 | return L2CAP_CTRL_SAR; | ||
830 | } | ||
831 | |||
832 | static inline __u8 __get_ctrl_super(struct l2cap_chan *chan, __u32 ctrl) | ||
833 | { | ||
834 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
835 | return (ctrl & L2CAP_EXT_CTRL_SUPERVISE) >> | ||
836 | L2CAP_EXT_CTRL_SUPER_SHIFT; | ||
837 | else | ||
838 | return (ctrl & L2CAP_CTRL_SUPERVISE) >> L2CAP_CTRL_SUPER_SHIFT; | ||
839 | } | ||
840 | |||
841 | static inline __u32 __set_ctrl_super(struct l2cap_chan *chan, __u32 super) | ||
842 | { | ||
843 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
844 | return (super << L2CAP_EXT_CTRL_SUPER_SHIFT) & | ||
845 | L2CAP_EXT_CTRL_SUPERVISE; | ||
846 | else | ||
847 | return (super << L2CAP_CTRL_SUPER_SHIFT) & | ||
848 | L2CAP_CTRL_SUPERVISE; | ||
849 | } | ||
850 | |||
851 | static inline __u32 __set_ctrl_final(struct l2cap_chan *chan) | ||
852 | { | ||
853 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
854 | return L2CAP_EXT_CTRL_FINAL; | ||
855 | else | ||
856 | return L2CAP_CTRL_FINAL; | ||
857 | } | ||
858 | |||
859 | static inline bool __is_ctrl_final(struct l2cap_chan *chan, __u32 ctrl) | ||
860 | { | ||
861 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
862 | return ctrl & L2CAP_EXT_CTRL_FINAL; | ||
863 | else | ||
864 | return ctrl & L2CAP_CTRL_FINAL; | ||
865 | } | ||
866 | |||
867 | static inline __u32 __set_ctrl_poll(struct l2cap_chan *chan) | ||
868 | { | ||
869 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
870 | return L2CAP_EXT_CTRL_POLL; | ||
871 | else | ||
872 | return L2CAP_CTRL_POLL; | ||
873 | } | ||
874 | |||
875 | static inline bool __is_ctrl_poll(struct l2cap_chan *chan, __u32 ctrl) | ||
876 | { | ||
877 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
878 | return ctrl & L2CAP_EXT_CTRL_POLL; | ||
879 | else | ||
880 | return ctrl & L2CAP_CTRL_POLL; | ||
881 | } | ||
882 | |||
883 | static inline __u32 __get_control(struct l2cap_chan *chan, void *p) | ||
884 | { | ||
885 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
886 | return get_unaligned_le32(p); | ||
887 | else | ||
888 | return get_unaligned_le16(p); | ||
889 | } | ||
890 | |||
891 | static inline void __put_control(struct l2cap_chan *chan, __u32 control, | ||
892 | void *p) | ||
893 | { | ||
894 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
895 | return put_unaligned_le32(control, p); | ||
896 | else | ||
897 | return put_unaligned_le16(control, p); | ||
898 | } | ||
899 | |||
900 | static inline __u8 __ctrl_size(struct l2cap_chan *chan) | ||
901 | { | ||
902 | if (test_bit(FLAG_EXT_CTRL, &chan->flags)) | ||
903 | return L2CAP_EXT_HDR_SIZE - L2CAP_HDR_SIZE; | ||
904 | else | ||
905 | return L2CAP_ENH_HDR_SIZE - L2CAP_HDR_SIZE; | ||
906 | } | 754 | } |
907 | 755 | ||
908 | extern bool disable_ertm; | 756 | extern bool disable_ertm; |
@@ -926,5 +774,8 @@ int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len, | |||
926 | void l2cap_chan_busy(struct l2cap_chan *chan, int busy); | 774 | void l2cap_chan_busy(struct l2cap_chan *chan, int busy); |
927 | int l2cap_chan_check_security(struct l2cap_chan *chan); | 775 | int l2cap_chan_check_security(struct l2cap_chan *chan); |
928 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); | 776 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); |
777 | int l2cap_ertm_init(struct l2cap_chan *chan); | ||
778 | void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | ||
779 | void l2cap_chan_del(struct l2cap_chan *chan, int err); | ||
929 | 780 | ||
930 | #endif /* __L2CAP_H */ | 781 | #endif /* __L2CAP_H */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 0289d4ce7070..7319f25250b6 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -404,6 +404,8 @@ struct cfg80211_beacon_data { | |||
404 | * | 404 | * |
405 | * Used to configure an AP interface. | 405 | * Used to configure an AP interface. |
406 | * | 406 | * |
407 | * @channel: the channel to start the AP on | ||
408 | * @channel_type: the channel type to use | ||
407 | * @beacon: beacon data | 409 | * @beacon: beacon data |
408 | * @beacon_interval: beacon interval | 410 | * @beacon_interval: beacon interval |
409 | * @dtim_period: DTIM period | 411 | * @dtim_period: DTIM period |
@@ -417,6 +419,9 @@ struct cfg80211_beacon_data { | |||
417 | * @inactivity_timeout: time in seconds to determine station's inactivity. | 419 | * @inactivity_timeout: time in seconds to determine station's inactivity. |
418 | */ | 420 | */ |
419 | struct cfg80211_ap_settings { | 421 | struct cfg80211_ap_settings { |
422 | struct ieee80211_channel *channel; | ||
423 | enum nl80211_channel_type channel_type; | ||
424 | |||
420 | struct cfg80211_beacon_data beacon; | 425 | struct cfg80211_beacon_data beacon; |
421 | 426 | ||
422 | int beacon_interval, dtim_period; | 427 | int beacon_interval, dtim_period; |
@@ -826,6 +831,8 @@ struct mesh_config { | |||
826 | 831 | ||
827 | /** | 832 | /** |
828 | * struct mesh_setup - 802.11s mesh setup configuration | 833 | * struct mesh_setup - 802.11s mesh setup configuration |
834 | * @channel: the channel to start the mesh network on | ||
835 | * @channel_type: the channel type to use | ||
829 | * @mesh_id: the mesh ID | 836 | * @mesh_id: the mesh ID |
830 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes | 837 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes |
831 | * @sync_method: which synchronization method to use | 838 | * @sync_method: which synchronization method to use |
@@ -840,6 +847,8 @@ struct mesh_config { | |||
840 | * These parameters are fixed when the mesh is created. | 847 | * These parameters are fixed when the mesh is created. |
841 | */ | 848 | */ |
842 | struct mesh_setup { | 849 | struct mesh_setup { |
850 | struct ieee80211_channel *channel; | ||
851 | enum nl80211_channel_type channel_type; | ||
843 | const u8 *mesh_id; | 852 | const u8 *mesh_id; |
844 | u8 mesh_id_len; | 853 | u8 mesh_id_len; |
845 | u8 sync_method; | 854 | u8 sync_method; |
@@ -1411,11 +1420,14 @@ struct cfg80211_gtk_rekey_data { | |||
1411 | * | 1420 | * |
1412 | * @set_txq_params: Set TX queue parameters | 1421 | * @set_txq_params: Set TX queue parameters |
1413 | * | 1422 | * |
1414 | * @set_channel: Set channel for a given wireless interface. Some devices | 1423 | * @libertas_set_mesh_channel: Only for backward compatibility for libertas, |
1415 | * may support multi-channel operation (by channel hopping) so cfg80211 | 1424 | * as it doesn't implement join_mesh and needs to set the channel to |
1416 | * doesn't verify much. Note, however, that the passed netdev may be | 1425 | * join the mesh instead. |
1417 | * %NULL as well if the user requested changing the channel for the | 1426 | * |
1418 | * device itself, or for a monitor interface. | 1427 | * @set_monitor_channel: Set the monitor mode channel for the device. If other |
1428 | * interfaces are active this callback should reject the configuration. | ||
1429 | * If no interfaces are active or the device is down, the channel should | ||
1430 | * be stored for when a monitor interface becomes active. | ||
1419 | * @get_channel: Get the current operating channel, should return %NULL if | 1431 | * @get_channel: Get the current operating channel, should return %NULL if |
1420 | * there's no single defined operating channel if for example the | 1432 | * there's no single defined operating channel if for example the |
1421 | * device implements channel hopping for multi-channel virtual interfaces. | 1433 | * device implements channel hopping for multi-channel virtual interfaces. |
@@ -1605,9 +1617,13 @@ struct cfg80211_ops { | |||
1605 | int (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev, | 1617 | int (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev, |
1606 | struct ieee80211_txq_params *params); | 1618 | struct ieee80211_txq_params *params); |
1607 | 1619 | ||
1608 | int (*set_channel)(struct wiphy *wiphy, struct net_device *dev, | 1620 | int (*libertas_set_mesh_channel)(struct wiphy *wiphy, |
1609 | struct ieee80211_channel *chan, | 1621 | struct net_device *dev, |
1610 | enum nl80211_channel_type channel_type); | 1622 | struct ieee80211_channel *chan); |
1623 | |||
1624 | int (*set_monitor_channel)(struct wiphy *wiphy, | ||
1625 | struct ieee80211_channel *chan, | ||
1626 | enum nl80211_channel_type channel_type); | ||
1611 | 1627 | ||
1612 | int (*scan)(struct wiphy *wiphy, struct net_device *dev, | 1628 | int (*scan)(struct wiphy *wiphy, struct net_device *dev, |
1613 | struct cfg80211_scan_request *request); | 1629 | struct cfg80211_scan_request *request); |
@@ -2263,7 +2279,10 @@ struct cfg80211_cached_keys; | |||
2263 | * @netdev: (private) Used to reference back to the netdev | 2279 | * @netdev: (private) Used to reference back to the netdev |
2264 | * @current_bss: (private) Used by the internal configuration code | 2280 | * @current_bss: (private) Used by the internal configuration code |
2265 | * @channel: (private) Used by the internal configuration code to track | 2281 | * @channel: (private) Used by the internal configuration code to track |
2266 | * user-set AP, monitor and WDS channels for wireless extensions | 2282 | * the user-set AP, monitor and WDS channel |
2283 | * @preset_chan: (private) Used by the internal configuration code to | ||
2284 | * track the channel to be used for AP later | ||
2285 | * @preset_chantype: (private) the corresponding channel type | ||
2267 | * @bssid: (private) Used by the internal configuration code | 2286 | * @bssid: (private) Used by the internal configuration code |
2268 | * @ssid: (private) Used by the internal configuration code | 2287 | * @ssid: (private) Used by the internal configuration code |
2269 | * @ssid_len: (private) Used by the internal configuration code | 2288 | * @ssid_len: (private) Used by the internal configuration code |
@@ -2313,7 +2332,8 @@ struct wireless_dev { | |||
2313 | spinlock_t event_lock; | 2332 | spinlock_t event_lock; |
2314 | 2333 | ||
2315 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | 2334 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ |
2316 | struct ieee80211_channel *channel; | 2335 | struct ieee80211_channel *preset_chan; |
2336 | enum nl80211_channel_type preset_chantype; | ||
2317 | 2337 | ||
2318 | bool ps; | 2338 | bool ps; |
2319 | int ps_timeout; | 2339 | int ps_timeout; |
@@ -3359,11 +3379,14 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy, | |||
3359 | const u8 *frame, size_t len, | 3379 | const u8 *frame, size_t len, |
3360 | int freq, int sig_dbm, gfp_t gfp); | 3380 | int freq, int sig_dbm, gfp_t gfp); |
3361 | 3381 | ||
3362 | /* | 3382 | /** |
3363 | * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used | 3383 | * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used |
3364 | * @wiphy: the wiphy | 3384 | * @wiphy: the wiphy |
3365 | * @chan: main channel | 3385 | * @chan: main channel |
3366 | * @channel_type: HT mode | 3386 | * @channel_type: HT mode |
3387 | * | ||
3388 | * This function returns true if there is no secondary channel or the secondary | ||
3389 | * channel can be used for beaconing (i.e. is not a radar channel etc.) | ||
3367 | */ | 3390 | */ |
3368 | bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, | 3391 | bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, |
3369 | struct ieee80211_channel *chan, | 3392 | struct ieee80211_channel *chan, |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 95e39b6a02ec..6914f9978aea 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -1297,6 +1297,10 @@ enum ieee80211_hw_flags { | |||
1297 | * reports, by default it is set to _MCS, _GI and _BW but doesn't | 1297 | * reports, by default it is set to _MCS, _GI and _BW but doesn't |
1298 | * include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only | 1298 | * include _FMT. Use %IEEE80211_RADIOTAP_MCS_HAVE_* values, only |
1299 | * adding _BW is supported today. | 1299 | * adding _BW is supported today. |
1300 | * | ||
1301 | * @netdev_features: netdev features to be set in each netdev created | ||
1302 | * from this HW. Note only HW checksum features are currently | ||
1303 | * compatible with mac80211. Other feature bits will be rejected. | ||
1300 | */ | 1304 | */ |
1301 | struct ieee80211_hw { | 1305 | struct ieee80211_hw { |
1302 | struct ieee80211_conf conf; | 1306 | struct ieee80211_conf conf; |
@@ -1319,6 +1323,7 @@ struct ieee80211_hw { | |||
1319 | u8 max_tx_aggregation_subframes; | 1323 | u8 max_tx_aggregation_subframes; |
1320 | u8 offchannel_tx_hw_queue; | 1324 | u8 offchannel_tx_hw_queue; |
1321 | u8 radiotap_mcs_details; | 1325 | u8 radiotap_mcs_details; |
1326 | netdev_features_t netdev_features; | ||
1322 | }; | 1327 | }; |
1323 | 1328 | ||
1324 | /** | 1329 | /** |
@@ -2183,7 +2188,10 @@ enum ieee80211_rate_control_changed { | |||
2183 | * offload. Frames to transmit on the off-channel channel are transmitted | 2188 | * offload. Frames to transmit on the off-channel channel are transmitted |
2184 | * normally except for the %IEEE80211_TX_CTL_TX_OFFCHAN flag. When the | 2189 | * normally except for the %IEEE80211_TX_CTL_TX_OFFCHAN flag. When the |
2185 | * duration (which will always be non-zero) expires, the driver must call | 2190 | * duration (which will always be non-zero) expires, the driver must call |
2186 | * ieee80211_remain_on_channel_expired(). This callback may sleep. | 2191 | * ieee80211_remain_on_channel_expired(). |
2192 | * Note that this callback may be called while the device is in IDLE and | ||
2193 | * must be accepted in this case. | ||
2194 | * This callback may sleep. | ||
2187 | * @cancel_remain_on_channel: Requests that an ongoing off-channel period is | 2195 | * @cancel_remain_on_channel: Requests that an ongoing off-channel period is |
2188 | * aborted before it expires. This callback may sleep. | 2196 | * aborted before it expires. This callback may sleep. |
2189 | * | 2197 | * |
@@ -3557,16 +3565,6 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif, | |||
3557 | gfp_t gfp); | 3565 | gfp_t gfp); |
3558 | 3566 | ||
3559 | /** | 3567 | /** |
3560 | * ieee80211_get_operstate - get the operstate of the vif | ||
3561 | * | ||
3562 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
3563 | * | ||
3564 | * The driver might need to know the operstate of the net_device | ||
3565 | * (specifically, whether the link is IF_OPER_UP after resume) | ||
3566 | */ | ||
3567 | unsigned char ieee80211_get_operstate(struct ieee80211_vif *vif); | ||
3568 | |||
3569 | /** | ||
3570 | * ieee80211_chswitch_done - Complete channel switch process | 3568 | * ieee80211_chswitch_done - Complete channel switch process |
3571 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 3569 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
3572 | * @success: make the channel switch successful or not | 3570 | * @success: make the channel switch successful or not |
@@ -3845,4 +3843,28 @@ int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif, | |||
3845 | */ | 3843 | */ |
3846 | int ieee80211_ave_rssi(struct ieee80211_vif *vif); | 3844 | int ieee80211_ave_rssi(struct ieee80211_vif *vif); |
3847 | 3845 | ||
3846 | /* Extra debugging macros */ | ||
3847 | |||
3848 | #ifdef CONFIG_MAC80211_HT_DEBUG | ||
3849 | #define ht_vdbg(fmt, ...) \ | ||
3850 | pr_debug(fmt, ##__VA_ARGS__) | ||
3851 | #else | ||
3852 | #define ht_vdbg(fmt, ...) \ | ||
3853 | do { \ | ||
3854 | if (0) \ | ||
3855 | pr_debug(fmt, ##__VA_ARGS__); \ | ||
3856 | } while (0) | ||
3857 | #endif | ||
3858 | |||
3859 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | ||
3860 | #define ibss_vdbg(fmt, ...) \ | ||
3861 | pr_debug(fmt, ##__VA_ARGS__) | ||
3862 | #else | ||
3863 | #define ibss_vdbg(fmt, ...) \ | ||
3864 | do { \ | ||
3865 | if (0) \ | ||
3866 | pr_debug(fmt, ##__VA_ARGS__); \ | ||
3867 | } while (0) | ||
3868 | #endif | ||
3869 | |||
3848 | #endif /* MAC80211_H */ | 3870 | #endif /* MAC80211_H */ |
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index 4467c9460857..e30e6a869714 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
@@ -31,7 +31,8 @@ struct nfc_hci_ops { | |||
31 | void (*close) (struct nfc_hci_dev *hdev); | 31 | void (*close) (struct nfc_hci_dev *hdev); |
32 | int (*hci_ready) (struct nfc_hci_dev *hdev); | 32 | int (*hci_ready) (struct nfc_hci_dev *hdev); |
33 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); | 33 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); |
34 | int (*start_poll) (struct nfc_hci_dev *hdev, u32 protocols); | 34 | int (*start_poll) (struct nfc_hci_dev *hdev, |
35 | u32 im_protocols, u32 tm_protocols); | ||
35 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, | 36 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, |
36 | struct nfc_target *target); | 37 | struct nfc_target *target); |
37 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, | 38 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index b7ca4a2a1d72..180964b954ab 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
@@ -53,7 +53,8 @@ struct nfc_target; | |||
53 | struct nfc_ops { | 53 | struct nfc_ops { |
54 | int (*dev_up)(struct nfc_dev *dev); | 54 | int (*dev_up)(struct nfc_dev *dev); |
55 | int (*dev_down)(struct nfc_dev *dev); | 55 | int (*dev_down)(struct nfc_dev *dev); |
56 | int (*start_poll)(struct nfc_dev *dev, u32 protocols); | 56 | int (*start_poll)(struct nfc_dev *dev, |
57 | u32 im_protocols, u32 tm_protocols); | ||
57 | void (*stop_poll)(struct nfc_dev *dev); | 58 | void (*stop_poll)(struct nfc_dev *dev); |
58 | int (*dep_link_up)(struct nfc_dev *dev, struct nfc_target *target, | 59 | int (*dep_link_up)(struct nfc_dev *dev, struct nfc_target *target, |
59 | u8 comm_mode, u8 *gb, size_t gb_len); | 60 | u8 comm_mode, u8 *gb, size_t gb_len); |
@@ -62,9 +63,10 @@ struct nfc_ops { | |||
62 | u32 protocol); | 63 | u32 protocol); |
63 | void (*deactivate_target)(struct nfc_dev *dev, | 64 | void (*deactivate_target)(struct nfc_dev *dev, |
64 | struct nfc_target *target); | 65 | struct nfc_target *target); |
65 | int (*data_exchange)(struct nfc_dev *dev, struct nfc_target *target, | 66 | int (*im_transceive)(struct nfc_dev *dev, struct nfc_target *target, |
66 | struct sk_buff *skb, data_exchange_cb_t cb, | 67 | struct sk_buff *skb, data_exchange_cb_t cb, |
67 | void *cb_context); | 68 | void *cb_context); |
69 | int (*tm_send)(struct nfc_dev *dev, struct sk_buff *skb); | ||
68 | int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target); | 70 | int (*check_presence)(struct nfc_dev *dev, struct nfc_target *target); |
69 | }; | 71 | }; |
70 | 72 | ||
@@ -99,10 +101,10 @@ struct nfc_dev { | |||
99 | int targets_generation; | 101 | int targets_generation; |
100 | struct device dev; | 102 | struct device dev; |
101 | bool dev_up; | 103 | bool dev_up; |
104 | u8 rf_mode; | ||
102 | bool polling; | 105 | bool polling; |
103 | struct nfc_target *active_target; | 106 | struct nfc_target *active_target; |
104 | bool dep_link_up; | 107 | bool dep_link_up; |
105 | u32 dep_rf_mode; | ||
106 | struct nfc_genl_data genl_data; | 108 | struct nfc_genl_data genl_data; |
107 | u32 supported_protocols; | 109 | u32 supported_protocols; |
108 | 110 | ||
@@ -188,6 +190,7 @@ struct sk_buff *nfc_alloc_recv_skb(unsigned int size, gfp_t gfp); | |||
188 | 190 | ||
189 | int nfc_set_remote_general_bytes(struct nfc_dev *dev, | 191 | int nfc_set_remote_general_bytes(struct nfc_dev *dev, |
190 | u8 *gt, u8 gt_len); | 192 | u8 *gt, u8 gt_len); |
193 | u8 *nfc_get_local_general_bytes(struct nfc_dev *dev, size_t *gb_len); | ||
191 | 194 | ||
192 | int nfc_targets_found(struct nfc_dev *dev, | 195 | int nfc_targets_found(struct nfc_dev *dev, |
193 | struct nfc_target *targets, int ntargets); | 196 | struct nfc_target *targets, int ntargets); |
@@ -196,4 +199,9 @@ int nfc_target_lost(struct nfc_dev *dev, u32 target_idx); | |||
196 | int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx, | 199 | int nfc_dep_link_is_up(struct nfc_dev *dev, u32 target_idx, |
197 | u8 comm_mode, u8 rf_mode); | 200 | u8 comm_mode, u8 rf_mode); |
198 | 201 | ||
202 | int nfc_tm_activated(struct nfc_dev *dev, u32 protocol, u8 comm_mode, | ||
203 | u8 *gb, size_t gb_len); | ||
204 | int nfc_tm_deactivated(struct nfc_dev *dev); | ||
205 | int nfc_tm_data_received(struct nfc_dev *dev, struct sk_buff *skb); | ||
206 | |||
199 | #endif /* __NET_NFC_H */ | 207 | #endif /* __NET_NFC_H */ |
diff --git a/include/net/nfc/shdlc.h b/include/net/nfc/shdlc.h index ab06afd462da..35e930d2f638 100644 --- a/include/net/nfc/shdlc.h +++ b/include/net/nfc/shdlc.h | |||
@@ -27,7 +27,8 @@ struct nfc_shdlc_ops { | |||
27 | void (*close) (struct nfc_shdlc *shdlc); | 27 | void (*close) (struct nfc_shdlc *shdlc); |
28 | int (*hci_ready) (struct nfc_shdlc *shdlc); | 28 | int (*hci_ready) (struct nfc_shdlc *shdlc); |
29 | int (*xmit) (struct nfc_shdlc *shdlc, struct sk_buff *skb); | 29 | int (*xmit) (struct nfc_shdlc *shdlc, struct sk_buff *skb); |
30 | int (*start_poll) (struct nfc_shdlc *shdlc, u32 protocols); | 30 | int (*start_poll) (struct nfc_shdlc *shdlc, |
31 | u32 im_protocols, u32 tm_protocols); | ||
31 | int (*target_from_gate) (struct nfc_shdlc *shdlc, u8 gate, | 32 | int (*target_from_gate) (struct nfc_shdlc *shdlc, u8 gate, |
32 | struct nfc_target *target); | 33 | struct nfc_target *target); |
33 | int (*complete_target_discovered) (struct nfc_shdlc *shdlc, u8 gate, | 34 | int (*complete_target_discovered) (struct nfc_shdlc *shdlc, u8 gate, |