0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101 #ifndef _P80211MGMT_H
0102 #define _P80211MGMT_H
0103
0104 #ifndef _P80211HDR_H
0105 #include "p80211hdr.h"
0106 #endif
0107
0108
0109 #define WLAN_EID_SSID 0
0110 #define WLAN_EID_SUPP_RATES 1
0111 #define WLAN_EID_FH_PARMS 2
0112 #define WLAN_EID_DS_PARMS 3
0113 #define WLAN_EID_CF_PARMS 4
0114 #define WLAN_EID_TIM 5
0115 #define WLAN_EID_IBSS_PARMS 6
0116
0117 #define WLAN_EID_CHALLENGE 16
0118
0119
0120
0121
0122 #define WLAN_MGMT_REASON_RSVD 0
0123 #define WLAN_MGMT_REASON_UNSPEC 1
0124 #define WLAN_MGMT_REASON_PRIOR_AUTH_INVALID 2
0125 #define WLAN_MGMT_REASON_DEAUTH_LEAVING 3
0126 #define WLAN_MGMT_REASON_DISASSOC_INACTIVE 4
0127 #define WLAN_MGMT_REASON_DISASSOC_AP_BUSY 5
0128 #define WLAN_MGMT_REASON_CLASS2_NONAUTH 6
0129 #define WLAN_MGMT_REASON_CLASS3_NONASSOC 7
0130 #define WLAN_MGMT_REASON_DISASSOC_STA_HASLEFT 8
0131 #define WLAN_MGMT_REASON_CANT_ASSOC_NONAUTH 9
0132
0133
0134 #define WLAN_MGMT_STATUS_SUCCESS 0
0135 #define WLAN_MGMT_STATUS_UNSPEC_FAILURE 1
0136 #define WLAN_MGMT_STATUS_CAPS_UNSUPPORTED 10
0137 #define WLAN_MGMT_STATUS_REASSOC_NO_ASSOC 11
0138 #define WLAN_MGMT_STATUS_ASSOC_DENIED_UNSPEC 12
0139 #define WLAN_MGMT_STATUS_UNSUPPORTED_AUTHALG 13
0140 #define WLAN_MGMT_STATUS_RX_AUTH_NOSEQ 14
0141 #define WLAN_MGMT_STATUS_CHALLENGE_FAIL 15
0142 #define WLAN_MGMT_STATUS_AUTH_TIMEOUT 16
0143 #define WLAN_MGMT_STATUS_ASSOC_DENIED_BUSY 17
0144 #define WLAN_MGMT_STATUS_ASSOC_DENIED_RATES 18
0145
0146 #define WLAN_MGMT_STATUS_ASSOC_DENIED_NOSHORT 19
0147 #define WLAN_MGMT_STATUS_ASSOC_DENIED_NOPBCC 20
0148 #define WLAN_MGMT_STATUS_ASSOC_DENIED_NOAGILITY 21
0149
0150
0151 #define WLAN_AUTH_ALG_OPENSYSTEM 0
0152 #define WLAN_AUTH_ALG_SHAREDKEY 1
0153
0154
0155
0156
0157
0158
0159 #define WLAN_BEACON_OFF_TS 0
0160 #define WLAN_BEACON_OFF_BCN_int 8
0161 #define WLAN_BEACON_OFF_CAPINFO 10
0162 #define WLAN_BEACON_OFF_SSID 12
0163
0164 #define WLAN_DISASSOC_OFF_REASON 0
0165
0166 #define WLAN_ASSOCREQ_OFF_CAP_INFO 0
0167 #define WLAN_ASSOCREQ_OFF_LISTEN_int 2
0168 #define WLAN_ASSOCREQ_OFF_SSID 4
0169
0170 #define WLAN_ASSOCRESP_OFF_CAP_INFO 0
0171 #define WLAN_ASSOCRESP_OFF_STATUS 2
0172 #define WLAN_ASSOCRESP_OFF_AID 4
0173 #define WLAN_ASSOCRESP_OFF_SUPP_RATES 6
0174
0175 #define WLAN_REASSOCREQ_OFF_CAP_INFO 0
0176 #define WLAN_REASSOCREQ_OFF_LISTEN_int 2
0177 #define WLAN_REASSOCREQ_OFF_CURR_AP 4
0178 #define WLAN_REASSOCREQ_OFF_SSID 10
0179
0180 #define WLAN_REASSOCRESP_OFF_CAP_INFO 0
0181 #define WLAN_REASSOCRESP_OFF_STATUS 2
0182 #define WLAN_REASSOCRESP_OFF_AID 4
0183 #define WLAN_REASSOCRESP_OFF_SUPP_RATES 6
0184
0185 #define WLAN_PROBEREQ_OFF_SSID 0
0186
0187 #define WLAN_PROBERESP_OFF_TS 0
0188 #define WLAN_PROBERESP_OFF_BCN_int 8
0189 #define WLAN_PROBERESP_OFF_CAP_INFO 10
0190 #define WLAN_PROBERESP_OFF_SSID 12
0191
0192 #define WLAN_AUTHEN_OFF_AUTH_ALG 0
0193 #define WLAN_AUTHEN_OFF_AUTH_SEQ 2
0194 #define WLAN_AUTHEN_OFF_STATUS 4
0195 #define WLAN_AUTHEN_OFF_CHALLENGE 6
0196
0197 #define WLAN_DEAUTHEN_OFF_REASON 0
0198
0199
0200 #define WLAN_GET_MGMT_CAP_INFO_ESS(n) ((n) & BIT(0))
0201 #define WLAN_GET_MGMT_CAP_INFO_IBSS(n) (((n) & BIT(1)) >> 1)
0202 #define WLAN_GET_MGMT_CAP_INFO_CFPOLLABLE(n) (((n) & BIT(2)) >> 2)
0203 #define WLAN_GET_MGMT_CAP_INFO_CFPOLLREQ(n) (((n) & BIT(3)) >> 3)
0204 #define WLAN_GET_MGMT_CAP_INFO_PRIVACY(n) (((n) & BIT(4)) >> 4)
0205
0206 #define WLAN_GET_MGMT_CAP_INFO_SHORT(n) (((n) & BIT(5)) >> 5)
0207 #define WLAN_GET_MGMT_CAP_INFO_PBCC(n) (((n) & BIT(6)) >> 6)
0208 #define WLAN_GET_MGMT_CAP_INFO_AGILITY(n) (((n) & BIT(7)) >> 7)
0209
0210 #define WLAN_SET_MGMT_CAP_INFO_ESS(n) (n)
0211 #define WLAN_SET_MGMT_CAP_INFO_IBSS(n) ((n) << 1)
0212 #define WLAN_SET_MGMT_CAP_INFO_CFPOLLABLE(n) ((n) << 2)
0213 #define WLAN_SET_MGMT_CAP_INFO_CFPOLLREQ(n) ((n) << 3)
0214 #define WLAN_SET_MGMT_CAP_INFO_PRIVACY(n) ((n) << 4)
0215
0216 #define WLAN_SET_MGMT_CAP_INFO_SHORT(n) ((n) << 5)
0217 #define WLAN_SET_MGMT_CAP_INFO_PBCC(n) ((n) << 6)
0218 #define WLAN_SET_MGMT_CAP_INFO_AGILITY(n) ((n) << 7)
0219
0220
0221
0222
0223 struct wlan_ie {
0224 u8 eid;
0225 u8 len;
0226 } __packed;
0227
0228
0229 struct wlan_ie_ssid {
0230 u8 eid;
0231 u8 len;
0232 u8 ssid[1];
0233 } __packed;
0234
0235
0236 struct wlan_ie_supp_rates {
0237 u8 eid;
0238 u8 len;
0239 u8 rates[1];
0240 } __packed;
0241
0242
0243 struct wlan_ie_fh_parms {
0244 u8 eid;
0245 u8 len;
0246 u16 dwell;
0247 u8 hopset;
0248 u8 hoppattern;
0249 u8 hopindex;
0250 } __packed;
0251
0252
0253 struct wlan_ie_ds_parms {
0254 u8 eid;
0255 u8 len;
0256 u8 curr_ch;
0257 } __packed;
0258
0259
0260
0261 struct wlan_ie_cf_parms {
0262 u8 eid;
0263 u8 len;
0264 u8 cfp_cnt;
0265 u8 cfp_period;
0266 u16 cfp_maxdur;
0267 u16 cfp_durremaining;
0268 } __packed;
0269
0270
0271 struct wlan_ie_tim {
0272 u8 eid;
0273 u8 len;
0274 u8 dtim_cnt;
0275 u8 dtim_period;
0276 u8 bitmap_ctl;
0277 u8 virt_bm[1];
0278 } __packed;
0279
0280
0281 struct wlan_ie_ibss_parms {
0282 u8 eid;
0283 u8 len;
0284 u16 atim_win;
0285 } __packed;
0286
0287
0288 struct wlan_ie_challenge {
0289 u8 eid;
0290 u8 len;
0291 u8 challenge[1];
0292 } __packed;
0293
0294
0295
0296
0297
0298 struct wlan_fr_mgmt {
0299 u16 type;
0300 u16 len;
0301 u8 *buf;
0302 struct p80211_hdr *hdr;
0303
0304 void *priv;
0305
0306
0307 };
0308
0309
0310 struct wlan_fr_beacon {
0311 u16 type;
0312 u16 len;
0313 u8 *buf;
0314 struct p80211_hdr *hdr;
0315
0316 void *priv;
0317
0318 u64 *ts;
0319 u16 *bcn_int;
0320 u16 *cap_info;
0321
0322 struct wlan_ie_ssid *ssid;
0323 struct wlan_ie_supp_rates *supp_rates;
0324 struct wlan_ie_fh_parms *fh_parms;
0325 struct wlan_ie_ds_parms *ds_parms;
0326 struct wlan_ie_cf_parms *cf_parms;
0327 struct wlan_ie_ibss_parms *ibss_parms;
0328 struct wlan_ie_tim *tim;
0329
0330 };
0331
0332
0333 struct wlan_fr_ibssatim {
0334 u16 type;
0335 u16 len;
0336 u8 *buf;
0337 struct p80211_hdr *hdr;
0338
0339 void *priv;
0340
0341
0342
0343
0344
0345
0346 };
0347
0348
0349 struct wlan_fr_disassoc {
0350 u16 type;
0351 u16 len;
0352 u8 *buf;
0353 struct p80211_hdr *hdr;
0354
0355 void *priv;
0356
0357 u16 *reason;
0358
0359
0360
0361 };
0362
0363
0364 struct wlan_fr_assocreq {
0365 u16 type;
0366 u16 len;
0367 u8 *buf;
0368 struct p80211_hdr *hdr;
0369
0370 void *priv;
0371
0372 u16 *cap_info;
0373 u16 *listen_int;
0374
0375 struct wlan_ie_ssid *ssid;
0376 struct wlan_ie_supp_rates *supp_rates;
0377
0378 };
0379
0380
0381 struct wlan_fr_assocresp {
0382 u16 type;
0383 u16 len;
0384 u8 *buf;
0385 struct p80211_hdr *hdr;
0386
0387 void *priv;
0388
0389 u16 *cap_info;
0390 u16 *status;
0391 u16 *aid;
0392
0393 struct wlan_ie_supp_rates *supp_rates;
0394
0395 };
0396
0397
0398 struct wlan_fr_reassocreq {
0399 u16 type;
0400 u16 len;
0401 u8 *buf;
0402 struct p80211_hdr *hdr;
0403
0404 void *priv;
0405
0406 u16 *cap_info;
0407 u16 *listen_int;
0408 u8 *curr_ap;
0409
0410 struct wlan_ie_ssid *ssid;
0411 struct wlan_ie_supp_rates *supp_rates;
0412
0413 };
0414
0415
0416 struct wlan_fr_reassocresp {
0417 u16 type;
0418 u16 len;
0419 u8 *buf;
0420 struct p80211_hdr *hdr;
0421
0422 void *priv;
0423
0424 u16 *cap_info;
0425 u16 *status;
0426 u16 *aid;
0427
0428 struct wlan_ie_supp_rates *supp_rates;
0429
0430 };
0431
0432
0433 struct wlan_fr_probereq {
0434 u16 type;
0435 u16 len;
0436 u8 *buf;
0437 struct p80211_hdr *hdr;
0438
0439 void *priv;
0440
0441
0442 struct wlan_ie_ssid *ssid;
0443 struct wlan_ie_supp_rates *supp_rates;
0444
0445 };
0446
0447
0448 struct wlan_fr_proberesp {
0449 u16 type;
0450 u16 len;
0451 u8 *buf;
0452 struct p80211_hdr *hdr;
0453
0454 void *priv;
0455
0456 u64 *ts;
0457 u16 *bcn_int;
0458 u16 *cap_info;
0459
0460 struct wlan_ie_ssid *ssid;
0461 struct wlan_ie_supp_rates *supp_rates;
0462 struct wlan_ie_fh_parms *fh_parms;
0463 struct wlan_ie_ds_parms *ds_parms;
0464 struct wlan_ie_cf_parms *cf_parms;
0465 struct wlan_ie_ibss_parms *ibss_parms;
0466 };
0467
0468
0469 struct wlan_fr_authen {
0470 u16 type;
0471 u16 len;
0472 u8 *buf;
0473 struct p80211_hdr *hdr;
0474
0475 void *priv;
0476
0477 u16 *auth_alg;
0478 u16 *auth_seq;
0479 u16 *status;
0480
0481 struct wlan_ie_challenge *challenge;
0482
0483 };
0484
0485
0486 struct wlan_fr_deauthen {
0487 u16 type;
0488 u16 len;
0489 u8 *buf;
0490 struct p80211_hdr *hdr;
0491
0492 void *priv;
0493
0494 u16 *reason;
0495
0496
0497
0498 };
0499
0500 void wlan_mgmt_encode_beacon(struct wlan_fr_beacon *f);
0501 void wlan_mgmt_decode_beacon(struct wlan_fr_beacon *f);
0502 void wlan_mgmt_encode_disassoc(struct wlan_fr_disassoc *f);
0503 void wlan_mgmt_decode_disassoc(struct wlan_fr_disassoc *f);
0504 void wlan_mgmt_encode_assocreq(struct wlan_fr_assocreq *f);
0505 void wlan_mgmt_decode_assocreq(struct wlan_fr_assocreq *f);
0506 void wlan_mgmt_encode_assocresp(struct wlan_fr_assocresp *f);
0507 void wlan_mgmt_decode_assocresp(struct wlan_fr_assocresp *f);
0508 void wlan_mgmt_encode_reassocreq(struct wlan_fr_reassocreq *f);
0509 void wlan_mgmt_decode_reassocreq(struct wlan_fr_reassocreq *f);
0510 void wlan_mgmt_encode_reassocresp(struct wlan_fr_reassocresp *f);
0511 void wlan_mgmt_decode_reassocresp(struct wlan_fr_reassocresp *f);
0512 void wlan_mgmt_encode_probereq(struct wlan_fr_probereq *f);
0513 void wlan_mgmt_decode_probereq(struct wlan_fr_probereq *f);
0514 void wlan_mgmt_encode_proberesp(struct wlan_fr_proberesp *f);
0515 void wlan_mgmt_decode_proberesp(struct wlan_fr_proberesp *f);
0516 void wlan_mgmt_encode_authen(struct wlan_fr_authen *f);
0517 void wlan_mgmt_decode_authen(struct wlan_fr_authen *f);
0518 void wlan_mgmt_encode_deauthen(struct wlan_fr_deauthen *f);
0519 void wlan_mgmt_decode_deauthen(struct wlan_fr_deauthen *f);
0520
0521 #endif