Staging: rt28x0: fix comments in sta/*.c files
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
ec278fa259
commit
8281958ba7
@ -37,27 +37,27 @@
|
||||
#include "../rt_config.h"
|
||||
|
||||
UCHAR CipherWpaTemplate[] = {
|
||||
0xdd, // WPA IE
|
||||
0x16, // Length
|
||||
0x00, 0x50, 0xf2, 0x01, // oui
|
||||
0x01, 0x00, // Version
|
||||
0x00, 0x50, 0xf2, 0x02, // Multicast
|
||||
0x01, 0x00, // Number of unicast
|
||||
0x00, 0x50, 0xf2, 0x02, // unicast
|
||||
0x01, 0x00, // number of authentication method
|
||||
0x00, 0x50, 0xf2, 0x01 // authentication
|
||||
0xdd, /* WPA IE */
|
||||
0x16, /* Length */
|
||||
0x00, 0x50, 0xf2, 0x01, /* oui */
|
||||
0x01, 0x00, /* Version */
|
||||
0x00, 0x50, 0xf2, 0x02, /* Multicast */
|
||||
0x01, 0x00, /* Number of unicast */
|
||||
0x00, 0x50, 0xf2, 0x02, /* unicast */
|
||||
0x01, 0x00, /* number of authentication method */
|
||||
0x00, 0x50, 0xf2, 0x01 /* authentication */
|
||||
};
|
||||
|
||||
UCHAR CipherWpa2Template[] = {
|
||||
0x30, // RSN IE
|
||||
0x14, // Length
|
||||
0x01, 0x00, // Version
|
||||
0x00, 0x0f, 0xac, 0x02, // group cipher, TKIP
|
||||
0x01, 0x00, // number of pairwise
|
||||
0x00, 0x0f, 0xac, 0x02, // unicast
|
||||
0x01, 0x00, // number of authentication method
|
||||
0x00, 0x0f, 0xac, 0x02, // authentication
|
||||
0x00, 0x00, // RSN capability
|
||||
0x30, /* RSN IE */
|
||||
0x14, /* Length */
|
||||
0x01, 0x00, /* Version */
|
||||
0x00, 0x0f, 0xac, 0x02, /* group cipher, TKIP */
|
||||
0x01, 0x00, /* number of pairwise */
|
||||
0x00, 0x0f, 0xac, 0x02, /* unicast */
|
||||
0x01, 0x00, /* number of authentication method */
|
||||
0x00, 0x0f, 0xac, 0x02, /* authentication */
|
||||
0x00, 0x00, /* RSN capability */
|
||||
};
|
||||
|
||||
UCHAR Ccx2IeInfo[] = { 0x00, 0x40, 0x96, 0x03, 0x02 };
|
||||
@ -80,7 +80,7 @@ VOID AssocStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||
(STATE_MACHINE_FUNC) Drop, ASSOC_IDLE,
|
||||
ASSOC_MACHINE_BASE);
|
||||
|
||||
// first column
|
||||
/* first column */
|
||||
StateMachineSetAction(S, ASSOC_IDLE, MT2_MLME_ASSOC_REQ,
|
||||
(STATE_MACHINE_FUNC) MlmeAssocReqAction);
|
||||
StateMachineSetAction(S, ASSOC_IDLE, MT2_MLME_REASSOC_REQ,
|
||||
@ -90,7 +90,7 @@ VOID AssocStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||
StateMachineSetAction(S, ASSOC_IDLE, MT2_PEER_DISASSOC_REQ,
|
||||
(STATE_MACHINE_FUNC) PeerDisassocAction);
|
||||
|
||||
// second column
|
||||
/* second column */
|
||||
StateMachineSetAction(S, ASSOC_WAIT_RSP, MT2_MLME_ASSOC_REQ,
|
||||
(STATE_MACHINE_FUNC) InvalidStateWhenAssoc);
|
||||
StateMachineSetAction(S, ASSOC_WAIT_RSP, MT2_MLME_REASSOC_REQ,
|
||||
@ -102,16 +102,16 @@ VOID AssocStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||
(STATE_MACHINE_FUNC) PeerDisassocAction);
|
||||
StateMachineSetAction(S, ASSOC_WAIT_RSP, MT2_PEER_ASSOC_RSP,
|
||||
(STATE_MACHINE_FUNC) PeerAssocRspAction);
|
||||
//
|
||||
// Patch 3Com AP MOde:3CRWE454G72
|
||||
// We send Assoc request frame to this AP, it always send Reassoc Rsp not Associate Rsp.
|
||||
//
|
||||
/* */
|
||||
/* Patch 3Com AP MOde:3CRWE454G72 */
|
||||
/* We send Assoc request frame to this AP, it always send Reassoc Rsp not Associate Rsp. */
|
||||
/* */
|
||||
StateMachineSetAction(S, ASSOC_WAIT_RSP, MT2_PEER_REASSOC_RSP,
|
||||
(STATE_MACHINE_FUNC) PeerAssocRspAction);
|
||||
StateMachineSetAction(S, ASSOC_WAIT_RSP, MT2_ASSOC_TIMEOUT,
|
||||
(STATE_MACHINE_FUNC) AssocTimeoutAction);
|
||||
|
||||
// third column
|
||||
/* third column */
|
||||
StateMachineSetAction(S, REASSOC_WAIT_RSP, MT2_MLME_ASSOC_REQ,
|
||||
(STATE_MACHINE_FUNC) InvalidStateWhenAssoc);
|
||||
StateMachineSetAction(S, REASSOC_WAIT_RSP, MT2_MLME_REASSOC_REQ,
|
||||
@ -123,15 +123,15 @@ VOID AssocStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||
(STATE_MACHINE_FUNC) PeerDisassocAction);
|
||||
StateMachineSetAction(S, REASSOC_WAIT_RSP, MT2_PEER_REASSOC_RSP,
|
||||
(STATE_MACHINE_FUNC) PeerReassocRspAction);
|
||||
//
|
||||
// Patch, AP doesn't send Reassociate Rsp frame to Station.
|
||||
//
|
||||
/* */
|
||||
/* Patch, AP doesn't send Reassociate Rsp frame to Station. */
|
||||
/* */
|
||||
StateMachineSetAction(S, REASSOC_WAIT_RSP, MT2_PEER_ASSOC_RSP,
|
||||
(STATE_MACHINE_FUNC) PeerReassocRspAction);
|
||||
StateMachineSetAction(S, REASSOC_WAIT_RSP, MT2_REASSOC_TIMEOUT,
|
||||
(STATE_MACHINE_FUNC) ReassocTimeoutAction);
|
||||
|
||||
// fourth column
|
||||
/* fourth column */
|
||||
StateMachineSetAction(S, DISASSOC_WAIT_RSP, MT2_MLME_ASSOC_REQ,
|
||||
(STATE_MACHINE_FUNC) InvalidStateWhenAssoc);
|
||||
StateMachineSetAction(S, DISASSOC_WAIT_RSP, MT2_MLME_REASSOC_REQ,
|
||||
@ -144,7 +144,7 @@ VOID AssocStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||
StateMachineSetAction(S, DISASSOC_WAIT_RSP, MT2_DISASSOC_TIMEOUT,
|
||||
(STATE_MACHINE_FUNC) DisassocTimeoutAction);
|
||||
|
||||
// initialize the timer
|
||||
/* initialize the timer */
|
||||
RTMPInitTimer(pAd, &pAd->MlmeAux.AssocTimer,
|
||||
GET_TIMER_FUNCTION(AssocTimeout), pAd, FALSE);
|
||||
RTMPInitTimer(pAd, &pAd->MlmeAux.ReassocTimer,
|
||||
@ -171,8 +171,8 @@ VOID AssocTimeout(IN PVOID SystemSpecific1,
|
||||
{
|
||||
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
||||
|
||||
// Do nothing if the driver is starting halt state.
|
||||
// This might happen when timer already been fired before cancel timer with mlmehalt
|
||||
/* Do nothing if the driver is starting halt state. */
|
||||
/* This might happen when timer already been fired before cancel timer with mlmehalt */
|
||||
if (RTMP_TEST_FLAG
|
||||
(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
|
||||
return;
|
||||
@ -199,8 +199,8 @@ VOID ReassocTimeout(IN PVOID SystemSpecific1,
|
||||
{
|
||||
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
||||
|
||||
// Do nothing if the driver is starting halt state.
|
||||
// This might happen when timer already been fired before cancel timer with mlmehalt
|
||||
/* Do nothing if the driver is starting halt state. */
|
||||
/* This might happen when timer already been fired before cancel timer with mlmehalt */
|
||||
if (RTMP_TEST_FLAG
|
||||
(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
|
||||
return;
|
||||
@ -227,8 +227,8 @@ VOID DisassocTimeout(IN PVOID SystemSpecific1,
|
||||
{
|
||||
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
||||
|
||||
// Do nothing if the driver is starting halt state.
|
||||
// This might happen when timer already been fired before cancel timer with mlmehalt
|
||||
/* Do nothing if the driver is starting halt state. */
|
||||
/* This might happen when timer already been fired before cancel timer with mlmehalt */
|
||||
if (RTMP_TEST_FLAG
|
||||
(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
|
||||
return;
|
||||
@ -277,7 +277,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
USHORT VarIesOffset;
|
||||
USHORT Status;
|
||||
|
||||
// Block all authentication request durning WPA block period
|
||||
/* Block all authentication request durning WPA block period */
|
||||
if (pAd->StaCfg.bBlockAssoc == TRUE) {
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("ASSOC - Block Assoc request durning WPA block period!\n"));
|
||||
@ -286,14 +286,14 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_ASSOC_CONF, 2,
|
||||
&Status);
|
||||
}
|
||||
// check sanity first
|
||||
/* check sanity first */
|
||||
else if (MlmeAssocReqSanity
|
||||
(pAd, Elem->Msg, Elem->MsgLen, ApAddr, &CapabilityInfo,
|
||||
&Timeout, &ListenIntv)) {
|
||||
RTMPCancelTimer(&pAd->MlmeAux.AssocTimer, &TimerCancelled);
|
||||
COPY_MAC_ADDR(pAd->MlmeAux.Bssid, ApAddr);
|
||||
|
||||
// Get an unused nonpaged memory
|
||||
/* Get an unused nonpaged memory */
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);
|
||||
if (NStatus != NDIS_STATUS_SUCCESS) {
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
@ -304,10 +304,10 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
MT2_ASSOC_CONF, 2, &Status);
|
||||
return;
|
||||
}
|
||||
// Add by James 03/06/27
|
||||
/* Add by James 03/06/27 */
|
||||
pAd->StaCfg.AssocInfo.Length =
|
||||
sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
|
||||
// Association don't need to report MAC address
|
||||
/* Association don't need to report MAC address */
|
||||
pAd->StaCfg.AssocInfo.AvailableRequestFixedIEs =
|
||||
NDIS_802_11_AI_REQFI_CAPABILITIES |
|
||||
NDIS_802_11_AI_REQFI_LISTENINTERVAL;
|
||||
@ -315,13 +315,13 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
CapabilityInfo;
|
||||
pAd->StaCfg.AssocInfo.RequestFixedIEs.ListenInterval =
|
||||
ListenIntv;
|
||||
// Only reassociate need this
|
||||
//COPY_MAC_ADDR(pAd->StaCfg.AssocInfo.RequestFixedIEs.CurrentAPAddress, ApAddr);
|
||||
/* Only reassociate need this */
|
||||
/*COPY_MAC_ADDR(pAd->StaCfg.AssocInfo.RequestFixedIEs.CurrentAPAddress, ApAddr); */
|
||||
pAd->StaCfg.AssocInfo.OffsetRequestIEs =
|
||||
sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
|
||||
|
||||
NdisZeroMemory(pAd->StaCfg.ReqVarIEs, MAX_VIE_LEN);
|
||||
// First add SSID
|
||||
/* First add SSID */
|
||||
VarIesOffset = 0;
|
||||
NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, &SsidIe,
|
||||
1);
|
||||
@ -333,7 +333,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
|
||||
VarIesOffset += pAd->MlmeAux.SsidLen;
|
||||
|
||||
// Second add Supported rates
|
||||
/* Second add Supported rates */
|
||||
NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, &SupRateIe,
|
||||
1);
|
||||
VarIesOffset += 1;
|
||||
@ -343,7 +343,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset,
|
||||
pAd->MlmeAux.SupRate, pAd->MlmeAux.SupRateLen);
|
||||
VarIesOffset += pAd->MlmeAux.SupRateLen;
|
||||
// End Add by James
|
||||
/* End Add by James */
|
||||
|
||||
if ((pAd->CommonCfg.Channel > 14) &&
|
||||
(pAd->CommonCfg.bIEEE80211H == TRUE))
|
||||
@ -353,7 +353,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
MgtMacHeaderInit(pAd, &AssocHdr, SUBTYPE_ASSOC_REQ, 0, ApAddr,
|
||||
ApAddr);
|
||||
|
||||
// Build basic frame first
|
||||
/* Build basic frame first */
|
||||
MakeOutgoingFrame(pOutBuffer, &FrameLen,
|
||||
sizeof(HEADER_802_11), &AssocHdr,
|
||||
2, &CapabilityInfo,
|
||||
@ -374,7 +374,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
pAd->MlmeAux.ExtRate, END_OF_ARGS);
|
||||
FrameLen += tmp;
|
||||
}
|
||||
// HT
|
||||
/* HT */
|
||||
if ((pAd->MlmeAux.HtCapabilityLen > 0)
|
||||
&& (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) {
|
||||
ULONG TmpLen;
|
||||
@ -398,14 +398,14 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
}
|
||||
FrameLen += TmpLen;
|
||||
}
|
||||
// add Ralink proprietary IE to inform AP this STA is going to use AGGREGATION or PIGGY-BACK+AGGREGATION
|
||||
// Case I: (Aggregation + Piggy-Back)
|
||||
// 1. user enable aggregation, AND
|
||||
// 2. Mac support piggy-back
|
||||
// 3. AP annouces it's PIGGY-BACK+AGGREGATION-capable in BEACON
|
||||
// Case II: (Aggregation)
|
||||
// 1. user enable aggregation, AND
|
||||
// 2. AP annouces it's AGGREGATION-capable in BEACON
|
||||
/* add Ralink proprietary IE to inform AP this STA is going to use AGGREGATION or PIGGY-BACK+AGGREGATION */
|
||||
/* Case I: (Aggregation + Piggy-Back) */
|
||||
/* 1. user enable aggregation, AND */
|
||||
/* 2. Mac support piggy-back */
|
||||
/* 3. AP annouces it's PIGGY-BACK+AGGREGATION-capable in BEACON */
|
||||
/* Case II: (Aggregation) */
|
||||
/* 1. user enable aggregation, AND */
|
||||
/* 2. AP annouces it's AGGREGATION-capable in BEACON */
|
||||
if (pAd->CommonCfg.bAggregationCapable) {
|
||||
if ((pAd->CommonCfg.bPiggyBackCapable)
|
||||
&& ((pAd->MlmeAux.APRalinkIe & 0x00000003) == 3)) {
|
||||
@ -452,20 +452,20 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
pAd->CommonCfg.MaxSPLength;
|
||||
WmeIe[8] |= *(PUCHAR) & QosInfo;
|
||||
} else {
|
||||
// The Parameter Set Count is set to ¡§0¡¨ in the association request frames
|
||||
// WmeIe[8] |= (pAd->MlmeAux.APEdcaParm.EdcaUpdateCount & 0x0f);
|
||||
/* The Parameter Set Count is set to ¡§0¡¨ in the association request frames */
|
||||
/* WmeIe[8] |= (pAd->MlmeAux.APEdcaParm.EdcaUpdateCount & 0x0f); */
|
||||
}
|
||||
|
||||
MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
|
||||
9, &WmeIe[0], END_OF_ARGS);
|
||||
FrameLen += tmp;
|
||||
}
|
||||
//
|
||||
// Let WPA(#221) Element ID on the end of this association frame.
|
||||
// Otherwise some AP will fail on parsing Element ID and set status fail on Assoc Rsp.
|
||||
// For example: Put Vendor Specific IE on the front of WPA IE.
|
||||
// This happens on AP (Model No:Linksys WRK54G)
|
||||
//
|
||||
/* */
|
||||
/* Let WPA(#221) Element ID on the end of this association frame. */
|
||||
/* Otherwise some AP will fail on parsing Element ID and set status fail on Assoc Rsp. */
|
||||
/* For example: Put Vendor Specific IE on the front of WPA IE. */
|
||||
/* This happens on AP (Model No:Linksys WRK54G) */
|
||||
/* */
|
||||
if (((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) ||
|
||||
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK) ||
|
||||
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA) ||
|
||||
@ -486,11 +486,11 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode,
|
||||
pAd->StaCfg.WepStatus, BSS0);
|
||||
|
||||
// Check for WPA PMK cache list
|
||||
/* Check for WPA PMK cache list */
|
||||
if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) {
|
||||
INT idx;
|
||||
BOOLEAN FoundPMK = FALSE;
|
||||
// Search chched PMKID, append it if existed
|
||||
/* Search chched PMKID, append it if existed */
|
||||
for (idx = 0; idx < PMKID_NO; idx++) {
|
||||
if (NdisEqualMemory
|
||||
(ApAddr,
|
||||
@ -501,7 +501,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
}
|
||||
}
|
||||
if (FoundPMK) {
|
||||
// Set PMK number
|
||||
/* Set PMK number */
|
||||
*(PUSHORT) & pAd->StaCfg.RSN_IE[pAd->
|
||||
StaCfg.
|
||||
RSNIE_Len]
|
||||
@ -538,7 +538,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
WPA_SUPPLICANT_ENABLE)
|
||||
|| (pAd->StaCfg.bRSN_IE_FromWpaSupplicant ==
|
||||
FALSE)) {
|
||||
// Append Variable IE
|
||||
/* Append Variable IE */
|
||||
NdisMoveMemory(pAd->StaCfg.ReqVarIEs +
|
||||
VarIesOffset, &RSNIe, 1);
|
||||
VarIesOffset += 1;
|
||||
@ -552,7 +552,7 @@ VOID MlmeAssocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
pAd->StaCfg.RSNIE_Len);
|
||||
VarIesOffset += pAd->StaCfg.RSNIE_Len;
|
||||
|
||||
// Set Variable IEs Length
|
||||
/* Set Variable IEs Length */
|
||||
pAd->StaCfg.ReqVarIELen = VarIesOffset;
|
||||
}
|
||||
|
||||
@ -605,7 +605,7 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
PUCHAR pOutBuffer = NULL;
|
||||
USHORT Status;
|
||||
|
||||
// Block all authentication request durning WPA block period
|
||||
/* Block all authentication request durning WPA block period */
|
||||
if (pAd->StaCfg.bBlockAssoc == TRUE) {
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("ASSOC - Block ReAssoc request durning WPA block period!\n"));
|
||||
@ -614,13 +614,13 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_REASSOC_CONF, 2,
|
||||
&Status);
|
||||
}
|
||||
// the parameters are the same as the association
|
||||
/* the parameters are the same as the association */
|
||||
else if (MlmeAssocReqSanity
|
||||
(pAd, Elem->Msg, Elem->MsgLen, ApAddr, &CapabilityInfo,
|
||||
&Timeout, &ListenIntv)) {
|
||||
RTMPCancelTimer(&pAd->MlmeAux.ReassocTimer, &TimerCancelled);
|
||||
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
||||
if (NStatus != NDIS_STATUS_SUCCESS) {
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("ASSOC - MlmeReassocReqAction() allocate memory failed \n"));
|
||||
@ -633,7 +633,7 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
|
||||
COPY_MAC_ADDR(pAd->MlmeAux.Bssid, ApAddr);
|
||||
|
||||
// make frame, use bssid as the AP address??
|
||||
/* make frame, use bssid as the AP address?? */
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("ASSOC - Send RE-ASSOC request...\n"));
|
||||
MgtMacHeaderInit(pAd, &ReassocHdr, SUBTYPE_REASSOC_REQ, 0,
|
||||
@ -676,7 +676,7 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
9, &WmeIe[0], END_OF_ARGS);
|
||||
FrameLen += tmp;
|
||||
}
|
||||
// HT
|
||||
/* HT */
|
||||
if ((pAd->MlmeAux.HtCapabilityLen > 0)
|
||||
&& (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) {
|
||||
ULONG TmpLen;
|
||||
@ -700,14 +700,14 @@ VOID MlmeReassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
}
|
||||
FrameLen += TmpLen;
|
||||
}
|
||||
// add Ralink proprietary IE to inform AP this STA is going to use AGGREGATION or PIGGY-BACK+AGGREGATION
|
||||
// Case I: (Aggregation + Piggy-Back)
|
||||
// 1. user enable aggregation, AND
|
||||
// 2. Mac support piggy-back
|
||||
// 3. AP annouces it's PIGGY-BACK+AGGREGATION-capable in BEACON
|
||||
// Case II: (Aggregation)
|
||||
// 1. user enable aggregation, AND
|
||||
// 2. AP annouces it's AGGREGATION-capable in BEACON
|
||||
/* add Ralink proprietary IE to inform AP this STA is going to use AGGREGATION or PIGGY-BACK+AGGREGATION */
|
||||
/* Case I: (Aggregation + Piggy-Back) */
|
||||
/* 1. user enable aggregation, AND */
|
||||
/* 2. Mac support piggy-back */
|
||||
/* 3. AP annouces it's PIGGY-BACK+AGGREGATION-capable in BEACON */
|
||||
/* Case II: (Aggregation) */
|
||||
/* 1. user enable aggregation, AND */
|
||||
/* 2. AP annouces it's AGGREGATION-capable in BEACON */
|
||||
if (pAd->CommonCfg.bAggregationCapable) {
|
||||
if ((pAd->CommonCfg.bPiggyBackCapable)
|
||||
&& ((pAd->MlmeAux.APRalinkIe & 0x00000003) == 3)) {
|
||||
@ -777,10 +777,10 @@ VOID MlmeDisassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
ULONG Timeout = 500;
|
||||
USHORT Status;
|
||||
|
||||
// skip sanity check
|
||||
/* skip sanity check */
|
||||
pDisassocReq = (PMLME_DISASSOC_REQ_STRUCT) (Elem->Msg);
|
||||
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
||||
if (NStatus != NDIS_STATUS_SUCCESS) {
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("ASSOC - MlmeDisassocReqAction() allocate memory failed\n"));
|
||||
@ -799,15 +799,15 @@ VOID MlmeDisassocReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
pDisassocReq->Addr[2], pDisassocReq->Addr[3],
|
||||
pDisassocReq->Addr[4], pDisassocReq->Addr[5],
|
||||
pDisassocReq->Reason));
|
||||
MgtMacHeaderInit(pAd, &DisassocHdr, SUBTYPE_DISASSOC, 0, pDisassocReq->Addr, pDisassocReq->Addr); // patch peap ttls switching issue
|
||||
MgtMacHeaderInit(pAd, &DisassocHdr, SUBTYPE_DISASSOC, 0, pDisassocReq->Addr, pDisassocReq->Addr); /* patch peap ttls switching issue */
|
||||
MakeOutgoingFrame(pOutBuffer, &FrameLen,
|
||||
sizeof(HEADER_802_11), &DisassocHdr,
|
||||
2, &pDisassocReq->Reason, END_OF_ARGS);
|
||||
MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
|
||||
|
||||
// To patch Instance and Buffalo(N) AP
|
||||
// Driver has to send deauth to Instance AP, but Buffalo(N) needs to send disassoc to reset Authenticator's state machine
|
||||
// Therefore, we send both of them.
|
||||
/* To patch Instance and Buffalo(N) AP */
|
||||
/* Driver has to send deauth to Instance AP, but Buffalo(N) needs to send disassoc to reset Authenticator's state machine */
|
||||
/* Therefore, we send both of them. */
|
||||
pDisassocHdr = (PHEADER_802_11) pOutBuffer;
|
||||
pDisassocHdr->FC.SubType = SUBTYPE_DEAUTH;
|
||||
MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
|
||||
@ -845,7 +845,7 @@ VOID PeerAssocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
UCHAR CkipFlag;
|
||||
EDCA_PARM EdcaParm;
|
||||
HT_CAPABILITY_IE HtCapability;
|
||||
ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE
|
||||
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
||||
UCHAR HtCapabilityLen = 0;
|
||||
UCHAR AddHtInfoLen;
|
||||
UCHAR NewExtChannelOffset = 0xff;
|
||||
@ -855,7 +855,7 @@ VOID PeerAssocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
&Aid, SupRate, &SupRateLen, ExtRate, &ExtRateLen, &HtCapability,
|
||||
&AddHtInfo, &HtCapabilityLen, &AddHtInfoLen, &NewExtChannelOffset,
|
||||
&EdcaParm, &CkipFlag)) {
|
||||
// The frame is for me ?
|
||||
/* The frame is for me ? */
|
||||
if (MAC_ADDR_EQUAL(Addr2, pAd->MlmeAux.Bssid)) {
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("PeerAssocRspAction():ASSOC - receive ASSOC_RSP to me (status=%d)\n",
|
||||
@ -873,7 +873,7 @@ VOID PeerAssocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
UCHAR MaxSupportedRateIn500Kbps = 0;
|
||||
UCHAR idx;
|
||||
|
||||
// supported rates array may not be sorted. sort it and find the maximum rate
|
||||
/* supported rates array may not be sorted. sort it and find the maximum rate */
|
||||
for (idx = 0; idx < SupRateLen; idx++) {
|
||||
if (MaxSupportedRateIn500Kbps <
|
||||
(SupRate[idx] & 0x7f))
|
||||
@ -887,7 +887,7 @@ VOID PeerAssocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
MaxSupportedRateIn500Kbps =
|
||||
ExtRate[idx] & 0x7f;
|
||||
}
|
||||
// go to procedure listed on page 376
|
||||
/* go to procedure listed on page 376 */
|
||||
AssocPostProc(pAd, Addr2, CapabilityInfo, Aid,
|
||||
SupRate, SupRateLen, ExtRate,
|
||||
ExtRateLen, &EdcaParm,
|
||||
@ -936,7 +936,7 @@ VOID PeerReassocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
BOOLEAN TimerCancelled;
|
||||
EDCA_PARM EdcaParm;
|
||||
HT_CAPABILITY_IE HtCapability;
|
||||
ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE
|
||||
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
||||
UCHAR HtCapabilityLen;
|
||||
UCHAR AddHtInfoLen;
|
||||
UCHAR NewExtChannelOffset = 0xff;
|
||||
@ -946,7 +946,7 @@ VOID PeerReassocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
&Aid, SupRate, &SupRateLen, ExtRate, &ExtRateLen, &HtCapability,
|
||||
&AddHtInfo, &HtCapabilityLen, &AddHtInfoLen, &NewExtChannelOffset,
|
||||
&EdcaParm, &CkipFlag)) {
|
||||
if (MAC_ADDR_EQUAL(Addr2, pAd->MlmeAux.Bssid)) // The frame is for me ?
|
||||
if (MAC_ADDR_EQUAL(Addr2, pAd->MlmeAux.Bssid)) /* The frame is for me ? */
|
||||
{
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("ASSOC - receive REASSOC_RSP to me (status=%d)\n",
|
||||
@ -955,7 +955,7 @@ VOID PeerReassocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
&TimerCancelled);
|
||||
|
||||
if (Status == MLME_SUCCESS) {
|
||||
// go to procedure listed on page 376
|
||||
/* go to procedure listed on page 376 */
|
||||
AssocPostProc(pAd, Addr2, CapabilityInfo, Aid,
|
||||
SupRate, SupRateLen, ExtRate,
|
||||
ExtRateLen, &EdcaParm,
|
||||
@ -972,7 +972,7 @@ VOID PeerReassocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
}
|
||||
|
||||
}
|
||||
// CkipFlag is no use for reassociate
|
||||
/* CkipFlag is no use for reassociate */
|
||||
pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
|
||||
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE,
|
||||
MT2_REASSOC_CONF, 2, &Status);
|
||||
@ -994,7 +994,7 @@ VOID PeerReassocRspAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
|
||||
==========================================================================
|
||||
*/
|
||||
VOID AssocPostProc(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr2, IN USHORT CapabilityInfo, IN USHORT Aid, IN UCHAR SupRate[], IN UCHAR SupRateLen, IN UCHAR ExtRate[], IN UCHAR ExtRateLen, IN PEDCA_PARM pEdcaParm, IN HT_CAPABILITY_IE * pHtCapability, IN UCHAR HtCapabilityLen, IN ADD_HT_INFO_IE * pAddHtInfo) // AP might use this additional ht info IE
|
||||
VOID AssocPostProc(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr2, IN USHORT CapabilityInfo, IN USHORT Aid, IN UCHAR SupRate[], IN UCHAR SupRateLen, IN UCHAR ExtRate[], IN UCHAR ExtRateLen, IN PEDCA_PARM pEdcaParm, IN HT_CAPABILITY_IE * pHtCapability, IN UCHAR HtCapabilityLen, IN ADD_HT_INFO_IE * pAddHtInfo) /* AP might use this additional ht info IE */
|
||||
{
|
||||
ULONG Idx;
|
||||
|
||||
@ -1004,7 +1004,7 @@ VOID AssocPostProc(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr2, IN USHORT CapabilityI
|
||||
pAd->MlmeAux.CapabilityInfo =
|
||||
CapabilityInfo & SUPPORTED_CAPABILITY_INFO;
|
||||
|
||||
// Some HT AP might lost WMM IE. We add WMM ourselves. beacuase HT requires QoS on.
|
||||
/* Some HT AP might lost WMM IE. We add WMM ourselves. beacuase HT requires QoS on. */
|
||||
if ((HtCapabilityLen > 0) && (pEdcaParm->bValid == FALSE)) {
|
||||
pEdcaParm->bValid = TRUE;
|
||||
pEdcaParm->Aifsn[0] = 3;
|
||||
@ -1031,12 +1031,12 @@ VOID AssocPostProc(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr2, IN USHORT CapabilityI
|
||||
|
||||
NdisMoveMemory(&pAd->MlmeAux.APEdcaParm, pEdcaParm, sizeof(EDCA_PARM));
|
||||
|
||||
// filter out un-supported rates
|
||||
/* filter out un-supported rates */
|
||||
pAd->MlmeAux.SupRateLen = SupRateLen;
|
||||
NdisMoveMemory(pAd->MlmeAux.SupRate, SupRate, SupRateLen);
|
||||
RTMPCheckRates(pAd, pAd->MlmeAux.SupRate, &pAd->MlmeAux.SupRateLen);
|
||||
|
||||
// filter out un-supported rates
|
||||
/* filter out un-supported rates */
|
||||
pAd->MlmeAux.ExtRateLen = ExtRateLen;
|
||||
NdisMoveMemory(pAd->MlmeAux.ExtRate, ExtRate, ExtRateLen);
|
||||
RTMPCheckRates(pAd, pAd->MlmeAux.ExtRate, &pAd->MlmeAux.ExtRateLen);
|
||||
@ -1054,17 +1054,17 @@ VOID AssocPostProc(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr2, IN USHORT CapabilityI
|
||||
pAd->MacTab.Content[BSSID_WCID].MmpsMode,
|
||||
pAd->MacTab.Content[BSSID_WCID].AMsduSize));
|
||||
|
||||
// Set New WPA information
|
||||
/* Set New WPA information */
|
||||
Idx = BssTableSearch(&pAd->ScanTab, pAddr2, pAd->MlmeAux.Channel);
|
||||
if (Idx == BSS_NOT_FOUND) {
|
||||
DBGPRINT_ERR(("ASSOC - Can't find BSS after receiving Assoc response\n"));
|
||||
} else {
|
||||
// Init variable
|
||||
/* Init variable */
|
||||
pAd->MacTab.Content[BSSID_WCID].RSNIE_Len = 0;
|
||||
NdisZeroMemory(pAd->MacTab.Content[BSSID_WCID].RSN_IE,
|
||||
MAX_LEN_OF_RSNIE);
|
||||
|
||||
// Store appropriate RSN_IE for WPA SM negotiation later
|
||||
/* Store appropriate RSN_IE for WPA SM negotiation later */
|
||||
if ((pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
|
||||
&& (pAd->ScanTab.BssEntry[Idx].VarIELen != 0)) {
|
||||
PUCHAR pVIE;
|
||||
@ -1073,14 +1073,14 @@ VOID AssocPostProc(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr2, IN USHORT CapabilityI
|
||||
|
||||
pVIE = pAd->ScanTab.BssEntry[Idx].VarIEs;
|
||||
len = pAd->ScanTab.BssEntry[Idx].VarIELen;
|
||||
//KH need to check again
|
||||
// Don't allow to go to sleep mode if authmode is WPA-related.
|
||||
//This can make Authentication process more smoothly.
|
||||
/*KH need to check again */
|
||||
/* Don't allow to go to sleep mode if authmode is WPA-related. */
|
||||
/*This can make Authentication process more smoothly. */
|
||||
RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
|
||||
|
||||
while (len > 0) {
|
||||
pEid = (PEID_STRUCT) pVIE;
|
||||
// For WPA/WPAPSK
|
||||
/* For WPA/WPAPSK */
|
||||
if ((pEid->Eid == IE_WPA)
|
||||
&&
|
||||
(NdisEqualMemory(pEid->Octet, WPA_OUI, 4))
|
||||
@ -1097,7 +1097,7 @@ VOID AssocPostProc(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr2, IN USHORT CapabilityI
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("AssocPostProc===> Store RSN_IE for WPA SM negotiation \n"));
|
||||
}
|
||||
// For WPA2/WPA2PSK
|
||||
/* For WPA2/WPA2PSK */
|
||||
else if ((pEid->Eid == IE_RSN)
|
||||
&&
|
||||
(NdisEqualMemory
|
||||
@ -1292,21 +1292,21 @@ VOID Cls3errAction(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr)
|
||||
NDIS_STATUS NStatus;
|
||||
USHORT Reason = REASON_CLS3ERR;
|
||||
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
||||
if (NStatus != NDIS_STATUS_SUCCESS)
|
||||
return;
|
||||
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("ASSOC - Class 3 Error, Send DISASSOC frame\n"));
|
||||
MgtMacHeaderInit(pAd, &DisassocHdr, SUBTYPE_DISASSOC, 0, pAddr, pAd->CommonCfg.Bssid); // patch peap ttls switching issue
|
||||
MgtMacHeaderInit(pAd, &DisassocHdr, SUBTYPE_DISASSOC, 0, pAddr, pAd->CommonCfg.Bssid); /* patch peap ttls switching issue */
|
||||
MakeOutgoingFrame(pOutBuffer, &FrameLen,
|
||||
sizeof(HEADER_802_11), &DisassocHdr,
|
||||
2, &Reason, END_OF_ARGS);
|
||||
MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
|
||||
|
||||
// To patch Instance and Buffalo(N) AP
|
||||
// Driver has to send deauth to Instance AP, but Buffalo(N) needs to send disassoc to reset Authenticator's state machine
|
||||
// Therefore, we send both of them.
|
||||
/* To patch Instance and Buffalo(N) AP */
|
||||
/* Driver has to send deauth to Instance AP, but Buffalo(N) needs to send disassoc to reset Authenticator's state machine */
|
||||
/* Therefore, we send both of them. */
|
||||
pDisassocHdr = (PHEADER_802_11) pOutBuffer;
|
||||
pDisassocHdr->FC.SubType = SUBTYPE_DEAUTH;
|
||||
MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
|
||||
@ -1393,7 +1393,7 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd,
|
||||
&& (MaxSupportedRate < RATE_FIRST_OFDM_RATE))
|
||||
return FALSE;
|
||||
|
||||
// 11n only
|
||||
/* 11n only */
|
||||
if (((pAd->CommonCfg.PhyMode == PHY_11N_2_4G)
|
||||
|| (pAd->CommonCfg.PhyMode == PHY_11N_5G))
|
||||
&& (HtCapabilityLen == 0))
|
||||
@ -1445,10 +1445,10 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd,
|
||||
}
|
||||
|
||||
NdisZeroMemory(&pEntry->HTCapability, sizeof(pEntry->HTCapability));
|
||||
// If this Entry supports 802.11n, upgrade to HT rate.
|
||||
/* If this Entry supports 802.11n, upgrade to HT rate. */
|
||||
if ((HtCapabilityLen != 0)
|
||||
&& (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)) {
|
||||
UCHAR j, bitmask; //k,bitmask;
|
||||
UCHAR j, bitmask; /*k,bitmask; */
|
||||
CHAR i;
|
||||
|
||||
if (ADHOC_ON(pAd))
|
||||
@ -1484,14 +1484,14 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd,
|
||||
pAd->MacTab.fAnyStation20Only = TRUE;
|
||||
}
|
||||
|
||||
// 3*3
|
||||
/* 3*3 */
|
||||
if (pAd->MACVersion >= RALINK_2883_VERSION
|
||||
&& pAd->MACVersion < RALINK_3070_VERSION)
|
||||
pEntry->MaxHTPhyMode.field.TxBF =
|
||||
pAd->CommonCfg.RegTransmitSetting.field.TxBF;
|
||||
|
||||
// find max fixed rate
|
||||
for (i = 23; i >= 0; i--) // 3*3
|
||||
/* find max fixed rate */
|
||||
for (i = 23; i >= 0; i--) /* 3*3 */
|
||||
{
|
||||
j = i / 8;
|
||||
bitmask = (1 << (i - (j * 8)));
|
||||
@ -1506,7 +1506,7 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd,
|
||||
|
||||
if (pAd->StaCfg.DesiredTransmitSetting.field.MCS != MCS_AUTO) {
|
||||
if (pAd->StaCfg.DesiredTransmitSetting.field.MCS == 32) {
|
||||
// Fix MCS as HT Duplicated Mode
|
||||
/* Fix MCS as HT Duplicated Mode */
|
||||
pEntry->MaxHTPhyMode.field.BW = 1;
|
||||
pEntry->MaxHTPhyMode.field.MODE = MODE_HTMIX;
|
||||
pEntry->MaxHTPhyMode.field.STBC = 0;
|
||||
@ -1514,7 +1514,7 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd,
|
||||
pEntry->MaxHTPhyMode.field.MCS = 32;
|
||||
} else if (pEntry->MaxHTPhyMode.field.MCS >
|
||||
pAd->StaCfg.HTPhyMode.field.MCS) {
|
||||
// STA supports fixed MCS
|
||||
/* STA supports fixed MCS */
|
||||
pEntry->MaxHTPhyMode.field.MCS =
|
||||
pAd->StaCfg.HTPhyMode.field.MCS;
|
||||
}
|
||||
@ -1565,7 +1565,7 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd,
|
||||
pEntry->HTPhyMode.word = pEntry->MaxHTPhyMode.word;
|
||||
pEntry->CurrTxRate = pEntry->MaxSupportedRate;
|
||||
|
||||
// Set asic auto fall back
|
||||
/* Set asic auto fall back */
|
||||
if (pAd->StaCfg.bAutoTxRateSwitch == TRUE) {
|
||||
PUCHAR pTable;
|
||||
UCHAR TableSize = 0;
|
||||
@ -1578,7 +1578,7 @@ BOOLEAN StaAddMacTableEntry(IN PRTMP_ADAPTER pAd,
|
||||
pEntry->HTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
|
||||
pEntry->bAutoTxRateSwitch = FALSE;
|
||||
|
||||
// If the legacy mode is set, overwrite the transmit setting of this entry.
|
||||
/* If the legacy mode is set, overwrite the transmit setting of this entry. */
|
||||
RTMPUpdateLegacyTxSetting((UCHAR) pAd->StaCfg.
|
||||
DesiredTransmitSetting.field.
|
||||
FixedTxMode, pEntry);
|
||||
|
@ -62,11 +62,11 @@ void AuthStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||
(STATE_MACHINE_FUNC) Drop, AUTH_REQ_IDLE,
|
||||
AUTH_MACHINE_BASE);
|
||||
|
||||
// the first column
|
||||
/* the first column */
|
||||
StateMachineSetAction(Sm, AUTH_REQ_IDLE, MT2_MLME_AUTH_REQ,
|
||||
(STATE_MACHINE_FUNC) MlmeAuthReqAction);
|
||||
|
||||
// the second column
|
||||
/* the second column */
|
||||
StateMachineSetAction(Sm, AUTH_WAIT_SEQ2, MT2_MLME_AUTH_REQ,
|
||||
(STATE_MACHINE_FUNC) InvalidStateWhenAuth);
|
||||
StateMachineSetAction(Sm, AUTH_WAIT_SEQ2, MT2_PEER_AUTH_EVEN,
|
||||
@ -74,7 +74,7 @@ void AuthStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||
StateMachineSetAction(Sm, AUTH_WAIT_SEQ2, MT2_AUTH_TIMEOUT,
|
||||
(STATE_MACHINE_FUNC) AuthTimeoutAction);
|
||||
|
||||
// the third column
|
||||
/* the third column */
|
||||
StateMachineSetAction(Sm, AUTH_WAIT_SEQ4, MT2_MLME_AUTH_REQ,
|
||||
(STATE_MACHINE_FUNC) InvalidStateWhenAuth);
|
||||
StateMachineSetAction(Sm, AUTH_WAIT_SEQ4, MT2_PEER_AUTH_EVEN,
|
||||
@ -103,13 +103,13 @@ VOID AuthTimeout(IN PVOID SystemSpecific1,
|
||||
|
||||
DBGPRINT(RT_DEBUG_TRACE, ("AUTH - AuthTimeout\n"));
|
||||
|
||||
// Do nothing if the driver is starting halt state.
|
||||
// This might happen when timer already been fired before cancel timer with mlmehalt
|
||||
/* Do nothing if the driver is starting halt state. */
|
||||
/* This might happen when timer already been fired before cancel timer with mlmehalt */
|
||||
if (RTMP_TEST_FLAG
|
||||
(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
|
||||
return;
|
||||
|
||||
// send a de-auth to reset AP's state machine (Patch AP-Dir635)
|
||||
/* send a de-auth to reset AP's state machine (Patch AP-Dir635) */
|
||||
if (pAd->Mlme.AuthMachine.CurrState == AUTH_WAIT_SEQ2)
|
||||
Cls2errAction(pAd, pAd->MlmeAux.Bssid);
|
||||
|
||||
@ -173,7 +173,7 @@ VOID PeerAuthRspAtSeq2Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
&TimerCancelled);
|
||||
|
||||
if (Status == MLME_SUCCESS) {
|
||||
// Authentication Mode "LEAP" has allow for CCX 1.X
|
||||
/* Authentication Mode "LEAP" has allow for CCX 1.X */
|
||||
if (pAd->MlmeAux.Alg == Ndis802_11AuthModeOpen) {
|
||||
pAd->Mlme.AuthMachine.CurrState =
|
||||
AUTH_REQ_IDLE;
|
||||
@ -181,11 +181,11 @@ VOID PeerAuthRspAtSeq2Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
MLME_CNTL_STATE_MACHINE,
|
||||
MT2_AUTH_CONF, 2, &Status);
|
||||
} else {
|
||||
// 2. shared key, need to be challenged
|
||||
/* 2. shared key, need to be challenged */
|
||||
Seq++;
|
||||
RemoteStatus = MLME_SUCCESS;
|
||||
|
||||
// Get an unused nonpaged memory
|
||||
/* Get an unused nonpaged memory */
|
||||
NStatus =
|
||||
MlmeAllocateMemory(pAd,
|
||||
&pOutBuffer);
|
||||
@ -208,7 +208,7 @@ VOID PeerAuthRspAtSeq2Action(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
SUBTYPE_AUTH, 0, Addr2,
|
||||
pAd->MlmeAux.Bssid);
|
||||
AuthHdr.FC.Wep = 1;
|
||||
// Encrypt challenge text & auth information
|
||||
/* Encrypt challenge text & auth information */
|
||||
RTMPInitWepEngine(pAd,
|
||||
pAd->
|
||||
SharedKey[BSS0][pAd->
|
||||
@ -332,7 +332,7 @@ VOID MlmeDeauthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
|
||||
pInfo = (MLME_DEAUTH_REQ_STRUCT *) Elem->Msg;
|
||||
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
||||
if (NStatus != NDIS_STATUS_SUCCESS) {
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("AUTH - MlmeDeauthReqAction() allocate memory fail\n"));
|
||||
@ -359,7 +359,7 @@ VOID MlmeDeauthReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
Status = MLME_SUCCESS;
|
||||
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_DEAUTH_CONF, 2, &Status);
|
||||
|
||||
// send wireless event - for deauthentication
|
||||
/* send wireless event - for deauthentication */
|
||||
if (pAd->CommonCfg.bWirelessEvent)
|
||||
RTMPSendWirelessEvent(pAd, IW_DEAUTH_EVENT_FLAG,
|
||||
pAd->MacTab.Content[BSSID_WCID].Addr,
|
||||
@ -422,7 +422,7 @@ VOID Cls2errAction(IN PRTMP_ADAPTER pAd, IN PUCHAR pAddr)
|
||||
ULONG FrameLen = 0;
|
||||
USHORT Reason = REASON_CLS2ERR;
|
||||
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
||||
if (NStatus != NDIS_STATUS_SUCCESS)
|
||||
return;
|
||||
|
||||
@ -455,7 +455,7 @@ BOOLEAN AUTH_ReqSend(IN PRTMP_ADAPTER pAd,
|
||||
PUCHAR pOutBuffer = NULL;
|
||||
ULONG FrameLen = 0, tmp = 0;
|
||||
|
||||
// Block all authentication request durning WPA block period
|
||||
/* Block all authentication request durning WPA block period */
|
||||
if (pAd->StaCfg.bBlockAssoc == TRUE) {
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("%s - Block Auth request durning WPA block period!\n",
|
||||
@ -475,7 +475,7 @@ BOOLEAN AUTH_ReqSend(IN PRTMP_ADAPTER pAd,
|
||||
Seq = SeqNo;
|
||||
Status = MLME_SUCCESS;
|
||||
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
||||
if (NStatus != NDIS_STATUS_SUCCESS) {
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("%s - MlmeAuthReqAction(Alg:%d) allocate memory failed\n",
|
||||
|
@ -55,11 +55,11 @@ VOID AuthRspStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||
(STATE_MACHINE_FUNC) Drop, AUTH_RSP_IDLE,
|
||||
AUTH_RSP_MACHINE_BASE);
|
||||
|
||||
// column 1
|
||||
/* column 1 */
|
||||
StateMachineSetAction(Sm, AUTH_RSP_IDLE, MT2_PEER_DEAUTH,
|
||||
(STATE_MACHINE_FUNC) PeerDeauthAction);
|
||||
|
||||
// column 2
|
||||
/* column 2 */
|
||||
StateMachineSetAction(Sm, AUTH_RSP_WAIT_CHAL, MT2_PEER_DEAUTH,
|
||||
(STATE_MACHINE_FUNC) PeerDeauthAction);
|
||||
|
||||
@ -88,7 +88,7 @@ VOID PeerAuthSimpleRspGenAndSend(IN PRTMP_ADAPTER pAd,
|
||||
DBGPRINT(RT_DEBUG_TRACE, ("Peer AUTH fail...\n"));
|
||||
return;
|
||||
}
|
||||
//Get an unused nonpaged memory
|
||||
/*Get an unused nonpaged memory */
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);
|
||||
if (NStatus != NDIS_STATUS_SUCCESS)
|
||||
return;
|
||||
@ -126,7 +126,7 @@ VOID PeerDeauthAction(IN PRTMP_ADAPTER pAd, IN PMLME_QUEUE_ELEM Elem)
|
||||
RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL,
|
||||
0);
|
||||
|
||||
// send wireless event - for deauthentication
|
||||
/* send wireless event - for deauthentication */
|
||||
if (pAd->CommonCfg.bWirelessEvent)
|
||||
RTMPSendWirelessEvent(pAd, IW_DEAUTH_EVENT_FLAG,
|
||||
pAd->MacTab.
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -86,7 +86,7 @@ BOOLEAN MlmeStartReqSanity(IN PRTMP_ADAPTER pAd,
|
||||
|
||||
==========================================================================
|
||||
*/
|
||||
BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen, OUT PUCHAR pAddr2, OUT USHORT * pCapabilityInfo, OUT USHORT * pStatus, OUT USHORT * pAid, OUT UCHAR SupRate[], OUT UCHAR * pSupRateLen, OUT UCHAR ExtRate[], OUT UCHAR * pExtRateLen, OUT HT_CAPABILITY_IE * pHtCapability, OUT ADD_HT_INFO_IE * pAddHtInfo, // AP might use this additional ht info IE
|
||||
BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen, OUT PUCHAR pAddr2, OUT USHORT * pCapabilityInfo, OUT USHORT * pStatus, OUT USHORT * pAid, OUT UCHAR SupRate[], OUT UCHAR * pSupRateLen, OUT UCHAR ExtRate[], OUT UCHAR * pExtRateLen, OUT HT_CAPABILITY_IE * pHtCapability, OUT ADD_HT_INFO_IE * pAddHtInfo, /* AP might use this additional ht info IE */
|
||||
OUT UCHAR * pHtCapabilityLen,
|
||||
OUT UCHAR * pAddHtInfoLen,
|
||||
OUT UCHAR * pNewExtChannelOffset,
|
||||
@ -118,10 +118,10 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen
|
||||
NdisMoveMemory(pAid, &pFrame->Octet[4], 2);
|
||||
Length += 2;
|
||||
|
||||
// Aid already swaped byte order in RTMPFrameEndianChange() for big endian platform
|
||||
*pAid = (*pAid) & 0x3fff; // AID is low 14-bit
|
||||
/* Aid already swaped byte order in RTMPFrameEndianChange() for big endian platform */
|
||||
*pAid = (*pAid) & 0x3fff; /* AID is low 14-bit */
|
||||
|
||||
// -- get supported rates from payload and advance the pointer
|
||||
/* -- get supported rates from payload and advance the pointer */
|
||||
IeType = pFrame->Octet[6];
|
||||
*pSupRateLen = pFrame->Octet[7];
|
||||
if ((IeType != IE_SUPP_RATES)
|
||||
@ -134,11 +134,11 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen
|
||||
|
||||
Length = Length + 2 + *pSupRateLen;
|
||||
|
||||
// many AP implement proprietary IEs in non-standard order, we'd better
|
||||
// tolerate mis-ordered IEs to get best compatibility
|
||||
/* many AP implement proprietary IEs in non-standard order, we'd better */
|
||||
/* tolerate mis-ordered IEs to get best compatibility */
|
||||
pEid = (PEID_STRUCT) & pFrame->Octet[8 + (*pSupRateLen)];
|
||||
|
||||
// get variable fields from payload and advance the pointer
|
||||
/* get variable fields from payload and advance the pointer */
|
||||
while ((Length + 2 + pEid->Len) <= MsgLen) {
|
||||
switch (pEid->Eid) {
|
||||
case IE_EXT_SUPP_RATES:
|
||||
@ -150,7 +150,7 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen
|
||||
|
||||
case IE_HT_CAP:
|
||||
case IE_HT_CAP2:
|
||||
if (pEid->Len >= SIZE_HT_CAP_IE) //Note: allow extension.!!
|
||||
if (pEid->Len >= SIZE_HT_CAP_IE) /*Note: allow extension.!! */
|
||||
{
|
||||
NdisMoveMemory(pHtCapability, pEid->Octet,
|
||||
SIZE_HT_CAP_IE);
|
||||
@ -172,8 +172,8 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen
|
||||
case IE_ADD_HT:
|
||||
case IE_ADD_HT2:
|
||||
if (pEid->Len >= sizeof(ADD_HT_INFO_IE)) {
|
||||
// This IE allows extension, but we can ignore extra bytes beyond our knowledge , so only
|
||||
// copy first sizeof(ADD_HT_INFO_IE)
|
||||
/* This IE allows extension, but we can ignore extra bytes beyond our knowledge , so only */
|
||||
/* copy first sizeof(ADD_HT_INFO_IE) */
|
||||
NdisMoveMemory(pAddHtInfo, pEid->Octet,
|
||||
sizeof(ADD_HT_INFO_IE));
|
||||
|
||||
@ -201,31 +201,31 @@ BOOLEAN PeerAssocRspSanity(IN PRTMP_ADAPTER pAd, IN VOID * pMsg, IN ULONG MsgLen
|
||||
break;
|
||||
|
||||
case IE_VENDOR_SPECIFIC:
|
||||
// handle WME PARAMTER ELEMENT
|
||||
/* handle WME PARAMTER ELEMENT */
|
||||
if (NdisEqualMemory(pEid->Octet, WME_PARM_ELEM, 6)
|
||||
&& (pEid->Len == 24)) {
|
||||
PUCHAR ptr;
|
||||
int i;
|
||||
|
||||
// parsing EDCA parameters
|
||||
/* parsing EDCA parameters */
|
||||
pEdcaParm->bValid = TRUE;
|
||||
pEdcaParm->bQAck = FALSE; // pEid->Octet[0] & 0x10;
|
||||
pEdcaParm->bQueueRequest = FALSE; // pEid->Octet[0] & 0x20;
|
||||
pEdcaParm->bTxopRequest = FALSE; // pEid->Octet[0] & 0x40;
|
||||
//pEdcaParm->bMoreDataAck = FALSE; // pEid->Octet[0] & 0x80;
|
||||
pEdcaParm->bQAck = FALSE; /* pEid->Octet[0] & 0x10; */
|
||||
pEdcaParm->bQueueRequest = FALSE; /* pEid->Octet[0] & 0x20; */
|
||||
pEdcaParm->bTxopRequest = FALSE; /* pEid->Octet[0] & 0x40; */
|
||||
/*pEdcaParm->bMoreDataAck = FALSE; // pEid->Octet[0] & 0x80; */
|
||||
pEdcaParm->EdcaUpdateCount =
|
||||
pEid->Octet[6] & 0x0f;
|
||||
pEdcaParm->bAPSDCapable =
|
||||
(pEid->Octet[6] & 0x80) ? 1 : 0;
|
||||
ptr = (PUCHAR) & pEid->Octet[8];
|
||||
for (i = 0; i < 4; i++) {
|
||||
UCHAR aci = (*ptr & 0x60) >> 5; // b5~6 is AC INDEX
|
||||
pEdcaParm->bACM[aci] = (((*ptr) & 0x10) == 0x10); // b5 is ACM
|
||||
pEdcaParm->Aifsn[aci] = (*ptr) & 0x0f; // b0~3 is AIFSN
|
||||
pEdcaParm->Cwmin[aci] = *(ptr + 1) & 0x0f; // b0~4 is Cwmin
|
||||
pEdcaParm->Cwmax[aci] = *(ptr + 1) >> 4; // b5~8 is Cwmax
|
||||
pEdcaParm->Txop[aci] = *(ptr + 2) + 256 * (*(ptr + 3)); // in unit of 32-us
|
||||
ptr += 4; // point to next AC
|
||||
UCHAR aci = (*ptr & 0x60) >> 5; /* b5~6 is AC INDEX */
|
||||
pEdcaParm->bACM[aci] = (((*ptr) & 0x10) == 0x10); /* b5 is ACM */
|
||||
pEdcaParm->Aifsn[aci] = (*ptr) & 0x0f; /* b0~3 is AIFSN */
|
||||
pEdcaParm->Cwmin[aci] = *(ptr + 1) & 0x0f; /* b0~4 is Cwmin */
|
||||
pEdcaParm->Cwmax[aci] = *(ptr + 1) >> 4; /* b5~8 is Cwmax */
|
||||
pEdcaParm->Txop[aci] = *(ptr + 2) + 256 * (*(ptr + 3)); /* in unit of 32-us */
|
||||
ptr += 4; /* point to next AC */
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -280,7 +280,7 @@ BOOLEAN PeerProbeReqSanity(IN PRTMP_ADAPTER pAd,
|
||||
|
||||
Idx = *pSsidLen + 2;
|
||||
|
||||
// -- get supported rates from payload and advance the pointer
|
||||
/* -- get supported rates from payload and advance the pointer */
|
||||
IeType = pFrame->Octet[Idx];
|
||||
RateLen = pFrame->Octet[Idx + 1];
|
||||
if (IeType != IE_SUPP_RATES) {
|
||||
@ -319,15 +319,15 @@ BOOLEAN GetTimBit(IN CHAR * Ptr,
|
||||
IdxPtr++;
|
||||
*TimLen = *IdxPtr;
|
||||
|
||||
// get DTIM Count from TIM element
|
||||
/* get DTIM Count from TIM element */
|
||||
IdxPtr++;
|
||||
*DtimCount = *IdxPtr;
|
||||
|
||||
// get DTIM Period from TIM element
|
||||
/* get DTIM Period from TIM element */
|
||||
IdxPtr++;
|
||||
*DtimPeriod = *IdxPtr;
|
||||
|
||||
// get Bitmap Control from TIM element
|
||||
/* get Bitmap Control from TIM element */
|
||||
IdxPtr++;
|
||||
BitCntl = *IdxPtr;
|
||||
|
||||
@ -336,20 +336,20 @@ BOOLEAN GetTimBit(IN CHAR * Ptr,
|
||||
else
|
||||
*BcastFlag = FALSE;
|
||||
|
||||
// Parse Partial Virtual Bitmap from TIM element
|
||||
N1 = BitCntl & 0xfe; // N1 is the first bitmap byte#
|
||||
N2 = *TimLen - 4 + N1; // N2 is the last bitmap byte#
|
||||
/* Parse Partial Virtual Bitmap from TIM element */
|
||||
N1 = BitCntl & 0xfe; /* N1 is the first bitmap byte# */
|
||||
N2 = *TimLen - 4 + N1; /* N2 is the last bitmap byte# */
|
||||
|
||||
if ((Aid < (N1 << 3)) || (Aid >= ((N2 + 1) << 3)))
|
||||
*MessageToMe = FALSE;
|
||||
else {
|
||||
MyByte = (Aid >> 3) - N1; // my byte position in the bitmap byte-stream
|
||||
MyByte = (Aid >> 3) - N1; /* my byte position in the bitmap byte-stream */
|
||||
MyBit = Aid % 16 - ((MyByte & 0x01) ? 8 : 0);
|
||||
|
||||
IdxPtr += (MyByte + 1);
|
||||
|
||||
//if (*IdxPtr)
|
||||
// DBGPRINT(RT_DEBUG_WARN, ("TIM bitmap = 0x%02x\n", *IdxPtr));
|
||||
/*if (*IdxPtr) */
|
||||
/* DBGPRINT(RT_DEBUG_WARN, ("TIM bitmap = 0x%02x\n", *IdxPtr)); */
|
||||
|
||||
if (*IdxPtr & (0x01 << MyBit))
|
||||
*MessageToMe = TRUE;
|
||||
|
@ -37,7 +37,7 @@
|
||||
*/
|
||||
#include "../rt_config.h"
|
||||
|
||||
#define ADHOC_ENTRY_BEACON_LOST_TIME (2*OS_HZ) // 2 sec
|
||||
#define ADHOC_ENTRY_BEACON_LOST_TIME (2*OS_HZ) /* 2 sec */
|
||||
|
||||
/*
|
||||
==========================================================================
|
||||
@ -57,7 +57,7 @@ VOID SyncStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||
(STATE_MACHINE_FUNC) Drop, SYNC_IDLE,
|
||||
SYNC_MACHINE_BASE);
|
||||
|
||||
// column 1
|
||||
/* column 1 */
|
||||
StateMachineSetAction(Sm, SYNC_IDLE, MT2_MLME_SCAN_REQ,
|
||||
(STATE_MACHINE_FUNC) MlmeScanReqAction);
|
||||
StateMachineSetAction(Sm, SYNC_IDLE, MT2_MLME_JOIN_REQ,
|
||||
@ -69,7 +69,7 @@ VOID SyncStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||
StateMachineSetAction(Sm, SYNC_IDLE, MT2_PEER_PROBE_REQ,
|
||||
(STATE_MACHINE_FUNC) PeerProbeReqAction);
|
||||
|
||||
//column 2
|
||||
/*column 2 */
|
||||
StateMachineSetAction(Sm, JOIN_WAIT_BEACON, MT2_MLME_SCAN_REQ,
|
||||
(STATE_MACHINE_FUNC) InvalidStateWhenScan);
|
||||
StateMachineSetAction(Sm, JOIN_WAIT_BEACON, MT2_MLME_JOIN_REQ,
|
||||
@ -81,7 +81,7 @@ VOID SyncStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||
StateMachineSetAction(Sm, JOIN_WAIT_BEACON, MT2_BEACON_TIMEOUT,
|
||||
(STATE_MACHINE_FUNC) BeaconTimeoutAtJoinAction);
|
||||
|
||||
// column 3
|
||||
/* column 3 */
|
||||
StateMachineSetAction(Sm, SCAN_LISTEN, MT2_MLME_SCAN_REQ,
|
||||
(STATE_MACHINE_FUNC) InvalidStateWhenScan);
|
||||
StateMachineSetAction(Sm, SCAN_LISTEN, MT2_MLME_JOIN_REQ,
|
||||
@ -95,7 +95,7 @@ VOID SyncStateMachineInit(IN PRTMP_ADAPTER pAd,
|
||||
StateMachineSetAction(Sm, SCAN_LISTEN, MT2_SCAN_TIMEOUT,
|
||||
(STATE_MACHINE_FUNC) ScanTimeoutAction);
|
||||
|
||||
// timer init
|
||||
/* timer init */
|
||||
RTMPInitTimer(pAd, &pAd->MlmeAux.BeaconTimer,
|
||||
GET_TIMER_FUNCTION(BeaconTimeout), pAd, FALSE);
|
||||
RTMPInitTimer(pAd, &pAd->MlmeAux.ScanTimer,
|
||||
@ -119,8 +119,8 @@ VOID BeaconTimeout(IN PVOID SystemSpecific1,
|
||||
|
||||
DBGPRINT(RT_DEBUG_TRACE, ("SYNC - BeaconTimeout\n"));
|
||||
|
||||
// Do nothing if the driver is starting halt state.
|
||||
// This might happen when timer already been fired before cancel timer with mlmehalt
|
||||
/* Do nothing if the driver is starting halt state. */
|
||||
/* This might happen when timer already been fired before cancel timer with mlmehalt */
|
||||
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))
|
||||
return;
|
||||
|
||||
@ -157,15 +157,15 @@ VOID ScanTimeout(IN PVOID SystemSpecific1,
|
||||
{
|
||||
RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) FunctionContext;
|
||||
|
||||
// Do nothing if the driver is starting halt state.
|
||||
// This might happen when timer already been fired before cancel timer with mlmehalt
|
||||
/* Do nothing if the driver is starting halt state. */
|
||||
/* This might happen when timer already been fired before cancel timer with mlmehalt */
|
||||
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))
|
||||
return;
|
||||
|
||||
if (MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_SCAN_TIMEOUT, 0, NULL)) {
|
||||
RTMP_MLME_HANDLER(pAd);
|
||||
} else {
|
||||
// To prevent SyncMachine.CurrState is SCAN_LISTEN forever.
|
||||
/* To prevent SyncMachine.CurrState is SCAN_LISTEN forever. */
|
||||
pAd->MlmeAux.Channel = 0;
|
||||
ScanNextChannel(pAd);
|
||||
if (pAd->CommonCfg.bWirelessEvent) {
|
||||
@ -193,14 +193,14 @@ VOID MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
PUCHAR pOutBuffer = NULL;
|
||||
NDIS_STATUS NStatus;
|
||||
|
||||
// Check the total scan tries for one single OID command
|
||||
// If this is the CCX 2.0 Case, skip that!
|
||||
/* Check the total scan tries for one single OID command */
|
||||
/* If this is the CCX 2.0 Case, skip that! */
|
||||
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_START_UP)) {
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("SYNC - MlmeScanReqAction before Startup\n"));
|
||||
return;
|
||||
}
|
||||
// Increase the scan retry counters.
|
||||
/* Increase the scan retry counters. */
|
||||
pAd->StaCfg.ScanCnt++;
|
||||
|
||||
#ifdef RTMP_MAC_PCI
|
||||
@ -219,24 +219,24 @@ VOID MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
RT28xxPciAsicRadioOn(pAd, GUI_IDLE_POWER_SAVE);
|
||||
}
|
||||
}
|
||||
#endif // RTMP_MAC_PCI //
|
||||
#endif /* RTMP_MAC_PCI // */
|
||||
|
||||
// first check the parameter sanity
|
||||
/* first check the parameter sanity */
|
||||
if (MlmeScanReqSanity(pAd,
|
||||
Elem->Msg,
|
||||
Elem->MsgLen,
|
||||
&BssType, (PCHAR) Ssid, &SsidLen, &ScanType)) {
|
||||
|
||||
// Check for channel load and noise hist request
|
||||
// Suspend MSDU only at scan request, not the last two mentioned
|
||||
// Suspend MSDU transmission here
|
||||
/* Check for channel load and noise hist request */
|
||||
/* Suspend MSDU only at scan request, not the last two mentioned */
|
||||
/* Suspend MSDU transmission here */
|
||||
RTMPSuspendMsduTransmission(pAd);
|
||||
|
||||
//
|
||||
// To prevent data lost.
|
||||
// Send an NULL data with turned PSM bit on to current associated AP before SCAN progress.
|
||||
// And should send an NULL data with turned PSM bit off to AP, when scan progress done
|
||||
//
|
||||
/* */
|
||||
/* To prevent data lost. */
|
||||
/* Send an NULL data with turned PSM bit on to current associated AP before SCAN progress. */
|
||||
/* And should send an NULL data with turned PSM bit off to AP, when scan progress done */
|
||||
/* */
|
||||
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)
|
||||
&& (INFRA_ON(pAd))) {
|
||||
NStatus = MlmeAllocateMemory(pAd, (PVOID) & pOutBuffer);
|
||||
@ -250,7 +250,7 @@ VOID MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
pHdr80211->FC.Type = BTYPE_DATA;
|
||||
pHdr80211->FC.PwrMgmt = PWR_SAVE;
|
||||
|
||||
// Send using priority queue
|
||||
/* Send using priority queue */
|
||||
MiniportMMRequest(pAd, 0, pOutBuffer,
|
||||
sizeof(HEADER_802_11));
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
@ -262,21 +262,21 @@ VOID MlmeScanReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
|
||||
NdisGetSystemUpTime(&Now);
|
||||
pAd->StaCfg.LastScanTime = Now;
|
||||
// reset all the timers
|
||||
/* reset all the timers */
|
||||
RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &TimerCancelled);
|
||||
RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled);
|
||||
|
||||
// record desired BSS parameters
|
||||
/* record desired BSS parameters */
|
||||
pAd->MlmeAux.BssType = BssType;
|
||||
pAd->MlmeAux.ScanType = ScanType;
|
||||
pAd->MlmeAux.SsidLen = SsidLen;
|
||||
NdisZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID);
|
||||
NdisMoveMemory(pAd->MlmeAux.Ssid, Ssid, SsidLen);
|
||||
|
||||
// start from the first channel
|
||||
/* start from the first channel */
|
||||
pAd->MlmeAux.Channel = FirstChannel(pAd);
|
||||
|
||||
// Let BBP register at 20MHz to do scan
|
||||
/* Let BBP register at 20MHz to do scan */
|
||||
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
|
||||
BBPValue &= (~0x18);
|
||||
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
|
||||
@ -324,18 +324,18 @@ VOID MlmeJoinReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
(RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF))) {
|
||||
RT28xxPciAsicRadioOn(pAd, GUI_IDLE_POWER_SAVE);
|
||||
}
|
||||
#endif // RTMP_MAC_PCI //
|
||||
#endif /* RTMP_MAC_PCI // */
|
||||
|
||||
// reset all the timers
|
||||
/* reset all the timers */
|
||||
RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled);
|
||||
RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &TimerCancelled);
|
||||
|
||||
pBss = &pAd->MlmeAux.SsidBssTab.BssEntry[pInfo->BssIdx];
|
||||
|
||||
// record the desired SSID & BSSID we're waiting for
|
||||
/* record the desired SSID & BSSID we're waiting for */
|
||||
COPY_MAC_ADDR(pAd->MlmeAux.Bssid, pBss->Bssid);
|
||||
|
||||
// If AP's SSID is not hidden, it is OK for updating ssid to MlmeAux again.
|
||||
/* If AP's SSID is not hidden, it is OK for updating ssid to MlmeAux again. */
|
||||
if (pBss->Hidden == 0) {
|
||||
RTMPZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID);
|
||||
NdisMoveMemory(pAd->MlmeAux.Ssid, pBss->Ssid, pBss->SsidLen);
|
||||
@ -346,14 +346,14 @@ VOID MlmeJoinReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
pAd->MlmeAux.Channel = pBss->Channel;
|
||||
pAd->MlmeAux.CentralChannel = pBss->CentralChannel;
|
||||
|
||||
// Let BBP register at 20MHz to do scan
|
||||
/* Let BBP register at 20MHz to do scan */
|
||||
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
|
||||
BBPValue &= (~0x18);
|
||||
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
|
||||
|
||||
DBGPRINT(RT_DEBUG_TRACE, ("SYNC - BBP R4 to 20MHz.l\n"));
|
||||
|
||||
// switch channel and waiting for beacon timer
|
||||
/* switch channel and waiting for beacon timer */
|
||||
AsicSwitchChannel(pAd, pAd->MlmeAux.Channel, FALSE);
|
||||
AsicLockChannel(pAd, pAd->MlmeAux.Channel);
|
||||
RTMPSetTimer(&pAd->MlmeAux.BeaconTimer, JOIN_TIMEOUT);
|
||||
@ -363,15 +363,15 @@ VOID MlmeJoinReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
(pAd->MlmeAux.Channel > 14) &&
|
||||
RadarChannelCheck(pAd, pAd->MlmeAux.Channel))
|
||||
) {
|
||||
//
|
||||
// We can't send any Probe request frame to meet 802.11h.
|
||||
//
|
||||
/* */
|
||||
/* We can't send any Probe request frame to meet 802.11h. */
|
||||
/* */
|
||||
if (pBss->Hidden == 0)
|
||||
break;
|
||||
}
|
||||
//
|
||||
// send probe request
|
||||
//
|
||||
/* */
|
||||
/* send probe request */
|
||||
/* */
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);
|
||||
if (NStatus == NDIS_STATUS_SUCCESS) {
|
||||
if (pAd->MlmeAux.Channel <= 14) {
|
||||
@ -380,9 +380,9 @@ VOID MlmeJoinReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
pExtRate = pAd->CommonCfg.ExtRate;
|
||||
ExtRateLen = pAd->CommonCfg.ExtRateLen;
|
||||
} else {
|
||||
//
|
||||
// Overwrite Support Rate, CCK rate are not allowed
|
||||
//
|
||||
/* */
|
||||
/* Overwrite Support Rate, CCK rate are not allowed */
|
||||
/* */
|
||||
pSupRate = ASupRate;
|
||||
SupRateLen = ASupRateLen;
|
||||
ExtRateLen = 0;
|
||||
@ -442,14 +442,14 @@ VOID MlmeStartReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen;
|
||||
BOOLEAN TimerCancelled;
|
||||
|
||||
// New for WPA security suites
|
||||
UCHAR VarIE[MAX_VIE_LEN]; // Total VIE length = MAX_VIE_LEN - -5
|
||||
/* New for WPA security suites */
|
||||
UCHAR VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */
|
||||
NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
|
||||
LARGE_INTEGER TimeStamp;
|
||||
BOOLEAN Privacy;
|
||||
USHORT Status;
|
||||
|
||||
// Init Variable IE structure
|
||||
/* Init Variable IE structure */
|
||||
pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE;
|
||||
pVIE->Length = 0;
|
||||
TimeStamp.u.LowPart = 0;
|
||||
@ -457,20 +457,20 @@ VOID MlmeStartReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
|
||||
if (MlmeStartReqSanity
|
||||
(pAd, Elem->Msg, Elem->MsgLen, (PCHAR) Ssid, &SsidLen)) {
|
||||
// reset all the timers
|
||||
/* reset all the timers */
|
||||
RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled);
|
||||
RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &TimerCancelled);
|
||||
|
||||
//
|
||||
// Start a new IBSS. All IBSS parameters are decided now....
|
||||
//
|
||||
/* */
|
||||
/* Start a new IBSS. All IBSS parameters are decided now.... */
|
||||
/* */
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("MlmeStartReqAction - Start a new IBSS. All IBSS parameters are decided now.... \n"));
|
||||
pAd->MlmeAux.BssType = BSS_ADHOC;
|
||||
NdisMoveMemory(pAd->MlmeAux.Ssid, Ssid, SsidLen);
|
||||
pAd->MlmeAux.SsidLen = SsidLen;
|
||||
|
||||
// generate a radom number as BSSID
|
||||
/* generate a radom number as BSSID */
|
||||
MacAddrRandomBssid(pAd, pAd->MlmeAux.Bssid);
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("MlmeStartReqAction - generate a radom number as BSSID \n"));
|
||||
@ -507,7 +507,7 @@ VOID MlmeStartReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
&pAd->MlmeAux.HtCapability,
|
||||
&pAd->MlmeAux.AddHtInfo);
|
||||
pAd->MlmeAux.HtCapabilityLen = sizeof(HT_CAPABILITY_IE);
|
||||
// Not turn pAd->StaActive.SupportedHtPhy.bHtEnable = TRUE here.
|
||||
/* Not turn pAd->StaActive.SupportedHtPhy.bHtEnable = TRUE here. */
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("SYNC -pAd->StaActive.SupportedHtPhy.bHtEnable = TRUE\n"));
|
||||
} else {
|
||||
@ -516,7 +516,7 @@ VOID MlmeStartReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
NdisZeroMemory(&pAd->StaActive.SupportedPhyInfo.
|
||||
MCSSet[0], 16);
|
||||
}
|
||||
// temporarily not support QOS in IBSS
|
||||
/* temporarily not support QOS in IBSS */
|
||||
NdisZeroMemory(&pAd->MlmeAux.APEdcaParm, sizeof(EDCA_PARM));
|
||||
NdisZeroMemory(&pAd->MlmeAux.APQbssLoad,
|
||||
sizeof(QBSS_LOAD_PARM));
|
||||
@ -570,17 +570,17 @@ VOID PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
QBSS_LOAD_PARM QbssLoad;
|
||||
QOS_CAPABILITY_PARM QosCapability;
|
||||
ULONG RalinkIe;
|
||||
UCHAR VarIE[MAX_VIE_LEN]; // Total VIE length = MAX_VIE_LEN - -5
|
||||
UCHAR VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */
|
||||
NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
|
||||
HT_CAPABILITY_IE HtCapability;
|
||||
ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE
|
||||
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
||||
UCHAR HtCapabilityLen = 0, PreNHtCapabilityLen = 0;
|
||||
UCHAR AddHtInfoLen;
|
||||
UCHAR NewExtChannelOffset = 0xff;
|
||||
|
||||
// NdisFillMemory(Ssid, MAX_LEN_OF_SSID, 0x00);
|
||||
/* NdisFillMemory(Ssid, MAX_LEN_OF_SSID, 0x00); */
|
||||
pFrame = (PFRAME_802_11) Elem->Msg;
|
||||
// Init Variable IE structure
|
||||
/* Init Variable IE structure */
|
||||
pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE;
|
||||
pVIE->Length = 0;
|
||||
|
||||
@ -659,7 +659,7 @@ VOID PeerBeaconAtScanAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
}
|
||||
|
||||
}
|
||||
// sanity check fail, ignored
|
||||
/* sanity check fail, ignored */
|
||||
}
|
||||
|
||||
/*
|
||||
@ -688,19 +688,19 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
QBSS_LOAD_PARM QbssLoad;
|
||||
QOS_CAPABILITY_PARM QosCapability;
|
||||
USHORT Status;
|
||||
UCHAR VarIE[MAX_VIE_LEN]; // Total VIE length = MAX_VIE_LEN - -5
|
||||
UCHAR VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */
|
||||
NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
|
||||
ULONG RalinkIe;
|
||||
ULONG Idx;
|
||||
HT_CAPABILITY_IE HtCapability;
|
||||
ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE
|
||||
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
||||
UCHAR HtCapabilityLen = 0, PreNHtCapabilityLen = 0;
|
||||
UCHAR AddHtInfoLen;
|
||||
UCHAR NewExtChannelOffset = 0xff;
|
||||
UCHAR CentralChannel;
|
||||
BOOLEAN bAllowNrate = FALSE;
|
||||
|
||||
// Init Variable IE structure
|
||||
/* Init Variable IE structure */
|
||||
pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE;
|
||||
pVIE->Length = 0;
|
||||
RTMPZeroMemory(&HtCapability, sizeof(HtCapability));
|
||||
@ -743,18 +743,18 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
&AddHtInfoLen,
|
||||
&AddHtInfo,
|
||||
&NewExtChannelOffset, &LenVIE, pVIE)) {
|
||||
// Disqualify 11b only adhoc when we are in 11g only adhoc mode
|
||||
/* Disqualify 11b only adhoc when we are in 11g only adhoc mode */
|
||||
if ((BssType == BSS_ADHOC)
|
||||
&& (pAd->CommonCfg.PhyMode == PHY_11G)
|
||||
&& ((SupRateLen + ExtRateLen) < 12))
|
||||
return;
|
||||
|
||||
// BEACON from desired BSS/IBSS found. We should be able to decide most
|
||||
// BSS parameters here.
|
||||
// Q. But what happen if this JOIN doesn't conclude a successful ASSOCIATEION?
|
||||
// Do we need to receover back all parameters belonging to previous BSS?
|
||||
// A. Should be not. There's no back-door recover to previous AP. It still need
|
||||
// a new JOIN-AUTH-ASSOC sequence.
|
||||
/* BEACON from desired BSS/IBSS found. We should be able to decide most */
|
||||
/* BSS parameters here. */
|
||||
/* Q. But what happen if this JOIN doesn't conclude a successful ASSOCIATEION? */
|
||||
/* Do we need to receover back all parameters belonging to previous BSS? */
|
||||
/* A. Should be not. There's no back-door recover to previous AP. It still need */
|
||||
/* a new JOIN-AUTH-ASSOC sequence. */
|
||||
if (MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, Bssid)) {
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("SYNC - receive desired BEACON at JoinWaitBeacon... Channel = %d\n",
|
||||
@ -762,7 +762,7 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer,
|
||||
&TimerCancelled);
|
||||
|
||||
// Update RSSI to prevent No signal display when cards first initialized
|
||||
/* Update RSSI to prevent No signal display when cards first initialized */
|
||||
pAd->StaCfg.RssiSample.LastRssi0 =
|
||||
ConvertToRssi(pAd, Elem->Rssi0, RSSI_0);
|
||||
pAd->StaCfg.RssiSample.LastRssi1 =
|
||||
@ -782,10 +782,10 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
pAd->StaCfg.RssiSample.AvgRssi2X8 =
|
||||
pAd->StaCfg.RssiSample.AvgRssi2 << 3;
|
||||
|
||||
//
|
||||
// We need to check if SSID only set to any, then we can record the current SSID.
|
||||
// Otherwise will cause hidden SSID association failed.
|
||||
//
|
||||
/* */
|
||||
/* We need to check if SSID only set to any, then we can record the current SSID. */
|
||||
/* Otherwise will cause hidden SSID association failed. */
|
||||
/* */
|
||||
if (pAd->MlmeAux.SsidLen == 0) {
|
||||
NdisMoveMemory(pAd->MlmeAux.Ssid, Ssid,
|
||||
SsidLen);
|
||||
@ -858,9 +858,9 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
CapabilityInfo;
|
||||
}
|
||||
} else {
|
||||
//
|
||||
// Multiple SSID case, used correct CapabilityInfo
|
||||
//
|
||||
/* */
|
||||
/* Multiple SSID case, used correct CapabilityInfo */
|
||||
/* */
|
||||
CapabilityInfo =
|
||||
pAd->ScanTab.BssEntry[Idx].
|
||||
CapabilityInfo;
|
||||
@ -877,8 +877,8 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
pAd->MlmeAux.CfpMaxDuration = Cf.CfpMaxDuration;
|
||||
pAd->MlmeAux.APRalinkIe = RalinkIe;
|
||||
|
||||
// Copy AP's supported rate to MlmeAux for creating assoication request
|
||||
// Also filter out not supported rate
|
||||
/* Copy AP's supported rate to MlmeAux for creating assoication request */
|
||||
/* Also filter out not supported rate */
|
||||
pAd->MlmeAux.SupRateLen = SupRateLen;
|
||||
NdisMoveMemory(pAd->MlmeAux.SupRate, SupRate,
|
||||
SupRateLen);
|
||||
@ -905,14 +905,14 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
|
||||
RTMPZeroMemory(&pAd->MlmeAux.HtCapability,
|
||||
SIZE_HT_CAP_IE);
|
||||
// filter out un-supported ht rates
|
||||
/* filter out un-supported ht rates */
|
||||
if (((HtCapabilityLen > 0) || (PreNHtCapabilityLen > 0))
|
||||
&& ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
|
||||
&& (bAllowNrate))) {
|
||||
RTMPMoveMemory(&pAd->MlmeAux.AddHtInfo,
|
||||
&AddHtInfo, SIZE_ADD_HT_INFO_IE);
|
||||
|
||||
// StaActive.SupportedHtPhy.MCSSet stores Peer AP's 11n Rx capability
|
||||
/* StaActive.SupportedHtPhy.MCSSet stores Peer AP's 11n Rx capability */
|
||||
NdisMoveMemory(pAd->StaActive.SupportedPhyInfo.
|
||||
MCSSet, HtCapability.MCSSet, 16);
|
||||
pAd->MlmeAux.NewExtChannelOffset =
|
||||
@ -925,7 +925,7 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
bPreNHt = TRUE;
|
||||
RTMPCheckHt(pAd, BSSID_WCID, &HtCapability,
|
||||
&AddHtInfo);
|
||||
// Copy AP Parameter to StaActive. This is also in LinkUp.
|
||||
/* Copy AP Parameter to StaActive. This is also in LinkUp. */
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("PeerBeaconAtJoinAction! (MpduDensity=%d, MaxRAmpduFactor=%d, BW=%d)\n",
|
||||
pAd->StaActive.SupportedHtPhy.
|
||||
@ -936,7 +936,7 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
|
||||
if (AddHtInfoLen > 0) {
|
||||
CentralChannel = AddHtInfo.ControlChan;
|
||||
// Check again the Bandwidth capability of this AP.
|
||||
/* Check again the Bandwidth capability of this AP. */
|
||||
if ((AddHtInfo.ControlChan > 2)
|
||||
&& (AddHtInfo.AddHtInfo.
|
||||
ExtChanOffset == EXTCHA_BELOW)
|
||||
@ -952,7 +952,7 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
CentralChannel =
|
||||
AddHtInfo.ControlChan + 2;
|
||||
}
|
||||
// Check Error .
|
||||
/* Check Error . */
|
||||
if (pAd->MlmeAux.CentralChannel !=
|
||||
CentralChannel)
|
||||
DBGPRINT(RT_DEBUG_ERROR,
|
||||
@ -970,7 +970,7 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
}
|
||||
|
||||
} else {
|
||||
// To prevent error, let legacy AP must have same CentralChannel and Channel.
|
||||
/* To prevent error, let legacy AP must have same CentralChannel and Channel. */
|
||||
if ((HtCapabilityLen == 0)
|
||||
&& (PreNHtCapabilityLen == 0))
|
||||
pAd->MlmeAux.CentralChannel =
|
||||
@ -988,7 +988,7 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
|
||||
RTMPUpdateMlmeRate(pAd);
|
||||
|
||||
// copy QOS related information
|
||||
/* copy QOS related information */
|
||||
if ((pAd->CommonCfg.bWmmCapable)
|
||||
|| (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
|
||||
) {
|
||||
@ -1015,10 +1015,10 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
pAd->MlmeAux.ExtRateLen));
|
||||
|
||||
if (AironetCellPowerLimit != 0xFF) {
|
||||
//We need to change our TxPower for CCX 2.0 AP Control of Client Transmit Power
|
||||
/*We need to change our TxPower for CCX 2.0 AP Control of Client Transmit Power */
|
||||
ChangeToCellPowerLimit(pAd,
|
||||
AironetCellPowerLimit);
|
||||
} else //Used the default TX Power Percentage.
|
||||
} else /*Used the default TX Power Percentage. */
|
||||
pAd->CommonCfg.TxPowerPercentage =
|
||||
pAd->CommonCfg.TxPowerDefault;
|
||||
|
||||
@ -1027,9 +1027,9 @@ VOID PeerBeaconAtJoinAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_JOIN_CONF,
|
||||
2, &Status);
|
||||
}
|
||||
// not to me BEACON, ignored
|
||||
/* not to me BEACON, ignored */
|
||||
}
|
||||
// sanity check fail, ignore this frame
|
||||
/* sanity check fail, ignore this frame */
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1062,11 +1062,11 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
QBSS_LOAD_PARM QbssLoad;
|
||||
QOS_CAPABILITY_PARM QosCapability;
|
||||
ULONG RalinkIe;
|
||||
// New for WPA security suites
|
||||
UCHAR VarIE[MAX_VIE_LEN]; // Total VIE length = MAX_VIE_LEN - -5
|
||||
/* New for WPA security suites */
|
||||
UCHAR VarIE[MAX_VIE_LEN]; /* Total VIE length = MAX_VIE_LEN - -5 */
|
||||
NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
|
||||
HT_CAPABILITY_IE HtCapability;
|
||||
ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE
|
||||
ADD_HT_INFO_IE AddHtInfo; /* AP might use this additional ht info IE */
|
||||
UCHAR HtCapabilityLen, PreNHtCapabilityLen;
|
||||
UCHAR AddHtInfoLen;
|
||||
UCHAR NewExtChannelOffset = 0xff;
|
||||
@ -1075,7 +1075,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
))
|
||||
return;
|
||||
|
||||
// Init Variable IE structure
|
||||
/* Init Variable IE structure */
|
||||
pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE;
|
||||
pVIE->Length = 0;
|
||||
RTMPZeroMemory(&HtCapability, sizeof(HtCapability));
|
||||
@ -1132,27 +1132,27 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
SSID_EQUAL(Ssid, SsidLen, pAd->CommonCfg.Ssid,
|
||||
pAd->CommonCfg.SsidLen) ? TRUE : FALSE;
|
||||
|
||||
// ignore BEACON not for my SSID
|
||||
/* ignore BEACON not for my SSID */
|
||||
if ((!is_my_ssid) && (!is_my_bssid))
|
||||
return;
|
||||
|
||||
// It means STA waits disassoc completely from this AP, ignores this beacon.
|
||||
/* It means STA waits disassoc completely from this AP, ignores this beacon. */
|
||||
if (pAd->Mlme.CntlMachine.CurrState == CNTL_WAIT_DISASSOC)
|
||||
return;
|
||||
|
||||
// Copy Control channel for this BSSID.
|
||||
/* Copy Control channel for this BSSID. */
|
||||
if (AddHtInfoLen != 0)
|
||||
Channel = AddHtInfo.ControlChan;
|
||||
|
||||
if ((HtCapabilityLen > 0) || (PreNHtCapabilityLen > 0))
|
||||
HtCapabilityLen = SIZE_HT_CAP_IE;
|
||||
|
||||
//
|
||||
// Housekeeping "SsidBssTab" table for later-on ROAMing usage.
|
||||
//
|
||||
/* */
|
||||
/* Housekeeping "SsidBssTab" table for later-on ROAMing usage. */
|
||||
/* */
|
||||
Bssidx = BssTableSearch(&pAd->ScanTab, Bssid, Channel);
|
||||
if (Bssidx == BSS_NOT_FOUND) {
|
||||
// discover new AP of this network, create BSS entry
|
||||
/* discover new AP of this network, create BSS entry */
|
||||
Bssidx =
|
||||
BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, Ssid,
|
||||
SsidLen, BssType, BeaconPeriod,
|
||||
@ -1165,7 +1165,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
CkipFlag, &EdcaParm,
|
||||
&QosCapability, &QbssLoad, LenVIE,
|
||||
pVIE);
|
||||
if (Bssidx == BSS_NOT_FOUND) // return if BSS table full
|
||||
if (Bssidx == BSS_NOT_FOUND) /* return if BSS table full */
|
||||
return;
|
||||
|
||||
NdisMoveMemory(pAd->ScanTab.BssEntry[Bssidx].PTSF,
|
||||
@ -1179,16 +1179,16 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
|
||||
if ((pAd->CommonCfg.bIEEE80211H == 1) && (NewChannel != 0)
|
||||
&& (Channel != NewChannel)) {
|
||||
// Switching to channel 1 can prevent from rescanning the current channel immediately (by auto reconnection).
|
||||
// In addition, clear the MLME queue and the scan table to discard the RX packets and previous scanning results.
|
||||
/* Switching to channel 1 can prevent from rescanning the current channel immediately (by auto reconnection). */
|
||||
/* In addition, clear the MLME queue and the scan table to discard the RX packets and previous scanning results. */
|
||||
AsicSwitchChannel(pAd, 1, FALSE);
|
||||
AsicLockChannel(pAd, 1);
|
||||
LinkDown(pAd, FALSE);
|
||||
MlmeQueueInit(&pAd->Mlme.Queue);
|
||||
BssTableInit(&pAd->ScanTab);
|
||||
RTMPusecDelay(1000000); // use delay to prevent STA do reassoc
|
||||
RTMPusecDelay(1000000); /* use delay to prevent STA do reassoc */
|
||||
|
||||
// channel sanity check
|
||||
/* channel sanity check */
|
||||
for (index = 0; index < pAd->ChannelListNum; index++) {
|
||||
if (pAd->ChannelList[index].Channel ==
|
||||
NewChannel) {
|
||||
@ -1211,17 +1211,17 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
DBGPRINT_ERR(("PeerBeacon(can not find New Channel=%d in ChannelList[%d]\n", pAd->CommonCfg.Channel, pAd->ChannelListNum));
|
||||
}
|
||||
}
|
||||
// if the ssid matched & bssid unmatched, we should select the bssid with large value.
|
||||
// This might happened when two STA start at the same time
|
||||
/* if the ssid matched & bssid unmatched, we should select the bssid with large value. */
|
||||
/* This might happened when two STA start at the same time */
|
||||
if ((!is_my_bssid) && ADHOC_ON(pAd)) {
|
||||
INT i;
|
||||
|
||||
// Add the safeguard against the mismatch of adhoc wep status
|
||||
/* Add the safeguard against the mismatch of adhoc wep status */
|
||||
if (pAd->StaCfg.WepStatus !=
|
||||
pAd->ScanTab.BssEntry[Bssidx].WepStatus) {
|
||||
return;
|
||||
}
|
||||
// collapse into the ADHOC network which has bigger BSSID value.
|
||||
/* collapse into the ADHOC network which has bigger BSSID value. */
|
||||
for (i = 0; i < 6; i++) {
|
||||
if (Bssid[i] > pAd->CommonCfg.Bssid[i]) {
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
@ -1233,8 +1233,8 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
COPY_MAC_ADDR(pAd->CommonCfg.Bssid,
|
||||
Bssid);
|
||||
AsicSetBssid(pAd, pAd->CommonCfg.Bssid);
|
||||
MakeIbssBeacon(pAd); // re-build BEACON frame
|
||||
AsicEnableIbssSync(pAd); // copy BEACON frame to on-chip memory
|
||||
MakeIbssBeacon(pAd); /* re-build BEACON frame */
|
||||
AsicEnableIbssSync(pAd); /* copy BEACON frame to on-chip memory */
|
||||
is_my_bssid = TRUE;
|
||||
break;
|
||||
} else if (Bssid[i] < pAd->CommonCfg.Bssid[i])
|
||||
@ -1244,12 +1244,12 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
|
||||
NdisGetSystemUpTime(&Now);
|
||||
pBss = &pAd->ScanTab.BssEntry[Bssidx];
|
||||
pBss->Rssi = RealRssi; // lastest RSSI
|
||||
pBss->LastBeaconRxTime = Now; // last RX timestamp
|
||||
pBss->Rssi = RealRssi; /* lastest RSSI */
|
||||
pBss->LastBeaconRxTime = Now; /* last RX timestamp */
|
||||
|
||||
//
|
||||
// BEACON from my BSSID - either IBSS or INFRA network
|
||||
//
|
||||
/* */
|
||||
/* BEACON from my BSSID - either IBSS or INFRA network */
|
||||
/* */
|
||||
if (is_my_bssid) {
|
||||
RXWI_STRUC RxWI;
|
||||
|
||||
@ -1263,17 +1263,17 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
|
||||
Update_Rssi_Sample(pAd, &pAd->StaCfg.RssiSample, &RxWI);
|
||||
if (AironetCellPowerLimit != 0xFF) {
|
||||
//
|
||||
// We get the Cisco (ccx) "TxPower Limit" required
|
||||
// Changed to appropriate TxPower Limit for Ciso Compatible Extensions
|
||||
//
|
||||
/* */
|
||||
/* We get the Cisco (ccx) "TxPower Limit" required */
|
||||
/* Changed to appropriate TxPower Limit for Ciso Compatible Extensions */
|
||||
/* */
|
||||
ChangeToCellPowerLimit(pAd,
|
||||
AironetCellPowerLimit);
|
||||
} else {
|
||||
//
|
||||
// AironetCellPowerLimit equal to 0xFF means the Cisco (ccx) "TxPower Limit" not exist.
|
||||
// Used the default TX Power Percentage, that set from UI.
|
||||
//
|
||||
/* */
|
||||
/* AironetCellPowerLimit equal to 0xFF means the Cisco (ccx) "TxPower Limit" not exist. */
|
||||
/* Used the default TX Power Percentage, that set from UI. */
|
||||
/* */
|
||||
pAd->CommonCfg.TxPowerPercentage =
|
||||
pAd->CommonCfg.TxPowerDefault;
|
||||
}
|
||||
@ -1283,7 +1283,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
UCHAR idx;
|
||||
MAC_TABLE_ENTRY *pEntry;
|
||||
|
||||
// supported rates array may not be sorted. sort it and find the maximum rate
|
||||
/* supported rates array may not be sorted. sort it and find the maximum rate */
|
||||
for (idx = 0; idx < SupRateLen; idx++) {
|
||||
if (MaxSupportedRateIn500Kbps <
|
||||
(SupRate[idx] & 0x7f))
|
||||
@ -1298,11 +1298,11 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
ExtRate[idx] & 0x7f;
|
||||
}
|
||||
|
||||
// look up the existing table
|
||||
/* look up the existing table */
|
||||
pEntry = MacTableLookup(pAd, Addr2);
|
||||
|
||||
// Ad-hoc mode is using MAC address as BA session. So we need to continuously find newly joined adhoc station by receiving beacon.
|
||||
// To prevent always check this, we use wcid == RESERVED_WCID to recognize it as newly joined adhoc station.
|
||||
/* Ad-hoc mode is using MAC address as BA session. So we need to continuously find newly joined adhoc station by receiving beacon. */
|
||||
/* To prevent always check this, we use wcid == RESERVED_WCID to recognize it as newly joined adhoc station. */
|
||||
if ((ADHOC_ON(pAd)
|
||||
&& (Elem->Wcid == RESERVED_WCID))
|
||||
|| (pEntry
|
||||
@ -1311,7 +1311,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
ADHOC_ENTRY_BEACON_LOST_TIME) <
|
||||
Now))) {
|
||||
if (pEntry == NULL)
|
||||
// Another adhoc joining, add to our MAC table.
|
||||
/* Another adhoc joining, add to our MAC table. */
|
||||
pEntry =
|
||||
MacTableInsertEntry(pAd,
|
||||
Addr2,
|
||||
@ -1345,7 +1345,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
if (pEntry && pEntry->ValidAsCLI)
|
||||
pEntry->LastBeaconRxTime = Now;
|
||||
|
||||
// At least another peer in this IBSS, declare MediaState as CONNECTED
|
||||
/* At least another peer in this IBSS, declare MediaState as CONNECTED */
|
||||
if (!OPSTATUS_TEST_FLAG
|
||||
(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)) {
|
||||
OPSTATUS_SET_FLAG(pAd,
|
||||
@ -1357,10 +1357,10 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
pAd->ExtraInfo = GENERAL_LINK_UP;
|
||||
AsicSetBssid(pAd, pAd->CommonCfg.Bssid);
|
||||
|
||||
// 2003/03/12 - john
|
||||
// Make sure this entry in "ScanTab" table, thus complies to Microsoft's policy that
|
||||
// "site survey" result should always include the current connected network.
|
||||
//
|
||||
/* 2003/03/12 - john */
|
||||
/* Make sure this entry in "ScanTab" table, thus complies to Microsoft's policy that */
|
||||
/* "site survey" result should always include the current connected network. */
|
||||
/* */
|
||||
Bssidx =
|
||||
BssTableSearch(&pAd->ScanTab, Bssid,
|
||||
Channel);
|
||||
@ -1404,12 +1404,12 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
if (INFRA_ON(pAd)) {
|
||||
BOOLEAN bUseShortSlot, bUseBGProtection;
|
||||
|
||||
// decide to use/change to -
|
||||
// 1. long slot (20 us) or short slot (9 us) time
|
||||
// 2. turn on/off RTS/CTS and/or CTS-to-self protection
|
||||
// 3. short preamble
|
||||
/* decide to use/change to - */
|
||||
/* 1. long slot (20 us) or short slot (9 us) time */
|
||||
/* 2. turn on/off RTS/CTS and/or CTS-to-self protection */
|
||||
/* 3. short preamble */
|
||||
|
||||
//bUseShortSlot = pAd->CommonCfg.bUseShortSlotTime && CAP_IS_SHORT_SLOT(CapabilityInfo);
|
||||
/*bUseShortSlot = pAd->CommonCfg.bUseShortSlotTime && CAP_IS_SHORT_SLOT(CapabilityInfo); */
|
||||
bUseShortSlot =
|
||||
CAP_IS_SHORT_SLOT(CapabilityInfo);
|
||||
if (bUseShortSlot !=
|
||||
@ -1417,11 +1417,11 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
fOP_STATUS_SHORT_SLOT_INUSED))
|
||||
AsicSetSlotTime(pAd, bUseShortSlot);
|
||||
|
||||
bUseBGProtection = (pAd->CommonCfg.UseBGProtection == 1) || // always use
|
||||
bUseBGProtection = (pAd->CommonCfg.UseBGProtection == 1) || /* always use */
|
||||
((pAd->CommonCfg.UseBGProtection == 0)
|
||||
&& ERP_IS_USE_PROTECTION(Erp));
|
||||
|
||||
if (pAd->CommonCfg.Channel > 14) // always no BG protection in A-band. falsely happened when switching A/G band to a dual-band AP
|
||||
if (pAd->CommonCfg.Channel > 14) /* always no BG protection in A-band. falsely happened when switching A/G band to a dual-band AP */
|
||||
bUseBGProtection = FALSE;
|
||||
|
||||
if (bUseBGProtection !=
|
||||
@ -1472,7 +1472,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
("SYNC - AP changed B/G protection to %d\n",
|
||||
bUseBGProtection));
|
||||
}
|
||||
// check Ht protection mode. and adhere to the Non-GF device indication by AP.
|
||||
/* check Ht protection mode. and adhere to the Non-GF device indication by AP. */
|
||||
if ((AddHtInfoLen != 0) &&
|
||||
((AddHtInfo.AddHtInfo2.OperaionMode !=
|
||||
pAd->MlmeAux.AddHtInfo.AddHtInfo2.
|
||||
@ -1532,7 +1532,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
EdcaParm.EdcaUpdateCount));
|
||||
AsicSetEdcaParm(pAd, &EdcaParm);
|
||||
}
|
||||
// copy QOS related information
|
||||
/* copy QOS related information */
|
||||
NdisMoveMemory(&pAd->CommonCfg.APQbssLoad,
|
||||
&QbssLoad,
|
||||
sizeof(QBSS_LOAD_PARM));
|
||||
@ -1540,28 +1540,28 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
&QosCapability,
|
||||
sizeof(QOS_CAPABILITY_PARM));
|
||||
}
|
||||
// only INFRASTRUCTURE mode support power-saving feature
|
||||
/* only INFRASTRUCTURE mode support power-saving feature */
|
||||
if ((INFRA_ON(pAd) && (pAd->StaCfg.Psm == PWR_SAVE))
|
||||
|| (pAd->CommonCfg.bAPSDForcePowerSave)) {
|
||||
UCHAR FreeNumber;
|
||||
// 1. AP has backlogged unicast-to-me frame, stay AWAKE, send PSPOLL
|
||||
// 2. AP has backlogged broadcast/multicast frame and we want those frames, stay AWAKE
|
||||
// 3. we have outgoing frames in TxRing or MgmtRing, better stay AWAKE
|
||||
// 4. Psm change to PWR_SAVE, but AP not been informed yet, we better stay AWAKE
|
||||
// 5. otherwise, put PHY back to sleep to save battery.
|
||||
/* 1. AP has backlogged unicast-to-me frame, stay AWAKE, send PSPOLL */
|
||||
/* 2. AP has backlogged broadcast/multicast frame and we want those frames, stay AWAKE */
|
||||
/* 3. we have outgoing frames in TxRing or MgmtRing, better stay AWAKE */
|
||||
/* 4. Psm change to PWR_SAVE, but AP not been informed yet, we better stay AWAKE */
|
||||
/* 5. otherwise, put PHY back to sleep to save battery. */
|
||||
if (MessageToMe) {
|
||||
#ifdef RTMP_MAC_PCI
|
||||
if (OPSTATUS_TEST_FLAG
|
||||
(pAd, fOP_STATUS_PCIE_DEVICE)) {
|
||||
// Restore to correct BBP R3 value
|
||||
/* Restore to correct BBP R3 value */
|
||||
if (pAd->Antenna.field.RxPath >
|
||||
1)
|
||||
RTMP_BBP_IO_WRITE8_BY_REG_ID
|
||||
(pAd, BBP_R3,
|
||||
pAd->StaCfg.BBPR3);
|
||||
// Turn clk to 80Mhz.
|
||||
/* Turn clk to 80Mhz. */
|
||||
}
|
||||
#endif // RTMP_MAC_PCI //
|
||||
#endif /* RTMP_MAC_PCI // */
|
||||
if (pAd->CommonCfg.bAPSDCapable
|
||||
&& pAd->CommonCfg.APEdcaParm.
|
||||
bAPSDCapable
|
||||
@ -1587,7 +1587,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
(pAd, BBP_R3,
|
||||
pAd->StaCfg.BBPR3);
|
||||
}
|
||||
#endif // RTMP_MAC_PCI //
|
||||
#endif /* RTMP_MAC_PCI // */
|
||||
} else
|
||||
if ((pAd->TxSwQueue[QID_AC_BK].Number != 0)
|
||||
|| (pAd->TxSwQueue[QID_AC_BE].Number !=
|
||||
@ -1617,8 +1617,8 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
(pAd, QID_MGMT, MGMT_RING_SIZE - 1,
|
||||
&FreeNumber) !=
|
||||
NDIS_STATUS_SUCCESS)) {
|
||||
// TODO: consider scheduled HCCA. might not be proper to use traditional DTIM-based power-saving scheme
|
||||
// can we cheat here (i.e. just check MGMT & AC_BE) for better performance?
|
||||
/* TODO: consider scheduled HCCA. might not be proper to use traditional DTIM-based power-saving scheme */
|
||||
/* can we cheat here (i.e. just check MGMT & AC_BE) for better performance? */
|
||||
#ifdef RTMP_MAC_PCI
|
||||
if (OPSTATUS_TEST_FLAG
|
||||
(pAd, fOP_STATUS_PCIE_DEVICE)) {
|
||||
@ -1628,7 +1628,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
(pAd, BBP_R3,
|
||||
pAd->StaCfg.BBPR3);
|
||||
}
|
||||
#endif // RTMP_MAC_PCI //
|
||||
#endif /* RTMP_MAC_PCI // */
|
||||
} else {
|
||||
if ((pAd->CommonCfg.
|
||||
bACMAPSDTr[QID_AC_VO])
|
||||
@ -1678,7 +1678,7 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
|
||||
if (!OPSTATUS_TEST_FLAG
|
||||
(pAd, fOP_STATUS_DOZE)) {
|
||||
// Set a flag to go to sleep . Then after parse this RxDoneInterrupt, will go to sleep mode.
|
||||
/* Set a flag to go to sleep . Then after parse this RxDoneInterrupt, will go to sleep mode. */
|
||||
pAd->
|
||||
ThisTbttNumToNextWakeUp
|
||||
=
|
||||
@ -1692,9 +1692,9 @@ VOID PeerBeacon(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
}
|
||||
}
|
||||
}
|
||||
// not my BSSID, ignore it
|
||||
/* not my BSSID, ignore it */
|
||||
}
|
||||
// sanity check fail, ignore this frame
|
||||
/* sanity check fail, ignore this frame */
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1728,12 +1728,12 @@ VOID PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
if ((SsidLen == 0)
|
||||
|| SSID_EQUAL(Ssid, SsidLen, pAd->CommonCfg.Ssid,
|
||||
pAd->CommonCfg.SsidLen)) {
|
||||
// allocate and send out ProbeRsp frame
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
|
||||
/* allocate and send out ProbeRsp frame */
|
||||
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
||||
if (NStatus != NDIS_STATUS_SUCCESS)
|
||||
return;
|
||||
|
||||
//pAd->StaCfg.AtimWin = 0; // ??????
|
||||
/*pAd->StaCfg.AtimWin = 0; // ?????? */
|
||||
|
||||
Privacy =
|
||||
(pAd->StaCfg.WepStatus ==
|
||||
@ -1774,7 +1774,7 @@ VOID PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
END_OF_ARGS);
|
||||
FrameLen += tmp;
|
||||
}
|
||||
// If adhoc secruity is set for WPA-None, append the cipher suite IE
|
||||
/* If adhoc secruity is set for WPA-None, append the cipher suite IE */
|
||||
if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone) {
|
||||
ULONG tmp;
|
||||
MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
|
||||
@ -1792,7 +1792,7 @@ VOID PeerProbeReqAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
HtLen = sizeof(pAd->CommonCfg.HtCapability);
|
||||
AddHtLen = sizeof(pAd->CommonCfg.AddHTInfo);
|
||||
NewExtLen = 1;
|
||||
//New extension channel offset IE is included in Beacon, Probe Rsp or channel Switch Announcement Frame
|
||||
/*New extension channel offset IE is included in Beacon, Probe Rsp or channel Switch Announcement Frame */
|
||||
if (pAd->bBroadComHT == TRUE) {
|
||||
MakeOutgoingFrame(pOutBuffer + FrameLen,
|
||||
&TmpLen, 1, &WpaIe, 4,
|
||||
@ -1852,14 +1852,14 @@ VOID ScanTimeoutAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
{
|
||||
pAd->MlmeAux.Channel = NextChannel(pAd, pAd->MlmeAux.Channel);
|
||||
|
||||
// Only one channel scanned for CISCO beacon request
|
||||
/* Only one channel scanned for CISCO beacon request */
|
||||
if ((pAd->MlmeAux.ScanType == SCAN_CISCO_ACTIVE) ||
|
||||
(pAd->MlmeAux.ScanType == SCAN_CISCO_PASSIVE) ||
|
||||
(pAd->MlmeAux.ScanType == SCAN_CISCO_NOISE) ||
|
||||
(pAd->MlmeAux.ScanType == SCAN_CISCO_CHANNEL_LOAD))
|
||||
pAd->MlmeAux.Channel = 0;
|
||||
|
||||
// this routine will stop if pAd->MlmeAux.Channel == 0
|
||||
/* this routine will stop if pAd->MlmeAux.Channel == 0 */
|
||||
ScanNextChannel(pAd);
|
||||
}
|
||||
|
||||
@ -1942,12 +1942,12 @@ VOID EnqueueProbeRequest(IN PRTMP_ADAPTER pAd)
|
||||
|
||||
DBGPRINT(RT_DEBUG_TRACE, ("force out a ProbeRequest ...\n"));
|
||||
|
||||
NState = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
|
||||
NState = MlmeAllocateMemory(pAd, &pOutBuffer); /*Get an unused nonpaged memory */
|
||||
if (NState == NDIS_STATUS_SUCCESS) {
|
||||
MgtMacHeaderInit(pAd, &Hdr80211, SUBTYPE_PROBE_REQ, 0,
|
||||
BROADCAST_ADDR, BROADCAST_ADDR);
|
||||
|
||||
// this ProbeRequest explicitly specify SSID to reduce unwanted ProbeResponse
|
||||
/* this ProbeRequest explicitly specify SSID to reduce unwanted ProbeResponse */
|
||||
MakeOutgoingFrame(pOutBuffer, &FrameLen,
|
||||
sizeof(HEADER_802_11), &Hdr80211,
|
||||
1, &SsidIe,
|
||||
|
@ -63,7 +63,7 @@ VOID RTMPReportMicError(IN PRTMP_ADAPTER pAd, IN PCIPHER_KEY pWpaKey)
|
||||
ULONG Now;
|
||||
UCHAR unicastKey = (pWpaKey->Type == PAIRWISE_KEY ? 1 : 0);
|
||||
|
||||
// Record Last MIC error time and count
|
||||
/* Record Last MIC error time and count */
|
||||
NdisGetSystemUpTime(&Now);
|
||||
if (pAd->StaCfg.MicErrCnt == 0) {
|
||||
pAd->StaCfg.MicErrCnt++;
|
||||
@ -71,7 +71,7 @@ VOID RTMPReportMicError(IN PRTMP_ADAPTER pAd, IN PCIPHER_KEY pWpaKey)
|
||||
NdisZeroMemory(pAd->StaCfg.ReplayCounter, 8);
|
||||
} else if (pAd->StaCfg.MicErrCnt == 1) {
|
||||
if ((pAd->StaCfg.LastMicErrorTime + (60 * OS_HZ)) < Now) {
|
||||
// Update Last MIC error time, this did not violate two MIC errors within 60 seconds
|
||||
/* Update Last MIC error time, this did not violate two MIC errors within 60 seconds */
|
||||
pAd->StaCfg.LastMicErrorTime = Now;
|
||||
} else {
|
||||
|
||||
@ -83,23 +83,23 @@ VOID RTMPReportMicError(IN PRTMP_ADAPTER pAd, IN PCIPHER_KEY pWpaKey)
|
||||
BSS0, 0);
|
||||
|
||||
pAd->StaCfg.LastMicErrorTime = Now;
|
||||
// Violate MIC error counts, MIC countermeasures kicks in
|
||||
/* Violate MIC error counts, MIC countermeasures kicks in */
|
||||
pAd->StaCfg.MicErrCnt++;
|
||||
// We shall block all reception
|
||||
// We shall clean all Tx ring and disassoicate from AP after next EAPOL frame
|
||||
//
|
||||
// No necessary to clean all Tx ring, on RTMPHardTransmit will stop sending non-802.1X EAPOL packets
|
||||
// if pAd->StaCfg.MicErrCnt greater than 2.
|
||||
//
|
||||
// RTMPRingCleanUp(pAd, QID_AC_BK);
|
||||
// RTMPRingCleanUp(pAd, QID_AC_BE);
|
||||
// RTMPRingCleanUp(pAd, QID_AC_VI);
|
||||
// RTMPRingCleanUp(pAd, QID_AC_VO);
|
||||
// RTMPRingCleanUp(pAd, QID_HCCA);
|
||||
/* We shall block all reception */
|
||||
/* We shall clean all Tx ring and disassoicate from AP after next EAPOL frame */
|
||||
/* */
|
||||
/* No necessary to clean all Tx ring, on RTMPHardTransmit will stop sending non-802.1X EAPOL packets */
|
||||
/* if pAd->StaCfg.MicErrCnt greater than 2. */
|
||||
/* */
|
||||
/* RTMPRingCleanUp(pAd, QID_AC_BK); */
|
||||
/* RTMPRingCleanUp(pAd, QID_AC_BE); */
|
||||
/* RTMPRingCleanUp(pAd, QID_AC_VI); */
|
||||
/* RTMPRingCleanUp(pAd, QID_AC_VO); */
|
||||
/* RTMPRingCleanUp(pAd, QID_HCCA); */
|
||||
}
|
||||
} else {
|
||||
// MIC error count >= 2
|
||||
// This should not happen
|
||||
/* MIC error count >= 2 */
|
||||
/* This should not happen */
|
||||
;
|
||||
}
|
||||
MlmeEnqueue(pAd,
|
||||
@ -112,7 +112,7 @@ VOID RTMPReportMicError(IN PRTMP_ADAPTER pAd, IN PCIPHER_KEY pWpaKey)
|
||||
}
|
||||
|
||||
#define LENGTH_EAP_H 4
|
||||
// If the received frame is EAP-Packet ,find out its EAP-Code (Request(0x01), Response(0x02), Success(0x03), Failure(0x04)).
|
||||
/* If the received frame is EAP-Packet ,find out its EAP-Code (Request(0x01), Response(0x02), Success(0x03), Failure(0x04)). */
|
||||
INT WpaCheckEapCode(IN PRTMP_ADAPTER pAd,
|
||||
IN PUCHAR pFrame, IN USHORT FrameLen, IN USHORT OffSet)
|
||||
{
|
||||
@ -123,11 +123,11 @@ INT WpaCheckEapCode(IN PRTMP_ADAPTER pAd,
|
||||
if (FrameLen < OffSet + LENGTH_EAPOL_H + LENGTH_EAP_H)
|
||||
return result;
|
||||
|
||||
pData = pFrame + OffSet; // skip offset bytes
|
||||
pData = pFrame + OffSet; /* skip offset bytes */
|
||||
|
||||
if (*(pData + 1) == EAPPacket) // 802.1x header - Packet Type
|
||||
if (*(pData + 1) == EAPPacket) /* 802.1x header - Packet Type */
|
||||
{
|
||||
result = *(pData + 4); // EAP header - Code
|
||||
result = *(pData + 4); /* EAP header - Code */
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -161,7 +161,7 @@ VOID WpaMicFailureReportFrame(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
bUnicast = (Elem->Msg[0] == 1 ? TRUE : FALSE);
|
||||
pAd->Sequence = ((pAd->Sequence) + 1) & (MAX_SEQ_NUMBER);
|
||||
|
||||
// init 802.3 header and Fill Packet
|
||||
/* init 802.3 header and Fill Packet */
|
||||
MAKE_802_3_HEADER(Header802_3, pAd->CommonCfg.Bssid,
|
||||
pAd->CurrentAddress, EAPOL);
|
||||
|
||||
@ -171,59 +171,59 @@ VOID WpaMicFailureReportFrame(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
||||
|
||||
Packet.KeyDesc.Type = WPA1_KEY_DESC;
|
||||
|
||||
// Request field presented
|
||||
/* Request field presented */
|
||||
Packet.KeyDesc.KeyInfo.Request = 1;
|
||||
|
||||
if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled) {
|
||||
Packet.KeyDesc.KeyInfo.KeyDescVer = 2;
|
||||
} else // TKIP
|
||||
} else /* TKIP */
|
||||
{
|
||||
Packet.KeyDesc.KeyInfo.KeyDescVer = 1;
|
||||
}
|
||||
|
||||
Packet.KeyDesc.KeyInfo.KeyType = (bUnicast ? PAIRWISEKEY : GROUPKEY);
|
||||
|
||||
// KeyMic field presented
|
||||
/* KeyMic field presented */
|
||||
Packet.KeyDesc.KeyInfo.KeyMic = 1;
|
||||
|
||||
// Error field presented
|
||||
/* Error field presented */
|
||||
Packet.KeyDesc.KeyInfo.Error = 1;
|
||||
|
||||
// Update packet length after decide Key data payload
|
||||
/* Update packet length after decide Key data payload */
|
||||
SET_UINT16_TO_ARRARY(Packet.Body_Len, LEN_EAPOL_KEY_MSG)
|
||||
// Key Replay Count
|
||||
/* Key Replay Count */
|
||||
NdisMoveMemory(Packet.KeyDesc.ReplayCounter,
|
||||
pAd->StaCfg.ReplayCounter, LEN_KEY_DESC_REPLAY);
|
||||
inc_byte_array(pAd->StaCfg.ReplayCounter, 8);
|
||||
|
||||
// Convert to little-endian format.
|
||||
/* Convert to little-endian format. */
|
||||
*((USHORT *) & Packet.KeyDesc.KeyInfo) =
|
||||
cpu2le16(*((USHORT *) & Packet.KeyDesc.KeyInfo));
|
||||
|
||||
MlmeAllocateMemory(pAd, (PUCHAR *) & pOutBuffer); // allocate memory
|
||||
MlmeAllocateMemory(pAd, (PUCHAR *) & pOutBuffer); /* allocate memory */
|
||||
if (pOutBuffer == NULL) {
|
||||
return;
|
||||
}
|
||||
// Prepare EAPOL frame for MIC calculation
|
||||
// Be careful, only EAPOL frame is counted for MIC calculation
|
||||
/* Prepare EAPOL frame for MIC calculation */
|
||||
/* Be careful, only EAPOL frame is counted for MIC calculation */
|
||||
MakeOutgoingFrame(pOutBuffer, &FrameLen,
|
||||
CONV_ARRARY_TO_UINT16(Packet.Body_Len) + 4, &Packet,
|
||||
END_OF_ARGS);
|
||||
|
||||
// Prepare and Fill MIC value
|
||||
/* Prepare and Fill MIC value */
|
||||
NdisZeroMemory(Mic, sizeof(Mic));
|
||||
if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled) { // AES
|
||||
if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled) { /* AES */
|
||||
UCHAR digest[20] = { 0 };
|
||||
HMAC_SHA1(pAd->StaCfg.PTK, LEN_EAP_MICK, pOutBuffer, FrameLen,
|
||||
digest, SHA1_DIGEST_SIZE);
|
||||
NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC);
|
||||
} else { // TKIP
|
||||
} else { /* TKIP */
|
||||
HMAC_MD5(pAd->StaCfg.PTK, LEN_EAP_MICK, pOutBuffer, FrameLen,
|
||||
Mic, MD5_DIGEST_SIZE);
|
||||
}
|
||||
NdisMoveMemory(Packet.KeyDesc.KeyMic, Mic, LEN_KEY_DESC_MIC);
|
||||
|
||||
// copy frame to Tx ring and send MIC failure report frame to authenticator
|
||||
/* copy frame to Tx ring and send MIC failure report frame to authenticator */
|
||||
RTMPToWirelessSta(pAd, &pAd->MacTab.Content[BSSID_WCID],
|
||||
Header802_3, LENGTH_802_3,
|
||||
(PUCHAR) & Packet,
|
||||
@ -262,7 +262,7 @@ VOID WpaDisassocApAndBlockAssoc(IN PVOID SystemSpecific1,
|
||||
RTMP_ADAPTER *pAd = (PRTMP_ADAPTER) FunctionContext;
|
||||
MLME_DISASSOC_REQ_STRUCT DisassocReq;
|
||||
|
||||
// disassoc from current AP first
|
||||
/* disassoc from current AP first */
|
||||
DBGPRINT(RT_DEBUG_TRACE,
|
||||
("RTMPReportMicError - disassociate with current AP after sending second continuous EAPOL frame\n"));
|
||||
DisassocParmFill(pAd, &DisassocReq, pAd->CommonCfg.Bssid,
|
||||
@ -281,12 +281,12 @@ VOID WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd)
|
||||
|
||||
pEntry = &pAd->MacTab.Content[BSSID_WCID];
|
||||
|
||||
// Pairwise key shall use key#0
|
||||
/* Pairwise key shall use key#0 */
|
||||
pSharedKey = &pAd->SharedKey[BSS0][0];
|
||||
|
||||
NdisMoveMemory(pAd->StaCfg.PTK, pEntry->PTK, LEN_PTK);
|
||||
|
||||
// Prepare pair-wise key information into shared key table
|
||||
/* Prepare pair-wise key information into shared key table */
|
||||
NdisZeroMemory(pSharedKey, sizeof(CIPHER_KEY));
|
||||
pSharedKey->KeyLen = LEN_TKIP_EK;
|
||||
NdisMoveMemory(pSharedKey->Key, &pAd->StaCfg.PTK[32], LEN_TKIP_EK);
|
||||
@ -295,7 +295,7 @@ VOID WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd)
|
||||
NdisMoveMemory(pSharedKey->TxMic,
|
||||
&pAd->StaCfg.PTK[48 + LEN_TKIP_RXMICK], LEN_TKIP_TXMICK);
|
||||
|
||||
// Decide its ChiperAlg
|
||||
/* Decide its ChiperAlg */
|
||||
if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
|
||||
pSharedKey->CipherAlg = CIPHER_TKIP;
|
||||
else if (pAd->StaCfg.PairCipher == Ndis802_11Encryption3Enabled)
|
||||
@ -303,7 +303,7 @@ VOID WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd)
|
||||
else
|
||||
pSharedKey->CipherAlg = CIPHER_NONE;
|
||||
|
||||
// Update these related information to MAC_TABLE_ENTRY
|
||||
/* Update these related information to MAC_TABLE_ENTRY */
|
||||
NdisMoveMemory(pEntry->PairwiseKey.Key, &pAd->StaCfg.PTK[32],
|
||||
LEN_TKIP_EK);
|
||||
NdisMoveMemory(pEntry->PairwiseKey.RxMic, &pAd->StaCfg.PTK[48],
|
||||
@ -312,7 +312,7 @@ VOID WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd)
|
||||
&pAd->StaCfg.PTK[48 + LEN_TKIP_RXMICK], LEN_TKIP_TXMICK);
|
||||
pEntry->PairwiseKey.CipherAlg = pSharedKey->CipherAlg;
|
||||
|
||||
// Update pairwise key information to ASIC Shared Key Table
|
||||
/* Update pairwise key information to ASIC Shared Key Table */
|
||||
AsicAddSharedKeyEntry(pAd,
|
||||
BSS0,
|
||||
0,
|
||||
@ -320,7 +320,7 @@ VOID WpaStaPairwiseKeySetting(IN PRTMP_ADAPTER pAd)
|
||||
pSharedKey->Key,
|
||||
pSharedKey->TxMic, pSharedKey->RxMic);
|
||||
|
||||
// Update ASIC WCID attribute table and IVEIV table
|
||||
/* Update ASIC WCID attribute table and IVEIV table */
|
||||
RTMPAddWcidAttributeEntry(pAd, BSS0, 0, pSharedKey->CipherAlg, pEntry);
|
||||
STA_PORT_SECURED(pAd);
|
||||
pAd->IndicateMediaState = NdisMediaStateConnected;
|
||||
@ -336,7 +336,7 @@ VOID WpaStaGroupKeySetting(IN PRTMP_ADAPTER pAd)
|
||||
|
||||
pSharedKey = &pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId];
|
||||
|
||||
// Prepare pair-wise key information into shared key table
|
||||
/* Prepare pair-wise key information into shared key table */
|
||||
NdisZeroMemory(pSharedKey, sizeof(CIPHER_KEY));
|
||||
pSharedKey->KeyLen = LEN_TKIP_EK;
|
||||
NdisMoveMemory(pSharedKey->Key, pAd->StaCfg.GTK, LEN_TKIP_EK);
|
||||
@ -345,7 +345,7 @@ VOID WpaStaGroupKeySetting(IN PRTMP_ADAPTER pAd)
|
||||
NdisMoveMemory(pSharedKey->TxMic, &pAd->StaCfg.GTK[24],
|
||||
LEN_TKIP_TXMICK);
|
||||
|
||||
// Update Shared Key CipherAlg
|
||||
/* Update Shared Key CipherAlg */
|
||||
pSharedKey->CipherAlg = CIPHER_NONE;
|
||||
if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption2Enabled)
|
||||
pSharedKey->CipherAlg = CIPHER_TKIP;
|
||||
@ -356,7 +356,7 @@ VOID WpaStaGroupKeySetting(IN PRTMP_ADAPTER pAd)
|
||||
else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
|
||||
pSharedKey->CipherAlg = CIPHER_WEP128;
|
||||
|
||||
// Update group key information to ASIC Shared Key Table
|
||||
/* Update group key information to ASIC Shared Key Table */
|
||||
AsicAddSharedKeyEntry(pAd,
|
||||
BSS0,
|
||||
pAd->StaCfg.DefaultKeyId,
|
||||
@ -364,7 +364,7 @@ VOID WpaStaGroupKeySetting(IN PRTMP_ADAPTER pAd)
|
||||
pSharedKey->Key,
|
||||
pSharedKey->TxMic, pSharedKey->RxMic);
|
||||
|
||||
// Update ASIC WCID attribute table and IVEIV table
|
||||
/* Update ASIC WCID attribute table and IVEIV table */
|
||||
RTMPAddWcidAttributeEntry(pAd,
|
||||
BSS0,
|
||||
pAd->StaCfg.DefaultKeyId,
|
||||
|
Loading…
x
Reference in New Issue
Block a user