2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 * Purpose: Handles the 802.11 management support functions
28 * vMgrEncodeBeacon - Encode the Beacon frame
29 * vMgrDecodeBeacon - Decode the Beacon frame
30 * vMgrEncodeIBSSATIM - Encode the IBSS ATIM frame
31 * vMgrDecodeIBSSATIM - Decode the IBSS ATIM frame
32 * vMgrEncodeDisassociation - Encode the Disassociation frame
33 * vMgrDecodeDisassociation - Decode the Disassociation frame
34 * vMgrEncodeAssocRequest - Encode the Association request frame
35 * vMgrDecodeAssocRequest - Decode the Association request frame
36 * vMgrEncodeAssocResponse - Encode the Association response frame
37 * vMgrDecodeAssocResponse - Decode the Association response frame
38 * vMgrEncodeReAssocRequest - Encode the ReAssociation request frame
39 * vMgrDecodeReAssocRequest - Decode the ReAssociation request frame
40 * vMgrEncodeProbeRequest - Encode the Probe request frame
41 * vMgrDecodeProbeRequest - Decode the Probe request frame
42 * vMgrEncodeProbeResponse - Encode the Probe response frame
43 * vMgrDecodeProbeResponse - Decode the Probe response frame
44 * vMgrEncodeAuthen - Encode the Authentication frame
45 * vMgrDecodeAuthen - Decode the Authentication frame
46 * vMgrEncodeDeauthen - Encode the DeAuthentication frame
47 * vMgrDecodeDeauthen - Decode the DeAuthentication frame
48 * vMgrEncodeReassocResponse - Encode the Reassociation response frame
49 * vMgrDecodeReassocResponse - Decode the Reassociation response frame
62 /*--------------------- Static Definitions -------------------------*/
64 /*--------------------- Static Classes ----------------------------*/
66 /*--------------------- Static Functions --------------------------*/
68 /*--------------------- Export Variables --------------------------*/
70 /*--------------------- Export Functions --------------------------*/
74 * Routine Description:
75 * Encode Beacon frame body offset
84 PWLAN_FR_BEACON pFrame
87 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
90 pFrame->pqwTimestamp = (__le64 *)
91 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
93 pFrame->pwBeaconInterval = (unsigned short *)
94 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
95 WLAN_BEACON_OFF_BCN_INT);
96 pFrame->pwCapInfo = (unsigned short *)
97 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
98 WLAN_BEACON_OFF_CAPINFO);
100 pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_BEACON_OFF_SSID;
105 * Routine Description:
106 * Decode Beacon frame body offset
116 PWLAN_FR_BEACON pFrame
121 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
124 pFrame->pqwTimestamp = (__le64 *)
125 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
127 pFrame->pwBeaconInterval = (unsigned short *)
128 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
129 WLAN_BEACON_OFF_BCN_INT);
130 pFrame->pwCapInfo = (unsigned short *)
131 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
132 WLAN_BEACON_OFF_CAPINFO);
134 /* Information elements */
135 pItem = (PWLAN_IE)((unsigned char *)
136 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))) +
137 WLAN_BEACON_OFF_SSID);
138 while (((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) {
139 switch (pItem->byElementID) {
141 if (pFrame->pSSID == NULL)
142 pFrame->pSSID = (PWLAN_IE_SSID)pItem;
144 case WLAN_EID_SUPP_RATES:
145 if (pFrame->pSuppRates == NULL)
146 pFrame->pSuppRates = (PWLAN_IE_SUPP_RATES)pItem;
148 case WLAN_EID_FH_PARMS:
149 /* pFrame->pFHParms = (PWLAN_IE_FH_PARMS)pItem; */
151 case WLAN_EID_DS_PARMS:
152 if (pFrame->pDSParms == NULL)
153 pFrame->pDSParms = (PWLAN_IE_DS_PARMS)pItem;
155 case WLAN_EID_CF_PARMS:
156 if (pFrame->pCFParms == NULL)
157 pFrame->pCFParms = (PWLAN_IE_CF_PARMS)pItem;
159 case WLAN_EID_IBSS_PARMS:
160 if (pFrame->pIBSSParms == NULL)
161 pFrame->pIBSSParms = (PWLAN_IE_IBSS_PARMS)pItem;
164 if (pFrame->pTIM == NULL)
165 pFrame->pTIM = (PWLAN_IE_TIM)pItem;
169 if (pFrame->pRSN == NULL)
170 pFrame->pRSN = (PWLAN_IE_RSN)pItem;
172 case WLAN_EID_RSN_WPA:
173 if (pFrame->pRSNWPA == NULL) {
174 if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == true)
176 (PWLAN_IE_RSN_EXT)pItem;
181 if (pFrame->pERP == NULL)
182 pFrame->pERP = (PWLAN_IE_ERP)pItem;
184 case WLAN_EID_EXTSUPP_RATES:
185 if (pFrame->pExtSuppRates == NULL)
186 pFrame->pExtSuppRates =
187 (PWLAN_IE_SUPP_RATES)pItem;
190 case WLAN_EID_COUNTRY: /* 7 */
191 if (pFrame->pIE_Country == NULL)
192 pFrame->pIE_Country = (PWLAN_IE_COUNTRY)pItem;
195 case WLAN_EID_PWR_CONSTRAINT: /* 32 */
196 if (pFrame->pIE_PowerConstraint == NULL)
197 pFrame->pIE_PowerConstraint =
198 (PWLAN_IE_PW_CONST)pItem;
201 case WLAN_EID_CH_SWITCH: /* 37 */
202 if (pFrame->pIE_CHSW == NULL)
203 pFrame->pIE_CHSW = (PWLAN_IE_CH_SW)pItem;
206 case WLAN_EID_QUIET: /* 40 */
207 if (pFrame->pIE_Quiet == NULL)
208 pFrame->pIE_Quiet = (PWLAN_IE_QUIET)pItem;
211 case WLAN_EID_IBSS_DFS:
212 if (pFrame->pIE_IBSSDFS == NULL)
213 pFrame->pIE_IBSSDFS = (PWLAN_IE_IBSS_DFS)pItem;
217 pr_debug("Unrecognized EID=%dd in beacon decode\n",
222 pItem = (PWLAN_IE)(((unsigned char *)pItem) + 2 + pItem->len);
228 * Routine Description:
239 PWLAN_FR_IBSSATIM pFrame
242 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
243 pFrame->len = WLAN_HDR_ADDR3_LEN;
248 * Routine Description:
259 PWLAN_FR_IBSSATIM pFrame
262 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
267 * Routine Description:
268 * Encode Disassociation
277 vMgrEncodeDisassociation(
278 PWLAN_FR_DISASSOC pFrame
281 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
284 pFrame->pwReason = (unsigned short *)
285 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
286 WLAN_DISASSOC_OFF_REASON);
287 pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_DISASSOC_OFF_REASON +
288 sizeof(*(pFrame->pwReason));
293 * Routine Description:
294 * Decode Disassociation
303 vMgrDecodeDisassociation(
304 PWLAN_FR_DISASSOC pFrame
307 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
310 pFrame->pwReason = (unsigned short *)
311 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
312 WLAN_DISASSOC_OFF_REASON);
317 * Routine Description:
318 * Encode Association Request
327 vMgrEncodeAssocRequest(
328 PWLAN_FR_ASSOCREQ pFrame
331 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
333 pFrame->pwCapInfo = (unsigned short *)
334 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
335 WLAN_ASSOCREQ_OFF_CAP_INFO);
336 pFrame->pwListenInterval = (unsigned short *)
337 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
338 WLAN_ASSOCREQ_OFF_LISTEN_INT);
339 pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_ASSOCREQ_OFF_LISTEN_INT +
340 sizeof(*(pFrame->pwListenInterval));
345 * Routine Description: (AP)
346 * Decode Association Request
355 vMgrDecodeAssocRequest(
356 PWLAN_FR_ASSOCREQ pFrame
361 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
363 pFrame->pwCapInfo = (unsigned short *)
364 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
365 WLAN_ASSOCREQ_OFF_CAP_INFO);
366 pFrame->pwListenInterval = (unsigned short *)
367 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
368 WLAN_ASSOCREQ_OFF_LISTEN_INT);
370 /* Information elements */
371 pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
372 + WLAN_ASSOCREQ_OFF_SSID);
374 while (((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) {
375 switch (pItem->byElementID) {
377 if (pFrame->pSSID == NULL)
378 pFrame->pSSID = (PWLAN_IE_SSID)pItem;
380 case WLAN_EID_SUPP_RATES:
381 if (pFrame->pSuppRates == NULL)
383 (PWLAN_IE_SUPP_RATES)pItem;
387 if (pFrame->pRSN == NULL)
388 pFrame->pRSN = (PWLAN_IE_RSN)pItem;
390 case WLAN_EID_RSN_WPA:
391 if (pFrame->pRSNWPA == NULL) {
392 if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == true)
394 (PWLAN_IE_RSN_EXT)pItem;
397 case WLAN_EID_EXTSUPP_RATES:
398 if (pFrame->pExtSuppRates == NULL)
399 pFrame->pExtSuppRates =
400 (PWLAN_IE_SUPP_RATES)pItem;
404 pr_debug("Unrecognized EID=%dd in assocreq decode\n",
408 pItem = (PWLAN_IE)(((unsigned char *)pItem) + 2 + pItem->len);
414 * Routine Description: (AP)
415 * Encode Association Response
424 vMgrEncodeAssocResponse(
425 PWLAN_FR_ASSOCRESP pFrame
428 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
431 pFrame->pwCapInfo = (unsigned short *)
432 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
433 WLAN_ASSOCRESP_OFF_CAP_INFO);
434 pFrame->pwStatus = (unsigned short *)
435 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
436 WLAN_ASSOCRESP_OFF_STATUS);
437 pFrame->pwAid = (unsigned short *)
438 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
439 WLAN_ASSOCRESP_OFF_AID);
440 pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_ASSOCRESP_OFF_AID +
441 sizeof(*(pFrame->pwAid));
446 * Routine Description:
447 * Decode Association Response
456 vMgrDecodeAssocResponse(
457 PWLAN_FR_ASSOCRESP pFrame
462 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
465 pFrame->pwCapInfo = (unsigned short *)
466 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
467 WLAN_ASSOCRESP_OFF_CAP_INFO);
468 pFrame->pwStatus = (unsigned short *)
469 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
470 WLAN_ASSOCRESP_OFF_STATUS);
471 pFrame->pwAid = (unsigned short *)
472 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
473 WLAN_ASSOCRESP_OFF_AID);
475 /* Information elements */
476 pFrame->pSuppRates = (PWLAN_IE_SUPP_RATES)
477 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
478 WLAN_ASSOCRESP_OFF_SUPP_RATES);
480 pItem = (PWLAN_IE)(pFrame->pSuppRates);
481 pItem = (PWLAN_IE)(((unsigned char *)pItem) + 2 + pItem->len);
483 if ((((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) &&
484 (pItem->byElementID == WLAN_EID_EXTSUPP_RATES)) {
485 pFrame->pExtSuppRates = (PWLAN_IE_SUPP_RATES)pItem;
486 pr_debug("pFrame->pExtSuppRates=[%p]\n", pItem);
488 pFrame->pExtSuppRates = NULL;
494 * Routine Description:
495 * Encode Reassociation Request
504 vMgrEncodeReassocRequest(
505 PWLAN_FR_REASSOCREQ pFrame
508 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
511 pFrame->pwCapInfo = (unsigned short *)
512 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
513 WLAN_REASSOCREQ_OFF_CAP_INFO);
514 pFrame->pwListenInterval = (unsigned short *)
515 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
516 WLAN_REASSOCREQ_OFF_LISTEN_INT);
517 pFrame->pAddrCurrAP = (PIEEE_ADDR)
518 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
519 WLAN_REASSOCREQ_OFF_CURR_AP);
520 pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_REASSOCREQ_OFF_CURR_AP +
521 sizeof(*(pFrame->pAddrCurrAP));
526 * Routine Description: (AP)
527 * Decode Reassociation Request
536 vMgrDecodeReassocRequest(
537 PWLAN_FR_REASSOCREQ pFrame
542 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
545 pFrame->pwCapInfo = (unsigned short *)
546 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
547 WLAN_REASSOCREQ_OFF_CAP_INFO);
548 pFrame->pwListenInterval = (unsigned short *)
549 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
550 WLAN_REASSOCREQ_OFF_LISTEN_INT);
551 pFrame->pAddrCurrAP = (PIEEE_ADDR)
552 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
553 WLAN_REASSOCREQ_OFF_CURR_AP);
555 /* Information elements */
556 pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
557 + WLAN_REASSOCREQ_OFF_SSID);
559 while (((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) {
560 switch (pItem->byElementID) {
562 if (pFrame->pSSID == NULL)
563 pFrame->pSSID = (PWLAN_IE_SSID)pItem;
565 case WLAN_EID_SUPP_RATES:
566 if (pFrame->pSuppRates == NULL)
568 (PWLAN_IE_SUPP_RATES)pItem;
572 if (pFrame->pRSN == NULL)
573 pFrame->pRSN = (PWLAN_IE_RSN)pItem;
575 case WLAN_EID_RSN_WPA:
576 if (pFrame->pRSNWPA == NULL) {
577 if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == true)
579 (PWLAN_IE_RSN_EXT)pItem;
583 case WLAN_EID_EXTSUPP_RATES:
584 if (pFrame->pExtSuppRates == NULL)
585 pFrame->pExtSuppRates =
586 (PWLAN_IE_SUPP_RATES)pItem;
589 pr_debug("Unrecognized EID=%dd in reassocreq decode\n",
593 pItem = (PWLAN_IE)(((unsigned char *)pItem) + 2 + pItem->len);
599 * Routine Description:
600 * Encode Probe Request
609 vMgrEncodeProbeRequest(
610 PWLAN_FR_PROBEREQ pFrame
613 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
614 pFrame->len = WLAN_HDR_ADDR3_LEN;
619 * Routine Description:
620 * Decode Probe Request
629 vMgrDecodeProbeRequest(
630 PWLAN_FR_PROBEREQ pFrame
635 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
637 /* Information elements */
638 pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)));
640 while (((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) {
641 switch (pItem->byElementID) {
643 if (pFrame->pSSID == NULL)
644 pFrame->pSSID = (PWLAN_IE_SSID)pItem;
647 case WLAN_EID_SUPP_RATES:
648 if (pFrame->pSuppRates == NULL)
650 (PWLAN_IE_SUPP_RATES)pItem;
653 case WLAN_EID_EXTSUPP_RATES:
654 if (pFrame->pExtSuppRates == NULL)
655 pFrame->pExtSuppRates =
656 (PWLAN_IE_SUPP_RATES)pItem;
660 pr_debug("Bad EID=%dd in probereq\n",
665 pItem = (PWLAN_IE)(((unsigned char *)pItem) + 2 + pItem->len);
671 * Routine Description:
672 * Encode Probe Response
681 vMgrEncodeProbeResponse(
682 PWLAN_FR_PROBERESP pFrame
685 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
688 pFrame->pqwTimestamp = (__le64 *)
689 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
690 WLAN_PROBERESP_OFF_TS);
691 pFrame->pwBeaconInterval = (unsigned short *)
692 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
693 WLAN_PROBERESP_OFF_BCN_INT);
694 pFrame->pwCapInfo = (unsigned short *)
695 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
696 WLAN_PROBERESP_OFF_CAP_INFO);
698 pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_PROBERESP_OFF_CAP_INFO +
699 sizeof(*(pFrame->pwCapInfo));
704 * Routine Description:
705 * Decode Probe Response
714 vMgrDecodeProbeResponse(
715 PWLAN_FR_PROBERESP pFrame
720 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
723 pFrame->pqwTimestamp = (__le64 *)
724 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
725 WLAN_PROBERESP_OFF_TS);
726 pFrame->pwBeaconInterval = (unsigned short *)
727 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
728 WLAN_PROBERESP_OFF_BCN_INT);
729 pFrame->pwCapInfo = (unsigned short *)
730 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
731 WLAN_PROBERESP_OFF_CAP_INFO);
733 /* Information elements */
734 pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
735 + WLAN_PROBERESP_OFF_SSID);
737 while (((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) {
738 switch (pItem->byElementID) {
740 if (pFrame->pSSID == NULL)
741 pFrame->pSSID = (PWLAN_IE_SSID)pItem;
743 case WLAN_EID_SUPP_RATES:
744 if (pFrame->pSuppRates == NULL)
746 (PWLAN_IE_SUPP_RATES)pItem;
748 case WLAN_EID_FH_PARMS:
750 case WLAN_EID_DS_PARMS:
751 if (pFrame->pDSParms == NULL)
752 pFrame->pDSParms = (PWLAN_IE_DS_PARMS)pItem;
754 case WLAN_EID_CF_PARMS:
755 if (pFrame->pCFParms == NULL)
756 pFrame->pCFParms = (PWLAN_IE_CF_PARMS)pItem;
758 case WLAN_EID_IBSS_PARMS:
759 if (pFrame->pIBSSParms == NULL)
761 (PWLAN_IE_IBSS_PARMS)pItem;
765 if (pFrame->pRSN == NULL)
766 pFrame->pRSN = (PWLAN_IE_RSN)pItem;
768 case WLAN_EID_RSN_WPA:
769 if (pFrame->pRSNWPA == NULL) {
770 if (WPAb_Is_RSN((PWLAN_IE_RSN_EXT)pItem) == true)
772 (PWLAN_IE_RSN_EXT)pItem;
776 if (pFrame->pERP == NULL)
777 pFrame->pERP = (PWLAN_IE_ERP)pItem;
779 case WLAN_EID_EXTSUPP_RATES:
780 if (pFrame->pExtSuppRates == NULL)
781 pFrame->pExtSuppRates =
782 (PWLAN_IE_SUPP_RATES)pItem;
785 case WLAN_EID_COUNTRY: /* 7 */
786 if (pFrame->pIE_Country == NULL)
787 pFrame->pIE_Country = (PWLAN_IE_COUNTRY)pItem;
790 case WLAN_EID_PWR_CONSTRAINT: /* 32 */
791 if (pFrame->pIE_PowerConstraint == NULL)
792 pFrame->pIE_PowerConstraint =
793 (PWLAN_IE_PW_CONST)pItem;
796 case WLAN_EID_CH_SWITCH: /* 37 */
797 if (pFrame->pIE_CHSW == NULL)
798 pFrame->pIE_CHSW = (PWLAN_IE_CH_SW)pItem;
801 case WLAN_EID_QUIET: /* 40 */
802 if (pFrame->pIE_Quiet == NULL)
803 pFrame->pIE_Quiet = (PWLAN_IE_QUIET)pItem;
806 case WLAN_EID_IBSS_DFS:
807 if (pFrame->pIE_IBSSDFS == NULL)
808 pFrame->pIE_IBSSDFS = (PWLAN_IE_IBSS_DFS)pItem;
812 pr_debug("Bad EID=%dd in proberesp\n",
817 pItem = (PWLAN_IE)(((unsigned char *)pItem) + 2 + pItem->len);
823 * Routine Description:
824 * Encode Authentication frame
834 PWLAN_FR_AUTHEN pFrame
837 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
840 pFrame->pwAuthAlgorithm = (unsigned short *)
841 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
842 WLAN_AUTHEN_OFF_AUTH_ALG);
843 pFrame->pwAuthSequence = (unsigned short *)
844 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
845 WLAN_AUTHEN_OFF_AUTH_SEQ);
846 pFrame->pwStatus = (unsigned short *)
847 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
848 WLAN_AUTHEN_OFF_STATUS);
849 pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_AUTHEN_OFF_STATUS +
850 sizeof(*(pFrame->pwStatus));
855 * Routine Description:
856 * Decode Authentication
866 PWLAN_FR_AUTHEN pFrame
871 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
874 pFrame->pwAuthAlgorithm = (unsigned short *)
875 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
876 WLAN_AUTHEN_OFF_AUTH_ALG);
877 pFrame->pwAuthSequence = (unsigned short *)
878 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
879 WLAN_AUTHEN_OFF_AUTH_SEQ);
880 pFrame->pwStatus = (unsigned short *)
881 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
882 WLAN_AUTHEN_OFF_STATUS);
884 /* Information elements */
885 pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
886 + WLAN_AUTHEN_OFF_CHALLENGE);
888 if (((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len) &&
889 pItem->byElementID == WLAN_EID_CHALLENGE)
890 pFrame->pChallenge = (PWLAN_IE_CHALLENGE)pItem;
895 * Routine Description:
896 * Encode Authentication
906 PWLAN_FR_DEAUTHEN pFrame
909 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
912 pFrame->pwReason = (unsigned short *)
913 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
914 WLAN_DEAUTHEN_OFF_REASON);
915 pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_DEAUTHEN_OFF_REASON +
916 sizeof(*(pFrame->pwReason));
921 * Routine Description:
922 * Decode Deauthentication
932 PWLAN_FR_DEAUTHEN pFrame
935 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
938 pFrame->pwReason = (unsigned short *)
939 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
940 WLAN_DEAUTHEN_OFF_REASON);
945 * Routine Description: (AP)
946 * Encode Reassociation Response
955 vMgrEncodeReassocResponse(
956 PWLAN_FR_REASSOCRESP pFrame
959 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
962 pFrame->pwCapInfo = (unsigned short *)
963 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
964 WLAN_REASSOCRESP_OFF_CAP_INFO);
965 pFrame->pwStatus = (unsigned short *)
966 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
967 WLAN_REASSOCRESP_OFF_STATUS);
968 pFrame->pwAid = (unsigned short *)
969 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
970 WLAN_REASSOCRESP_OFF_AID);
972 pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_REASSOCRESP_OFF_AID +
973 sizeof(*(pFrame->pwAid));
978 * Routine Description:
979 * Decode Reassociation Response
988 vMgrDecodeReassocResponse(
989 PWLAN_FR_REASSOCRESP pFrame
994 pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
997 pFrame->pwCapInfo = (unsigned short *)
998 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
999 WLAN_REASSOCRESP_OFF_CAP_INFO);
1000 pFrame->pwStatus = (unsigned short *)
1001 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
1002 WLAN_REASSOCRESP_OFF_STATUS);
1003 pFrame->pwAid = (unsigned short *)
1004 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
1005 WLAN_REASSOCRESP_OFF_AID);
1007 /* Information elements */
1008 pFrame->pSuppRates = (PWLAN_IE_SUPP_RATES)
1009 (WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) +
1010 WLAN_REASSOCRESP_OFF_SUPP_RATES);
1012 pItem = (PWLAN_IE)(pFrame->pSuppRates);
1013 pItem = (PWLAN_IE)(((unsigned char *)pItem) + 2 + pItem->len);
1015 if ((((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) &&
1016 (pItem->byElementID == WLAN_EID_EXTSUPP_RATES)) {
1017 pFrame->pExtSuppRates = (PWLAN_IE_SUPP_RATES)pItem;