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