restore 2.6.23 support for rb532. 2.6.24 is 100% broken and was only added accidentally
[openwrt/svn-archive/archive.git] / target / linux / generic-2.6 / patches-2.6.23 / 210-mac80211_include_wireless_dev.patch
1 --- a/include/linux/ieee80211.h
2 +++ b/include/linux/ieee80211.h
3 @@ -106,6 +106,75 @@
4 } __attribute__ ((packed));
5
6
7 +struct ieee80211_ht_capability {
8 + __le16 capabilities_info;
9 + u8 mac_ht_params_info;
10 + u8 supported_mcs_set[16];
11 + __le16 extended_ht_capability_info;
12 + __le32 tx_BF_capability_info;
13 + u8 antenna_selection_info;
14 +}__attribute__ ((packed));
15 +
16 +struct ieee80211_ht_additional_info {
17 + u8 control_chan;
18 + u8 ht_param;
19 + __le16 operation_mode;
20 + __le16 stbc_param;
21 + u8 basic_set[16];
22 +}__attribute__ ((packed));
23 +
24 +
25 +#define IEEE80211_TSINFO_TYPE(a) ((a.byte1 & 0x01) >> 0)
26 +#define IEEE80211_TSINFO_TSID(a) ((a.byte1 & 0x1E) >> 1)
27 +#define IEEE80211_TSINFO_DIR(a) ((a.byte1 & 0x60) >> 5)
28 +#define IEEE80211_TSINFO_POLICY(a) ((a.byte1 & 0x80) >> 7 + \
29 + (a.byte2 & 0x01) << 1)
30 +#define IEEE80211_TSINFO_AGG(a) ((a.byte2 & 0x02) >> 1)
31 +#define IEEE80211_TSINFO_APSD(a) ((a.byte2 & 0x04) >> 2)
32 +#define IEEE80211_TSINFO_UP(a) ((a.byte2 & 0x38) >> 3)
33 +#define IEEE80211_TSINFO_ACK(a) ((a.byte2 & 0xC0) >> 6)
34 +#define IEEE80211_TSINFO_SCHEDULE(a) ((a.byte3 & 0x01) >> 0)
35 +
36 +#define IEEE80211_SET_TSINFO_TYPE(i, d) (i.byte1 |= (d << 0) & 0x01)
37 +#define IEEE80211_SET_TSINFO_TSID(i, d) (i.byte1 |= (d << 1) & 0x1E)
38 +#define IEEE80211_SET_TSINFO_DIR(i, d) (i.byte1 |= (d << 5) & 0x60)
39 +#define IEEE80211_SET_TSINFO_POLICY(i, d) \
40 +do { \
41 + i.byte1 |= (d & 0x01) << 7; \
42 + i.byte2 |= (d & 0x02) >> 1; \
43 +} while(0)
44 +#define IEEE80211_SET_TSINFO_AGG(i, d) (i.byte2 |= (d << 1) & 0x02)
45 +#define IEEE80211_SET_TSINFO_APSD(i, d) (i.byte2 |= (d << 2) & 0x04)
46 +#define IEEE80211_SET_TSINFO_UP(i, d) (i.byte2 |= (d << 3) & 0x38)
47 +#define IEEE80211_SET_TSINFO_ACK(i, d) (i.byte2 |= (d << 6) & 0xC0)
48 +#define IEEE80211_SET_TSINFO_SCHEDULE(i, d) (i.byte3 |= (d << 0) & 0x01)
49 +
50 +struct ieee80211_ts_info {
51 + u8 byte1;
52 + u8 byte2;
53 + u8 byte3;
54 +} __attribute__ ((packed));
55 +
56 +struct ieee80211_elem_tspec {
57 + struct ieee80211_ts_info ts_info;
58 + __le16 nominal_msdu_size;
59 + __le16 max_msdu_size;
60 + __le32 min_service_interval;
61 + __le32 max_service_interval;
62 + __le32 inactivity_interval;
63 + __le32 suspension_interval;
64 + __le32 service_start_time;
65 + __le32 min_data_rate;
66 + __le32 mean_data_rate;
67 + __le32 peak_data_rate;
68 + __le32 burst_size;
69 + __le32 delay_bound;
70 + __le32 min_phy_rate;
71 + __le16 surplus_band_allow;
72 + __le16 medium_time;
73 +} __attribute__ ((packed));
74 +
75 +
76 struct ieee80211_mgmt {
77 __le16 frame_control;
78 __le16 duration;
79 @@ -173,9 +242,51 @@
80 struct {
81 u8 action_code;
82 u8 dialog_token;
83 + u8 variable[0];
84 + } __attribute__ ((packed)) addts_req;
85 + struct {
86 + u8 action_code;
87 + u8 dialog_token;
88 + __le16 status_code;
89 + u8 variable[0];
90 + } __attribute__ ((packed)) addts_resp;
91 + struct {
92 + u8 action_code;
93 + struct ieee80211_ts_info ts_info;
94 + __le16 reason_code;
95 + } __attribute__ ((packed)) delts;
96 + struct {
97 + u8 action_code;
98 + u8 dialog_token;
99 u8 status_code;
100 u8 variable[0];
101 } __attribute__ ((packed)) wme_action;
102 + struct {
103 + u8 action_code;
104 + u8 dest[6];
105 + u8 src[6];
106 + __le16 capab_info;
107 + __le16 timeout;
108 + /* Followed by Supported Rates and
109 + * Extended Supported Rates */
110 + u8 variable[0];
111 + } __attribute__ ((packed)) dls_req;
112 + struct {
113 + u8 action_code;
114 + __le16 status_code;
115 + u8 dest[6];
116 + u8 src[6];
117 + /* Followed by Capability Information,
118 + * Supported Rates and Extended
119 + * Supported Rates */
120 + u8 variable[0];
121 + } __attribute__ ((packed)) dls_resp;
122 + struct {
123 + u8 action_code;
124 + u8 dest[6];
125 + u8 src[6];
126 + __le16 reason_code;
127 + } __attribute__ ((packed)) dls_teardown;
128 struct{
129 u8 action_code;
130 u8 element_id;
131 @@ -184,6 +295,25 @@
132 u8 new_chan;
133 u8 switch_count;
134 } __attribute__((packed)) chan_switch;
135 + struct{
136 + u8 action_code;
137 + u8 dialog_token;
138 + __le16 capab;
139 + __le16 timeout;
140 + __le16 start_seq_num;
141 + } __attribute__((packed)) addba_req;
142 + struct{
143 + u8 action_code;
144 + u8 dialog_token;
145 + __le16 status;
146 + __le16 capab;
147 + __le16 timeout;
148 + } __attribute__((packed)) addba_resp;
149 + struct{
150 + u8 action_code;
151 + __le16 params;
152 + __le16 reason_code;
153 + }__attribute__((packed)) delba;
154 } u;
155 } __attribute__ ((packed)) action;
156 } u;
157 @@ -270,6 +400,18 @@
158 WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
159 WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
160 WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
161 + /* 802.11e */
162 + WLAN_STATUS_UNSPECIFIED_QOS = 32,
163 + WLAN_STATUS_ASSOC_DENIED_NOBANDWIDTH = 33,
164 + WLAN_STATUS_ASSOC_DENIED_LOWACK = 34,
165 + WLAN_STATUS_ASSOC_DENIED_UNSUPP_QOS = 35,
166 + WLAN_STATUS_REQUEST_DECLINED = 37,
167 + WLAN_STATUS_INVALID_QOS_PARAM = 38,
168 + WLAN_STATUS_CHANGE_TSPEC = 39,
169 + WLAN_STATUS_WAIT_TS_DELAY = 47,
170 + WLAN_STATUS_NO_DIRECT_LINK = 48,
171 + WLAN_STATUS_STA_NOT_PRESENT = 49,
172 + WLAN_STATUS_STA_NOT_QSTA = 50,
173 };
174
175
176 @@ -300,9 +442,50 @@
177 WLAN_REASON_INVALID_RSN_IE_CAP = 22,
178 WLAN_REASON_IEEE8021X_FAILED = 23,
179 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
180 + /* 802.11e */
181 + WLAN_REASON_DISASSOC_UNSPECIFIED_QOS = 32,
182 + WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH = 33,
183 + WLAN_REASON_DISASSOC_LOW_ACK = 34,
184 + WLAN_REASON_DISASSOC_QAP_EXCEED_TXOP = 35,
185 + WLAN_REASON_QSTA_LEAVE_QBSS = 36,
186 + WLAN_REASON_QSTA_NOT_USE = 37,
187 + WLAN_REASON_QSTA_REQUIRE_SETUP = 38,
188 + WLAN_REASON_QSTA_TIMEOUT = 39,
189 + WLAN_REASON_QSTA_CIPHER_NOT_SUPP = 45,
190 };
191
192
193 +/* Category Code */
194 +enum ieee80211_category {
195 + WLAN_CATEGORY_SPECTRUM_MGMT = 0,
196 + WLAN_CATEGORY_QOS = 1,
197 + WLAN_CATEGORY_DLS = 2,
198 + WLAN_CATEGORY_BACK = 3,
199 + WLAN_CATEGORY_WMM = 17,
200 +};
201 +
202 +/* QoS Action Code */
203 +enum ieee80211_qos_actioncode {
204 + WLAN_ACTION_QOS_ADDTS_REQ = 0,
205 + WLAN_ACTION_QOS_ADDTS_RESP = 1,
206 + WLAN_ACTION_QOS_DELTS = 2,
207 + WLAN_ACTION_QOS_SCHEDULE = 3,
208 +};
209 +
210 +/* DLS Action Code */
211 +enum ieee80211_dls_actioncode {
212 + WLAN_ACTION_DLS_REQ = 0,
213 + WLAN_ACTION_DLS_RESP = 1,
214 + WLAN_ACTION_DLS_TEARDOWN = 2,
215 +};
216 +
217 +/* BACK Action Code */
218 +enum ieee80211_back_actioncode {
219 + WLAN_ACTION_ADDBA_REQ = 0,
220 + WLAN_ACTION_ADDBA_RESP = 1,
221 + WLAN_ACTION_DELBA = 2,
222 +};
223 +
224 /* Information Element IDs */
225 enum ieee80211_eid {
226 WLAN_EID_SSID = 0,
227 @@ -318,6 +501,15 @@
228 WLAN_EID_HP_PARAMS = 8,
229 WLAN_EID_HP_TABLE = 9,
230 WLAN_EID_REQUEST = 10,
231 + /* 802.11e */
232 + WLAN_EID_QBSS_LOAD = 11,
233 + WLAN_EID_EDCA_PARAM_SET = 12,
234 + WLAN_EID_TSPEC = 13,
235 + WLAN_EID_TCLAS = 14,
236 + WLAN_EID_SCHEDULE = 15,
237 + WLAN_EID_TS_DELAY = 43,
238 + WLAN_EID_TCLAS_PROCESSING = 44,
239 + WLAN_EID_QOS_CAPA = 46,
240 /* 802.11h */
241 WLAN_EID_PWR_CONSTRAINT = 32,
242 WLAN_EID_PWR_CAPABILITY = 33,
243 @@ -332,6 +524,9 @@
244 /* 802.11g */
245 WLAN_EID_ERP_INFO = 42,
246 WLAN_EID_EXT_SUPP_RATES = 50,
247 + /* 802.11n */
248 + WLAN_EID_HT_CAPABILITY = 45,
249 + WLAN_EID_HT_EXTRA_INFO = 61,
250 /* 802.11i */
251 WLAN_EID_RSN = 48,
252 WLAN_EID_WPA = 221,
253 @@ -340,6 +535,9 @@
254 WLAN_EID_QOS_PARAMETER = 222
255 };
256
257 +/* 80211n */
258 +#define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080
259 +
260 /* cipher suite selectors */
261 #define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00
262 #define WLAN_CIPHER_SUITE_WEP40 0x000FAC01
263 @@ -350,4 +548,37 @@
264
265 #define WLAN_MAX_KEY_LEN 32
266
267 +enum ieee80211_tsinfo_direction {
268 + WLAN_TSINFO_UPLINK = 0,
269 + WLAN_TSINFO_DOWNLINK = 1,
270 + WLAN_TSINFO_DIRECTLINK = 2,
271 + WLAN_TSINFO_BIDIRECTIONAL = 3,
272 +};
273 +
274 +enum ieee80211_tsinfo_access {
275 + WLAN_TSINFO_EDCA = 1,
276 + WLAN_TSINFO_HCCA = 2,
277 + WLAN_TSINFO_HEMM = 3,
278 +};
279 +
280 +enum ieee80211_tsinfo_psb {
281 + WLAN_TSINFO_PSB_LEGACY = 0,
282 + WLAN_TSINFO_PSB_APSD = 1,
283 +};
284 +
285 +
286 +/* WI-FI Alliance OUI Type and Subtype */
287 +enum wifi_oui_type {
288 + WIFI_OUI_TYPE_WPA = 1,
289 + WIFI_OUI_TYPE_WMM = 2,
290 + WIFI_OUI_TYPE_WSC = 4,
291 + WIFI_OUI_TYPE_PSD = 6,
292 +};
293 +
294 +enum wifi_oui_stype_wmm {
295 + WIFI_OUI_STYPE_WMM_INFO = 0,
296 + WIFI_OUI_STYPE_WMM_PARAM = 1,
297 + WIFI_OUI_STYPE_WMM_TSPEC = 2,
298 +};
299 +
300 #endif /* IEEE80211_H */
301 --- a/include/linux/nl80211.h
302 +++ b/include/linux/nl80211.h
303 @@ -7,6 +7,217 @@
304 */
305
306 /**
307 + * enum nl80211_commands - supported nl80211 commands
308 + * @NL80211_CMD_UNSPEC: unspecified command to catch errors
309 + * @NL80211_CMD_RENAME_WIPHY: rename a wiphy, needs
310 + * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME
311 + * @NL80211_CMD_WIPHY_NEWNAME: rename notification
312 + * @NL80211_CMD_GET_CMDLIST: TO BE DEFINED PROPERLY. currently the code makes
313 + * it depend on the wiphy only but it really should depend on the
314 + * interface type too....
315 + * @NL80211_CMD_NEW_CMDLIST: command list result
316 + * @NL80211_CMD_ADD_VIRTUAL_INTERFACE: create a virtual interface for the
317 + * wiphy identified by an %NL80211_ATTR_WIPHY attribute with the given
318 + * %NL80211_ATTR_IFTYPE and %NL80211_ATTR_IFNAME.
319 + * @NL80211_CMD_DEL_VIRTUAL_INTERFACE: destroy a virtual interface identified
320 + * by %NL80211_ATTR_IFINDEX.
321 + * @NL80211_CMD_CHANGE_VIRTUAL_INTERFACE: change type of virtual interface to
322 + * the type given by %NL80211_ATTR_IFTYPE, the interface is identified by
323 + * %NL80211_ATTR_IFINDEX.
324 + * @NL80211_CMD_GET_WIPHYS: request a list of all wiphys present in the system
325 + * @NL80211_CMD_NEW_WIPHYS: returned list of all wiphys
326 + * @NL80211_CMD_GET_INTERFACES: request a list of all interfaces belonging to
327 + * the wiphy identified by %NL80211_ATTR_WIPHY
328 + * @NL80211_CMD_NEW_INTERFACES: result for %NL80211_CMD_GET_INTERFACES
329 + * @NL80211_CMD_INITIATE_SCAN: initiate a scan with the passed parameters. THe
330 + * parameters may contain %NL80211_ATTR_FLAG_SCAN_ACTIVE,
331 + * %NL80211_ATTR_PHYMODE and a list of channels in an
332 + * %NL80211_ATTR_CHANNEL_LIST attribute (an array of nested attributes)
333 + * containing %NL80211_ATTR_CHANNEL, %NL80211_ATTR_PHYMODE, and possibly
334 + * %NL80211_ATTR_FLAG_SCAN_ACTIVE. The outer %NL80211_ATTR_FLAG_SCAN_ACTIVE
335 + * is ignored when a channel list is present.
336 + * @NL80211_CMD_SCAN_RESULT: scan result, contains an array in
337 + * %NL80211_ATTR_BSS_LIST.
338 + * @NL80211_CMD_ASSOCIATE: associate with the given parameters
339 + * (%NL80211_ATTR_SSID is mandatory, %NL80211_ATTR_TIMEOUT_TU,
340 + * %NL80211_ATTR_BSSID, %NL80211_ATTR_CHANNEL, %NL80211_ATTR_PHYMODE,
341 + * and %NL80211_ATTR_IE may be given)
342 + * @NL80211_CMD_ADD_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
343 + * %NL80211_ATTR_KEY_ID, %NL80211_ATTR_KEY_TYPE, %NL80211_ATTR_MAC and
344 + * %NL80211_ATTR_KEY_CIPHER attributes.
345 + * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_ID,
346 + * %NL80211_ATTR_KEY_TYPE and %NL80211_ATTR_MAC or all keys.
347 + * @__NL80211_CMD_AFTER_LAST: internal use
348 + */
349 +enum nl80211_commands {
350 +/* don't change the order or add anything inbetween, this is ABI! */
351 + NL80211_CMD_UNSPEC,
352 + /* %input: wiphy, wiphy_name */
353 + NL80211_CMD_RENAME_WIPHY,
354 + NL80211_CMD_WIPHY_NEWNAME,
355 + /* %input: wiphy|ifindex */
356 + NL80211_CMD_GET_CMDLIST,
357 + NL80211_CMD_NEW_CMDLIST,
358 + /* %input: wiphy, ifname, {iftype} */
359 + NL80211_CMD_ADD_VIRTUAL_INTERFACE,
360 + /* %input: wiphy, ifindex */
361 + NL80211_CMD_DEL_VIRTUAL_INTERFACE,
362 + /* %input: ifindex, iftype */
363 + NL80211_CMD_CHANGE_VIRTUAL_INTERFACE,
364 + /* %input: */
365 + NL80211_CMD_GET_WIPHYS,
366 + NL80211_CMD_NEW_WIPHYS,
367 + /* %input: wiphy */
368 + NL80211_CMD_GET_INTERFACES,
369 + NL80211_CMD_NEW_INTERFACES,
370 + NL80211_CMD_INITIATE_SCAN,
371 + NL80211_CMD_SCAN_RESULT,
372 + NL80211_CMD_GET_ASSOCIATION,
373 + NL80211_CMD_ASSOCIATION_CHANGED,
374 + NL80211_CMD_ASSOCIATE,
375 + NL80211_CMD_DISASSOCIATE,
376 + NL80211_CMD_DEAUTH,
377 + NL80211_CMD_GET_AUTH_LIST,
378 + NL80211_CMD_NEW_AUTH_LIST,
379 + NL80211_CMD_AUTHENTICATION_CHANGED,
380 + NL80211_CMD_AP_SET_BEACON,
381 + NL80211_CMD_AP_ADD_STA,
382 + NL80211_CMD_AP_UPDATE_STA,
383 + NL80211_CMD_AP_GET_STA_INFO,
384 + NL80211_CMD_AP_SET_RATESETS,
385 + NL80211_CMD_ADD_KEY,
386 + NL80211_CMD_DEL_KEY,
387 +
388 + /* add commands here */
389 +
390 + /* used to define NL80211_CMD_MAX below */
391 + __NL80211_CMD_AFTER_LAST
392 +};
393 +#define NL80211_CMD_MAX (__NL80211_CMD_AFTER_LAST - 1)
394 +
395 +
396 +/**
397 + * enum nl80211_attrs - nl80211 netlink attributes
398 + * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
399 + * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
400 + * @NL80211_ATTR_IFNAME: network interface name
401 + * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
402 + * /sys/class/ieee80211/<phyname>/index
403 + * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
404 + * @NL80211_ATTR_CMDS: list of u8's identifying commands a device supports
405 + * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
406 + * @NL80211_ATTR_INTERFACE_LIST: interface array, nested netlink attribute
407 + * @NL80211_ATTR_WIPHY_LIST: wiphy array, nested netlink attribute
408 + * @NL80211_ATTR_BSSID: BSSID (must be 6 bytes)
409 + * @NL80211_ATTR_SSID: SSID (1-32 bytes)
410 + * @NL80211_ATTR_CHANNEL: channel number
411 + * @NL80211_ATTR_PHYMODE: PHY mode, see &enum nl80211_phymode
412 + * @NL80211_ATTR_CHANNEL_LIST: netlink nested attribute array containing scan
413 + * parameters for channels
414 + * @NL80211_ATTR_BSS_LIST: nested attribute containing an array
415 + * @NL80211_ATTR_BSSTYPE: BSS type, see &enum nl80211_bsstype
416 + * @NL80211_ATTR_BEACON_PERIOD: beacon period
417 + * @NL80211_ATTR_DTIM_PERIOD: DTIM period
418 + * @NL80211_ATTR_TIMESTAMP: 64-bit timestamp of received beacon/probe response
419 + * @NL80211_ATTR_IE: information element(s), maximum length %NL80211_MAX_IE_LEN
420 + * @NL80211_ATTR_AUTH_ALGORITHM: authentication algorithm
421 + * @NL80211_ATTR_TIMEOUT_TU: timeout in TU (TO BE USED)
422 + * @NL80211_ATTR_REASON_CODE: 802.11 reason code
423 + * @NL80211_ATTR_ASSOCIATION_ID: association ID (u16, 1-2007)
424 + * @NL80211_ATTR_DEAUTHENTICATED: TO BE USED
425 + * @NL80211_ATTR_RX_SENSITIVITY: receiver sensitivity in dBm
426 + * @NL80211_ATTR_TRANSMIT_POWER: transmit power in mW
427 + * @NL80211_ATTR_FRAG_THRESHOLD: fragmentation threshold (bytes)
428 + * @NL80211_ATTR_FLAG_SCAN_ACTIVE: netlink flag indiciating active scan
429 + * @NL80211_ATTR_KEY_DATA: temporal key data
430 + * @NL80211_ATTR_KEY_ID: key ID (u8, 0-3)
431 + * @NL80211_ATTR_KEY_TYPE: key type (see &enum nl80211_keytype)
432 + * @NL80211_ATTR_MAC: MAC address
433 + * @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32)
434 + * @__NL80211_ATTR_AFTER_LAST: internal use
435 + */
436 +enum nl80211_attrs {
437 +/* don't change the order or add anything inbetween, this is ABI! */
438 + NL80211_ATTR_UNSPEC,
439 + /* %type: u32 */
440 + NL80211_ATTR_IFINDEX,
441 + /* %type: nulstring */
442 + NL80211_ATTR_IFNAME,
443 + /* %type: u32 */
444 + NL80211_ATTR_WIPHY,
445 + /* %type: nulstring */
446 + NL80211_ATTR_WIPHY_NAME,
447 + NL80211_ATTR_CMDS,
448 + /* %type: u32 */
449 + NL80211_ATTR_IFTYPE,
450 + NL80211_ATTR_INTERFACE_LIST,
451 + NL80211_ATTR_WIPHY_LIST,
452 + NL80211_ATTR_BSSID,
453 + NL80211_ATTR_SSID,
454 + NL80211_ATTR_CHANNEL,
455 + NL80211_ATTR_PHYMODE,
456 + NL80211_ATTR_CHANNEL_LIST,
457 + NL80211_ATTR_BSS_LIST,
458 + NL80211_ATTR_BSSTYPE,
459 + NL80211_ATTR_BEACON_PERIOD,
460 + NL80211_ATTR_DTIM_PERIOD,
461 + NL80211_ATTR_TIMESTAMP,
462 + NL80211_ATTR_IE,
463 + NL80211_ATTR_AUTH_ALGORITHM,
464 + NL80211_ATTR_TIMEOUT_TU,
465 + NL80211_ATTR_REASON_CODE,
466 + NL80211_ATTR_ASSOCIATION_ID,
467 + NL80211_ATTR_DEAUTHENTICATED,
468 + NL80211_ATTR_RX_SENSITIVITY,
469 + NL80211_ATTR_TRANSMIT_POWER,
470 + NL80211_ATTR_FRAG_THRESHOLD,
471 + NL80211_ATTR_FLAG_SCAN_ACTIVE,
472 +
473 + NL80211_ATTR_KEY_DATA,
474 + NL80211_ATTR_KEY_ID,
475 + NL80211_ATTR_KEY_TYPE,
476 + NL80211_ATTR_MAC,
477 + NL80211_ATTR_KEY_CIPHER,
478 +
479 + NL80211_ATTR_BEACON_HEAD,
480 + NL80211_ATTR_BEACON_TAIL,
481 +
482 + /* add attributes here, update the policy in nl80211.c */
483 +
484 + /* used to define NL80211_ATTR_MAX below */
485 + __NL80211_ATTR_AFTER_LAST,
486 +};
487 +#define NL80211_ATTR_MAX (__NL80211_ATTR_AFTER_LAST - 1)
488 +
489 +/**
490 + * enum nl80211_multicast_groups - multicast groups for nl80211
491 + * @NL80211_GROUP_CONFIG: members of this group are notified of
492 + * configuration changes
493 + */
494 +enum nl80211_multicast_groups {
495 + /* be notified of configuration changes like wiphy renames */
496 + NL80211_GROUP_CONFIG,
497 +
498 + /* add groups here */
499 +
500 + /* keep last */
501 + __NL80211_GROUP_AFTER_LAST
502 +};
503 +#define NL80211_GROUP_MAX (__NL80211_GROUP_AFTER_LAST - 1)
504 +
505 +/*
506 + * maximum length of IE(s) passed in an NL80211_ATTR_IE.
507 + * this is an arbitrary limit, 774 means three full-length
508 + * IEs would fit... increase if necessary */
509 +#define NL80211_MAX_IE_LEN 774
510 +
511 +/*
512 + * maximum number of items in an ATTR_CHANNEL_LIST,
513 + * just to avoid too large allocations
514 + */
515 +#define NL80211_MAX_CHANNEL_LIST_ITEM 200
516 +
517 +/**
518 * enum nl80211_iftype - (virtual) interface types
519 * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
520 * @NL80211_IFTYPE_ADHOC: independent BSS member
521 @@ -35,4 +246,56 @@
522 };
523 #define NL80211_IFTYPE_MAX (__NL80211_IFTYPE_AFTER_LAST - 1)
524
525 +/**
526 + * enum nl80211_phymode - PHY modes
527 + * @NL80211_PHYMODE_A: 5 GHz PHY
528 + * @NL80211_PHYMODE_B: 2.4 GHz PHY (B mode)
529 + * @NL80211_PHYMODE_G: 2.4 GHz PHY (G, compatible with B)
530 + * @__NL80211_PHYMODE_AFTER_LAST: internal use
531 + *
532 + * These values are used for %NL80211_ATTR_PHYMODE.
533 + */
534 +enum nl80211_phymode {
535 + NL80211_PHYMODE_A,
536 + NL80211_PHYMODE_B,
537 + NL80211_PHYMODE_G,
538 +
539 + /* keep last */
540 + __NL80211_PHYMODE_AFTER_LAST
541 +};
542 +#define NL80211_PHYMODE_MAX (__NL80211_PHYMODE_AFTER_LAST - 1)
543 +
544 +/**
545 + * enum nl80211_bsstype - BSS types
546 + * @NL80211_BSSTYPE_INFRASTRUCTURE: infrastructure BSS
547 + * @NL80211_BSSTYPE_INDEPENDENT: independent BSS (ad-hoc network)
548 + * @__NL80211_BSSTYPE_AFTER_LAST: internal use
549 + *
550 + * These values are used for %NL80211_ATTR_BSSTYPE.
551 + */
552 +enum nl80211_bsstype {
553 + NL80211_BSSTYPE_INFRASTRUCTURE,
554 + NL80211_BSSTYPE_INDEPENDENT,
555 +
556 + /* keep last */
557 + __NL80211_BSSTYPE_AFTER_LAST
558 +};
559 +#define NL80211_BSSTYPE_MAX (__NL80211_BSSTYPE_AFTER_LAST - 1)
560 +
561 +/**
562 + * enum nl80211_keytype - key types
563 + * @NL80211_KEYTYPE_GROUP: group key
564 + * @NL80211_KEYTYPE_PAIRWISE: pairwise key
565 + * @NL80211_KEYTYPE_PEER: peer key
566 + */
567 +enum nl80211_keytype {
568 + NL80211_KEYTYPE_GROUP,
569 + NL80211_KEYTYPE_PAIRWISE,
570 + NL80211_KEYTYPE_PEER,
571 +
572 + /* keep last */
573 + __NL80211_KEYTYPE_AFTER_LAST
574 +};
575 +#define NL80211_KEYTYPE_MAX (__NL80211_KEYTYPE_AFTER_LAST - 1)
576 +
577 #endif /* __LINUX_NL80211_H */
578 --- a/include/net/cfg80211.h
579 +++ b/include/net/cfg80211.h
580 @@ -3,6 +3,7 @@
581
582 #include <linux/netlink.h>
583 #include <linux/skbuff.h>
584 +#include <linux/nl80211.h>
585 #include <net/genetlink.h>
586
587 /*
588 @@ -49,6 +50,69 @@
589 struct ieee80211_radiotap_iterator *iterator);
590
591
592 +/**
593 + * struct scan_channel - describes a single channel to scan
594 + * @phymode: PHY mode for this channel
595 + * @channel: channel number (1-14, ...)
596 + * @active: scan actively or passively on this channel
597 + */
598 +struct scan_channel {
599 + enum nl80211_phymode phymode;
600 + u32 channel;
601 + int active;
602 +};
603 +
604 +/**
605 + * struct scan_params - describes scan parameters
606 + * @n_channels: number of items in @channels array or -1 to indicate all
607 + * channels should be scanned (in that case @channels will be %NULL)
608 + * @active: when n_channels is -1 this determines active/passive scanning.
609 + * @phymode: when n_channels is -1 this determines PHY mode to scan. It is
610 + * not possible to scan different PHY modes in one request w/o giving
611 + * a channel list.
612 + * @channels: array containing @n_channels &struct scan_channel items
613 + */
614 +struct scan_params {
615 + int n_channels;
616 + int active;
617 + enum nl80211_phymode phymode;
618 + struct scan_channel *channels;
619 +};
620 +
621 +/**
622 + * struct association_params - describes association parameters
623 + * @valid: this member contains flags which items are valid
624 + * @bssid: the BSSID of the BSS to associate [%ASSOC_PARAMS_BSSID]
625 + * @timeout: timeout (in TU) [%ASSOC_PARAMS_TIMEOUT]
626 + * @ie: information element(s) to include in the association frames [%ASSOC_PARAMS_IE]
627 + * @ie_len: length of the information element(s)
628 + * @ssid: the SSID, always valid.
629 + * @ssid_len: length of the SSID
630 + */
631 +struct association_params {
632 + u8 *bssid;
633 + u32 timeout;
634 + u8 *ie;
635 + int ie_len;
636 + u8 *ssid;
637 + int ssid_len;
638 +
639 + unsigned int valid;
640 +};
641 +#define ASSOC_PARAMS_TIMEOUT (1<<0)
642 +
643 +/**
644 + * struct key_params - key information
645 + */
646 +struct key_params {
647 + u8 *key;
648 + int key_len;
649 + int key_id;
650 + u32 key_type;
651 + u8 *macaddress;
652 + u32 cipher;
653 +};
654 +
655 /* from net/wireless.h */
656 struct wiphy;
657
658 @@ -68,11 +132,62 @@
659 * @add_virtual_intf: create a new virtual interface with the given name
660 *
661 * @del_virtual_intf: remove the virtual interface determined by ifindex.
662 + *
663 + * @change_virtual_intf: change type of virtual interface
664 + *
665 + * @associate: associate with given parameters
666 + *
667 + * @disassociate: disassociate from current AP
668 + *
669 + * @deauth: deauth from current AP
670 + *
671 + * @initiate_scan: scan with the given information (see &struct scan_params above)
672 + *
673 + * @get_association: get BSSID of the BSS that the device is currently
674 + * associated to and return 1, or return 0 if not
675 + * associated (or a negative error code)
676 + * @get_auth_list: get list of BSSIDs of all BSSs the device has
677 + * authenticated with, must call next_bssid for each,
678 + * next_bssid returns non-zero on error, the given data
679 + * is to be passed to that callback
680 + * @add_key: add a key using &struct key_params
681 + * @del_key: delete a key using info from &struct key_params
682 */
683 struct cfg80211_ops {
684 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
685 - unsigned int type);
686 + enum nl80211_iftype type);
687 int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex);
688 + int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex,
689 + enum nl80211_iftype type);
690 +
691 + int (*associate)(struct wiphy *wiphy, struct net_device *dev,
692 + struct association_params *params);
693 + int (*disassociate)(struct wiphy *wiphy, struct net_device *dev);
694 + int (*deauth)(struct wiphy *wiphy, struct net_device *dev);
695 +
696 +
697 + int (*initiate_scan)(struct wiphy *wiphy, struct net_device *dev,
698 + struct scan_params *params);
699 +
700 +
701 + int (*get_association)(struct wiphy *wiphy, struct net_device *dev,
702 + u8 *bssid);
703 +
704 + int (*get_auth_list)(struct wiphy *wiphy, struct net_device *dev,
705 + void *data,
706 + int (*next_bssid)(void *data, u8 *bssid));
707 +
708 + int (*add_key)(struct wiphy *wiphy, struct net_device *dev,
709 + struct key_params *params);
710 + int (*del_key)(struct wiphy *wiphy, struct net_device *dev,
711 + struct key_params *params);
712 };
713
714 +
715 +/* helper functions specific to nl80211 */
716 +extern void *nl80211hdr_put(struct sk_buff *skb, u32 pid,
717 + u32 seq, int flags, u8 cmd);
718 +extern void *nl80211msg_new(struct sk_buff **skb, u32 pid,
719 + u32 seq, int flags, u8 cmd);
720 +
721 #endif /* __NET_CFG80211_H */
722 --- a/include/net/iw_handler.h
723 +++ b/include/net/iw_handler.h
724 @@ -431,7 +431,13 @@
725 * Those may be called only within the kernel.
726 */
727
728 -/* functions that may be called by driver modules */
729 +/* First : function strictly used inside the kernel */
730 +
731 +/* Handle /proc/net/wireless, called in net/code/dev.c */
732 +extern int dev_get_wireless_info(char * buffer, char **start, off_t offset,
733 + int length);
734 +
735 +/* Second : functions that may be called by driver modules */
736
737 /* Send a single event to user space */
738 extern void wireless_send_event(struct net_device * dev,
739 --- a/include/net/mac80211.h
740 +++ b/include/net/mac80211.h
741 @@ -300,7 +300,6 @@
742 /* Following five fields are used for IEEE 802.11H */
743 unsigned int radar_detect;
744 unsigned int spect_mgmt;
745 - /* All following fields are currently unused. */
746 unsigned int quiet_duration; /* duration of quiet period */
747 unsigned int quiet_offset; /* how far into the beacon is the quiet
748 * period */
749 @@ -521,6 +520,9 @@
750 * per-packet RC4 key with each TX frame when doing hwcrypto */
751 #define IEEE80211_HW_TKIP_REQ_PHASE2_KEY (1<<14)
752
753 + /* The device capable of supporting 11n */
754 +#define IEEE80211_HW_SUPPORT_HT_MODE (1<<15)
755 +
756 u32 flags; /* hardware flags defined above */
757
758 /* Set to the size of a needed device specific skb headroom for TX skbs. */
759 @@ -649,8 +651,7 @@
760 * used if the wlan hardware or low-level driver implements PAE.
761 * 80211.o module will anyway filter frames based on authorization
762 * state, so this function pointer can be NULL if low-level driver does
763 - * not require event notification about port state changes.
764 - * Currently unused. */
765 + * not require event notification about port state changes. */
766 int (*set_port_auth)(struct ieee80211_hw *hw, u8 *addr,
767 int authorized);
768
769 @@ -702,8 +703,9 @@
770 /* Get statistics of the current TX queue status. This is used to get
771 * number of currently queued packets (queue length), maximum queue
772 * size (limit), and total number of packets sent using each TX queue
773 - * (count).
774 - * Currently unused. */
775 + * (count). This information is used for WMM to find out which TX
776 + * queues have room for more packets and by hostapd to provide
777 + * statistics about the current queueing state to external programs. */
778 int (*get_tx_stats)(struct ieee80211_hw *hw,
779 struct ieee80211_tx_queue_stats *stats);
780
781 @@ -713,12 +715,25 @@
782 * Must be atomic. */
783 u64 (*get_tsf)(struct ieee80211_hw *hw);
784
785 + /* Call low level driver with 11n Block Ack action */
786 + int (*handle_ba_action)(struct ieee80211_hw *hw,
787 + struct ieee80211_mgmt *mgmt);
788 +
789 /* Reset the TSF timer and allow firmware/hardware to synchronize with
790 * other STAs in the IBSS. This is only used in IBSS mode. This
791 * function is optional if the firmware/hardware takes full care of
792 * TSF synchronization. */
793 void (*reset_tsf)(struct ieee80211_hw *hw);
794
795 + /* Configure ht parameters. */
796 + int (*conf_ht)(struct ieee80211_hw *hw,
797 + struct ieee80211_ht_capability *ht_cap_param,
798 + struct ieee80211_ht_additional_info *ht_extra_param);
799 +
800 + /* Get ht capabilities from the device */
801 + void (*get_ht_capab)(struct ieee80211_hw *hw,
802 + struct ieee80211_ht_capability *ht_cap_param);
803 +
804 /* Setup beacon data for IBSS beacons. Unlike access point (Master),
805 * IBSS uses a fixed beacon frame which is configured using this
806 * function. This handler is required only for IBSS mode. */