|
|
@@ -37,35 +37,35 @@
|
|
|
#include "../rt_config.h"
|
|
|
|
|
|
UCHAR CipherSuiteWpaNoneTkip[] = {
|
|
|
- 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, 0x00 // authentication
|
|
|
+ 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, 0x00 /* authentication */
|
|
|
};
|
|
|
|
|
|
UCHAR CipherSuiteWpaNoneTkipLen =
|
|
|
(sizeof(CipherSuiteWpaNoneTkip) / sizeof(UCHAR));
|
|
|
|
|
|
UCHAR CipherSuiteWpaNoneAes[] = {
|
|
|
- 0x00, 0x50, 0xf2, 0x01, // oui
|
|
|
- 0x01, 0x00, // Version
|
|
|
- 0x00, 0x50, 0xf2, 0x04, // Multicast
|
|
|
- 0x01, 0x00, // Number of unicast
|
|
|
- 0x00, 0x50, 0xf2, 0x04, // unicast
|
|
|
- 0x01, 0x00, // number of authentication method
|
|
|
- 0x00, 0x50, 0xf2, 0x00 // authentication
|
|
|
+ 0x00, 0x50, 0xf2, 0x01, /* oui */
|
|
|
+ 0x01, 0x00, /* Version */
|
|
|
+ 0x00, 0x50, 0xf2, 0x04, /* Multicast */
|
|
|
+ 0x01, 0x00, /* Number of unicast */
|
|
|
+ 0x00, 0x50, 0xf2, 0x04, /* unicast */
|
|
|
+ 0x01, 0x00, /* number of authentication method */
|
|
|
+ 0x00, 0x50, 0xf2, 0x00 /* authentication */
|
|
|
};
|
|
|
|
|
|
UCHAR CipherSuiteWpaNoneAesLen =
|
|
|
(sizeof(CipherSuiteWpaNoneAes) / sizeof(UCHAR));
|
|
|
|
|
|
-// The following MACRO is called after 1. starting an new IBSS, 2. succesfully JOIN an IBSS,
|
|
|
-// or 3. succesfully ASSOCIATE to a BSS, 4. successfully RE_ASSOCIATE to a BSS
|
|
|
-// All settings successfuly negotiated furing MLME state machines become final settings
|
|
|
-// and are copied to pAd->StaActive
|
|
|
+/* The following MACRO is called after 1. starting an new IBSS, 2. succesfully JOIN an IBSS, */
|
|
|
+/* or 3. succesfully ASSOCIATE to a BSS, 4. successfully RE_ASSOCIATE to a BSS */
|
|
|
+/* All settings successfuly negotiated furing MLME state machines become final settings */
|
|
|
+/* and are copied to pAd->StaActive */
|
|
|
#define COPY_SETTINGS_FROM_MLME_AUX_TO_ACTIVE_CFG(_pAd) \
|
|
|
{ \
|
|
|
NdisZeroMemory((_pAd)->CommonCfg.Ssid, MAX_LEN_OF_SSID); \
|
|
|
@@ -105,8 +105,8 @@ UCHAR CipherSuiteWpaNoneAesLen =
|
|
|
VOID MlmeCntlInit(IN PRTMP_ADAPTER pAd,
|
|
|
IN STATE_MACHINE * S, OUT STATE_MACHINE_FUNC Trans[])
|
|
|
{
|
|
|
- // Control state machine differs from other state machines, the interface
|
|
|
- // follows the standard interface
|
|
|
+ /* Control state machine differs from other state machines, the interface */
|
|
|
+ /* follows the standard interface */
|
|
|
pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
|
|
|
}
|
|
|
|
|
|
@@ -133,12 +133,12 @@ VOID MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd,
|
|
|
CntlWaitJoinProc(pAd, Elem);
|
|
|
break;
|
|
|
|
|
|
- // CNTL_WAIT_REASSOC is the only state in CNTL machine that does
|
|
|
- // not triggered directly or indirectly by "RTMPSetInformation(OID_xxx)".
|
|
|
- // Therefore not protected by NDIS's "only one outstanding OID request"
|
|
|
- // rule. Which means NDIS may SET OID in the middle of ROAMing attempts.
|
|
|
- // Current approach is to block new SET request at RTMPSetInformation()
|
|
|
- // when CntlMachine.CurrState is not CNTL_IDLE
|
|
|
+ /* CNTL_WAIT_REASSOC is the only state in CNTL machine that does */
|
|
|
+ /* not triggered directly or indirectly by "RTMPSetInformation(OID_xxx)". */
|
|
|
+ /* Therefore not protected by NDIS's "only one outstanding OID request" */
|
|
|
+ /* rule. Which means NDIS may SET OID in the middle of ROAMing attempts. */
|
|
|
+ /* Current approach is to block new SET request at RTMPSetInformation() */
|
|
|
+ /* when CntlMachine.CurrState is not CNTL_IDLE */
|
|
|
case CNTL_WAIT_REASSOC:
|
|
|
CntlWaitReassocProc(pAd, Elem);
|
|
|
break;
|
|
|
@@ -158,15 +158,15 @@ VOID MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd,
|
|
|
|
|
|
case CNTL_WAIT_OID_LIST_SCAN:
|
|
|
if (Elem->MsgType == MT2_SCAN_CONF) {
|
|
|
- // Resume TxRing after SCANING complete. We hope the out-of-service time
|
|
|
- // won't be too long to let upper layer time-out the waiting frames
|
|
|
+ /* Resume TxRing after SCANING complete. We hope the out-of-service time */
|
|
|
+ /* won't be too long to let upper layer time-out the waiting frames */
|
|
|
RTMPResumeMsduTransmission(pAd);
|
|
|
|
|
|
pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
|
|
|
|
|
|
- //
|
|
|
- // Set LED status to previous status.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* Set LED status to previous status. */
|
|
|
+ /* */
|
|
|
if (pAd->bLedOnScanning) {
|
|
|
pAd->bLedOnScanning = FALSE;
|
|
|
RTMPSetLED(pAd, pAd->LedStatus);
|
|
|
@@ -181,28 +181,28 @@ VOID MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd,
|
|
|
}
|
|
|
break;
|
|
|
#ifdef RTMP_MAC_USB
|
|
|
- //
|
|
|
- // This state is for that we want to connect to an AP but
|
|
|
- // it didn't find on BSS List table. So we need to scan the air first,
|
|
|
- // after that we can try to connect to the desired AP if available.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* This state is for that we want to connect to an AP but */
|
|
|
+ /* it didn't find on BSS List table. So we need to scan the air first, */
|
|
|
+ /* after that we can try to connect to the desired AP if available. */
|
|
|
+ /* */
|
|
|
case CNTL_WAIT_SCAN_FOR_CONNECT:
|
|
|
if (Elem->MsgType == MT2_SCAN_CONF) {
|
|
|
- // Resume TxRing after SCANING complete. We hope the out-of-service time
|
|
|
- // won't be too long to let upper layer time-out the waiting frames
|
|
|
+ /* Resume TxRing after SCANING complete. We hope the out-of-service time */
|
|
|
+ /* won't be too long to let upper layer time-out the waiting frames */
|
|
|
RTMPResumeMsduTransmission(pAd);
|
|
|
#ifdef CCX_SUPPORT
|
|
|
if (pAd->StaCfg.CCXReqType != MSRN_TYPE_UNUSED) {
|
|
|
- // Cisco scan request is finished, prepare beacon report
|
|
|
+ /* Cisco scan request is finished, prepare beacon report */
|
|
|
MlmeEnqueue(pAd, AIRONET_STATE_MACHINE,
|
|
|
MT2_AIRONET_SCAN_DONE, 0, NULL);
|
|
|
}
|
|
|
-#endif // CCX_SUPPORT //
|
|
|
+#endif /* CCX_SUPPORT // */
|
|
|
pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
|
|
|
|
|
|
- //
|
|
|
- // Check if we can connect to.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* Check if we can connect to. */
|
|
|
+ /* */
|
|
|
BssTableSsidSort(pAd, &pAd->MlmeAux.SsidBssTab,
|
|
|
(CHAR *) pAd->MlmeAux.
|
|
|
AutoReconnectSsid,
|
|
|
@@ -212,7 +212,7 @@ VOID MlmeCntlMachinePerformAction(IN PRTMP_ADAPTER pAd,
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
-#endif // RTMP_MAC_USB //
|
|
|
+#endif /* RTMP_MAC_USB // */
|
|
|
default:
|
|
|
DBGPRINT_ERR(("!ERROR! CNTL - Illegal message type(=%ld)",
|
|
|
Elem->MsgType));
|
|
|
@@ -257,8 +257,8 @@ VOID CntlIdleProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
|
|
|
if (pAd->StaCfg.WpaSupplicantUP !=
|
|
|
WPA_SUPPLICANT_ENABLE_WITH_WEB_UI) {
|
|
|
- // Set the AutoReconnectSsid to prevent it reconnect to old SSID
|
|
|
- // Since calling this indicate user don't want to connect to that SSID anymore.
|
|
|
+ /* Set the AutoReconnectSsid to prevent it reconnect to old SSID */
|
|
|
+ /* Since calling this indicate user don't want to connect to that SSID anymore. */
|
|
|
pAd->MlmeAux.AutoReconnectSsidLen = 32;
|
|
|
NdisZeroMemory(pAd->MlmeAux.AutoReconnectSsid,
|
|
|
pAd->MlmeAux.AutoReconnectSsidLen);
|
|
|
@@ -287,8 +287,8 @@ VOID CntlOidScanProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
ULONG BssIdx = BSS_NOT_FOUND;
|
|
|
BSS_ENTRY CurrBss;
|
|
|
|
|
|
- // record current BSS if network is connected.
|
|
|
- // 2003-2-13 do not include current IBSS if this is the only STA in this IBSS.
|
|
|
+ /* record current BSS if network is connected. */
|
|
|
+ /* 2003-2-13 do not include current IBSS if this is the only STA in this IBSS. */
|
|
|
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)) {
|
|
|
BssIdx =
|
|
|
BssSsidTableSearch(&pAd->ScanTab, pAd->CommonCfg.Bssid,
|
|
|
@@ -300,14 +300,14 @@ VOID CntlOidScanProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
sizeof(BSS_ENTRY));
|
|
|
}
|
|
|
}
|
|
|
- // clean up previous SCAN result, add current BSS back to table if any
|
|
|
+ /* clean up previous SCAN result, add current BSS back to table if any */
|
|
|
BssTableInit(&pAd->ScanTab);
|
|
|
if (BssIdx != BSS_NOT_FOUND) {
|
|
|
- // DDK Note: If the NIC is associated with a particular BSSID and SSID
|
|
|
- // that are not contained in the list of BSSIDs generated by this scan, the
|
|
|
- // BSSID description of the currently associated BSSID and SSID should be
|
|
|
- // appended to the list of BSSIDs in the NIC's database.
|
|
|
- // To ensure this, we append this BSS as the first entry in SCAN result
|
|
|
+ /* DDK Note: If the NIC is associated with a particular BSSID and SSID */
|
|
|
+ /* that are not contained in the list of BSSIDs generated by this scan, the */
|
|
|
+ /* BSSID description of the currently associated BSSID and SSID should be */
|
|
|
+ /* appended to the list of BSSIDs in the NIC's database. */
|
|
|
+ /* To ensure this, we append this BSS as the first entry in SCAN result */
|
|
|
NdisMoveMemory(&pAd->ScanTab.BssEntry[0], &CurrBss,
|
|
|
sizeof(BSS_ENTRY));
|
|
|
pAd->ScanTab.BssNr = 1;
|
|
|
@@ -335,7 +335,7 @@ VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
MLME_DISASSOC_REQ_STRUCT DisassocReq;
|
|
|
ULONG Now;
|
|
|
|
|
|
- // Step 1. record the desired user settings to MlmeAux
|
|
|
+ /* Step 1. record the desired user settings to MlmeAux */
|
|
|
NdisZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID);
|
|
|
NdisMoveMemory(pAd->MlmeAux.Ssid, pOidSsid->Ssid, pOidSsid->SsidLength);
|
|
|
pAd->MlmeAux.SsidLen = (UCHAR) pOidSsid->SsidLength;
|
|
|
@@ -344,16 +344,16 @@ VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
|
|
|
pAd->StaCfg.bAutoConnectByBssid = FALSE;
|
|
|
|
|
|
- //
|
|
|
- // Update Reconnect Ssid, that user desired to connect.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* Update Reconnect Ssid, that user desired to connect. */
|
|
|
+ /* */
|
|
|
NdisZeroMemory(pAd->MlmeAux.AutoReconnectSsid, MAX_LEN_OF_SSID);
|
|
|
NdisMoveMemory(pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.Ssid,
|
|
|
pAd->MlmeAux.SsidLen);
|
|
|
pAd->MlmeAux.AutoReconnectSsidLen = pAd->MlmeAux.SsidLen;
|
|
|
|
|
|
- // step 2. find all matching BSS in the lastest SCAN result (inBssTab)
|
|
|
- // & log them into MlmeAux.SsidBssTab for later-on iteration. Sort by RSSI order
|
|
|
+ /* step 2. find all matching BSS in the lastest SCAN result (inBssTab) */
|
|
|
+ /* & log them into MlmeAux.SsidBssTab for later-on iteration. Sort by RSSI order */
|
|
|
BssTableSsidSort(pAd, &pAd->MlmeAux.SsidBssTab,
|
|
|
(PCHAR) pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
|
|
|
|
|
|
@@ -371,18 +371,18 @@ VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
pAd->CommonCfg.SsidLen)
|
|
|
&& MAC_ADDR_EQUAL(pAd->CommonCfg.Bssid,
|
|
|
pAd->MlmeAux.SsidBssTab.BssEntry[0].Bssid)) {
|
|
|
- // Case 1. already connected with an AP who has the desired SSID
|
|
|
- // with highest RSSI
|
|
|
+ /* Case 1. already connected with an AP who has the desired SSID */
|
|
|
+ /* with highest RSSI */
|
|
|
|
|
|
- // Add checking Mode "LEAP" for CCX 1.0
|
|
|
+ /* Add checking Mode "LEAP" for CCX 1.0 */
|
|
|
if (((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA) ||
|
|
|
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) ||
|
|
|
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) ||
|
|
|
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK)
|
|
|
) &&
|
|
|
(pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED)) {
|
|
|
- // case 1.1 For WPA, WPA-PSK, if the 1x port is not secured, we have to redo
|
|
|
- // connection process
|
|
|
+ /* case 1.1 For WPA, WPA-PSK, if the 1x port is not secured, we have to redo */
|
|
|
+ /* connection process */
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("CntlOidSsidProc():CNTL - disassociate with current AP...\n"));
|
|
|
DisassocParmFill(pAd, &DisassocReq,
|
|
|
@@ -394,7 +394,7 @@ VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
&DisassocReq);
|
|
|
pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_DISASSOC;
|
|
|
} else if (pAd->bConfigChanged == TRUE) {
|
|
|
- // case 1.2 Important Config has changed, we have to reconnect to the same AP
|
|
|
+ /* case 1.2 Important Config has changed, we have to reconnect to the same AP */
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("CntlOidSsidProc():CNTL - disassociate with current AP Because config changed...\n"));
|
|
|
DisassocParmFill(pAd, &DisassocReq,
|
|
|
@@ -406,22 +406,22 @@ VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
&DisassocReq);
|
|
|
pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_DISASSOC;
|
|
|
} else {
|
|
|
- // case 1.3. already connected to the SSID with highest RSSI.
|
|
|
+ /* case 1.3. already connected to the SSID with highest RSSI. */
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("CntlOidSsidProc():CNTL - already with this BSSID. ignore this SET_SSID request\n"));
|
|
|
- //
|
|
|
- // (HCT 12.1) 1c_wlan_mediaevents required
|
|
|
- // media connect events are indicated when associating with the same AP
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* (HCT 12.1) 1c_wlan_mediaevents required */
|
|
|
+ /* media connect events are indicated when associating with the same AP */
|
|
|
+ /* */
|
|
|
if (INFRA_ON(pAd)) {
|
|
|
- //
|
|
|
- // Since MediaState already is NdisMediaStateConnected
|
|
|
- // We just indicate the connect event again to meet the WHQL required.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* Since MediaState already is NdisMediaStateConnected */
|
|
|
+ /* We just indicate the connect event again to meet the WHQL required. */
|
|
|
+ /* */
|
|
|
pAd->IndicateMediaState =
|
|
|
NdisMediaStateConnected;
|
|
|
RTMP_IndicateMediaState(pAd);
|
|
|
- pAd->ExtraInfo = GENERAL_LINK_UP; // Update extra information to link is up
|
|
|
+ pAd->ExtraInfo = GENERAL_LINK_UP; /* Update extra information to link is up */
|
|
|
}
|
|
|
|
|
|
pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
|
|
|
@@ -430,26 +430,26 @@ VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
0);
|
|
|
}
|
|
|
} else if (INFRA_ON(pAd)) {
|
|
|
- //
|
|
|
- // For RT61
|
|
|
- // [88888] OID_802_11_SSID should have returned NDTEST_WEP_AP2(Returned: )
|
|
|
- // RT61 may lost SSID, and not connect to NDTEST_WEP_AP2 and will connect to NDTEST_WEP_AP2 by Autoreconnect
|
|
|
- // But media status is connected, so the SSID not report correctly.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* For RT61 */
|
|
|
+ /* [88888] OID_802_11_SSID should have returned NDTEST_WEP_AP2(Returned: ) */
|
|
|
+ /* RT61 may lost SSID, and not connect to NDTEST_WEP_AP2 and will connect to NDTEST_WEP_AP2 by Autoreconnect */
|
|
|
+ /* But media status is connected, so the SSID not report correctly. */
|
|
|
+ /* */
|
|
|
if (!SSID_EQUAL
|
|
|
(pAd->CommonCfg.Ssid, pAd->CommonCfg.SsidLen,
|
|
|
pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen)) {
|
|
|
- //
|
|
|
- // Different SSID means not Roaming case, so we let LinkDown() to Indicate a disconnect event.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* Different SSID means not Roaming case, so we let LinkDown() to Indicate a disconnect event. */
|
|
|
+ /* */
|
|
|
pAd->MlmeAux.CurrReqIsFromNdis = TRUE;
|
|
|
}
|
|
|
- // case 2. active INFRA association existent
|
|
|
- // roaming is done within miniport driver, nothing to do with configuration
|
|
|
- // utility. so upon a new SET(OID_802_11_SSID) is received, we just
|
|
|
- // disassociate with the current associated AP,
|
|
|
- // then perform a new association with this new SSID, no matter the
|
|
|
- // new/old SSID are the same or not.
|
|
|
+ /* case 2. active INFRA association existent */
|
|
|
+ /* roaming is done within miniport driver, nothing to do with configuration */
|
|
|
+ /* utility. so upon a new SET(OID_802_11_SSID) is received, we just */
|
|
|
+ /* disassociate with the current associated AP, */
|
|
|
+ /* then perform a new association with this new SSID, no matter the */
|
|
|
+ /* new/old SSID are the same or not. */
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("CntlOidSsidProc():CNTL - disassociate with current AP...\n"));
|
|
|
DisassocParmFill(pAd, &DisassocReq, pAd->CommonCfg.Bssid,
|
|
|
@@ -488,7 +488,7 @@ VOID CntlOidSsidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
|
|
|
pAd->Mlme.CntlMachine.CurrState =
|
|
|
CNTL_WAIT_OID_LIST_SCAN;
|
|
|
- // Reset Missed scan number
|
|
|
+ /* Reset Missed scan number */
|
|
|
pAd->StaCfg.LastScanTime = Now;
|
|
|
} else {
|
|
|
pAd->MlmeAux.BssIdx = 0;
|
|
|
@@ -512,18 +512,18 @@ VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
MLME_DISASSOC_REQ_STRUCT DisassocReq;
|
|
|
MLME_JOIN_REQ_STRUCT JoinReq;
|
|
|
|
|
|
- // record user desired settings
|
|
|
+ /* record user desired settings */
|
|
|
COPY_MAC_ADDR(pAd->MlmeAux.Bssid, pOidBssid);
|
|
|
pAd->MlmeAux.BssType = pAd->StaCfg.BssType;
|
|
|
|
|
|
- // find the desired BSS in the latest SCAN result table
|
|
|
+ /* find the desired BSS in the latest SCAN result table */
|
|
|
BssIdx = BssTableSearch(&pAd->ScanTab, pOidBssid, pAd->MlmeAux.Channel);
|
|
|
if (BssIdx == BSS_NOT_FOUND) {
|
|
|
MLME_SCAN_REQ_STRUCT ScanReq;
|
|
|
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("CNTL - BSSID not found. reply NDIS_STATUS_NOT_ACCEPTED\n"));
|
|
|
- //pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
|
|
|
+ /*pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE; */
|
|
|
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("CNTL - BSSID not found. start a new scan\n"));
|
|
|
@@ -532,13 +532,13 @@ VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ,
|
|
|
sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
|
|
|
pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
|
|
|
- // Reset Missed scan number
|
|
|
+ /* Reset Missed scan number */
|
|
|
NdisGetSystemUpTime(&pAd->StaCfg.LastScanTime);
|
|
|
return;
|
|
|
}
|
|
|
- //
|
|
|
- // Update Reconnect Ssid, that user desired to connect.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* Update Reconnect Ssid, that user desired to connect. */
|
|
|
+ /* */
|
|
|
NdisZeroMemory(pAd->MlmeAux.AutoReconnectSsid, MAX_LEN_OF_SSID);
|
|
|
pAd->MlmeAux.AutoReconnectSsidLen =
|
|
|
pAd->ScanTab.BssEntry[BssIdx].SsidLen;
|
|
|
@@ -546,21 +546,21 @@ VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
pAd->ScanTab.BssEntry[BssIdx].Ssid,
|
|
|
pAd->ScanTab.BssEntry[BssIdx].SsidLen);
|
|
|
|
|
|
- // copy the matched BSS entry from ScanTab to MlmeAux.SsidBssTab. Why?
|
|
|
- // Because we need this entry to become the JOIN target in later on SYNC state machine
|
|
|
+ /* copy the matched BSS entry from ScanTab to MlmeAux.SsidBssTab. Why? */
|
|
|
+ /* Because we need this entry to become the JOIN target in later on SYNC state machine */
|
|
|
pAd->MlmeAux.BssIdx = 0;
|
|
|
pAd->MlmeAux.SsidBssTab.BssNr = 1;
|
|
|
NdisMoveMemory(&pAd->MlmeAux.SsidBssTab.BssEntry[0],
|
|
|
&pAd->ScanTab.BssEntry[BssIdx], sizeof(BSS_ENTRY));
|
|
|
|
|
|
- // Add SSID into MlmeAux for site surey joining hidden SSID
|
|
|
+ /* Add SSID into MlmeAux for site surey joining hidden SSID */
|
|
|
pAd->MlmeAux.SsidLen = pAd->ScanTab.BssEntry[BssIdx].SsidLen;
|
|
|
NdisMoveMemory(pAd->MlmeAux.Ssid, pAd->ScanTab.BssEntry[BssIdx].Ssid,
|
|
|
pAd->MlmeAux.SsidLen);
|
|
|
|
|
|
{
|
|
|
if (INFRA_ON(pAd)) {
|
|
|
- // disassoc from current AP first
|
|
|
+ /* disassoc from current AP first */
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("CNTL - disassociate with current AP ...\n"));
|
|
|
DisassocParmFill(pAd, &DisassocReq,
|
|
|
@@ -586,14 +586,14 @@ VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("NDIS_STATUS_MEDIA_DISCONNECT Event C!\n"));
|
|
|
}
|
|
|
- // Change the wepstatus to original wepstatus
|
|
|
+ /* Change the wepstatus to original wepstatus */
|
|
|
pAd->StaCfg.WepStatus = pAd->StaCfg.OrigWepStatus;
|
|
|
pAd->StaCfg.PairCipher = pAd->StaCfg.OrigWepStatus;
|
|
|
pAd->StaCfg.GroupCipher = pAd->StaCfg.OrigWepStatus;
|
|
|
|
|
|
- // Check cipher suite, AP must have more secured cipher than station setting
|
|
|
- // Set the Pairwise and Group cipher to match the intended AP setting
|
|
|
- // We can only connect to AP with less secured cipher setting
|
|
|
+ /* Check cipher suite, AP must have more secured cipher than station setting */
|
|
|
+ /* Set the Pairwise and Group cipher to match the intended AP setting */
|
|
|
+ /* We can only connect to AP with less secured cipher setting */
|
|
|
if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA)
|
|
|
|| (pAd->StaCfg.AuthMode ==
|
|
|
Ndis802_11AuthModeWPAPSK)) {
|
|
|
@@ -612,7 +612,7 @@ VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
pAd->StaCfg.PairCipher =
|
|
|
pAd->ScanTab.BssEntry[BssIdx].WPA.
|
|
|
PairCipherAux;
|
|
|
- else // There is no PairCipher Aux, downgrade our capability to TKIP
|
|
|
+ else /* There is no PairCipher Aux, downgrade our capability to TKIP */
|
|
|
pAd->StaCfg.PairCipher =
|
|
|
Ndis802_11Encryption2Enabled;
|
|
|
} else
|
|
|
@@ -634,16 +634,16 @@ VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
pAd->StaCfg.PairCipher =
|
|
|
pAd->ScanTab.BssEntry[BssIdx].WPA2.
|
|
|
PairCipherAux;
|
|
|
- else // There is no PairCipher Aux, downgrade our capability to TKIP
|
|
|
+ else /* There is no PairCipher Aux, downgrade our capability to TKIP */
|
|
|
pAd->StaCfg.PairCipher =
|
|
|
Ndis802_11Encryption2Enabled;
|
|
|
|
|
|
- // RSN capability
|
|
|
+ /* RSN capability */
|
|
|
pAd->StaCfg.RsnCapability =
|
|
|
pAd->ScanTab.BssEntry[BssIdx].WPA2.
|
|
|
RsnCapability;
|
|
|
}
|
|
|
- // Set Mix cipher flag
|
|
|
+ /* Set Mix cipher flag */
|
|
|
pAd->StaCfg.bMixCipher =
|
|
|
(pAd->StaCfg.PairCipher ==
|
|
|
pAd->StaCfg.GroupCipher) ? FALSE : TRUE;
|
|
|
@@ -652,7 +652,7 @@ VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
// If mix cipher, re-build RSNIE
|
|
|
RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, 0);
|
|
|
} */
|
|
|
- // No active association, join the BSS immediately
|
|
|
+ /* No active association, join the BSS immediately */
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("CNTL - joining %02x:%02x:%02x:%02x:%02x:%02x ...\n",
|
|
|
pOidBssid[0], pOidBssid[1], pOidBssid[2],
|
|
|
@@ -667,14 +667,14 @@ VOID CntlOidRTBssidProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// Roaming is the only external request triggering CNTL state machine
|
|
|
-// despite of other "SET OID" operation. All "SET OID" related oerations
|
|
|
-// happen in sequence, because no other SET OID will be sent to this device
|
|
|
-// until the the previous SET operation is complete (successful o failed).
|
|
|
-// So, how do we quarantee this ROAMING request won't corrupt other "SET OID"?
|
|
|
-// or been corrupted by other "SET OID"?
|
|
|
-//
|
|
|
-// IRQL = DISPATCH_LEVEL
|
|
|
+/* Roaming is the only external request triggering CNTL state machine */
|
|
|
+/* despite of other "SET OID" operation. All "SET OID" related oerations */
|
|
|
+/* happen in sequence, because no other SET OID will be sent to this device */
|
|
|
+/* until the the previous SET operation is complete (successful o failed). */
|
|
|
+/* So, how do we quarantee this ROAMING request won't corrupt other "SET OID"? */
|
|
|
+/* or been corrupted by other "SET OID"? */
|
|
|
+/* */
|
|
|
+/* IRQL = DISPATCH_LEVEL */
|
|
|
VOID CntlMlmeRoamingProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
{
|
|
|
UCHAR BBPValue = 0;
|
|
|
@@ -682,7 +682,7 @@ VOID CntlMlmeRoamingProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Roaming in MlmeAux.RoamTab...\n"));
|
|
|
|
|
|
{
|
|
|
- //Let BBP register at 20MHz to do (fast) roaming.
|
|
|
+ /*Let BBP register at 20MHz to do (fast) roaming. */
|
|
|
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
|
|
|
BBPValue &= (~0x18);
|
|
|
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
|
|
|
@@ -720,7 +720,7 @@ VOID CntlWaitDisassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
|
|
|
LinkDown(pAd, FALSE);
|
|
|
|
|
|
- // case 1. no matching BSS, and user wants ADHOC, so we just start a new one
|
|
|
+ /* case 1. no matching BSS, and user wants ADHOC, so we just start a new one */
|
|
|
if ((pAd->MlmeAux.SsidBssTab.BssNr == 0)
|
|
|
&& (pAd->StaCfg.BssType == BSS_ADHOC)) {
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
@@ -732,7 +732,7 @@ VOID CntlWaitDisassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
sizeof(MLME_START_REQ_STRUCT), &StartReq);
|
|
|
pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_START;
|
|
|
}
|
|
|
- // case 2. try each matched BSS
|
|
|
+ /* case 2. try each matched BSS */
|
|
|
else {
|
|
|
pAd->MlmeAux.BssIdx = 0;
|
|
|
|
|
|
@@ -757,12 +757,12 @@ VOID CntlWaitJoinProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
if (Elem->MsgType == MT2_JOIN_CONF) {
|
|
|
NdisMoveMemory(&Reason, Elem->Msg, sizeof(USHORT));
|
|
|
if (Reason == MLME_SUCCESS) {
|
|
|
- // 1. joined an IBSS, we are pretty much done here
|
|
|
+ /* 1. joined an IBSS, we are pretty much done here */
|
|
|
if (pAd->MlmeAux.BssType == BSS_ADHOC) {
|
|
|
- //
|
|
|
- // 5G bands rules of Japan:
|
|
|
- // Ad hoc must be disabled in W53(ch52,56,60,64) channels.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* 5G bands rules of Japan: */
|
|
|
+ /* Ad hoc must be disabled in W53(ch52,56,60,64) channels. */
|
|
|
+ /* */
|
|
|
if ((pAd->CommonCfg.bIEEE80211H == 1) &&
|
|
|
RadarChannelCheck(pAd,
|
|
|
pAd->CommonCfg.Channel)
|
|
|
@@ -790,10 +790,10 @@ VOID CntlWaitJoinProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
NdisMediaStateConnected;
|
|
|
pAd->ExtraInfo = GENERAL_LINK_UP;
|
|
|
}
|
|
|
- // 2. joined a new INFRA network, start from authentication
|
|
|
+ /* 2. joined a new INFRA network, start from authentication */
|
|
|
else {
|
|
|
{
|
|
|
- // either Ndis802_11AuthModeShared or Ndis802_11AuthModeAutoSwitch, try shared key first
|
|
|
+ /* either Ndis802_11AuthModeShared or Ndis802_11AuthModeAutoSwitch, try shared key first */
|
|
|
if ((pAd->StaCfg.AuthMode ==
|
|
|
Ndis802_11AuthModeShared)
|
|
|
|| (pAd->StaCfg.AuthMode ==
|
|
|
@@ -817,7 +817,7 @@ VOID CntlWaitJoinProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
CNTL_WAIT_AUTH;
|
|
|
}
|
|
|
} else {
|
|
|
- // 3. failed, try next BSS
|
|
|
+ /* 3. failed, try next BSS */
|
|
|
pAd->MlmeAux.BssIdx++;
|
|
|
IterateOnBssTab(pAd);
|
|
|
}
|
|
|
@@ -839,10 +839,10 @@ VOID CntlWaitStartProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
if (Elem->MsgType == MT2_START_CONF) {
|
|
|
NdisMoveMemory(&Result, Elem->Msg, sizeof(USHORT));
|
|
|
if (Result == MLME_SUCCESS) {
|
|
|
- //
|
|
|
- // 5G bands rules of Japan:
|
|
|
- // Ad hoc must be disabled in W53(ch52,56,60,64) channels.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* 5G bands rules of Japan: */
|
|
|
+ /* Ad hoc must be disabled in W53(ch52,56,60,64) channels. */
|
|
|
+ /* */
|
|
|
if ((pAd->CommonCfg.bIEEE80211H == 1) &&
|
|
|
RadarChannelCheck(pAd, pAd->CommonCfg.Channel)
|
|
|
) {
|
|
|
@@ -892,7 +892,7 @@ VOID CntlWaitStartProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
}
|
|
|
LinkUp(pAd, BSS_ADHOC);
|
|
|
pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
|
|
|
- // Before send beacon, driver need do radar detection
|
|
|
+ /* Before send beacon, driver need do radar detection */
|
|
|
if ((pAd->CommonCfg.Channel > 14)
|
|
|
&& (pAd->CommonCfg.bIEEE80211H == 1)
|
|
|
&& RadarChannelCheck(pAd, pAd->CommonCfg.Channel)) {
|
|
|
@@ -950,9 +950,9 @@ VOID CntlWaitAuthProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
CNTL_WAIT_ASSOC;
|
|
|
}
|
|
|
} else {
|
|
|
- // This fail may because of the AP already keep us in its MAC table without
|
|
|
- // ageing-out. The previous authentication attempt must have let it remove us.
|
|
|
- // so try Authentication again may help. For D-Link DWL-900AP+ compatibility.
|
|
|
+ /* This fail may because of the AP already keep us in its MAC table without */
|
|
|
+ /* ageing-out. The previous authentication attempt must have let it remove us. */
|
|
|
+ /* so try Authentication again may help. For D-Link DWL-900AP+ compatibility. */
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("CNTL - AUTH FAIL, try again...\n"));
|
|
|
|
|
|
@@ -961,7 +961,7 @@ VOID CntlWaitAuthProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
Ndis802_11AuthModeShared)
|
|
|
|| (pAd->StaCfg.AuthMode ==
|
|
|
Ndis802_11AuthModeAutoSwitch)) {
|
|
|
- // either Ndis802_11AuthModeShared or Ndis802_11AuthModeAutoSwitch, try shared key first
|
|
|
+ /* either Ndis802_11AuthModeShared or Ndis802_11AuthModeAutoSwitch, try shared key first */
|
|
|
AuthParmFill(pAd, &AuthReq,
|
|
|
pAd->MlmeAux.Bssid,
|
|
|
AUTH_MODE_KEY);
|
|
|
@@ -1028,10 +1028,10 @@ VOID CntlWaitAuthProc2(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
pAd->Mlme.CntlMachine.CurrState =
|
|
|
CNTL_WAIT_AUTH2;
|
|
|
} else {
|
|
|
- // not success, try next BSS
|
|
|
+ /* not success, try next BSS */
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("CNTL - AUTH FAIL, give up; try next BSS\n"));
|
|
|
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE; //???????
|
|
|
+ pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE; /*??????? */
|
|
|
pAd->MlmeAux.BssIdx++;
|
|
|
IterateOnBssTab(pAd);
|
|
|
}
|
|
|
@@ -1067,7 +1067,7 @@ VOID CntlWaitAssocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
("CNTL - Association successful on BSS #%ld\n",
|
|
|
pAd->MlmeAux.BssIdx));
|
|
|
} else {
|
|
|
- // not success, try next BSS
|
|
|
+ /* not success, try next BSS */
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("CNTL - Association fails on BSS #%ld\n",
|
|
|
pAd->MlmeAux.BssIdx));
|
|
|
@@ -1092,16 +1092,16 @@ VOID CntlWaitReassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
if (Elem->MsgType == MT2_REASSOC_CONF) {
|
|
|
NdisMoveMemory(&Result, Elem->Msg, sizeof(USHORT));
|
|
|
if (Result == MLME_SUCCESS) {
|
|
|
- // send wireless event - for association
|
|
|
+ /* send wireless event - for association */
|
|
|
if (pAd->CommonCfg.bWirelessEvent)
|
|
|
RTMPSendWirelessEvent(pAd, IW_ASSOC_EVENT_FLAG,
|
|
|
pAd->MacTab.
|
|
|
Content[BSSID_WCID].Addr,
|
|
|
BSS0, 0);
|
|
|
|
|
|
- //
|
|
|
- // NDIS requires a new Link UP indication but no Link Down for RE-ASSOC
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* NDIS requires a new Link UP indication but no Link Down for RE-ASSOC */
|
|
|
+ /* */
|
|
|
LinkUp(pAd, BSS_INFRA);
|
|
|
|
|
|
pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
|
|
|
@@ -1109,7 +1109,7 @@ VOID CntlWaitReassocProc(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem)
|
|
|
("CNTL - Re-assocition successful on BSS #%ld\n",
|
|
|
pAd->MlmeAux.RoamIdx));
|
|
|
} else {
|
|
|
- // reassoc failed, try to pick next BSS in the BSS Table
|
|
|
+ /* reassoc failed, try to pick next BSS in the BSS Table */
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("CNTL - Re-assocition fails on BSS #%ld\n",
|
|
|
pAd->MlmeAux.RoamIdx));
|
|
|
@@ -1128,7 +1128,7 @@ VOID AdhocTurnOnQos(IN PRTMP_ADAPTER pAd)
|
|
|
#define AC2_DEF_TXOP 94
|
|
|
#define AC3_DEF_TXOP 47
|
|
|
|
|
|
- // Turn on QOs if use HT rate.
|
|
|
+ /* Turn on QOs if use HT rate. */
|
|
|
if (pAd->CommonCfg.APEdcaParm.bValid == FALSE) {
|
|
|
pAd->CommonCfg.APEdcaParm.bValid = TRUE;
|
|
|
pAd->CommonCfg.APEdcaParm.Aifsn[0] = 3;
|
|
|
@@ -1170,7 +1170,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
UCHAR Value = 0, idx = 0, HashIdx = 0;
|
|
|
MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry = NULL;
|
|
|
|
|
|
- // Init ChannelQuality to prevent DEAD_CQI at initial LinkUp
|
|
|
+ /* Init ChannelQuality to prevent DEAD_CQI at initial LinkUp */
|
|
|
pAd->Mlme.ChannelQuality = 50;
|
|
|
|
|
|
pEntry = MacTableLookup(pAd, pAd->CommonCfg.Bssid);
|
|
|
@@ -1181,15 +1181,15 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
|
|
|
pEntry = &pAd->MacTab.Content[BSSID_WCID];
|
|
|
|
|
|
- //
|
|
|
- // ASSOC - DisassocTimeoutAction
|
|
|
- // CNTL - Dis-associate successful
|
|
|
- // !!! LINK DOWN !!!
|
|
|
- // [88888] OID_802_11_SSID should have returned NDTEST_WEP_AP2(Returned: )
|
|
|
- //
|
|
|
- // To prevent DisassocTimeoutAction to call Link down after we link up,
|
|
|
- // cancel the DisassocTimer no matter what it start or not.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* ASSOC - DisassocTimeoutAction */
|
|
|
+ /* CNTL - Dis-associate successful */
|
|
|
+ /* !!! LINK DOWN !!! */
|
|
|
+ /* [88888] OID_802_11_SSID should have returned NDTEST_WEP_AP2(Returned: ) */
|
|
|
+ /* */
|
|
|
+ /* To prevent DisassocTimeoutAction to call Link down after we link up, */
|
|
|
+ /* cancel the DisassocTimer no matter what it start or not. */
|
|
|
+ /* */
|
|
|
RTMPCancelTimer(&pAd->MlmeAux.DisassocTimer, &Cancelled);
|
|
|
|
|
|
COPY_SETTINGS_FROM_MLME_AUX_TO_ACTIVE_CFG(pAd);
|
|
|
@@ -1197,8 +1197,8 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
COPY_HTSETTINGS_FROM_MLME_AUX_TO_ACTIVE_CFG(pAd);
|
|
|
|
|
|
#ifdef RTMP_MAC_PCI
|
|
|
- // Before power save before link up function, We will force use 1R.
|
|
|
- // So after link up, check Rx antenna # again.
|
|
|
+ /* Before power save before link up function, We will force use 1R. */
|
|
|
+ /* So after link up, check Rx antenna # again. */
|
|
|
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value);
|
|
|
if (pAd->Antenna.field.RxPath == 3) {
|
|
|
Value |= (0x10);
|
|
|
@@ -1209,7 +1209,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
}
|
|
|
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
|
|
|
pAd->StaCfg.BBPR3 = Value;
|
|
|
-#endif // RTMP_MAC_PCI //
|
|
|
+#endif /* RTMP_MAC_PCI // */
|
|
|
|
|
|
if (BssType == BSS_ADHOC) {
|
|
|
OPSTATUS_SET_FLAG(pAd, fOP_STATUS_ADHOC_ON);
|
|
|
@@ -1226,17 +1226,17 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
DBGPRINT(RT_DEBUG_TRACE, ("!!!Infra LINK UP !!! \n"));
|
|
|
}
|
|
|
|
|
|
- // 3*3
|
|
|
- // reset Tx beamforming bit
|
|
|
+ /* 3*3 */
|
|
|
+ /* reset Tx beamforming bit */
|
|
|
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &Value);
|
|
|
Value &= (~0x01);
|
|
|
Value |= pAd->CommonCfg.RegTransmitSetting.field.TxBF;
|
|
|
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value);
|
|
|
|
|
|
- // Change to AP channel
|
|
|
+ /* Change to AP channel */
|
|
|
if ((pAd->CommonCfg.CentralChannel > pAd->CommonCfg.Channel)
|
|
|
&& (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_40)) {
|
|
|
- // Must using 40MHz.
|
|
|
+ /* Must using 40MHz. */
|
|
|
pAd->CommonCfg.BBPCurrentBW = BW_40;
|
|
|
AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
|
|
|
AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
|
|
|
@@ -1246,13 +1246,13 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
Value |= 0x10;
|
|
|
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value);
|
|
|
|
|
|
- // RX : control channel at lower
|
|
|
+ /* RX : control channel at lower */
|
|
|
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value);
|
|
|
Value &= (~0x20);
|
|
|
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
|
|
|
#ifdef RTMP_MAC_PCI
|
|
|
pAd->StaCfg.BBPR3 = Value;
|
|
|
-#endif // RTMP_MAC_PCI //
|
|
|
+#endif /* RTMP_MAC_PCI // */
|
|
|
|
|
|
RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data);
|
|
|
Data &= 0xfffffffe;
|
|
|
@@ -1271,7 +1271,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
} else if ((pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel)
|
|
|
&& (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth ==
|
|
|
BW_40)) {
|
|
|
- // Must using 40MHz.
|
|
|
+ /* Must using 40MHz. */
|
|
|
pAd->CommonCfg.BBPCurrentBW = BW_40;
|
|
|
AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
|
|
|
AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
|
|
|
@@ -1290,7 +1290,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
|
|
|
#ifdef RTMP_MAC_PCI
|
|
|
pAd->StaCfg.BBPR3 = Value;
|
|
|
-#endif // RTMP_MAC_PCI //
|
|
|
+#endif /* RTMP_MAC_PCI // */
|
|
|
|
|
|
if (pAd->MACVersion == 0x28600100) {
|
|
|
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x1A);
|
|
|
@@ -1321,7 +1321,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
|
|
|
#ifdef RTMP_MAC_PCI
|
|
|
pAd->StaCfg.BBPR3 = Value;
|
|
|
-#endif // RTMP_MAC_PCI //
|
|
|
+#endif /* RTMP_MAC_PCI // */
|
|
|
|
|
|
if (pAd->MACVersion == 0x28600100) {
|
|
|
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x16);
|
|
|
@@ -1335,9 +1335,9 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
|
|
|
RTMPSetAGCInitValue(pAd, pAd->CommonCfg.BBPCurrentBW);
|
|
|
|
|
|
- //
|
|
|
- // Save BBP_R66 value, it will be used in RTUSBResumeMsduTransmission
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* Save BBP_R66 value, it will be used in RTUSBResumeMsduTransmission */
|
|
|
+ /* */
|
|
|
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R66,
|
|
|
&pAd->BbpTuning.R66CurrentValue);
|
|
|
|
|
|
@@ -1355,12 +1355,12 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
AsicSetSlotTime(pAd, TRUE);
|
|
|
AsicSetEdcaParm(pAd, &pAd->CommonCfg.APEdcaParm);
|
|
|
|
|
|
- // Call this for RTS protectionfor legacy rate, we will always enable RTS threshold, but normally it will not hit
|
|
|
+ /* Call this for RTS protectionfor legacy rate, we will always enable RTS threshold, but normally it will not hit */
|
|
|
AsicUpdateProtect(pAd, 0, (OFDMSETPROTECT | CCKSETPROTECT), TRUE,
|
|
|
FALSE);
|
|
|
|
|
|
if ((pAd->StaActive.SupportedPhyInfo.bHtEnable == TRUE)) {
|
|
|
- // Update HT protectionfor based on AP's operating mode.
|
|
|
+ /* Update HT protectionfor based on AP's operating mode. */
|
|
|
if (pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent == 1) {
|
|
|
AsicUpdateProtect(pAd,
|
|
|
pAd->MlmeAux.AddHtInfo.AddHtInfo2.
|
|
|
@@ -1376,7 +1376,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
NdisZeroMemory(&pAd->DrsCounters, sizeof(COUNTER_DRS));
|
|
|
|
|
|
NdisGetSystemUpTime(&Now);
|
|
|
- pAd->StaCfg.LastBeaconRxTime = Now; // last RX timestamp
|
|
|
+ pAd->StaCfg.LastBeaconRxTime = Now; /* last RX timestamp */
|
|
|
|
|
|
if ((pAd->CommonCfg.TxPreamble != Rt802_11PreambleLong) &&
|
|
|
CAP_IS_SHORT_PREAMBLE_ON(pAd->StaActive.CapabilityInfo)) {
|
|
|
@@ -1394,18 +1394,18 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
if ((pAd->CommonCfg.Channel > 14)
|
|
|
&& (pAd->CommonCfg.bIEEE80211H == 1)
|
|
|
&& RadarChannelCheck(pAd, pAd->CommonCfg.Channel)) {
|
|
|
- ; //Do nothing
|
|
|
+ ; /*Do nothing */
|
|
|
} else {
|
|
|
AsicEnableIbssSync(pAd);
|
|
|
}
|
|
|
|
|
|
- // In ad hoc mode, use MAC table from index 1.
|
|
|
- // p.s ASIC use all 0xff as termination of WCID table search.To prevent it's 0xff-ff-ff-ff-ff-ff, Write 0 here.
|
|
|
+ /* In ad hoc mode, use MAC table from index 1. */
|
|
|
+ /* p.s ASIC use all 0xff as termination of WCID table search.To prevent it's 0xff-ff-ff-ff-ff-ff, Write 0 here. */
|
|
|
RTMP_IO_WRITE32(pAd, MAC_WCID_BASE, 0x00);
|
|
|
RTMP_IO_WRITE32(pAd, 0x1808, 0x00);
|
|
|
|
|
|
- // If WEP is enabled, add key material and cipherAlg into Asic
|
|
|
- // Fill in Shared Key Table(offset: 0x6c00) and Shared Key Mode(offset: 0x7000)
|
|
|
+ /* If WEP is enabled, add key material and cipherAlg into Asic */
|
|
|
+ /* Fill in Shared Key Table(offset: 0x6c00) and Shared Key Mode(offset: 0x7000) */
|
|
|
|
|
|
if (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled) {
|
|
|
PUCHAR Key;
|
|
|
@@ -1416,13 +1416,13 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
Key = pAd->SharedKey[BSS0][idx].Key;
|
|
|
|
|
|
if (pAd->SharedKey[BSS0][idx].KeyLen > 0) {
|
|
|
- // Set key material and cipherAlg to Asic
|
|
|
+ /* Set key material and cipherAlg to Asic */
|
|
|
AsicAddSharedKeyEntry(pAd, BSS0, idx,
|
|
|
CipherAlg, Key,
|
|
|
NULL, NULL);
|
|
|
|
|
|
if (idx == pAd->StaCfg.DefaultKeyId) {
|
|
|
- // Update WCID attribute table and IVEIV table for this group key table
|
|
|
+ /* Update WCID attribute table and IVEIV table for this group key table */
|
|
|
RTMPAddWcidAttributeEntry(pAd,
|
|
|
BSS0,
|
|
|
idx,
|
|
|
@@ -1433,10 +1433,10 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
|
|
|
}
|
|
|
}
|
|
|
- // If WPANone is enabled, add key material and cipherAlg into Asic
|
|
|
- // Fill in Shared Key Table(offset: 0x6c00) and Shared Key Mode(offset: 0x7000)
|
|
|
+ /* If WPANone is enabled, add key material and cipherAlg into Asic */
|
|
|
+ /* Fill in Shared Key Table(offset: 0x6c00) and Shared Key Mode(offset: 0x7000) */
|
|
|
else if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone) {
|
|
|
- pAd->StaCfg.DefaultKeyId = 0; // always be zero
|
|
|
+ pAd->StaCfg.DefaultKeyId = 0; /* always be zero */
|
|
|
|
|
|
NdisZeroMemory(&pAd->SharedKey[BSS0][0],
|
|
|
sizeof(CIPHER_KEY));
|
|
|
@@ -1453,7 +1453,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
&pAd->StaCfg.PMK[16],
|
|
|
LEN_TKIP_TXMICK);
|
|
|
}
|
|
|
- // Decide its ChiperAlg
|
|
|
+ /* Decide its ChiperAlg */
|
|
|
if (pAd->StaCfg.PairCipher ==
|
|
|
Ndis802_11Encryption2Enabled)
|
|
|
pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_TKIP;
|
|
|
@@ -1467,7 +1467,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_AES;
|
|
|
}
|
|
|
|
|
|
- // Set key material and cipherAlg to Asic
|
|
|
+ /* Set key material and cipherAlg to Asic */
|
|
|
AsicAddSharedKeyEntry(pAd,
|
|
|
BSS0,
|
|
|
0,
|
|
|
@@ -1476,16 +1476,16 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
pAd->SharedKey[BSS0][0].TxMic,
|
|
|
pAd->SharedKey[BSS0][0].RxMic);
|
|
|
|
|
|
- // Update WCID attribute table and IVEIV table for this group key table
|
|
|
+ /* Update WCID attribute table and IVEIV table for this group key table */
|
|
|
RTMPAddWcidAttributeEntry(pAd, BSS0, 0,
|
|
|
pAd->SharedKey[BSS0][0].
|
|
|
CipherAlg, NULL);
|
|
|
|
|
|
}
|
|
|
|
|
|
- } else // BSS_INFRA
|
|
|
+ } else /* BSS_INFRA */
|
|
|
{
|
|
|
- // Check the new SSID with last SSID
|
|
|
+ /* Check the new SSID with last SSID */
|
|
|
while (Cancelled == TRUE) {
|
|
|
if (pAd->CommonCfg.LastSsidLen ==
|
|
|
pAd->CommonCfg.SsidLen) {
|
|
|
@@ -1493,11 +1493,11 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
(pAd->CommonCfg.LastSsid,
|
|
|
pAd->CommonCfg.Ssid,
|
|
|
pAd->CommonCfg.LastSsidLen) == 0) {
|
|
|
- // Link to the old one no linkdown is required.
|
|
|
+ /* Link to the old one no linkdown is required. */
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- // Send link down event before set to link up
|
|
|
+ /* Send link down event before set to link up */
|
|
|
pAd->IndicateMediaState = NdisMediaStateDisconnected;
|
|
|
RTMP_IndicateMediaState(pAd);
|
|
|
pAd->ExtraInfo = GENERAL_LINK_DOWN;
|
|
|
@@ -1506,43 +1506,43 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- //
|
|
|
- // On WPA mode, Remove All Keys if not connect to the last BSSID
|
|
|
- // Key will be set after 4-way handshake.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* On WPA mode, Remove All Keys if not connect to the last BSSID */
|
|
|
+ /* Key will be set after 4-way handshake. */
|
|
|
+ /* */
|
|
|
if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA) {
|
|
|
ULONG IV;
|
|
|
|
|
|
- // Remove all WPA keys
|
|
|
+ /* Remove all WPA keys */
|
|
|
RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
|
|
|
RTMPWPARemoveAllKeys(pAd);
|
|
|
pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
|
|
|
pAd->StaCfg.PrivacyFilter =
|
|
|
Ndis802_11PrivFilter8021xWEP;
|
|
|
|
|
|
- // Fixed connection failed with Range Maximizer - 515 AP (Marvell Chip) when security is WPAPSK/TKIP
|
|
|
- // If IV related values are too large in GroupMsg2, AP would ignore this message.
|
|
|
+ /* Fixed connection failed with Range Maximizer - 515 AP (Marvell Chip) when security is WPAPSK/TKIP */
|
|
|
+ /* If IV related values are too large in GroupMsg2, AP would ignore this message. */
|
|
|
IV = 1;
|
|
|
IV |= (pAd->StaCfg.DefaultKeyId << 30);
|
|
|
AsicUpdateWCIDIVEIV(pAd, BSSID_WCID, IV, 0);
|
|
|
}
|
|
|
- // NOTE:
|
|
|
- // the decision of using "short slot time" or not may change dynamically due to
|
|
|
- // new STA association to the AP. so we have to decide that upon parsing BEACON, not here
|
|
|
+ /* NOTE: */
|
|
|
+ /* the decision of using "short slot time" or not may change dynamically due to */
|
|
|
+ /* new STA association to the AP. so we have to decide that upon parsing BEACON, not here */
|
|
|
|
|
|
- // NOTE:
|
|
|
- // the decision to use "RTC/CTS" or "CTS-to-self" protection or not may change dynamically
|
|
|
- // due to new STA association to the AP. so we have to decide that upon parsing BEACON, not here
|
|
|
+ /* NOTE: */
|
|
|
+ /* the decision to use "RTC/CTS" or "CTS-to-self" protection or not may change dynamically */
|
|
|
+ /* due to new STA association to the AP. so we have to decide that upon parsing BEACON, not here */
|
|
|
|
|
|
ComposePsPoll(pAd);
|
|
|
ComposeNullFrame(pAd);
|
|
|
|
|
|
AsicEnableBssSync(pAd);
|
|
|
|
|
|
- // Add BSSID to WCID search table
|
|
|
+ /* Add BSSID to WCID search table */
|
|
|
AsicUpdateRxWCIDTable(pAd, BSSID_WCID, pAd->CommonCfg.Bssid);
|
|
|
|
|
|
- // If WEP is enabled, add paiewise and shared key
|
|
|
+ /* If WEP is enabled, add paiewise and shared key */
|
|
|
if (((pAd->StaCfg.WpaSupplicantUP) &&
|
|
|
(pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled) &&
|
|
|
(pAd->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED)) ||
|
|
|
@@ -1556,13 +1556,13 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
Key = pAd->SharedKey[BSS0][idx].Key;
|
|
|
|
|
|
if (pAd->SharedKey[BSS0][idx].KeyLen > 0) {
|
|
|
- // Set key material and cipherAlg to Asic
|
|
|
+ /* Set key material and cipherAlg to Asic */
|
|
|
AsicAddSharedKeyEntry(pAd, BSS0, idx,
|
|
|
CipherAlg, Key,
|
|
|
NULL, NULL);
|
|
|
|
|
|
if (idx == pAd->StaCfg.DefaultKeyId) {
|
|
|
- // Assign group key info
|
|
|
+ /* Assign group key info */
|
|
|
RTMPAddWcidAttributeEntry(pAd,
|
|
|
BSS0,
|
|
|
idx,
|
|
|
@@ -1570,7 +1570,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
NULL);
|
|
|
|
|
|
pEntry->Aid = BSSID_WCID;
|
|
|
- // Assign pairwise key info
|
|
|
+ /* Assign pairwise key info */
|
|
|
RTMPAddWcidAttributeEntry(pAd,
|
|
|
BSS0,
|
|
|
idx,
|
|
|
@@ -1580,11 +1580,11 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // only INFRASTRUCTURE mode need to indicate connectivity immediately; ADHOC mode
|
|
|
- // should wait until at least 2 active nodes in this BSSID.
|
|
|
+ /* only INFRASTRUCTURE mode need to indicate connectivity immediately; ADHOC mode */
|
|
|
+ /* should wait until at least 2 active nodes in this BSSID. */
|
|
|
OPSTATUS_SET_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
|
|
|
|
|
|
- // For GUI ++
|
|
|
+ /* For GUI ++ */
|
|
|
if (pAd->StaCfg.AuthMode < Ndis802_11AuthModeWPA) {
|
|
|
pAd->IndicateMediaState = NdisMediaStateConnected;
|
|
|
pAd->ExtraInfo = GENERAL_LINK_UP;
|
|
|
@@ -1597,11 +1597,11 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
RTMPSetTimer(&pAd->Mlme.LinkDownTimer,
|
|
|
LINK_DOWN_TIMEOUT);
|
|
|
}
|
|
|
- // --
|
|
|
+ /* -- */
|
|
|
|
|
|
- // Add BSSID in my MAC Table.
|
|
|
+ /* Add BSSID in my MAC Table. */
|
|
|
NdisAcquireSpinLock(&pAd->MacTabLock);
|
|
|
- // add this MAC entry into HASH table
|
|
|
+ /* add this MAC entry into HASH table */
|
|
|
if (pEntry) {
|
|
|
HashIdx = MAC_ADDR_HASH_INDEX(pAd->CommonCfg.Bssid);
|
|
|
if (pAd->MacTab.Hash[HashIdx] == NULL) {
|
|
|
@@ -1618,8 +1618,8 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
MAC_ADDR_LEN);
|
|
|
pEntry->Aid = BSSID_WCID;
|
|
|
pEntry->pAd = pAd;
|
|
|
- pEntry->ValidAsCLI = TRUE; //Although this is bssid..still set ValidAsCl
|
|
|
- pAd->MacTab.Size = 1; // infra mode always set MACtab size =1.
|
|
|
+ pEntry->ValidAsCLI = TRUE; /*Although this is bssid..still set ValidAsCl */
|
|
|
+ pAd->MacTab.Size = 1; /* infra mode always set MACtab size =1. */
|
|
|
pEntry->Sst = SST_ASSOC;
|
|
|
pEntry->AuthState = SST_ASSOC;
|
|
|
pEntry->AuthMode = pAd->StaCfg.AuthMode;
|
|
|
@@ -1687,15 +1687,15 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
pAd->CommonCfg.BACapability.word,
|
|
|
pAd->MacTab.Content[BSSID_WCID].ClientStatusFlags));
|
|
|
|
|
|
- // Set LED
|
|
|
+ /* Set LED */
|
|
|
RTMPSetLED(pAd, LED_LINK_UP);
|
|
|
|
|
|
pAd->Mlme.PeriodicRound = 0;
|
|
|
pAd->Mlme.OneSecPeriodicRound = 0;
|
|
|
- pAd->bConfigChanged = FALSE; // Reset config flag
|
|
|
- pAd->ExtraInfo = GENERAL_LINK_UP; // Update extra information to link is up
|
|
|
+ pAd->bConfigChanged = FALSE; /* Reset config flag */
|
|
|
+ pAd->ExtraInfo = GENERAL_LINK_UP; /* Update extra information to link is up */
|
|
|
|
|
|
- // Set asic auto fall back
|
|
|
+ /* Set asic auto fall back */
|
|
|
{
|
|
|
PUCHAR pTable;
|
|
|
UCHAR TableSize = 0;
|
|
|
@@ -1719,7 +1719,7 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
|| (pEntry->HTPhyMode.field.MCS == 32))
|
|
|
pEntry->HTPhyMode.field.STBC = STBC_NONE;
|
|
|
|
|
|
- // 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. */
|
|
|
if (pEntry->HTPhyMode.field.MODE <= MODE_OFDM)
|
|
|
RTMPUpdateLegacyTxSetting((UCHAR) pAd->StaCfg.
|
|
|
DesiredTransmitSetting.field.
|
|
|
@@ -1728,9 +1728,9 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
pEntry->bAutoTxRateSwitch = TRUE;
|
|
|
NdisReleaseSpinLock(&pAd->MacTabLock);
|
|
|
|
|
|
- // Let Link Status Page display first initial rate.
|
|
|
+ /* Let Link Status Page display first initial rate. */
|
|
|
pAd->LastTxRate = (USHORT) (pEntry->HTPhyMode.word);
|
|
|
- // Select DAC according to HT or Legacy
|
|
|
+ /* Select DAC according to HT or Legacy */
|
|
|
if (pAd->StaActive.SupportedPhyInfo.MCSSet[0] != 0x00) {
|
|
|
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R1, &Value);
|
|
|
Value &= (~0x18);
|
|
|
@@ -1746,20 +1746,20 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
|
|
|
if (pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE) {
|
|
|
} else if (pEntry->MaxRAmpduFactor == 0) {
|
|
|
- // If HT AP doesn't support MaxRAmpduFactor = 1, we need to set max PSDU to 0.
|
|
|
- // Because our Init value is 1 at MACRegTable.
|
|
|
+ /* If HT AP doesn't support MaxRAmpduFactor = 1, we need to set max PSDU to 0. */
|
|
|
+ /* Because our Init value is 1 at MACRegTable. */
|
|
|
RTMP_IO_WRITE32(pAd, MAX_LEN_CFG, 0x0fff);
|
|
|
}
|
|
|
- // Patch for Marvel AP to gain high throughput
|
|
|
- // Need to set as following,
|
|
|
- // 1. Set txop in register-EDCA_AC0_CFG as 0x60
|
|
|
- // 2. Set EnTXWriteBackDDONE in register-WPDMA_GLO_CFG as zero
|
|
|
- // 3. PBF_MAX_PCNT as 0x1F3FBF9F
|
|
|
- // 4. kick per two packets when dequeue
|
|
|
- //
|
|
|
- // Txop can only be modified when RDG is off, WMM is disable and TxBurst is enable
|
|
|
- //
|
|
|
- // if 1. Legacy AP WMM on, or 2. 11n AP, AMPDU disable. Force turn off burst no matter what bEnableTxBurst is.
|
|
|
+ /* Patch for Marvel AP to gain high throughput */
|
|
|
+ /* Need to set as following, */
|
|
|
+ /* 1. Set txop in register-EDCA_AC0_CFG as 0x60 */
|
|
|
+ /* 2. Set EnTXWriteBackDDONE in register-WPDMA_GLO_CFG as zero */
|
|
|
+ /* 3. PBF_MAX_PCNT as 0x1F3FBF9F */
|
|
|
+ /* 4. kick per two packets when dequeue */
|
|
|
+ /* */
|
|
|
+ /* Txop can only be modified when RDG is off, WMM is disable and TxBurst is enable */
|
|
|
+ /* */
|
|
|
+ /* if 1. Legacy AP WMM on, or 2. 11n AP, AMPDU disable. Force turn off burst no matter what bEnableTxBurst is. */
|
|
|
if (!((pAd->CommonCfg.RxStream == 1) && (pAd->CommonCfg.TxStream == 1))
|
|
|
&& (pAd->StaCfg.bForceTxBurst == FALSE)
|
|
|
&&
|
|
|
@@ -1791,14 +1791,14 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
DBGPRINT(RT_DEBUG_TRACE, ("Txburst 3\n"));
|
|
|
}
|
|
|
|
|
|
- // Re-check to turn on TX burst or not.
|
|
|
+ /* Re-check to turn on TX burst or not. */
|
|
|
if ((pAd->CommonCfg.IOTestParm.bLastAtheros == TRUE)
|
|
|
&& ((STA_WEP_ON(pAd)) || (STA_TKIP_ON(pAd)))) {
|
|
|
pAd->CommonCfg.IOTestParm.bNextDisableRxBA = TRUE;
|
|
|
if (pAd->CommonCfg.bEnableTxBurst) {
|
|
|
UINT32 MACValue = 0;
|
|
|
- // Force disable TXOP value in this case. The same action in MLMEUpdateProtect too.
|
|
|
- // I didn't change PBF_MAX_PCNT setting.
|
|
|
+ /* Force disable TXOP value in this case. The same action in MLMEUpdateProtect too. */
|
|
|
+ /* I didn't change PBF_MAX_PCNT setting. */
|
|
|
RTMP_IO_READ32(pAd, EDCA_AC0_CFG, &MACValue);
|
|
|
MACValue &= 0xFFFFFF00;
|
|
|
RTMP_IO_WRITE32(pAd, EDCA_AC0_CFG, MACValue);
|
|
|
@@ -1813,9 +1813,9 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("!!!pAd->bNextDisableRxBA= %d \n",
|
|
|
pAd->CommonCfg.IOTestParm.bNextDisableRxBA));
|
|
|
- // BSSID add in one MAC entry too. Because in Tx, ASIC need to check Cipher and IV/EIV, BAbitmap
|
|
|
- // Pther information in MACTab.Content[BSSID_WCID] is not necessary for driver.
|
|
|
- // Note: As STA, The MACTab.Content[BSSID_WCID]. PairwiseKey and Shared Key for BSS0 are the same.
|
|
|
+ /* BSSID add in one MAC entry too. Because in Tx, ASIC need to check Cipher and IV/EIV, BAbitmap */
|
|
|
+ /* Pther information in MACTab.Content[BSSID_WCID] is not necessary for driver. */
|
|
|
+ /* Note: As STA, The MACTab.Content[BSSID_WCID]. PairwiseKey and Shared Key for BSS0 are the same. */
|
|
|
|
|
|
if (pAd->StaCfg.WepStatus <= Ndis802_11WEPDisabled) {
|
|
|
if (pAd->StaCfg.WpaSupplicantUP &&
|
|
|
@@ -1832,10 +1832,10 @@ VOID LinkUp(IN PRTMP_ADAPTER pAd, IN UCHAR BssType)
|
|
|
pEntry->PortSecured = pAd->StaCfg.PortSecured;
|
|
|
NdisReleaseSpinLock(&pAd->MacTabLock);
|
|
|
|
|
|
- //
|
|
|
- // Patch Atheros AP TX will breakdown issue.
|
|
|
- // AP Model: DLink DWL-8200AP
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* Patch Atheros AP TX will breakdown issue. */
|
|
|
+ /* AP Model: DLink DWL-8200AP */
|
|
|
+ /* */
|
|
|
if (INFRA_ON(pAd) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED)
|
|
|
&& STA_TKIP_ON(pAd)) {
|
|
|
RTMP_IO_WRITE32(pAd, RX_PARSER_CFG, 0x01);
|
|
|
@@ -1877,14 +1877,14 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|
|
{
|
|
|
UCHAR i, ByteValue = 0;
|
|
|
|
|
|
- // Do nothing if monitor mode is on
|
|
|
+ /* Do nothing if monitor mode is on */
|
|
|
if (MONITOR_ON(pAd))
|
|
|
return;
|
|
|
|
|
|
RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW);
|
|
|
- //Comment the codes, beasue the line 2291 call the same function.
|
|
|
- //RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
|
|
|
- // Not allow go to sleep within linkdown function.
|
|
|
+ /*Comment the codes, beasue the line 2291 call the same function. */
|
|
|
+ /*RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled); */
|
|
|
+ /* Not allow go to sleep within linkdown function. */
|
|
|
RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
|
|
|
|
|
|
if (pAd->CommonCfg.bWirelessEvent) {
|
|
|
@@ -1904,7 +1904,7 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|
|
}
|
|
|
|
|
|
pAd->bPCIclkOff = FALSE;
|
|
|
-#endif // RTMP_MAC_PCI //
|
|
|
+#endif /* RTMP_MAC_PCI // */
|
|
|
|
|
|
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
|
|
|
|| RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND)
|
|
|
@@ -1917,9 +1917,9 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|
|
}
|
|
|
#ifdef RTMP_MAC_PCI
|
|
|
pAd->bPCIclkOff = FALSE;
|
|
|
-#endif // RTMP_MAC_PCI //
|
|
|
+#endif /* RTMP_MAC_PCI // */
|
|
|
|
|
|
- if (ADHOC_ON(pAd)) // Adhoc mode link down
|
|
|
+ if (ADHOC_ON(pAd)) /* Adhoc mode link down */
|
|
|
{
|
|
|
DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK DOWN 1!!!\n"));
|
|
|
|
|
|
@@ -1932,14 +1932,14 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|
|
pAd->CommonCfg.Channel);
|
|
|
DBGPRINT(RT_DEBUG_TRACE,
|
|
|
("!!! MacTab.Size=%d !!!\n", pAd->MacTab.Size));
|
|
|
- } else // Infra structure mode
|
|
|
+ } else /* Infra structure mode */
|
|
|
{
|
|
|
DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK DOWN 2!!!\n"));
|
|
|
|
|
|
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_INFRA_ON);
|
|
|
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
|
|
|
|
|
|
- // Saved last SSID for linkup comparison
|
|
|
+ /* Saved last SSID for linkup comparison */
|
|
|
pAd->CommonCfg.LastSsidLen = pAd->CommonCfg.SsidLen;
|
|
|
NdisMoveMemory(pAd->CommonCfg.LastSsid, pAd->CommonCfg.Ssid,
|
|
|
pAd->CommonCfg.LastSsidLen);
|
|
|
@@ -1952,20 +1952,20 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|
|
("NDIS_STATUS_MEDIA_DISCONNECT Event A!\n"));
|
|
|
pAd->MlmeAux.CurrReqIsFromNdis = FALSE;
|
|
|
} else {
|
|
|
- //
|
|
|
- // If disassociation request is from NDIS, then we don't need to delete BSSID from entry.
|
|
|
- // Otherwise lost beacon or receive De-Authentication from AP,
|
|
|
- // then we should delete BSSID from BssTable.
|
|
|
- // If we don't delete from entry, roaming will fail.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* If disassociation request is from NDIS, then we don't need to delete BSSID from entry. */
|
|
|
+ /* Otherwise lost beacon or receive De-Authentication from AP, */
|
|
|
+ /* then we should delete BSSID from BssTable. */
|
|
|
+ /* If we don't delete from entry, roaming will fail. */
|
|
|
+ /* */
|
|
|
BssTableDeleteEntry(&pAd->ScanTab, pAd->CommonCfg.Bssid,
|
|
|
pAd->CommonCfg.Channel);
|
|
|
}
|
|
|
|
|
|
- // restore back 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
|
|
|
+ /* restore back 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 */
|
|
|
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_BG_PROTECTION_INUSED);
|
|
|
|
|
|
}
|
|
|
@@ -1976,13 +1976,13 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|
|
pAd->MacTab.Content[i].Addr);
|
|
|
}
|
|
|
|
|
|
- AsicSetSlotTime(pAd, TRUE); //FALSE);
|
|
|
+ AsicSetSlotTime(pAd, TRUE); /*FALSE); */
|
|
|
AsicSetEdcaParm(pAd, NULL);
|
|
|
|
|
|
- // Set LED
|
|
|
+ /* Set LED */
|
|
|
RTMPSetLED(pAd, LED_LINK_DOWN);
|
|
|
pAd->LedIndicatorStrength = 0xF0;
|
|
|
- RTMPSetSignalLED(pAd, -100); // Force signal strength Led to be turned off, firmware is not done it.
|
|
|
+ RTMPSetSignalLED(pAd, -100); /* Force signal strength Led to be turned off, firmware is not done it. */
|
|
|
|
|
|
AsicDisableSync(pAd);
|
|
|
|
|
|
@@ -1990,7 +1990,7 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|
|
pAd->Mlme.OneSecPeriodicRound = 0;
|
|
|
|
|
|
if (pAd->StaCfg.BssType == BSS_INFRA) {
|
|
|
- // Remove StaCfg Information after link down
|
|
|
+ /* Remove StaCfg Information after link down */
|
|
|
NdisZeroMemory(pAd->CommonCfg.Bssid, MAC_ADDR_LEN);
|
|
|
NdisZeroMemory(pAd->CommonCfg.Ssid, MAX_LEN_OF_SSID);
|
|
|
pAd->CommonCfg.SsidLen = 0;
|
|
|
@@ -2001,25 +2001,25 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|
|
pAd->MlmeAux.HtCapabilityLen = 0;
|
|
|
pAd->MlmeAux.NewExtChannelOffset = 0xff;
|
|
|
|
|
|
- // Reset WPA-PSK state. Only reset when supplicant enabled
|
|
|
+ /* Reset WPA-PSK state. Only reset when supplicant enabled */
|
|
|
if (pAd->StaCfg.WpaState != SS_NOTUSE) {
|
|
|
pAd->StaCfg.WpaState = SS_START;
|
|
|
- // Clear Replay counter
|
|
|
+ /* Clear Replay counter */
|
|
|
NdisZeroMemory(pAd->StaCfg.ReplayCounter, 8);
|
|
|
|
|
|
}
|
|
|
- //
|
|
|
- // if link down come from AP, we need to remove all WPA keys on WPA mode.
|
|
|
- // otherwise will cause 4-way handshaking failed, since the WPA key not empty.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* if link down come from AP, we need to remove all WPA keys on WPA mode. */
|
|
|
+ /* otherwise will cause 4-way handshaking failed, since the WPA key not empty. */
|
|
|
+ /* */
|
|
|
if ((IsReqFromAP) && (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)) {
|
|
|
- // Remove all WPA keys
|
|
|
+ /* Remove all WPA keys */
|
|
|
RTMPWPARemoveAllKeys(pAd);
|
|
|
}
|
|
|
- // 802.1x port control
|
|
|
+ /* 802.1x port control */
|
|
|
|
|
|
- // Prevent clear PortSecured here with static WEP
|
|
|
- // NetworkManger set security policy first then set SSID to connect AP.
|
|
|
+ /* Prevent clear PortSecured here with static WEP */
|
|
|
+ /* NetworkManger set security policy first then set SSID to connect AP. */
|
|
|
if (pAd->StaCfg.WpaSupplicantUP &&
|
|
|
(pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled) &&
|
|
|
(pAd->StaCfg.IEEE8021X == FALSE)) {
|
|
|
@@ -2037,16 +2037,16 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|
|
pAd->StaCfg.MicErrCnt = 0;
|
|
|
|
|
|
pAd->IndicateMediaState = NdisMediaStateDisconnected;
|
|
|
- // Update extra information to link is up
|
|
|
+ /* Update extra information to link is up */
|
|
|
pAd->ExtraInfo = GENERAL_LINK_DOWN;
|
|
|
|
|
|
pAd->StaActive.SupportedPhyInfo.bHtEnable = FALSE;
|
|
|
|
|
|
#ifdef RTMP_MAC_USB
|
|
|
pAd->bUsbTxBulkAggre = FALSE;
|
|
|
-#endif // RTMP_MAC_USB //
|
|
|
+#endif /* RTMP_MAC_USB // */
|
|
|
|
|
|
- // Clean association information
|
|
|
+ /* Clean association information */
|
|
|
NdisZeroMemory(&pAd->StaCfg.AssocInfo,
|
|
|
sizeof(NDIS_802_11_ASSOCIATION_INFORMATION));
|
|
|
pAd->StaCfg.AssocInfo.Length =
|
|
|
@@ -2054,9 +2054,9 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|
|
pAd->StaCfg.ReqVarIELen = 0;
|
|
|
pAd->StaCfg.ResVarIELen = 0;
|
|
|
|
|
|
- //
|
|
|
- // Reset RSSI value after link down
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* Reset RSSI value after link down */
|
|
|
+ /* */
|
|
|
pAd->StaCfg.RssiSample.AvgRssi0 = 0;
|
|
|
pAd->StaCfg.RssiSample.AvgRssi0X8 = 0;
|
|
|
pAd->StaCfg.RssiSample.AvgRssi1 = 0;
|
|
|
@@ -2064,20 +2064,20 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|
|
pAd->StaCfg.RssiSample.AvgRssi2 = 0;
|
|
|
pAd->StaCfg.RssiSample.AvgRssi2X8 = 0;
|
|
|
|
|
|
- // Restore MlmeRate
|
|
|
+ /* Restore MlmeRate */
|
|
|
pAd->CommonCfg.MlmeRate = pAd->CommonCfg.BasicMlmeRate;
|
|
|
pAd->CommonCfg.RtsRate = pAd->CommonCfg.BasicMlmeRate;
|
|
|
|
|
|
- //
|
|
|
- // After Link down, reset piggy-back setting in ASIC. Disable RDG.
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* After Link down, reset piggy-back setting in ASIC. Disable RDG. */
|
|
|
+ /* */
|
|
|
if (pAd->CommonCfg.BBPCurrentBW == BW_40) {
|
|
|
pAd->CommonCfg.BBPCurrentBW = BW_20;
|
|
|
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &ByteValue);
|
|
|
ByteValue &= (~0x18);
|
|
|
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, ByteValue);
|
|
|
}
|
|
|
- // Reset DAC
|
|
|
+ /* Reset DAC */
|
|
|
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R1, &ByteValue);
|
|
|
ByteValue &= (~0x18);
|
|
|
if (pAd->Antenna.field.TxPath == 2) {
|
|
|
@@ -2090,7 +2090,7 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|
|
|
|
|
pAd->CommonCfg.BACapability.word = pAd->CommonCfg.REGBACapability.word;
|
|
|
|
|
|
- // Restore all settings in the following.
|
|
|
+ /* Restore all settings in the following. */
|
|
|
AsicUpdateProtect(pAd, 0,
|
|
|
(ALLN_SETPROTECT | CCKSETPROTECT | OFDMSETPROTECT),
|
|
|
TRUE, FALSE);
|
|
|
@@ -2101,7 +2101,7 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|
|
RTMP_IO_WRITE32(pAd, MAX_LEN_CFG, 0x1fff);
|
|
|
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
|
|
|
|
|
|
-// Allow go to sleep after linkdown steps.
|
|
|
+/* Allow go to sleep after linkdown steps. */
|
|
|
RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
|
|
|
|
|
|
RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL, 0);
|
|
|
@@ -2111,7 +2111,7 @@ VOID LinkDown(IN PRTMP_ADAPTER pAd, IN BOOLEAN IsReqFromAP)
|
|
|
&& (pAd->Antenna.field.RxPath > 1 || pAd->Antenna.field.TxPath > 1)) {
|
|
|
RTMP_ASIC_MMPS_DISABLE(pAd);
|
|
|
}
|
|
|
-#endif // RT30xx //
|
|
|
+#endif /* RT30xx // */
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
@@ -2128,16 +2128,16 @@ VOID IterateOnBssTab(IN PRTMP_ADAPTER pAd)
|
|
|
MLME_JOIN_REQ_STRUCT JoinReq;
|
|
|
ULONG BssIdx;
|
|
|
|
|
|
- // Change the wepstatus to original wepstatus
|
|
|
+ /* Change the wepstatus to original wepstatus */
|
|
|
pAd->StaCfg.WepStatus = pAd->StaCfg.OrigWepStatus;
|
|
|
pAd->StaCfg.PairCipher = pAd->StaCfg.OrigWepStatus;
|
|
|
pAd->StaCfg.GroupCipher = pAd->StaCfg.OrigWepStatus;
|
|
|
|
|
|
BssIdx = pAd->MlmeAux.BssIdx;
|
|
|
if (BssIdx < pAd->MlmeAux.SsidBssTab.BssNr) {
|
|
|
- // Check cipher suite, AP must have more secured cipher than station setting
|
|
|
- // Set the Pairwise and Group cipher to match the intended AP setting
|
|
|
- // We can only connect to AP with less secured cipher setting
|
|
|
+ /* Check cipher suite, AP must have more secured cipher than station setting */
|
|
|
+ /* Set the Pairwise and Group cipher to match the intended AP setting */
|
|
|
+ /* We can only connect to AP with less secured cipher setting */
|
|
|
if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA)
|
|
|
|| (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK)) {
|
|
|
pAd->StaCfg.GroupCipher =
|
|
|
@@ -2155,7 +2155,7 @@ VOID IterateOnBssTab(IN PRTMP_ADAPTER pAd)
|
|
|
pAd->StaCfg.PairCipher =
|
|
|
pAd->MlmeAux.SsidBssTab.BssEntry[BssIdx].
|
|
|
WPA.PairCipherAux;
|
|
|
- else // There is no PairCipher Aux, downgrade our capability to TKIP
|
|
|
+ else /* There is no PairCipher Aux, downgrade our capability to TKIP */
|
|
|
pAd->StaCfg.PairCipher =
|
|
|
Ndis802_11Encryption2Enabled;
|
|
|
} else if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2)
|
|
|
@@ -2176,16 +2176,16 @@ VOID IterateOnBssTab(IN PRTMP_ADAPTER pAd)
|
|
|
pAd->StaCfg.PairCipher =
|
|
|
pAd->MlmeAux.SsidBssTab.BssEntry[BssIdx].
|
|
|
WPA2.PairCipherAux;
|
|
|
- else // There is no PairCipher Aux, downgrade our capability to TKIP
|
|
|
+ else /* There is no PairCipher Aux, downgrade our capability to TKIP */
|
|
|
pAd->StaCfg.PairCipher =
|
|
|
Ndis802_11Encryption2Enabled;
|
|
|
|
|
|
- // RSN capability
|
|
|
+ /* RSN capability */
|
|
|
pAd->StaCfg.RsnCapability =
|
|
|
pAd->MlmeAux.SsidBssTab.BssEntry[BssIdx].WPA2.
|
|
|
RsnCapability;
|
|
|
}
|
|
|
- // Set Mix cipher flag
|
|
|
+ /* Set Mix cipher flag */
|
|
|
pAd->StaCfg.bMixCipher =
|
|
|
(pAd->StaCfg.PairCipher ==
|
|
|
pAd->StaCfg.GroupCipher) ? FALSE : TRUE;
|
|
|
@@ -2211,7 +2211,7 @@ VOID IterateOnBssTab(IN PRTMP_ADAPTER pAd)
|
|
|
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ,
|
|
|
sizeof(MLME_START_REQ_STRUCT), &StartReq);
|
|
|
pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_START;
|
|
|
- } else // no more BSS
|
|
|
+ } else /* no more BSS */
|
|
|
{
|
|
|
|
|
|
{
|
|
|
@@ -2226,8 +2226,8 @@ VOID IterateOnBssTab(IN PRTMP_ADAPTER pAd)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// for re-association only
|
|
|
-// IRQL = DISPATCH_LEVEL
|
|
|
+/* for re-association only */
|
|
|
+/* IRQL = DISPATCH_LEVEL */
|
|
|
VOID IterateOnBssTab2(IN PRTMP_ADAPTER pAd)
|
|
|
{
|
|
|
MLME_REASSOC_REQ_STRUCT ReassocReq;
|
|
|
@@ -2245,7 +2245,7 @@ VOID IterateOnBssTab2(IN PRTMP_ADAPTER pAd)
|
|
|
AsicSwitchChannel(pAd, pBss->Channel, FALSE);
|
|
|
AsicLockChannel(pAd, pBss->Channel);
|
|
|
|
|
|
- // reassociate message has the same structure as associate message
|
|
|
+ /* reassociate message has the same structure as associate message */
|
|
|
AssocParmFill(pAd, &ReassocReq, pBss->Bssid,
|
|
|
pBss->CapabilityInfo, ASSOC_TIMEOUT,
|
|
|
pAd->StaCfg.DefaultListenCount);
|
|
|
@@ -2253,7 +2253,7 @@ VOID IterateOnBssTab2(IN PRTMP_ADAPTER pAd)
|
|
|
sizeof(MLME_REASSOC_REQ_STRUCT), &ReassocReq);
|
|
|
|
|
|
pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_REASSOC;
|
|
|
- } else // no more BSS
|
|
|
+ } else /* no more BSS */
|
|
|
{
|
|
|
|
|
|
{
|
|
|
@@ -2355,7 +2355,7 @@ VOID ComposePsPoll(IN PRTMP_ADAPTER pAd)
|
|
|
COPY_MAC_ADDR(pAd->PsPollFrame.Ta, pAd->CurrentAddress);
|
|
|
}
|
|
|
|
|
|
-// IRQL = DISPATCH_LEVEL
|
|
|
+/* IRQL = DISPATCH_LEVEL */
|
|
|
VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd)
|
|
|
{
|
|
|
NdisZeroMemory(&pAd->NullFrame, sizeof(HEADER_802_11));
|
|
|
@@ -2366,7 +2366,7 @@ VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd)
|
|
|
COPY_MAC_ADDR(pAd->NullFrame.Addr2, pAd->CurrentAddress);
|
|
|
COPY_MAC_ADDR(pAd->NullFrame.Addr3, pAd->CommonCfg.Bssid);
|
|
|
}
|
|
|
-#endif // RTMP_MAC_PCI //
|
|
|
+#endif /* RTMP_MAC_PCI // */
|
|
|
#ifdef RTMP_MAC_USB
|
|
|
VOID MlmeCntlConfirm(IN PRTMP_ADAPTER pAd, IN ULONG MsgType, IN USHORT Msg)
|
|
|
{
|
|
|
@@ -2407,12 +2407,12 @@ VOID ComposePsPoll(IN PRTMP_ADAPTER pAd)
|
|
|
RTMPMoveMemory(&pAd->PsPollContext.TransferBuffer->field.
|
|
|
WirelessPacket[TXWI_SIZE + TXINFO_SIZE],
|
|
|
&pAd->PsPollFrame, sizeof(PSPOLL_FRAME));
|
|
|
- // Append 4 extra zero bytes.
|
|
|
+ /* Append 4 extra zero bytes. */
|
|
|
pAd->PsPollContext.BulkOutSize =
|
|
|
TXINFO_SIZE + TXWI_SIZE + sizeof(PSPOLL_FRAME) + 4;
|
|
|
}
|
|
|
|
|
|
-// IRQL = DISPATCH_LEVEL
|
|
|
+/* IRQL = DISPATCH_LEVEL */
|
|
|
VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd)
|
|
|
{
|
|
|
PTXINFO_STRUC pTxInfo;
|
|
|
@@ -2446,7 +2446,7 @@ VOID ComposeNullFrame(IN PRTMP_ADAPTER pAd)
|
|
|
pAd->NullContext.BulkOutSize =
|
|
|
TXINFO_SIZE + TXWI_SIZE + sizeof(pAd->NullFrame) + 4;
|
|
|
}
|
|
|
-#endif // RTMP_MAC_USB //
|
|
|
+#endif /* RTMP_MAC_USB // */
|
|
|
|
|
|
/*
|
|
|
==========================================================================
|
|
|
@@ -2477,27 +2477,27 @@ ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd)
|
|
|
|
|
|
if ((pAd->CommonCfg.PhyMode == PHY_11B)
|
|
|
&& (pAd->CommonCfg.Channel <= 14)) {
|
|
|
- SupRate[0] = 0x82; // 1 mbps
|
|
|
- SupRate[1] = 0x84; // 2 mbps
|
|
|
- SupRate[2] = 0x8b; // 5.5 mbps
|
|
|
- SupRate[3] = 0x96; // 11 mbps
|
|
|
+ SupRate[0] = 0x82; /* 1 mbps */
|
|
|
+ SupRate[1] = 0x84; /* 2 mbps */
|
|
|
+ SupRate[2] = 0x8b; /* 5.5 mbps */
|
|
|
+ SupRate[3] = 0x96; /* 11 mbps */
|
|
|
SupRateLen = 4;
|
|
|
ExtRateLen = 0;
|
|
|
} else if (pAd->CommonCfg.Channel > 14) {
|
|
|
- SupRate[0] = 0x8C; // 6 mbps, in units of 0.5 Mbps, basic rate
|
|
|
- SupRate[1] = 0x12; // 9 mbps, in units of 0.5 Mbps
|
|
|
- SupRate[2] = 0x98; // 12 mbps, in units of 0.5 Mbps, basic rate
|
|
|
- SupRate[3] = 0x24; // 18 mbps, in units of 0.5 Mbps
|
|
|
- SupRate[4] = 0xb0; // 24 mbps, in units of 0.5 Mbps, basic rate
|
|
|
- SupRate[5] = 0x48; // 36 mbps, in units of 0.5 Mbps
|
|
|
- SupRate[6] = 0x60; // 48 mbps, in units of 0.5 Mbps
|
|
|
- SupRate[7] = 0x6c; // 54 mbps, in units of 0.5 Mbps
|
|
|
+ SupRate[0] = 0x8C; /* 6 mbps, in units of 0.5 Mbps, basic rate */
|
|
|
+ SupRate[1] = 0x12; /* 9 mbps, in units of 0.5 Mbps */
|
|
|
+ SupRate[2] = 0x98; /* 12 mbps, in units of 0.5 Mbps, basic rate */
|
|
|
+ SupRate[3] = 0x24; /* 18 mbps, in units of 0.5 Mbps */
|
|
|
+ SupRate[4] = 0xb0; /* 24 mbps, in units of 0.5 Mbps, basic rate */
|
|
|
+ SupRate[5] = 0x48; /* 36 mbps, in units of 0.5 Mbps */
|
|
|
+ SupRate[6] = 0x60; /* 48 mbps, in units of 0.5 Mbps */
|
|
|
+ SupRate[7] = 0x6c; /* 54 mbps, in units of 0.5 Mbps */
|
|
|
SupRateLen = 8;
|
|
|
ExtRateLen = 0;
|
|
|
|
|
|
- //
|
|
|
- // Also Update MlmeRate & RtsRate for G only & A only
|
|
|
- //
|
|
|
+ /* */
|
|
|
+ /* Also Update MlmeRate & RtsRate for G only & A only */
|
|
|
+ /* */
|
|
|
pAd->CommonCfg.MlmeRate = RATE_6;
|
|
|
pAd->CommonCfg.RtsRate = RATE_6;
|
|
|
pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_OFDM;
|
|
|
@@ -2508,20 +2508,20 @@ ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd)
|
|
|
pAd->MacTab.Content[BSS0Mcast_WCID].HTPhyMode.field.MCS =
|
|
|
OfdmRateToRxwiMCS[pAd->CommonCfg.MlmeRate];
|
|
|
} else {
|
|
|
- SupRate[0] = 0x82; // 1 mbps
|
|
|
- SupRate[1] = 0x84; // 2 mbps
|
|
|
- SupRate[2] = 0x8b; // 5.5 mbps
|
|
|
- SupRate[3] = 0x96; // 11 mbps
|
|
|
+ SupRate[0] = 0x82; /* 1 mbps */
|
|
|
+ SupRate[1] = 0x84; /* 2 mbps */
|
|
|
+ SupRate[2] = 0x8b; /* 5.5 mbps */
|
|
|
+ SupRate[3] = 0x96; /* 11 mbps */
|
|
|
SupRateLen = 4;
|
|
|
|
|
|
- ExtRate[0] = 0x0C; // 6 mbps, in units of 0.5 Mbps,
|
|
|
- ExtRate[1] = 0x12; // 9 mbps, in units of 0.5 Mbps
|
|
|
- ExtRate[2] = 0x18; // 12 mbps, in units of 0.5 Mbps,
|
|
|
- ExtRate[3] = 0x24; // 18 mbps, in units of 0.5 Mbps
|
|
|
- ExtRate[4] = 0x30; // 24 mbps, in units of 0.5 Mbps,
|
|
|
- ExtRate[5] = 0x48; // 36 mbps, in units of 0.5 Mbps
|
|
|
- ExtRate[6] = 0x60; // 48 mbps, in units of 0.5 Mbps
|
|
|
- ExtRate[7] = 0x6c; // 54 mbps, in units of 0.5 Mbps
|
|
|
+ ExtRate[0] = 0x0C; /* 6 mbps, in units of 0.5 Mbps, */
|
|
|
+ ExtRate[1] = 0x12; /* 9 mbps, in units of 0.5 Mbps */
|
|
|
+ ExtRate[2] = 0x18; /* 12 mbps, in units of 0.5 Mbps, */
|
|
|
+ ExtRate[3] = 0x24; /* 18 mbps, in units of 0.5 Mbps */
|
|
|
+ ExtRate[4] = 0x30; /* 24 mbps, in units of 0.5 Mbps, */
|
|
|
+ ExtRate[5] = 0x48; /* 36 mbps, in units of 0.5 Mbps */
|
|
|
+ ExtRate[6] = 0x60; /* 48 mbps, in units of 0.5 Mbps */
|
|
|
+ ExtRate[7] = 0x6c; /* 54 mbps, in units of 0.5 Mbps */
|
|
|
ExtRateLen = 8;
|
|
|
}
|
|
|
|
|
|
@@ -2530,7 +2530,7 @@ ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd)
|
|
|
pAd->StaActive.ExtRateLen = ExtRateLen;
|
|
|
NdisMoveMemory(pAd->StaActive.ExtRate, ExtRate, ExtRateLen);
|
|
|
|
|
|
- // compose IBSS beacon frame
|
|
|
+ /* compose IBSS beacon frame */
|
|
|
MgtMacHeaderInit(pAd, &BcnHdr, SUBTYPE_BEACON, 0, BROADCAST_ADDR,
|
|
|
pAd->CommonCfg.Bssid);
|
|
|
Privacy = (pAd->StaCfg.WepStatus == Ndis802_11Encryption1Enabled)
|
|
|
@@ -2558,7 +2558,7 @@ ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd)
|
|
|
1, &IbssIe,
|
|
|
1, &IbssLen, 2, &pAd->StaActive.AtimWin, END_OF_ARGS);
|
|
|
|
|
|
- // add ERP_IE and EXT_RAE IE of in 802.11g
|
|
|
+ /* add ERP_IE and EXT_RAE IE of in 802.11g */
|
|
|
if (ExtRateLen) {
|
|
|
ULONG tmp;
|
|
|
|
|
|
@@ -2569,7 +2569,7 @@ ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd)
|
|
|
ExtRateLen, ExtRate, 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;
|
|
|
RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus,
|
|
|
@@ -2587,7 +2587,7 @@ ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd)
|
|
|
ULONG TmpLen;
|
|
|
UCHAR HtLen, HtLen1;
|
|
|
|
|
|
- // add HT Capability IE
|
|
|
+ /* add HT Capability IE */
|
|
|
HtLen = sizeof(pAd->CommonCfg.HtCapability);
|
|
|
HtLen1 = sizeof(pAd->CommonCfg.AddHTInfo);
|
|
|
|
|
|
@@ -2602,14 +2602,14 @@ ULONG MakeIbssBeacon(IN PRTMP_ADAPTER pAd)
|
|
|
|
|
|
FrameLen += TmpLen;
|
|
|
}
|
|
|
- //beacon use reserved WCID 0xff
|
|
|
+ /*beacon use reserved WCID 0xff */
|
|
|
if (pAd->CommonCfg.Channel > 14) {
|
|
|
RTMPWriteTxWI(pAd, pTxWI, FALSE, FALSE, TRUE, FALSE, FALSE,
|
|
|
TRUE, 0, 0xff, FrameLen, PID_MGMT, PID_BEACON,
|
|
|
RATE_1, IFS_HTTXOP, FALSE,
|
|
|
&pAd->CommonCfg.MlmeTransmit);
|
|
|
} else {
|
|
|
- // Set to use 1Mbps for Adhoc beacon.
|
|
|
+ /* Set to use 1Mbps for Adhoc beacon. */
|
|
|
HTTRANSMIT_SETTING Transmit;
|
|
|
Transmit.word = 0;
|
|
|
RTMPWriteTxWI(pAd, pTxWI, FALSE, FALSE, TRUE, FALSE, FALSE,
|