diff options
author | Jiri Benc <jbenc@suse.cz> | 2005-08-25 20:13:04 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-25 20:13:04 -0400 |
commit | 95d5185d1ab6875b86a639310919dc48a716c7be (patch) | |
tree | 4e127ad70ce5de9a33d81c875e665c229e66000d | |
parent | f13baae43e97e84d3f06080908db75a017c62165 (diff) |
ieee80211: convert defines to enums
From: Gertjan van Wingerde <gwingerde@home.nl>
Attached patch cleans up the long lists of #defines for status codes,
reason codes, and information elements.
Signed-off-by: Gertjan van Wingerde <gwingerde@home.nl>
Signed-off-by: Jiri Benc <jbenc@suse.cz>
-rw-r--r-- | include/net/ieee80211.h | 168 |
1 files changed, 87 insertions, 81 deletions
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index 1feb3fb8914c..52248f101080 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -290,63 +290,67 @@ struct ieee80211_snap_hdr { | |||
290 | #define WLAN_CAPABILITY_OSSS_OFDM (1<<13) | 290 | #define WLAN_CAPABILITY_OSSS_OFDM (1<<13) |
291 | 291 | ||
292 | /* Status codes */ | 292 | /* Status codes */ |
293 | #define WLAN_STATUS_SUCCESS 0 | 293 | enum ieee80211_statuscode { |
294 | #define WLAN_STATUS_UNSPECIFIED_FAILURE 1 | 294 | WLAN_STATUS_SUCCESS = 0, |
295 | #define WLAN_STATUS_CAPS_UNSUPPORTED 10 | 295 | WLAN_STATUS_UNSPECIFIED_FAILURE = 1, |
296 | #define WLAN_STATUS_REASSOC_NO_ASSOC 11 | 296 | WLAN_STATUS_CAPS_UNSUPPORTED = 10, |
297 | #define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12 | 297 | WLAN_STATUS_REASSOC_NO_ASSOC = 11, |
298 | #define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13 | 298 | WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12, |
299 | #define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14 | 299 | WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13, |
300 | #define WLAN_STATUS_CHALLENGE_FAIL 15 | 300 | WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14, |
301 | #define WLAN_STATUS_AUTH_TIMEOUT 16 | 301 | WLAN_STATUS_CHALLENGE_FAIL = 15, |
302 | #define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17 | 302 | WLAN_STATUS_AUTH_TIMEOUT = 16, |
303 | #define WLAN_STATUS_ASSOC_DENIED_RATES 18 | 303 | WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17, |
304 | /* 802.11b */ | 304 | WLAN_STATUS_ASSOC_DENIED_RATES = 18, |
305 | #define WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE 19 | 305 | /* 802.11b */ |
306 | #define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20 | 306 | WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19, |
307 | #define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21 | 307 | WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20, |
308 | /* 802.11h */ | 308 | WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21, |
309 | #define WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM 22 | 309 | /* 802.11h */ |
310 | #define WLAN_STATUS_ASSOC_REJECTED_BAD_POWER 23 | 310 | WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22, |
311 | #define WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN 24 | 311 | WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23, |
312 | /* 802.11g */ | 312 | WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24, |
313 | #define WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME 25 | 313 | /* 802.11g */ |
314 | #define WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM 26 | 314 | WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25, |
315 | /* 802.11i */ | 315 | WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26, |
316 | #define WLAN_STATUS_INVALID_IE 40 | 316 | /* 802.11i */ |
317 | #define WLAN_STATUS_INVALID_GROUP_CIPHER 41 | 317 | WLAN_STATUS_INVALID_IE = 40, |
318 | #define WLAN_STATUS_INVALID_PAIRWISE_CIPHER 42 | 318 | WLAN_STATUS_INVALID_GROUP_CIPHER = 41, |
319 | #define WLAN_STATUS_INVALID_AKMP 43 | 319 | WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42, |
320 | #define WLAN_STATUS_UNSUPP_RSN_VERSION 44 | 320 | WLAN_STATUS_INVALID_AKMP = 43, |
321 | #define WLAN_STATUS_INVALID_RSN_IE_CAP 45 | 321 | WLAN_STATUS_UNSUPP_RSN_VERSION = 44, |
322 | #define WLAN_STATUS_CIPHER_SUITE_REJECTED 46 | 322 | WLAN_STATUS_INVALID_RSN_IE_CAP = 45, |
323 | WLAN_STATUS_CIPHER_SUITE_REJECTED = 46, | ||
324 | }; | ||
323 | 325 | ||
324 | /* Reason codes */ | 326 | /* Reason codes */ |
325 | #define WLAN_REASON_UNSPECIFIED 1 | 327 | enum ieee80211_reasoncode { |
326 | #define WLAN_REASON_PREV_AUTH_NOT_VALID 2 | 328 | WLAN_REASON_UNSPECIFIED = 1, |
327 | #define WLAN_REASON_DEAUTH_LEAVING 3 | 329 | WLAN_REASON_PREV_AUTH_NOT_VALID = 2, |
328 | #define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4 | 330 | WLAN_REASON_DEAUTH_LEAVING = 3, |
329 | #define WLAN_REASON_DISASSOC_AP_BUSY 5 | 331 | WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4, |
330 | #define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6 | 332 | WLAN_REASON_DISASSOC_AP_BUSY = 5, |
331 | #define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7 | 333 | WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6, |
332 | #define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8 | 334 | WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7, |
333 | #define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9 | 335 | WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8, |
334 | /* 802.11h */ | 336 | WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9, |
335 | #define WLAN_REASON_DISASSOC_BAD_POWER 10 | 337 | /* 802.11h */ |
336 | #define WLAN_REASON_DISASSOC_BAD_SUPP_CHAN 11 | 338 | WLAN_REASON_DISASSOC_BAD_POWER = 10, |
337 | /* 802.11i */ | 339 | WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11, |
338 | #define WLAN_REASON_INVALID_IE 13 | 340 | /* 802.11i */ |
339 | #define WLAN_REASON_MIC_FAILURE 14 | 341 | WLAN_REASON_INVALID_IE = 13, |
340 | #define WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT 15 | 342 | WLAN_REASON_MIC_FAILURE = 14, |
341 | #define WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT 16 | 343 | WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15, |
342 | #define WLAN_REASON_IE_DIFFERENT 17 | 344 | WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16, |
343 | #define WLAN_REASON_INVALID_GROUP_CIPHER 18 | 345 | WLAN_REASON_IE_DIFFERENT = 17, |
344 | #define WLAN_REASON_INVALID_PAIRWISE_CIPHER 19 | 346 | WLAN_REASON_INVALID_GROUP_CIPHER = 18, |
345 | #define WLAN_REASON_INVALID_AKMP 20 | 347 | WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19, |
346 | #define WLAN_REASON_UNSUPP_RSN_VERSION 21 | 348 | WLAN_REASON_INVALID_AKMP = 20, |
347 | #define WLAN_REASON_INVALID_RSN_IE_CAP 22 | 349 | WLAN_REASON_UNSUPP_RSN_VERSION = 21, |
348 | #define WLAN_REASON_IEEE8021X_FAILED 23 | 350 | WLAN_REASON_INVALID_RSN_IE_CAP = 22, |
349 | #define WLAN_REASON_CIPHER_SUITE_REJECTED 24 | 351 | WLAN_REASON_IEEE8021X_FAILED = 23, |
352 | WLAN_REASON_CIPHER_SUITE_REJECTED = 24, | ||
353 | }; | ||
350 | 354 | ||
351 | 355 | ||
352 | #define IEEE80211_STATMASK_SIGNAL (1<<0) | 356 | #define IEEE80211_STATMASK_SIGNAL (1<<0) |
@@ -525,32 +529,34 @@ Total: 28-2340 bytes | |||
525 | #define BEACON_PROBE_SSID_ID_POSITION 12 | 529 | #define BEACON_PROBE_SSID_ID_POSITION 12 |
526 | 530 | ||
527 | /* Management Frame Information Element Types */ | 531 | /* Management Frame Information Element Types */ |
528 | #define MFIE_TYPE_SSID 0 | 532 | enum ieee80211_mfie { |
529 | #define MFIE_TYPE_RATES 1 | 533 | MFIE_TYPE_SSID = 0, |
530 | #define MFIE_TYPE_FH_SET 2 | 534 | MFIE_TYPE_RATES = 1, |
531 | #define MFIE_TYPE_DS_SET 3 | 535 | MFIE_TYPE_FH_SET = 2, |
532 | #define MFIE_TYPE_CF_SET 4 | 536 | MFIE_TYPE_DS_SET = 3, |
533 | #define MFIE_TYPE_TIM 5 | 537 | MFIE_TYPE_CF_SET = 4, |
534 | #define MFIE_TYPE_IBSS_SET 6 | 538 | MFIE_TYPE_TIM = 5, |
535 | #define MFIE_TYPE_COUNTRY 7 | 539 | MFIE_TYPE_IBSS_SET = 6, |
536 | #define MFIE_TYPE_HOP_PARAMS 8 | 540 | MFIE_TYPE_COUNTRY = 7, |
537 | #define MFIE_TYPE_HOP_TABLE 9 | 541 | MFIE_TYPE_HOP_PARAMS = 8, |
538 | #define MFIE_TYPE_REQUEST 10 | 542 | MFIE_TYPE_HOP_TABLE = 9, |
539 | #define MFIE_TYPE_CHALLENGE 16 | 543 | MFIE_TYPE_REQUEST = 10, |
540 | #define MFIE_TYPE_POWER_CONSTRAINT 32 | 544 | MFIE_TYPE_CHALLENGE = 16, |
541 | #define MFIE_TYPE_POWER_CAPABILITY 33 | 545 | MFIE_TYPE_POWER_CONSTRAINT = 32, |
542 | #define MFIE_TYPE_TPC_REQUEST 34 | 546 | MFIE_TYPE_POWER_CAPABILITY = 33, |
543 | #define MFIE_TYPE_TPC_REPORT 35 | 547 | MFIE_TYPE_TPC_REQUEST = 34, |
544 | #define MFIE_TYPE_SUPP_CHANNELS 36 | 548 | MFIE_TYPE_TPC_REPORT = 35, |
545 | #define MFIE_TYPE_CSA 37 | 549 | MFIE_TYPE_SUPP_CHANNELS = 36, |
546 | #define MFIE_TYPE_MEASURE_REQUEST 38 | 550 | MFIE_TYPE_CSA = 37, |
547 | #define MFIE_TYPE_MEASURE_REPORT 39 | 551 | MFIE_TYPE_MEASURE_REQUEST = 38, |
548 | #define MFIE_TYPE_QUIET 40 | 552 | MFIE_TYPE_MEASURE_REPORT = 39, |
549 | #define MFIE_TYPE_IBSS_DFS 41 | 553 | MFIE_TYPE_QUIET = 40, |
550 | #define MFIE_TYPE_ERP_INFO 42 | 554 | MFIE_TYPE_IBSS_DFS = 41, |
551 | #define MFIE_TYPE_RSN 48 | 555 | MFIE_TYPE_ERP_INFO = 42, |
552 | #define MFIE_TYPE_RATES_EX 50 | 556 | MFIE_TYPE_RSN = 48, |
553 | #define MFIE_TYPE_GENERIC 221 | 557 | MFIE_TYPE_RATES_EX = 50, |
558 | MFIE_TYPE_GENERIC = 221, | ||
559 | }; | ||
554 | 560 | ||
555 | struct ieee80211_info_element_hdr { | 561 | struct ieee80211_info_element_hdr { |
556 | u8 id; | 562 | u8 id; |