00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 #ifndef _P80211TYPES_H
00058 #define _P80211TYPES_H
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 #ifndef _WLAN_COMPAT_H
00069 #include <wlan/wlan_compat.h>
00070 #endif
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081 #define P80211_TYPE_OCTETSTR 1
00082 #define P80211_TYPE_DISPLAYSTR 2
00083 #define P80211_TYPE_INT 4
00084 #define P80211_TYPE_ENUMINT 5
00085
00086
00087 #define P80211_TYPE_UNKDATA 6
00088
00089 #define P80211_TYPE_INTARRAY 7
00090 #define P80211_TYPE_BITARRAY 8
00091 #define P80211_TYPE_MACARRAY 9
00092
00093
00094
00095
00096
00097
00098 #define P80211_MIB_CAT_DOT11SMT 1
00099 #define P80211_MIB_CAT_DOT11MAC 2
00100 #define P80211_MIB_CAT_DOT11PHY 3
00101
00102 #define P80211SEC_DOT11SMT P80211_MIB_CAT_DOT11SMT
00103 #define P80211SEC_DOT11MAC P80211_MIB_CAT_DOT11MAC
00104 #define P80211SEC_DOT11PHY P80211_MIB_CAT_DOT11PHY
00105
00106
00107 #define P80211_MSG_CAT_DOT11REQ 1
00108 #define P80211_MSG_CAT_DOT11IND 2
00109
00110
00111 #define P80211SEC_DOT11REQ P80211_MSG_CAT_DOT11REQ
00112 #define P80211SEC_DOT11IND P80211_MSG_CAT_DOT11IND
00113
00114
00115
00116
00117
00118
00119
00120
00121 #define P80211DID_ACCESS_READ 0x10000000
00122 #define P80211DID_ACCESS_WRITE 0x08000000
00123 #define P80211DID_WRITEONLY 0x00000001
00124 #define P80211DID_READONLY 0x00000002
00125 #define P80211DID_READWRITE 0x00000003
00126 #define P80211DID_ISTABLE_FALSE 0
00127 #define P80211DID_ISTABLE_TRUE 1
00128
00129
00130
00131
00132
00133
00134
00135 #define P80211ENUM_BAD 0xffffffffUL
00136 #define P80211ENUM_BADSTR "P80211ENUM_BAD"
00137
00138 #define P80211ENUM_truth_false 0
00139 #define P80211ENUM_truth_true 1
00140 #define P80211ENUM_ifstate_disable 0
00141 #define P80211ENUM_ifstate_fwload 1
00142 #define P80211ENUM_ifstate_enable 2
00143 #define P80211ENUM_powermgmt_active 1
00144 #define P80211ENUM_powermgmt_powersave 2
00145 #define P80211ENUM_bsstype_infrastructure 1
00146 #define P80211ENUM_bsstype_independent 2
00147 #define P80211ENUM_bsstype_any 3
00148 #define P80211ENUM_authalg_opensystem 1
00149 #define P80211ENUM_authalg_sharedkey 2
00150 #define P80211ENUM_phytype_fhss 1
00151 #define P80211ENUM_phytype_dsss 2
00152 #define P80211ENUM_phytype_irbaseband 3
00153 #define P80211ENUM_temptype_commercial 1
00154 #define P80211ENUM_temptype_industrial 2
00155 #define P80211ENUM_regdomain_fcc 16
00156 #define P80211ENUM_regdomain_doc 32
00157 #define P80211ENUM_regdomain_etsi 48
00158 #define P80211ENUM_regdomain_spain 49
00159 #define P80211ENUM_regdomain_france 50
00160 #define P80211ENUM_regdomain_mkk 64
00161 #define P80211ENUM_ccamode_edonly 1
00162 #define P80211ENUM_ccamode_csonly 2
00163 #define P80211ENUM_ccamode_edandcs 4
00164 #define P80211ENUM_ccamode_cswithtimer 8
00165 #define P80211ENUM_ccamode_hrcsanded 16
00166 #define P80211ENUM_diversity_fixedlist 1
00167 #define P80211ENUM_diversity_notsupported 2
00168 #define P80211ENUM_diversity_dynamic 3
00169 #define P80211ENUM_scantype_active 1
00170 #define P80211ENUM_scantype_passive 2
00171 #define P80211ENUM_scantype_both 3
00172 #define P80211ENUM_resultcode_success 1
00173 #define P80211ENUM_resultcode_invalid_parameters 2
00174 #define P80211ENUM_resultcode_not_supported 3
00175 #define P80211ENUM_resultcode_timeout 4
00176 #define P80211ENUM_resultcode_too_many_req 5
00177 #define P80211ENUM_resultcode_refused 6
00178 #define P80211ENUM_resultcode_bss_already 7
00179 #define P80211ENUM_resultcode_invalid_access 8
00180 #define P80211ENUM_resultcode_invalid_mibattribute 9
00181 #define P80211ENUM_resultcode_cant_set_readonly_mib 10
00182 #define P80211ENUM_resultcode_implementation_failure 11
00183 #define P80211ENUM_resultcode_cant_get_writeonly_mib 12
00184 #define P80211ENUM_reason_unspec_reason 1
00185 #define P80211ENUM_reason_auth_not_valid 2
00186 #define P80211ENUM_reason_deauth_lv_ss 3
00187 #define P80211ENUM_reason_inactivity 4
00188 #define P80211ENUM_reason_ap_overload 5
00189 #define P80211ENUM_reason_class23_err 6
00190 #define P80211ENUM_reason_class3_err 7
00191 #define P80211ENUM_reason_disas_lv_ss 8
00192 #define P80211ENUM_reason_asoc_not_auth 9
00193 #define P80211ENUM_status_successful 0
00194 #define P80211ENUM_status_unspec_failure 1
00195 #define P80211ENUM_status_unsup_cap 10
00196 #define P80211ENUM_status_reasoc_no_asoc 11
00197 #define P80211ENUM_status_fail_other 12
00198 #define P80211ENUM_status_unspt_alg 13
00199 #define P80211ENUM_status_auth_seq_fail 14
00200 #define P80211ENUM_status_chlng_fail 15
00201 #define P80211ENUM_status_auth_timeout 16
00202 #define P80211ENUM_status_ap_full 17
00203 #define P80211ENUM_status_unsup_rate 18
00204 #define P80211ENUM_status_unsup_shortpreamble 19
00205 #define P80211ENUM_status_unsup_pbcc 20
00206 #define P80211ENUM_status_unsup_agility 21
00207 #define P80211ENUM_msgitem_status_data_ok 0
00208 #define P80211ENUM_msgitem_status_no_value 1
00209 #define P80211ENUM_msgitem_status_invalid_itemname 2
00210 #define P80211ENUM_msgitem_status_invalid_itemdata 3
00211 #define P80211ENUM_msgitem_status_missing_itemdata 4
00212 #define P80211ENUM_msgitem_status_incomplete_itemdata 5
00213 #define P80211ENUM_msgitem_status_invalid_msg_did 6
00214 #define P80211ENUM_msgitem_status_invalid_mib_did 7
00215 #define P80211ENUM_msgitem_status_missing_conv_func 8
00216 #define P80211ENUM_msgitem_status_string_too_long 9
00217 #define P80211ENUM_msgitem_status_data_out_of_range 10
00218 #define P80211ENUM_msgitem_status_string_too_short 11
00219 #define P80211ENUM_msgitem_status_missing_valid_func 12
00220 #define P80211ENUM_msgitem_status_unknown 13
00221 #define P80211ENUM_msgitem_status_invalid_did 14
00222 #define P80211ENUM_msgitem_status_missing_print_func 15
00223
00224 #define P80211ENUM_lnxroam_reason_unknown 0
00225 #define P80211ENUM_lnxroam_reason_beacon 1
00226 #define P80211ENUM_lnxroam_reason_signal 2
00227 #define P80211ENUM_lnxroam_reason_txretry 3
00228 #define P80211ENUM_lnxroam_reason_notjoined 4
00229
00230 #define P80211ENUM_p2preamble_long 0
00231 #define P80211ENUM_p2preamble_short 2
00232 #define P80211ENUM_p2preamble_mixed 3
00233
00234
00235
00236
00237 #define MAXLEN_PSTR6 (6)
00238 #define MAXLEN_PSTR14 (14)
00239 #define MAXLEN_PSTR32 (32)
00240 #define MAXLEN_PSTR255 (255)
00241 #define MAXLEN_MIBATTRIBUTE (392)
00242
00243
00244
00245
00246 #define P80211_SET_INT(item, value) do { \
00247 (item).data = (value); \
00248 (item).status = P80211ENUM_msgitem_status_data_ok; \
00249 } while(0)
00250
00251
00252
00253 #define NOT_SET "NOT_SET"
00254 #define NOT_SUPPORTED "NOT_SUPPORTED"
00255 #define UNKNOWN_DATA "UNKNOWN_DATA"
00256
00257
00258
00259
00260
00261
00262
00263 #define ISREQUIRED (0x80000000UL)
00264 #define ISREQUEST (0x40000000UL)
00265 #define ISCONFIRM (0x20000000UL)
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280 #define P80211ITEM_SETFLAGS(q, r, c) ( q | r | c )
00281
00282 #define P80211ITEM_ISREQUIRED(flags) (((UINT32)(flags & ISREQUIRED)) >> 31 )
00283 #define P80211ITEM_ISREQUEST(flags) (((UINT32)(flags & ISREQUEST)) >> 30 )
00284 #define P80211ITEM_ISCONFIRM(flags) (((UINT32)(flags & ISCONFIRM)) >> 29 )
00285
00286
00287
00288
00289 #define MKENUMNAME(name) p80211enum_ ## name
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305 #define P80211DID_INVALID 0xffffffffUL
00306 #define P80211DID_VALID 0x00000000UL
00307
00308 #define P80211DID_LSB_SECTION (0)
00309 #define P80211DID_LSB_GROUP (6)
00310 #define P80211DID_LSB_ITEM (12)
00311 #define P80211DID_LSB_INDEX (18)
00312 #define P80211DID_LSB_ISTABLE (26)
00313 #define P80211DID_LSB_ACCESS (27)
00314
00315 #define P80211DID_MASK_SECTION (0x0000003fUL)
00316 #define P80211DID_MASK_GROUP (0x0000003fUL)
00317 #define P80211DID_MASK_ITEM (0x0000003fUL)
00318 #define P80211DID_MASK_INDEX (0x000000ffUL)
00319 #define P80211DID_MASK_ISTABLE (0x00000001UL)
00320 #define P80211DID_MASK_ACCESS (0x00000003UL)
00321
00322
00323 #define P80211DID_MK(a,m,l) ((((UINT32)(a)) & (m)) << (l))
00324
00325 #define P80211DID_MKSECTION(a) P80211DID_MK(a, \
00326 P80211DID_MASK_SECTION, \
00327 P80211DID_LSB_SECTION )
00328 #define P80211DID_MKGROUP(a) P80211DID_MK(a, \
00329 P80211DID_MASK_GROUP, \
00330 P80211DID_LSB_GROUP )
00331 #define P80211DID_MKITEM(a) P80211DID_MK(a, \
00332 P80211DID_MASK_ITEM, \
00333 P80211DID_LSB_ITEM )
00334 #define P80211DID_MKINDEX(a) P80211DID_MK(a, \
00335 P80211DID_MASK_INDEX, \
00336 P80211DID_LSB_INDEX )
00337 #define P80211DID_MKISTABLE(a) P80211DID_MK(a, \
00338 P80211DID_MASK_ISTABLE, \
00339 P80211DID_LSB_ISTABLE )
00340
00341
00342 #define P80211DID_MKID(s,g,i,n,t,a) (P80211DID_MKSECTION(s) | \
00343 P80211DID_MKGROUP(g) | \
00344 P80211DID_MKITEM(i) | \
00345 P80211DID_MKINDEX(n) | \
00346 P80211DID_MKISTABLE(t) | \
00347 (a) )
00348
00349
00350 #define P80211DID_GET(a,m,l) ((((UINT32)(a)) >> (l)) & (m))
00351
00352 #define P80211DID_SECTION(a) P80211DID_GET(a, \
00353 P80211DID_MASK_SECTION, \
00354 P80211DID_LSB_SECTION)
00355 #define P80211DID_GROUP(a) P80211DID_GET(a, \
00356 P80211DID_MASK_GROUP, \
00357 P80211DID_LSB_GROUP)
00358 #define P80211DID_ITEM(a) P80211DID_GET(a, \
00359 P80211DID_MASK_ITEM, \
00360 P80211DID_LSB_ITEM)
00361 #define P80211DID_INDEX(a) P80211DID_GET(a, \
00362 P80211DID_MASK_INDEX, \
00363 P80211DID_LSB_INDEX)
00364 #define P80211DID_ISTABLE(a) P80211DID_GET(a, \
00365 P80211DID_MASK_ISTABLE, \
00366 P80211DID_LSB_ISTABLE)
00367 #define P80211DID_ACCESS(a) P80211DID_GET(a, \
00368 P80211DID_MASK_ACCESS, \
00369 P80211DID_LSB_ACCESS)
00370
00371
00372
00373
00374
00375
00376
00377
00378 typedef struct p80211enumpair
00379 {
00380 UINT32 val;
00381 char *name;
00382 } p80211enumpair_t;
00383
00384 typedef struct p80211enum
00385 {
00386 INT nitems;
00387 p80211enumpair_t *list;
00388 } p80211enum_t;
00389
00390
00391
00392
00393
00394
00395 typedef struct p80211pstr
00396 {
00397 UINT8 len;
00398 } __WLAN_ATTRIB_PACK__ p80211pstr_t;
00399
00400 typedef struct p80211pstrd
00401 {
00402 UINT8 len;
00403 UINT8 data[0];
00404 } __WLAN_ATTRIB_PACK__ p80211pstrd_t;
00405
00406
00407 typedef struct p80211pstr255
00408 {
00409 UINT8 len;
00410 UINT8 data[MAXLEN_PSTR255];
00411 } __WLAN_ATTRIB_PACK__ p80211pstr255_t;
00412
00413
00414 typedef struct p80211pstr6
00415 {
00416 UINT8 len;
00417 UINT8 data[MAXLEN_PSTR6];
00418 } __WLAN_ATTRIB_PACK__ p80211pstr6_t;
00419
00420
00421 typedef struct p80211pstr14
00422 {
00423 UINT8 len;
00424 UINT8 data[MAXLEN_PSTR14];
00425 } __WLAN_ATTRIB_PACK__ p80211pstr14_t;
00426
00427
00428 typedef struct p80211pstr32
00429 {
00430 UINT8 len;
00431 UINT8 data[MAXLEN_PSTR32];
00432 } __WLAN_ATTRIB_PACK__ p80211pstr32_t;
00433
00434
00435 typedef struct p80211macarray
00436 {
00437 UINT32 cnt;
00438 UINT8 data[1][MAXLEN_PSTR6];
00439 } __WLAN_ATTRIB_PACK__ p80211macarray_t;
00440
00441
00442 typedef struct p80211item
00443 {
00444 UINT32 did;
00445 UINT16 status;
00446 UINT16 len;
00447 } __WLAN_ATTRIB_PACK__ p80211item_t;
00448
00449
00450 typedef struct p80211itemd
00451 {
00452 UINT32 did;
00453 UINT16 status;
00454 UINT16 len;
00455 UINT8 data[0];
00456 } __WLAN_ATTRIB_PACK__ p80211itemd_t;
00457
00458
00459 typedef struct p80211item_uint32
00460 {
00461 UINT32 did;
00462 UINT16 status;
00463 UINT16 len;
00464 UINT32 data;
00465 } __WLAN_ATTRIB_PACK__ p80211item_uint32_t;
00466
00467
00468 typedef struct p80211item_pstr6
00469 {
00470 UINT32 did;
00471 UINT16 status;
00472 UINT16 len;
00473 p80211pstr6_t data;
00474 } __WLAN_ATTRIB_PACK__ p80211item_pstr6_t;
00475
00476
00477 typedef struct p80211item_pstr14
00478 {
00479 UINT32 did;
00480 UINT16 status;
00481 UINT16 len;
00482 p80211pstr14_t data;
00483 } __WLAN_ATTRIB_PACK__ p80211item_pstr14_t;
00484
00485
00486 typedef struct p80211item_pstr32
00487 {
00488 UINT32 did;
00489 UINT16 status;
00490 UINT16 len;
00491 p80211pstr32_t data;
00492 } __WLAN_ATTRIB_PACK__ p80211item_pstr32_t;
00493
00494
00495 typedef struct p80211item_pstr255
00496 {
00497 UINT32 did;
00498 UINT16 status;
00499 UINT16 len;
00500 p80211pstr255_t data;
00501 } __WLAN_ATTRIB_PACK__ p80211item_pstr255_t;
00502
00503
00504 typedef struct p80211item_unk392
00505 {
00506 UINT32 did;
00507 UINT16 status;
00508 UINT16 len;
00509 UINT8 data[MAXLEN_MIBATTRIBUTE];
00510 } __WLAN_ATTRIB_PACK__ p80211item_unk392_t;
00511
00512
00513 typedef struct p80211item_unk1024
00514 {
00515 UINT32 did;
00516 UINT16 status;
00517 UINT16 len;
00518 UINT8 data[1024];
00519 } __WLAN_ATTRIB_PACK__ p80211item_unk1024_t;
00520
00521
00522 typedef struct p80211item_unk4096
00523 {
00524 UINT32 did;
00525 UINT16 status;
00526 UINT16 len;
00527 UINT8 data[4096];
00528 } __WLAN_ATTRIB_PACK__ p80211item_unk4096_t;
00529
00530 struct catlistitem;
00531
00532
00533
00534
00535
00536
00537 typedef void (*p80211_totext_t)( struct catlistitem *, UINT32 did, UINT8* itembuf, char *textbuf);
00538 typedef void (*p80211_fromtext_t)( struct catlistitem *, UINT32 did, UINT8* itembuf, char *textbuf);
00539 typedef UINT32 (*p80211_valid_t)( struct catlistitem *, UINT32 did, UINT8* itembuf);
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550 extern p80211enum_t MKENUMNAME(truth);
00551 extern p80211enum_t MKENUMNAME(ifstate);
00552 extern p80211enum_t MKENUMNAME(powermgmt);
00553 extern p80211enum_t MKENUMNAME(bsstype);
00554 extern p80211enum_t MKENUMNAME(authalg);
00555 extern p80211enum_t MKENUMNAME(phytype);
00556 extern p80211enum_t MKENUMNAME(temptype);
00557 extern p80211enum_t MKENUMNAME(regdomain);
00558 extern p80211enum_t MKENUMNAME(ccamode);
00559 extern p80211enum_t MKENUMNAME(diversity);
00560 extern p80211enum_t MKENUMNAME(scantype);
00561 extern p80211enum_t MKENUMNAME(resultcode);
00562 extern p80211enum_t MKENUMNAME(reason);
00563 extern p80211enum_t MKENUMNAME(status);
00564 extern p80211enum_t MKENUMNAME(msgcode);
00565 extern p80211enum_t MKENUMNAME(msgitem_status);
00566
00567 extern p80211enum_t MKENUMNAME(lnxroam_reason);
00568
00569 extern p80211enum_t MKENUMNAME(p2preamble);
00570
00571
00572
00573
00574
00575
00576
00577
00578 UINT32 p80211enum_text2int(p80211enum_t *ep, char *text);
00579 UINT32 p80211enum_int2text(p80211enum_t *ep, UINT32 val, char *text);
00580 void p80211_error2text(int err_code, char *err_str);
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594 void p80211_totext_displaystr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00595
00596
00597 void p80211_fromtext_displaystr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00598
00599
00600 UINT32 p80211_isvalid_displaystr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
00601
00602
00603
00604 void p80211_totext_octetstr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00605
00606
00607 void p80211_fromtext_octetstr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00608
00609
00610 UINT32 p80211_isvalid_octetstr( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
00611
00612
00613
00614 void p80211_totext_int( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00615
00616
00617 void p80211_fromtext_int( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00618
00619
00620 UINT32 p80211_isvalid_int( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
00621
00622
00623
00624 void p80211_totext_enumint( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00625
00626
00627 void p80211_fromtext_enumint( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00628
00629
00630 UINT32 p80211_isvalid_enumint( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
00631
00632
00633
00634 void p80211_totext_intarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00635
00636
00637 void p80211_fromtext_intarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00638
00639
00640 UINT32 p80211_isvalid_intarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
00641
00642
00643
00644 void p80211_totext_bitarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00645
00646
00647 void p80211_fromtext_bitarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00648
00649
00650 UINT32 p80211_isvalid_bitarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
00651
00652
00653 void p80211_totext_macarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00654
00655 void p80211_fromtext_macarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00656
00657
00658 UINT32 p80211_isvalid_macarray( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
00659
00660
00661
00662 void p80211_totext_getmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00663 void p80211_totext_setmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00664
00665
00666
00667 void p80211_fromtext_getmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00668 void p80211_fromtext_setmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf, char *textbuf );
00669
00670
00671 UINT32 p80211_isvalid_getmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
00672 UINT32 p80211_isvalid_setmibattribute( struct catlistitem *metalist, UINT32 did, UINT8 *itembuf );
00673
00674 #endif
00675