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