Commit e1c77579 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

staging:vt6655:bssdb: Whitespace cleanups

Neatening only.
git diff -w shows no differences.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 37529367
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
/*--------------------- Static Classes ----------------------------*/ /*--------------------- Static Classes ----------------------------*/
/*--------------------- Static Variables --------------------------*/ /*--------------------- Static Variables --------------------------*/
static int msglevel =MSG_LEVEL_INFO; static int msglevel = MSG_LEVEL_INFO;
//static int msglevel =MSG_LEVEL_DEBUG; //static int msglevel =MSG_LEVEL_DEBUG;
...@@ -77,14 +77,14 @@ const unsigned short awHWRetry0[5][5] = { ...@@ -77,14 +77,14 @@ const unsigned short awHWRetry0[5][5] = {
{RATE_36M, RATE_36M, RATE_24M, RATE_18M, RATE_18M}, {RATE_36M, RATE_36M, RATE_24M, RATE_18M, RATE_18M},
{RATE_48M, RATE_48M, RATE_36M, RATE_24M, RATE_24M}, {RATE_48M, RATE_48M, RATE_36M, RATE_24M, RATE_24M},
{RATE_54M, RATE_54M, RATE_48M, RATE_36M, RATE_36M} {RATE_54M, RATE_54M, RATE_48M, RATE_36M, RATE_36M}
}; };
const unsigned short awHWRetry1[5][5] = { const unsigned short awHWRetry1[5][5] = {
{RATE_18M, RATE_18M, RATE_12M, RATE_6M, RATE_6M}, {RATE_18M, RATE_18M, RATE_12M, RATE_6M, RATE_6M},
{RATE_24M, RATE_24M, RATE_18M, RATE_6M, RATE_6M}, {RATE_24M, RATE_24M, RATE_18M, RATE_6M, RATE_6M},
{RATE_36M, RATE_36M, RATE_24M, RATE_12M, RATE_12M}, {RATE_36M, RATE_36M, RATE_24M, RATE_12M, RATE_12M},
{RATE_48M, RATE_48M, RATE_24M, RATE_12M, RATE_12M}, {RATE_48M, RATE_48M, RATE_24M, RATE_12M, RATE_12M},
{RATE_54M, RATE_54M, RATE_36M, RATE_18M, RATE_18M} {RATE_54M, RATE_54M, RATE_36M, RATE_18M, RATE_18M}
}; };
...@@ -92,18 +92,18 @@ const unsigned short awHWRetry1[5][5] = { ...@@ -92,18 +92,18 @@ const unsigned short awHWRetry1[5][5] = {
void s_vCheckSensitivity( void s_vCheckSensitivity(
void *hDeviceContext void *hDeviceContext
); );
#ifdef Calcu_LinkQual #ifdef Calcu_LinkQual
void s_uCalculateLinkQual( void s_uCalculateLinkQual(
void *hDeviceContext void *hDeviceContext
); );
#endif #endif
void s_vCheckPreEDThreshold( void s_vCheckPreEDThreshold(
void *hDeviceContext void *hDeviceContext
); );
/*--------------------- Export Variables --------------------------*/ /*--------------------- Export Variables --------------------------*/
...@@ -121,7 +121,7 @@ void s_vCheckPreEDThreshold( ...@@ -121,7 +121,7 @@ void s_vCheckPreEDThreshold(
* Return Value: * Return Value:
* PTR to KnownBSS or NULL * PTR to KnownBSS or NULL
* *
-*/ -*/
PKnownBSS PKnownBSS
BSSpSearchBSSList( BSSpSearchBSSList(
...@@ -129,7 +129,7 @@ BSSpSearchBSSList( ...@@ -129,7 +129,7 @@ BSSpSearchBSSList(
unsigned char *pbyDesireBSSID, unsigned char *pbyDesireBSSID,
unsigned char *pbyDesireSSID, unsigned char *pbyDesireSSID,
CARD_PHY_TYPE ePhyType CARD_PHY_TYPE ePhyType
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = pDevice->pMgmt; PSMgmtObject pMgmt = pDevice->pMgmt;
...@@ -137,14 +137,14 @@ BSSpSearchBSSList( ...@@ -137,14 +137,14 @@ BSSpSearchBSSList(
PWLAN_IE_SSID pSSID = NULL; PWLAN_IE_SSID pSSID = NULL;
PKnownBSS pCurrBSS = NULL; PKnownBSS pCurrBSS = NULL;
PKnownBSS pSelect = NULL; PKnownBSS pSelect = NULL;
unsigned char ZeroBSSID[WLAN_BSSID_LEN]={0x00,0x00,0x00,0x00,0x00,0x00}; unsigned char ZeroBSSID[WLAN_BSSID_LEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
unsigned int ii = 0; unsigned int ii = 0;
if (pbyDesireBSSID != NULL) { if (pbyDesireBSSID != NULL) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"BSSpSearchBSSList BSSID[%pM]\n", pbyDesireBSSID); "BSSpSearchBSSList BSSID[%pM]\n", pbyDesireBSSID);
if ((!is_broadcast_ether_addr(pbyDesireBSSID)) && if ((!is_broadcast_ether_addr(pbyDesireBSSID)) &&
(memcmp(pbyDesireBSSID, ZeroBSSID, 6)!= 0)){ (memcmp(pbyDesireBSSID, ZeroBSSID, 6) != 0)) {
pbyBSSID = pbyDesireBSSID; pbyBSSID = pbyDesireBSSID;
} }
} }
...@@ -156,21 +156,21 @@ BSSpSearchBSSList( ...@@ -156,21 +156,21 @@ BSSpSearchBSSList(
if (pbyBSSID != NULL) { if (pbyBSSID != NULL) {
// match BSSID first // match BSSID first
for (ii = 0; ii <MAX_BSS_NUM; ii++) { for (ii = 0; ii < MAX_BSS_NUM; ii++) {
pCurrBSS = &(pMgmt->sBSSList[ii]); pCurrBSS = &(pMgmt->sBSSList[ii]);
if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false; if (pDevice->bLinkPass == false) pCurrBSS->bSelected = false;
if ((pCurrBSS->bActive) && if ((pCurrBSS->bActive) &&
(pCurrBSS->bSelected == false)) { (pCurrBSS->bSelected == false)) {
if (!compare_ether_addr(pCurrBSS->abyBSSID, pbyBSSID)) { if (!compare_ether_addr(pCurrBSS->abyBSSID, pbyBSSID)) {
if (pSSID != NULL) { if (pSSID != NULL) {
// compare ssid // compare ssid
if ( !memcmp(pSSID->abySSID, if (!memcmp(pSSID->abySSID,
((PWLAN_IE_SSID)pCurrBSS->abySSID)->abySSID, ((PWLAN_IE_SSID)pCurrBSS->abySSID)->abySSID,
pSSID->len)) { pSSID->len)) {
if ((pMgmt->eConfigMode == WMAC_CONFIG_AUTO) || if ((pMgmt->eConfigMode == WMAC_CONFIG_AUTO) ||
((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo)) || ((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo)) ||
((pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA) && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo)) ((pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA) && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo))
) { ) {
pCurrBSS->bSelected = true; pCurrBSS->bSelected = true;
return(pCurrBSS); return(pCurrBSS);
} }
...@@ -179,7 +179,7 @@ if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false; ...@@ -179,7 +179,7 @@ if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false;
if ((pMgmt->eConfigMode == WMAC_CONFIG_AUTO) || if ((pMgmt->eConfigMode == WMAC_CONFIG_AUTO) ||
((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo)) || ((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo)) ||
((pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA) && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo)) ((pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA) && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo))
) { ) {
pCurrBSS->bSelected = true; pCurrBSS->bSelected = true;
return(pCurrBSS); return(pCurrBSS);
} }
...@@ -189,7 +189,7 @@ if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false; ...@@ -189,7 +189,7 @@ if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false;
} }
} else { } else {
// ignore BSSID // ignore BSSID
for (ii = 0; ii <MAX_BSS_NUM; ii++) { for (ii = 0; ii < MAX_BSS_NUM; ii++) {
pCurrBSS = &(pMgmt->sBSSList[ii]); pCurrBSS = &(pMgmt->sBSSList[ii]);
//2007-0721-01<Add>by MikeLiu //2007-0721-01<Add>by MikeLiu
pCurrBSS->bSelected = false; pCurrBSS->bSelected = false;
...@@ -197,7 +197,7 @@ if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false; ...@@ -197,7 +197,7 @@ if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false;
if (pSSID != NULL) { if (pSSID != NULL) {
// matched SSID // matched SSID
if (! !memcmp(pSSID->abySSID, if (!!memcmp(pSSID->abySSID,
((PWLAN_IE_SSID)pCurrBSS->abySSID)->abySSID, ((PWLAN_IE_SSID)pCurrBSS->abySSID)->abySSID,
pSSID->len) || pSSID->len) ||
(pSSID->len != ((PWLAN_IE_SSID)pCurrBSS->abySSID)->len)) { (pSSID->len != ((PWLAN_IE_SSID)pCurrBSS->abySSID)->len)) {
...@@ -207,9 +207,9 @@ if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false; ...@@ -207,9 +207,9 @@ if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false;
} }
if (((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo)) || if (((pMgmt->eConfigMode == WMAC_CONFIG_IBSS_STA) && WLAN_GET_CAP_INFO_ESS(pCurrBSS->wCapInfo)) ||
((pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA) && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo)) ((pMgmt->eConfigMode == WMAC_CONFIG_ESS_STA) && WLAN_GET_CAP_INFO_IBSS(pCurrBSS->wCapInfo))
){ ) {
// Type not match skip this BSS // Type not match skip this BSS
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"BSS type mismatch.... Config[%d] BSS[0x%04x]\n", pMgmt->eConfigMode, pCurrBSS->wCapInfo); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "BSS type mismatch.... Config[%d] BSS[0x%04x]\n", pMgmt->eConfigMode, pCurrBSS->wCapInfo);
continue; continue;
} }
...@@ -217,7 +217,7 @@ if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false; ...@@ -217,7 +217,7 @@ if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false;
if (((ePhyType == PHY_TYPE_11A) && (PHY_TYPE_11A != pCurrBSS->eNetworkTypeInUse)) || if (((ePhyType == PHY_TYPE_11A) && (PHY_TYPE_11A != pCurrBSS->eNetworkTypeInUse)) ||
((ePhyType != PHY_TYPE_11A) && (PHY_TYPE_11A == pCurrBSS->eNetworkTypeInUse))) { ((ePhyType != PHY_TYPE_11A) && (PHY_TYPE_11A == pCurrBSS->eNetworkTypeInUse))) {
// PhyType not match skip this BSS // PhyType not match skip this BSS
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Physical type mismatch.... ePhyType[%d] BSS[%d]\n", ePhyType, pCurrBSS->eNetworkTypeInUse); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Physical type mismatch.... ePhyType[%d] BSS[%d]\n", ePhyType, pCurrBSS->eNetworkTypeInUse);
continue; continue;
} }
} }
...@@ -257,7 +257,7 @@ if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false; ...@@ -257,7 +257,7 @@ if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false;
if (pDevice->bRoaming == false) { if (pDevice->bRoaming == false) {
// Einsn Add @20070907 // Einsn Add @20070907
memset(pbyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1); memset(pbyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
memcpy(pbyDesireSSID,pCurrBSS->abySSID,WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1) ; memcpy(pbyDesireSSID,pCurrBSS->abySSID,WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1);
}*/ }*/
return(pSelect); return(pSelect);
...@@ -276,14 +276,14 @@ if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false; ...@@ -276,14 +276,14 @@ if(pDevice->bLinkPass==false) pCurrBSS->bSelected = false;
* Return Value: * Return Value:
* None. * None.
* *
-*/ -*/
void void
BSSvClearBSSList( BSSvClearBSSList(
void *hDeviceContext, void *hDeviceContext,
bool bKeepCurrBSSID bool bKeepCurrBSSID
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = pDevice->pMgmt; PSMgmtObject pMgmt = pDevice->pMgmt;
...@@ -299,7 +299,7 @@ BSSvClearBSSList( ...@@ -299,7 +299,7 @@ BSSvClearBSSList(
} }
if ((pMgmt->sBSSList[ii].bActive) && (pMgmt->sBSSList[ii].uClearCount < BSS_CLEAR_COUNT)) { if ((pMgmt->sBSSList[ii].bActive) && (pMgmt->sBSSList[ii].uClearCount < BSS_CLEAR_COUNT)) {
pMgmt->sBSSList[ii].uClearCount ++; pMgmt->sBSSList[ii].uClearCount++;
continue; continue;
} }
...@@ -321,13 +321,13 @@ BSSvClearBSSList( ...@@ -321,13 +321,13 @@ BSSvClearBSSList(
* Return Value: * Return Value:
* true if found. * true if found.
* *
-*/ -*/
PKnownBSS PKnownBSS
BSSpAddrIsInBSSList( BSSpAddrIsInBSSList(
void *hDeviceContext, void *hDeviceContext,
unsigned char *abyBSSID, unsigned char *abyBSSID,
PWLAN_IE_SSID pSSID PWLAN_IE_SSID pSSID
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = pDevice->pMgmt; PSMgmtObject pMgmt = pDevice->pMgmt;
...@@ -340,7 +340,7 @@ BSSpAddrIsInBSSList( ...@@ -340,7 +340,7 @@ BSSpAddrIsInBSSList(
if (!compare_ether_addr(pBSSList->abyBSSID, abyBSSID)) { if (!compare_ether_addr(pBSSList->abyBSSID, abyBSSID)) {
// if (pSSID == NULL) // if (pSSID == NULL)
// return pBSSList; // return pBSSList;
if (pSSID->len == ((PWLAN_IE_SSID)pBSSList->abySSID)->len){ if (pSSID->len == ((PWLAN_IE_SSID)pBSSList->abySSID)->len) {
if (memcmp(pSSID->abySSID, if (memcmp(pSSID->abySSID,
((PWLAN_IE_SSID)pBSSList->abySSID)->abySSID, ((PWLAN_IE_SSID)pBSSList->abySSID)->abySSID,
pSSID->len) == 0) pSSID->len) == 0)
...@@ -363,10 +363,10 @@ BSSpAddrIsInBSSList( ...@@ -363,10 +363,10 @@ BSSpAddrIsInBSSList(
* Return Value: * Return Value:
* true if success. * true if success.
* *
-*/ -*/
bool bool
BSSbInsertToBSSList ( BSSbInsertToBSSList(
void *hDeviceContext, void *hDeviceContext,
unsigned char *abyBSSIDAddr, unsigned char *abyBSSIDAddr,
QWORD qwTimestamp, QWORD qwTimestamp,
...@@ -384,7 +384,7 @@ BSSbInsertToBSSList ( ...@@ -384,7 +384,7 @@ BSSbInsertToBSSList (
unsigned int uIELength, unsigned int uIELength,
unsigned char *pbyIEs, unsigned char *pbyIEs,
void *pRxPacketContext void *pRxPacketContext
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
...@@ -405,13 +405,13 @@ BSSbInsertToBSSList ( ...@@ -405,13 +405,13 @@ BSSbInsertToBSSList (
break; break;
} }
if (ii == MAX_BSS_NUM){ if (ii == MAX_BSS_NUM) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Get free KnowBSS node failed.\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Get free KnowBSS node failed.\n");
return false; return false;
} }
// save the BSS info // save the BSS info
pBSSList->bActive = true; pBSSList->bActive = true;
memcpy( pBSSList->abyBSSID, abyBSSIDAddr, WLAN_BSSID_LEN); memcpy(pBSSList->abyBSSID, abyBSSIDAddr, WLAN_BSSID_LEN);
HIDWORD(pBSSList->qwBSSTimestamp) = cpu_to_le32(HIDWORD(qwTimestamp)); HIDWORD(pBSSList->qwBSSTimestamp) = cpu_to_le32(HIDWORD(qwTimestamp));
LODWORD(pBSSList->qwBSSTimestamp) = cpu_to_le32(LODWORD(qwTimestamp)); LODWORD(pBSSList->qwBSSTimestamp) = cpu_to_le32(LODWORD(qwTimestamp));
pBSSList->wBeaconInterval = cpu_to_le16(wBeaconInterval); pBSSList->wBeaconInterval = cpu_to_le16(wBeaconInterval);
...@@ -420,19 +420,19 @@ BSSbInsertToBSSList ( ...@@ -420,19 +420,19 @@ BSSbInsertToBSSList (
if (pSSID->len > WLAN_SSID_MAXLEN) if (pSSID->len > WLAN_SSID_MAXLEN)
pSSID->len = WLAN_SSID_MAXLEN; pSSID->len = WLAN_SSID_MAXLEN;
memcpy( pBSSList->abySSID, pSSID, pSSID->len + WLAN_IEHDR_LEN); memcpy(pBSSList->abySSID, pSSID, pSSID->len + WLAN_IEHDR_LEN);
pBSSList->uChannel = byCurrChannel; pBSSList->uChannel = byCurrChannel;
if (pSuppRates->len > WLAN_RATES_MAXLEN) if (pSuppRates->len > WLAN_RATES_MAXLEN)
pSuppRates->len = WLAN_RATES_MAXLEN; pSuppRates->len = WLAN_RATES_MAXLEN;
memcpy( pBSSList->abySuppRates, pSuppRates, pSuppRates->len + WLAN_IEHDR_LEN); memcpy(pBSSList->abySuppRates, pSuppRates, pSuppRates->len + WLAN_IEHDR_LEN);
if (pExtSuppRates != NULL) { if (pExtSuppRates != NULL) {
if (pExtSuppRates->len > WLAN_RATES_MAXLEN) if (pExtSuppRates->len > WLAN_RATES_MAXLEN)
pExtSuppRates->len = WLAN_RATES_MAXLEN; pExtSuppRates->len = WLAN_RATES_MAXLEN;
memcpy(pBSSList->abyExtSuppRates, pExtSuppRates, pExtSuppRates->len + WLAN_IEHDR_LEN); memcpy(pBSSList->abyExtSuppRates, pExtSuppRates, pExtSuppRates->len + WLAN_IEHDR_LEN);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"BSSbInsertToBSSList: pExtSuppRates->len = %d\n", pExtSuppRates->len); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "BSSbInsertToBSSList: pExtSuppRates->len = %d\n", pExtSuppRates->len);
} else { } else {
memset(pBSSList->abyExtSuppRates, 0, WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1); memset(pBSSList->abyExtSuppRates, 0, WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1);
...@@ -492,14 +492,14 @@ BSSbInsertToBSSList ( ...@@ -492,14 +492,14 @@ BSSbInsertToBSSList (
PSKeyItem pTransmitKey = NULL; PSKeyItem pTransmitKey = NULL;
bool bIs802_1x = false; bool bIs802_1x = false;
for (ii = 0; ii < pBSSList->wAKMSSAuthCount; ii ++) { for (ii = 0; ii < pBSSList->wAKMSSAuthCount; ii++) {
if (pBSSList->abyAKMSSAuthType[ii] == WLAN_11i_AKMSS_802_1X) { if (pBSSList->abyAKMSSAuthType[ii] == WLAN_11i_AKMSS_802_1X) {
bIs802_1x = true; bIs802_1x = true;
break; break;
} }
} }
if ((bIs802_1x == true) && (pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->len) && if ((bIs802_1x == true) && (pSSID->len == ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->len) &&
( !memcmp(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySSID, pSSID->len))) { (!memcmp(pSSID->abySSID, ((PWLAN_IE_SSID)pMgmt->abyDesireSSID)->abySSID, pSSID->len))) {
bAdd_PMKID_Candidate((void *)pDevice, pBSSList->abyBSSID, &pBSSList->sRSNCapObj); bAdd_PMKID_Candidate((void *)pDevice, pBSSList->abyBSSID, &pBSSList->sRSNCapObj);
...@@ -536,16 +536,16 @@ BSSbInsertToBSSList ( ...@@ -536,16 +536,16 @@ BSSbInsertToBSSList (
// valid EID // valid EID
if (pQuiet == NULL) { if (pQuiet == NULL) {
pQuiet = (PWLAN_IE_QUIET)pIE_Quiet; pQuiet = (PWLAN_IE_QUIET)pIE_Quiet;
CARDbSetQuiet( pMgmt->pAdapter, CARDbSetQuiet(pMgmt->pAdapter,
true, true,
pQuiet->byQuietCount, pQuiet->byQuietCount,
pQuiet->byQuietPeriod, pQuiet->byQuietPeriod,
*((unsigned short *)pQuiet->abyQuietDuration), *((unsigned short *)pQuiet->abyQuietDuration),
*((unsigned short *)pQuiet->abyQuietOffset) *((unsigned short *)pQuiet->abyQuietOffset)
); );
} else { } else {
pQuiet = (PWLAN_IE_QUIET)pIE_Quiet; pQuiet = (PWLAN_IE_QUIET)pIE_Quiet;
CARDbSetQuiet( pMgmt->pAdapter, CARDbSetQuiet(pMgmt->pAdapter,
false, false,
pQuiet->byQuietCount, pQuiet->byQuietCount,
pQuiet->byQuietPeriod, pQuiet->byQuietPeriod,
...@@ -578,11 +578,11 @@ BSSbInsertToBSSList ( ...@@ -578,11 +578,11 @@ BSSbInsertToBSSList (
* Return Value: * Return Value:
* true if success. * true if success.
* *
-*/ -*/
// TODO: input structure modify // TODO: input structure modify
bool bool
BSSbUpdateToBSSList ( BSSbUpdateToBSSList(
void *hDeviceContext, void *hDeviceContext,
QWORD qwTimestamp, QWORD qwTimestamp,
unsigned short wBeaconInterval, unsigned short wBeaconInterval,
...@@ -601,7 +601,7 @@ BSSbUpdateToBSSList ( ...@@ -601,7 +601,7 @@ BSSbUpdateToBSSList (
unsigned int uIELength, unsigned int uIELength,
unsigned char *pbyIEs, unsigned char *pbyIEs,
void *pRxPacketContext void *pRxPacketContext
) )
{ {
int ii; int ii;
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
...@@ -623,17 +623,17 @@ BSSbUpdateToBSSList ( ...@@ -623,17 +623,17 @@ BSSbUpdateToBSSList (
pBSSList->wCapInfo = cpu_to_le16(wCapInfo); pBSSList->wCapInfo = cpu_to_le16(wCapInfo);
pBSSList->uClearCount = 0; pBSSList->uClearCount = 0;
pBSSList->uChannel = byCurrChannel; pBSSList->uChannel = byCurrChannel;
// DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"BSSbUpdateToBSSList: pBSSList->uChannel: %d\n", pBSSList->uChannel); // DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "BSSbUpdateToBSSList: pBSSList->uChannel: %d\n", pBSSList->uChannel);
if (pSSID->len > WLAN_SSID_MAXLEN) if (pSSID->len > WLAN_SSID_MAXLEN)
pSSID->len = WLAN_SSID_MAXLEN; pSSID->len = WLAN_SSID_MAXLEN;
if ((pSSID->len != 0) && (pSSID->abySSID[0] != 0)) if ((pSSID->len != 0) && (pSSID->abySSID[0] != 0))
memcpy(pBSSList->abySSID, pSSID, pSSID->len + WLAN_IEHDR_LEN); memcpy(pBSSList->abySSID, pSSID, pSSID->len + WLAN_IEHDR_LEN);
memcpy(pBSSList->abySuppRates, pSuppRates,pSuppRates->len + WLAN_IEHDR_LEN); memcpy(pBSSList->abySuppRates, pSuppRates, pSuppRates->len + WLAN_IEHDR_LEN);
if (pExtSuppRates != NULL) { if (pExtSuppRates != NULL) {
memcpy(pBSSList->abyExtSuppRates, pExtSuppRates,pExtSuppRates->len + WLAN_IEHDR_LEN); memcpy(pBSSList->abyExtSuppRates, pExtSuppRates, pExtSuppRates->len + WLAN_IEHDR_LEN);
} else { } else {
memset(pBSSList->abyExtSuppRates, 0, WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1); memset(pBSSList->abyExtSuppRates, 0, WLAN_IEHDR_LEN + WLAN_RATES_MAXLEN + 1);
} }
...@@ -653,7 +653,7 @@ BSSbUpdateToBSSList ( ...@@ -653,7 +653,7 @@ BSSbUpdateToBSSList (
pBSSList->byRxRate = pRxPacket->byRxRate; pBSSList->byRxRate = pRxPacket->byRxRate;
pBSSList->qwLocalTSF = pRxPacket->qwLocalTSF; pBSSList->qwLocalTSF = pRxPacket->qwLocalTSF;
if(bChannelHit) if (bChannelHit)
pBSSList->uRSSI = pRxPacket->uRSSI; pBSSList->uRSSI = pRxPacket->uRSSI;
pBSSList->bySQ = pRxPacket->bySQ; pBSSList->bySQ = pRxPacket->bySQ;
...@@ -693,7 +693,7 @@ BSSbUpdateToBSSList ( ...@@ -693,7 +693,7 @@ BSSbUpdateToBSSList (
pBSSList->byRSSIStatCnt++; pBSSList->byRSSIStatCnt++;
pBSSList->byRSSIStatCnt %= RSSI_STAT_COUNT; pBSSList->byRSSIStatCnt %= RSSI_STAT_COUNT;
pBSSList->ldBmAverage[pBSSList->byRSSIStatCnt] = ldBm; pBSSList->ldBmAverage[pBSSList->byRSSIStatCnt] = ldBm;
for(ii=0;ii<RSSI_STAT_COUNT;ii++) { for (ii = 0; ii < RSSI_STAT_COUNT; ii++) {
if (pBSSList->ldBmAverage[ii] != 0) { if (pBSSList->ldBmAverage[ii] != 0) {
pBSSList->ldBmMAX = max(pBSSList->ldBmAverage[ii], ldBm); pBSSList->ldBmMAX = max(pBSSList->ldBmAverage[ii], ldBm);
} }
...@@ -712,16 +712,16 @@ BSSbUpdateToBSSList ( ...@@ -712,16 +712,16 @@ BSSbUpdateToBSSList (
// valid EID // valid EID
if (pQuiet == NULL) { if (pQuiet == NULL) {
pQuiet = (PWLAN_IE_QUIET)pIE_Quiet; pQuiet = (PWLAN_IE_QUIET)pIE_Quiet;
CARDbSetQuiet( pMgmt->pAdapter, CARDbSetQuiet(pMgmt->pAdapter,
true, true,
pQuiet->byQuietCount, pQuiet->byQuietCount,
pQuiet->byQuietPeriod, pQuiet->byQuietPeriod,
*((unsigned short *)pQuiet->abyQuietDuration), *((unsigned short *)pQuiet->abyQuietDuration),
*((unsigned short *)pQuiet->abyQuietOffset) *((unsigned short *)pQuiet->abyQuietOffset)
); );
} else { } else {
pQuiet = (PWLAN_IE_QUIET)pIE_Quiet; pQuiet = (PWLAN_IE_QUIET)pIE_Quiet;
CARDbSetQuiet( pMgmt->pAdapter, CARDbSetQuiet(pMgmt->pAdapter,
false, false,
pQuiet->byQuietCount, pQuiet->byQuietCount,
pQuiet->byQuietPeriod, pQuiet->byQuietPeriod,
...@@ -757,7 +757,7 @@ BSSbUpdateToBSSList ( ...@@ -757,7 +757,7 @@ BSSbUpdateToBSSList (
* Return Value: * Return Value:
* None * None
* *
-*/ -*/
bool bool
BSSDBbIsSTAInNodeDB(void *pMgmtObject, unsigned char *abyDstAddr, BSSDBbIsSTAInNodeDB(void *pMgmtObject, unsigned char *abyDstAddr,
...@@ -790,7 +790,7 @@ BSSDBbIsSTAInNodeDB(void *pMgmtObject, unsigned char *abyDstAddr, ...@@ -790,7 +790,7 @@ BSSDBbIsSTAInNodeDB(void *pMgmtObject, unsigned char *abyDstAddr,
* Return Value: * Return Value:
* None * None
* *
-*/ -*/
void void
BSSvCreateOneNode(void *hDeviceContext, unsigned int *puNodeIndex) BSSvCreateOneNode(void *hDeviceContext, unsigned int *puNodeIndex)
{ {
...@@ -817,7 +817,7 @@ BSSvCreateOneNode(void *hDeviceContext, unsigned int *puNodeIndex) ...@@ -817,7 +817,7 @@ BSSvCreateOneNode(void *hDeviceContext, unsigned int *puNodeIndex)
} }
// if not found replace uInActiveCount is largest one. // if not found replace uInActiveCount is largest one.
if ( ii == (MAX_NODE_NUM + 1)) { if (ii == (MAX_NODE_NUM + 1)) {
*puNodeIndex = SelectIndex; *puNodeIndex = SelectIndex;
DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Replace inactive node = %d\n", SelectIndex); DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Replace inactive node = %d\n", SelectIndex);
// clear ps buffer // clear ps buffer
...@@ -852,12 +852,12 @@ BSSvCreateOneNode(void *hDeviceContext, unsigned int *puNodeIndex) ...@@ -852,12 +852,12 @@ BSSvCreateOneNode(void *hDeviceContext, unsigned int *puNodeIndex)
* Return Value: * Return Value:
* None * None
* *
-*/ -*/
void void
BSSvRemoveOneNode( BSSvRemoveOneNode(
void *hDeviceContext, void *hDeviceContext,
unsigned int uNodeIndex unsigned int uNodeIndex
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
...@@ -884,7 +884,7 @@ BSSvRemoveOneNode( ...@@ -884,7 +884,7 @@ BSSvRemoveOneNode(
* Return Value: * Return Value:
* None * None
* *
-*/ -*/
void void
BSSvUpdateAPNode( BSSvUpdateAPNode(
...@@ -892,7 +892,7 @@ BSSvUpdateAPNode( ...@@ -892,7 +892,7 @@ BSSvUpdateAPNode(
unsigned short *pwCapInfo, unsigned short *pwCapInfo,
PWLAN_IE_SUPP_RATES pSuppRates, PWLAN_IE_SUPP_RATES pSuppRates,
PWLAN_IE_SUPP_RATES pExtSuppRates PWLAN_IE_SUPP_RATES pExtSuppRates
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = pDevice->pMgmt; PSMgmtObject pMgmt = pDevice->pMgmt;
...@@ -919,17 +919,17 @@ BSSvUpdateAPNode( ...@@ -919,17 +919,17 @@ BSSvUpdateAPNode(
&(pMgmt->sNodeDBTable[0].wSuppRate), &(pMgmt->sNodeDBTable[0].wSuppRate),
&(pMgmt->sNodeDBTable[0].byTopCCKBasicRate), &(pMgmt->sNodeDBTable[0].byTopCCKBasicRate),
&(pMgmt->sNodeDBTable[0].byTopOFDMBasicRate) &(pMgmt->sNodeDBTable[0].byTopOFDMBasicRate)
); );
memcpy(pMgmt->sNodeDBTable[0].abyMACAddr, pMgmt->abyCurrBSSID, WLAN_ADDR_LEN); memcpy(pMgmt->sNodeDBTable[0].abyMACAddr, pMgmt->abyCurrBSSID, WLAN_ADDR_LEN);
pMgmt->sNodeDBTable[0].wTxDataRate = pMgmt->sNodeDBTable[0].wMaxSuppRate; pMgmt->sNodeDBTable[0].wTxDataRate = pMgmt->sNodeDBTable[0].wMaxSuppRate;
pMgmt->sNodeDBTable[0].bShortPreamble = WLAN_GET_CAP_INFO_SHORTPREAMBLE(*pwCapInfo); pMgmt->sNodeDBTable[0].bShortPreamble = WLAN_GET_CAP_INFO_SHORTPREAMBLE(*pwCapInfo);
pMgmt->sNodeDBTable[0].uRatePollTimeout = FALLBACK_POLL_SECOND; pMgmt->sNodeDBTable[0].uRatePollTimeout = FALLBACK_POLL_SECOND;
#ifdef PLICE_DEBUG #ifdef PLICE_DEBUG
printk("BSSvUpdateAPNode:MaxSuppRate is %d\n",pMgmt->sNodeDBTable[0].wMaxSuppRate); printk("BSSvUpdateAPNode:MaxSuppRate is %d\n", pMgmt->sNodeDBTable[0].wMaxSuppRate);
#endif #endif
// Auto rate fallback function initiation. // Auto rate fallback function initiation.
// RATEbInit(pDevice); // RATEbInit(pDevice);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"pMgmt->sNodeDBTable[0].wTxDataRate = %d \n", pMgmt->sNodeDBTable[0].wTxDataRate); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pMgmt->sNodeDBTable[0].wTxDataRate = %d \n", pMgmt->sNodeDBTable[0].wTxDataRate);
}; };
...@@ -946,13 +946,13 @@ BSSvUpdateAPNode( ...@@ -946,13 +946,13 @@ BSSvUpdateAPNode(
* Return Value: * Return Value:
* None * None
* *
-*/ -*/
void void
BSSvAddMulticastNode( BSSvAddMulticastNode(
void *hDeviceContext void *hDeviceContext
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = pDevice->pMgmt; PSMgmtObject pMgmt = pDevice->pMgmt;
...@@ -972,10 +972,10 @@ BSSvAddMulticastNode( ...@@ -972,10 +972,10 @@ BSSvAddMulticastNode(
&(pMgmt->sNodeDBTable[0].wSuppRate), &(pMgmt->sNodeDBTable[0].wSuppRate),
&(pMgmt->sNodeDBTable[0].byTopCCKBasicRate), &(pMgmt->sNodeDBTable[0].byTopCCKBasicRate),
&(pMgmt->sNodeDBTable[0].byTopOFDMBasicRate) &(pMgmt->sNodeDBTable[0].byTopOFDMBasicRate)
); );
pMgmt->sNodeDBTable[0].wTxDataRate = pMgmt->sNodeDBTable[0].wMaxBasicRate; pMgmt->sNodeDBTable[0].wTxDataRate = pMgmt->sNodeDBTable[0].wMaxBasicRate;
#ifdef PLICE_DEBUG #ifdef PLICE_DEBUG
printk("BSSvAddMultiCastNode:pMgmt->sNodeDBTable[0].wTxDataRate is %d\n",pMgmt->sNodeDBTable[0].wTxDataRate); printk("BSSvAddMultiCastNode:pMgmt->sNodeDBTable[0].wTxDataRate is %d\n", pMgmt->sNodeDBTable[0].wTxDataRate);
#endif #endif
pMgmt->sNodeDBTable[0].uRatePollTimeout = FALLBACK_POLL_SECOND; pMgmt->sNodeDBTable[0].uRatePollTimeout = FALLBACK_POLL_SECOND;
...@@ -996,16 +996,16 @@ BSSvAddMulticastNode( ...@@ -996,16 +996,16 @@ BSSvAddMulticastNode(
* Return Value: * Return Value:
* none. * none.
* *
-*/ -*/
//2008-4-14 <add> by chester for led issue //2008-4-14 <add> by chester for led issue
#ifdef FOR_LED_ON_NOTEBOOK #ifdef FOR_LED_ON_NOTEBOOK
bool cc=false; bool cc = false;
unsigned int status; unsigned int status;
#endif #endif
void void
BSSvSecondCallBack( BSSvSecondCallBack(
void *hDeviceContext void *hDeviceContext
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = pDevice->pMgmt; PSMgmtObject pMgmt = pDevice->pMgmt;
...@@ -1014,7 +1014,7 @@ BSSvSecondCallBack( ...@@ -1014,7 +1014,7 @@ BSSvSecondCallBack(
unsigned int uSleepySTACnt = 0; unsigned int uSleepySTACnt = 0;
unsigned int uNonShortSlotSTACnt = 0; unsigned int uNonShortSlotSTACnt = 0;
unsigned int uLongPreambleSTACnt = 0; unsigned int uLongPreambleSTACnt = 0;
viawget_wpa_header* wpahdr; //DavidWang viawget_wpa_header *wpahdr; //DavidWang
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
...@@ -1024,82 +1024,82 @@ BSSvSecondCallBack( ...@@ -1024,82 +1024,82 @@ BSSvSecondCallBack(
~(WLAN_SET_ERP_BARKER_MODE(1) | WLAN_SET_ERP_NONERP_PRESENT(1)); ~(WLAN_SET_ERP_BARKER_MODE(1) | WLAN_SET_ERP_NONERP_PRESENT(1));
//2008-4-14 <add> by chester for led issue //2008-4-14 <add> by chester for led issue
#ifdef FOR_LED_ON_NOTEBOOK #ifdef FOR_LED_ON_NOTEBOOK
MACvGPIOIn(pDevice->PortOffset, &pDevice->byGPIO); MACvGPIOIn(pDevice->PortOffset, &pDevice->byGPIO);
if ((( !(pDevice->byGPIO & GPIO0_DATA)&&(pDevice->bHWRadioOff == false))||((pDevice->byGPIO & GPIO0_DATA)&&(pDevice->bHWRadioOff == true)))&&(cc==false)){ if (((!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->bHWRadioOff == false)) || ((pDevice->byGPIO & GPIO0_DATA) && (pDevice->bHWRadioOff == true))) && (cc == false)) {
cc=true; cc = true;
} }
else if(cc==true){ else if (cc == true) {
if(pDevice->bHWRadioOff == true){ if (pDevice->bHWRadioOff == true) {
if ( !(pDevice->byGPIO & GPIO0_DATA)) if (!(pDevice->byGPIO & GPIO0_DATA))
//||( !(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV))) //||(!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV)))
{if(status==1) goto start; { if (status == 1) goto start;
status=1; status = 1;
CARDbRadioPowerOff(pDevice); CARDbRadioPowerOff(pDevice);
pMgmt->sNodeDBTable[0].bActive = false; pMgmt->sNodeDBTable[0].bActive = false;
pMgmt->eCurrMode = WMAC_MODE_STANDBY; pMgmt->eCurrMode = WMAC_MODE_STANDBY;
pMgmt->eCurrState = WMAC_STATE_IDLE; pMgmt->eCurrState = WMAC_STATE_IDLE;
//netif_stop_queue(pDevice->dev); //netif_stop_queue(pDevice->dev);
pDevice->bLinkPass = false; pDevice->bLinkPass = false;
} }
if (pDevice->byGPIO &GPIO0_DATA) if (pDevice->byGPIO & GPIO0_DATA)
//||( !(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV))) //||(!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV)))
{if(status==2) goto start; {if (status == 2) goto start;
status=2; status = 2;
CARDbRadioPowerOn(pDevice); CARDbRadioPowerOn(pDevice);
} } } }
else{ else{
if (pDevice->byGPIO & GPIO0_DATA) if (pDevice->byGPIO & GPIO0_DATA)
//||( !(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV))) //||(!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV)))
{if(status==3) goto start; {if (status == 3) goto start;
status=3; status = 3;
CARDbRadioPowerOff(pDevice); CARDbRadioPowerOff(pDevice);
pMgmt->sNodeDBTable[0].bActive = false; pMgmt->sNodeDBTable[0].bActive = false;
pMgmt->eCurrMode = WMAC_MODE_STANDBY; pMgmt->eCurrMode = WMAC_MODE_STANDBY;
pMgmt->eCurrState = WMAC_STATE_IDLE; pMgmt->eCurrState = WMAC_STATE_IDLE;
//netif_stop_queue(pDevice->dev); //netif_stop_queue(pDevice->dev);
pDevice->bLinkPass = false; pDevice->bLinkPass = false;
} }
if ( !(pDevice->byGPIO & GPIO0_DATA)) if (!(pDevice->byGPIO & GPIO0_DATA))
//||( !(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV))) //||(!(pDevice->byGPIO & GPIO0_DATA) && (pDevice->byRadioCtl & EEP_RADIOCTL_INV)))
{if(status==4) goto start; {if (status == 4) goto start;
status=4; status = 4;
CARDbRadioPowerOn(pDevice); CARDbRadioPowerOn(pDevice);
} } } }
} }
start: start:
#endif #endif
if (pDevice->wUseProtectCntDown > 0) { if (pDevice->wUseProtectCntDown > 0) {
pDevice->wUseProtectCntDown --; pDevice->wUseProtectCntDown--;
} }
else { else {
// disable protect mode // disable protect mode
pDevice->byERPFlag &= ~(WLAN_SET_ERP_USE_PROTECTION(1)); pDevice->byERPFlag &= ~(WLAN_SET_ERP_USE_PROTECTION(1));
} }
{ {
pDevice->byReAssocCount++; pDevice->byReAssocCount++;
if((pDevice->byReAssocCount > 10) && (pDevice->bLinkPass != true)) { //10 sec timeout if ((pDevice->byReAssocCount > 10) && (pDevice->bLinkPass != true)) { //10 sec timeout
printk("Re-association timeout!!!\n"); printk("Re-association timeout!!!\n");
pDevice->byReAssocCount = 0; pDevice->byReAssocCount = 0;
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
// if(pDevice->bWPASuppWextEnabled == true) // if (pDevice->bWPASuppWextEnabled == true)
{ {
union iwreq_data wrqu; union iwreq_data wrqu;
memset(&wrqu, 0, sizeof (wrqu)); memset(&wrqu, 0, sizeof(wrqu));
wrqu.ap_addr.sa_family = ARPHRD_ETHER; wrqu.ap_addr.sa_family = ARPHRD_ETHER;
PRINT_K("wireless_send_event--->SIOCGIWAP(disassociated)\n"); PRINT_K("wireless_send_event--->SIOCGIWAP(disassociated)\n");
wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL); wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
} }
#endif #endif
} }
else if(pDevice->bLinkPass == true) else if (pDevice->bLinkPass == true)
pDevice->byReAssocCount = 0; pDevice->byReAssocCount = 0;
} }
#ifdef Calcu_LinkQual #ifdef Calcu_LinkQual
s_uCalculateLinkQual((void *)pDevice); s_uCalculateLinkQual((void *)pDevice);
...@@ -1127,7 +1127,7 @@ CARDbRadioPowerOn(pDevice); ...@@ -1127,7 +1127,7 @@ CARDbRadioPowerOn(pDevice);
if (pMgmt->sNodeDBTable[ii].uInActiveCount < ERP_RECOVER_COUNT) { if (pMgmt->sNodeDBTable[ii].uInActiveCount < ERP_RECOVER_COUNT) {
if (!pMgmt->sNodeDBTable[ii].bShortPreamble) { if (!pMgmt->sNodeDBTable[ii].bShortPreamble) {
pDevice->byERPFlag |= WLAN_SET_ERP_BARKER_MODE(1); pDevice->byERPFlag |= WLAN_SET_ERP_BARKER_MODE(1);
uLongPreambleSTACnt ++; uLongPreambleSTACnt++;
} }
if (!pMgmt->sNodeDBTable[ii].bERPExist) { if (!pMgmt->sNodeDBTable[ii].bERPExist) {
pDevice->byERPFlag |= WLAN_SET_ERP_NONERP_PRESENT(1); pDevice->byERPFlag |= WLAN_SET_ERP_NONERP_PRESENT(1);
...@@ -1159,11 +1159,11 @@ CARDbRadioPowerOn(pDevice); ...@@ -1159,11 +1159,11 @@ CARDbRadioPowerOn(pDevice);
// ii = 0 reserved for unicast AP node (Infra STA) // ii = 0 reserved for unicast AP node (Infra STA)
if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA) if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA)
#ifdef PLICE_DEBUG #ifdef PLICE_DEBUG
printk("SecondCallback:Before:TxDataRate is %d\n",pMgmt->sNodeDBTable[0].wTxDataRate); printk("SecondCallback:Before:TxDataRate is %d\n", pMgmt->sNodeDBTable[0].wTxDataRate);
#endif #endif
RATEvTxRateFallBack((void *)pDevice, &(pMgmt->sNodeDBTable[ii])); RATEvTxRateFallBack((void *)pDevice, &(pMgmt->sNodeDBTable[ii]));
#ifdef PLICE_DEBUG #ifdef PLICE_DEBUG
printk("SecondCallback:After:TxDataRate is %d\n",pMgmt->sNodeDBTable[0].wTxDataRate); printk("SecondCallback:After:TxDataRate is %d\n", pMgmt->sNodeDBTable[0].wTxDataRate);
#endif #endif
} }
...@@ -1174,7 +1174,7 @@ CARDbRadioPowerOn(pDevice); ...@@ -1174,7 +1174,7 @@ CARDbRadioPowerOn(pDevice);
if (pMgmt->sNodeDBTable[ii].wEnQueueCnt != 0) { if (pMgmt->sNodeDBTable[ii].wEnQueueCnt != 0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Index= %d, Queue = %d pending \n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Index= %d, Queue = %d pending \n",
ii, pMgmt->sNodeDBTable[ii].wEnQueueCnt); ii, pMgmt->sNodeDBTable[ii].wEnQueueCnt);
if ((ii >0) && (pMgmt->sNodeDBTable[ii].wEnQueueCnt > 15)) { if ((ii > 0) && (pMgmt->sNodeDBTable[ii].wEnQueueCnt > 15)) {
BSSvRemoveOneNode(pDevice, ii); BSSvRemoveOneNode(pDevice, ii);
DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Pending many queues PS STA Index = %d remove \n", ii); DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Pending many queues PS STA Index = %d remove \n", ii);
continue; continue;
...@@ -1261,9 +1261,9 @@ CARDbRadioPowerOn(pDevice); ...@@ -1261,9 +1261,9 @@ CARDbRadioPowerOn(pDevice);
} }
if ((pMgmt->sNodeDBTable[0].uInActiveCount >= (LOST_BEACON_COUNT/2)) && if ((pMgmt->sNodeDBTable[0].uInActiveCount >= (LOST_BEACON_COUNT/2)) &&
(pDevice->byBBVGACurrent != pDevice->abyBBVGA[0]) ) { (pDevice->byBBVGACurrent != pDevice->abyBBVGA[0])) {
pDevice->byBBVGANew = pDevice->abyBBVGA[0]; pDevice->byBBVGANew = pDevice->abyBBVGA[0];
bScheduleCommand((void *) pDevice, WLAN_CMD_CHANGE_BBSENSITIVITY, NULL); bScheduleCommand((void *)pDevice, WLAN_CMD_CHANGE_BBSENSITIVITY, NULL);
} }
if (pMgmt->sNodeDBTable[0].uInActiveCount >= LOST_BEACON_COUNT) { if (pMgmt->sNodeDBTable[0].uInActiveCount >= LOST_BEACON_COUNT) {
...@@ -1288,37 +1288,37 @@ CARDbRadioPowerOn(pDevice); ...@@ -1288,37 +1288,37 @@ CARDbRadioPowerOn(pDevice);
netif_rx(pDevice->skb); netif_rx(pDevice->skb);
pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz); pDevice->skb = dev_alloc_skb((int)pDevice->rx_buf_sz);
} }
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
// if(pDevice->bWPASuppWextEnabled == true) // if (pDevice->bWPASuppWextEnabled == true)
{ {
union iwreq_data wrqu; union iwreq_data wrqu;
memset(&wrqu, 0, sizeof (wrqu)); memset(&wrqu, 0, sizeof(wrqu));
wrqu.ap_addr.sa_family = ARPHRD_ETHER; wrqu.ap_addr.sa_family = ARPHRD_ETHER;
PRINT_K("wireless_send_event--->SIOCGIWAP(disassociated)\n"); PRINT_K("wireless_send_event--->SIOCGIWAP(disassociated)\n");
wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL); wireless_send_event(pDevice->dev, SIOCGIWAP, &wrqu, NULL);
} }
#endif #endif
} }
} }
else if (pItemSSID->len != 0) { else if (pItemSSID->len != 0) {
if (pDevice->uAutoReConnectTime < 10) { if (pDevice->uAutoReConnectTime < 10) {
pDevice->uAutoReConnectTime++; pDevice->uAutoReConnectTime++;
#ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT #ifdef WPA_SUPPLICANT_DRIVER_WEXT_SUPPORT
//network manager support need not do Roaming scan??? //network manager support need not do Roaming scan???
if(pDevice->bWPASuppWextEnabled ==true) if (pDevice->bWPASuppWextEnabled == true)
pDevice->uAutoReConnectTime = 0; pDevice->uAutoReConnectTime = 0;
#endif #endif
} }
else { else {
//mike use old encryption status for wpa reauthen //mike use old encryption status for wpa reauthen
if(pDevice->bWPADEVUp) if (pDevice->bWPADEVUp)
pDevice->eEncryptionStatus = pDevice->eOldEncryptionStatus; pDevice->eEncryptionStatus = pDevice->eOldEncryptionStatus;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Roaming ...\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Roaming ...\n");
BSSvClearBSSList((void *)pDevice, pDevice->bLinkPass); BSSvClearBSSList((void *)pDevice, pDevice->bLinkPass);
pMgmt->eScanType = WMAC_SCAN_ACTIVE; pMgmt->eScanType = WMAC_SCAN_ACTIVE;
bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID); bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, pMgmt->abyDesireSSID); bScheduleCommand((void *)pDevice, WLAN_CMD_SSID, pMgmt->abyDesireSSID);
pDevice->uAutoReConnectTime = 0; pDevice->uAutoReConnectTime = 0;
} }
} }
...@@ -1333,8 +1333,8 @@ CARDbRadioPowerOn(pDevice); ...@@ -1333,8 +1333,8 @@ CARDbRadioPowerOn(pDevice);
else { else {
DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Adhoc re-scanning ...\n"); DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Adhoc re-scanning ...\n");
pMgmt->eScanType = WMAC_SCAN_ACTIVE; pMgmt->eScanType = WMAC_SCAN_ACTIVE;
bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL); bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, NULL);
bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, NULL); bScheduleCommand((void *)pDevice, WLAN_CMD_SSID, NULL);
pDevice->uAutoReConnectTime = 0; pDevice->uAutoReConnectTime = 0;
}; };
} }
...@@ -1344,7 +1344,7 @@ CARDbRadioPowerOn(pDevice); ...@@ -1344,7 +1344,7 @@ CARDbRadioPowerOn(pDevice);
//s_vCheckSensitivity((void *) pDevice); //s_vCheckSensitivity((void *) pDevice);
s_vCheckPreEDThreshold((void *)pDevice); s_vCheckPreEDThreshold((void *)pDevice);
} }
if (pMgmt->sNodeDBTable[0].uInActiveCount >=ADHOC_LOST_BEACON_COUNT) { if (pMgmt->sNodeDBTable[0].uInActiveCount >= ADHOC_LOST_BEACON_COUNT) {
DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Lost other STA beacon [%d] sec, started !\n", pMgmt->sNodeDBTable[0].uInActiveCount); DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "Lost other STA beacon [%d] sec, started !\n", pMgmt->sNodeDBTable[0].uInActiveCount);
pMgmt->sNodeDBTable[0].uInActiveCount = 0; pMgmt->sNodeDBTable[0].uInActiveCount = 0;
pMgmt->eCurrState = WMAC_STATE_STARTED; pMgmt->eCurrState = WMAC_STATE_STARTED;
...@@ -1375,7 +1375,7 @@ CARDbRadioPowerOn(pDevice); ...@@ -1375,7 +1375,7 @@ CARDbRadioPowerOn(pDevice);
* Return Value: * Return Value:
* none. * none.
* *
-*/ -*/
...@@ -1386,7 +1386,7 @@ BSSvUpdateNodeTxCounter( ...@@ -1386,7 +1386,7 @@ BSSvUpdateNodeTxCounter(
unsigned char byTsr1, unsigned char byTsr1,
unsigned char *pbyBuffer, unsigned char *pbyBuffer,
unsigned int uFIFOHeaderSize unsigned int uFIFOHeaderSize
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = pDevice->pMgmt; PSMgmtObject pMgmt = pDevice->pMgmt;
...@@ -1421,14 +1421,14 @@ BSSvUpdateNodeTxCounter( ...@@ -1421,14 +1421,14 @@ BSSvUpdateNodeTxCounter(
////#endif ////#endif
// Only Unicast using support rates // Only Unicast using support rates
if (pTxBufHead->wFIFOCtl & FIFOCTL_NEEDACK) { if (pTxBufHead->wFIFOCtl & FIFOCTL_NEEDACK) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wRate %04X, byTsr0 %02X, byTsr1 %02X\n", wRate, byTsr0, byTsr1); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wRate %04X, byTsr0 %02X, byTsr1 %02X\n", wRate, byTsr0, byTsr1);
if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA) { if (pMgmt->eCurrMode == WMAC_MODE_ESS_STA) {
pMgmt->sNodeDBTable[0].uTxAttempts += 1; pMgmt->sNodeDBTable[0].uTxAttempts += 1;
if ((byTsr1 & TSR1_TERR) == 0) { if ((byTsr1 & TSR1_TERR) == 0) {
// transmit success, TxAttempts at least plus one // transmit success, TxAttempts at least plus one
pMgmt->sNodeDBTable[0].uTxOk[MAX_RATE]++; pMgmt->sNodeDBTable[0].uTxOk[MAX_RATE]++;
if ( (byFallBack == AUTO_FB_NONE) || if ((byFallBack == AUTO_FB_NONE) ||
(wRate < RATE_18M) ) { (wRate < RATE_18M)) {
wFallBackRate = wRate; wFallBackRate = wRate;
} else if (byFallBack == AUTO_FB_0) { } else if (byFallBack == AUTO_FB_0) {
//PLICE_DEBUG //PLICE_DEBUG
...@@ -1448,17 +1448,17 @@ BSSvUpdateNodeTxCounter( ...@@ -1448,17 +1448,17 @@ BSSvUpdateNodeTxCounter(
} }
pMgmt->sNodeDBTable[0].uTxOk[wFallBackRate]++; pMgmt->sNodeDBTable[0].uTxOk[wFallBackRate]++;
} else { } else {
pMgmt->sNodeDBTable[0].uTxFailures ++; pMgmt->sNodeDBTable[0].uTxFailures++;
} }
pMgmt->sNodeDBTable[0].uTxRetry += byTxRetry; pMgmt->sNodeDBTable[0].uTxRetry += byTxRetry;
if (byTxRetry != 0) { if (byTxRetry != 0) {
pMgmt->sNodeDBTable[0].uTxFail[MAX_RATE]+=byTxRetry; pMgmt->sNodeDBTable[0].uTxFail[MAX_RATE] += byTxRetry;
if ( (byFallBack == AUTO_FB_NONE) || if ((byFallBack == AUTO_FB_NONE) ||
(wRate < RATE_18M) ) { (wRate < RATE_18M)) {
pMgmt->sNodeDBTable[0].uTxFail[wRate]+=byTxRetry; pMgmt->sNodeDBTable[0].uTxFail[wRate] += byTxRetry;
} else if (byFallBack == AUTO_FB_0) { } else if (byFallBack == AUTO_FB_0) {
//PLICE_DEBUG //PLICE_DEBUG
for(ii=0;ii<byTxRetry;ii++) for (ii = 0; ii < byTxRetry; ii++)
//for (ii=0;ii<txRetryTemp;ii++) //for (ii=0;ii<txRetryTemp;ii++)
{ {
if (ii < 5) if (ii < 5)
...@@ -1478,7 +1478,7 @@ BSSvUpdateNodeTxCounter( ...@@ -1478,7 +1478,7 @@ BSSvUpdateNodeTxCounter(
pMgmt->sNodeDBTable[0].uTxFail[wFallBackRate]++; pMgmt->sNodeDBTable[0].uTxFail[wFallBackRate]++;
} }
} else if (byFallBack == AUTO_FB_1) { } else if (byFallBack == AUTO_FB_1) {
for(ii=0;ii<byTxRetry;ii++) { for (ii = 0; ii < byTxRetry; ii++) {
if (ii < 5) if (ii < 5)
wFallBackRate = awHWRetry1[wRate-RATE_18M][ii]; wFallBackRate = awHWRetry1[wRate-RATE_18M][ii];
else else
...@@ -1494,13 +1494,13 @@ BSSvUpdateNodeTxCounter( ...@@ -1494,13 +1494,13 @@ BSSvUpdateNodeTxCounter(
pMACHeader = (PS802_11Header)(pbyBuffer + uFIFOHeaderSize); pMACHeader = (PS802_11Header)(pbyBuffer + uFIFOHeaderSize);
if (BSSDBbIsSTAInNodeDB((void *)pMgmt, &(pMACHeader->abyAddr1[0]), &uNodeIndex)){ if (BSSDBbIsSTAInNodeDB((void *)pMgmt, &(pMACHeader->abyAddr1[0]), &uNodeIndex)) {
pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts += 1; pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts += 1;
if ((byTsr1 & TSR1_TERR) == 0) { if ((byTsr1 & TSR1_TERR) == 0) {
// transmit success, TxAttempts at least plus one // transmit success, TxAttempts at least plus one
pMgmt->sNodeDBTable[uNodeIndex].uTxOk[MAX_RATE]++; pMgmt->sNodeDBTable[uNodeIndex].uTxOk[MAX_RATE]++;
if ( (byFallBack == AUTO_FB_NONE) || if ((byFallBack == AUTO_FB_NONE) ||
(wRate < RATE_18M) ) { (wRate < RATE_18M)) {
wFallBackRate = wRate; wFallBackRate = wRate;
} else if (byFallBack == AUTO_FB_0) { } else if (byFallBack == AUTO_FB_0) {
if (byTxRetry < 5) if (byTxRetry < 5)
...@@ -1515,24 +1515,24 @@ BSSvUpdateNodeTxCounter( ...@@ -1515,24 +1515,24 @@ BSSvUpdateNodeTxCounter(
} }
pMgmt->sNodeDBTable[uNodeIndex].uTxOk[wFallBackRate]++; pMgmt->sNodeDBTable[uNodeIndex].uTxOk[wFallBackRate]++;
} else { } else {
pMgmt->sNodeDBTable[uNodeIndex].uTxFailures ++; pMgmt->sNodeDBTable[uNodeIndex].uTxFailures++;
} }
pMgmt->sNodeDBTable[uNodeIndex].uTxRetry += byTxRetry; pMgmt->sNodeDBTable[uNodeIndex].uTxRetry += byTxRetry;
if (byTxRetry != 0) { if (byTxRetry != 0) {
pMgmt->sNodeDBTable[uNodeIndex].uTxFail[MAX_RATE]+=byTxRetry; pMgmt->sNodeDBTable[uNodeIndex].uTxFail[MAX_RATE] += byTxRetry;
if ( (byFallBack == AUTO_FB_NONE) || if ((byFallBack == AUTO_FB_NONE) ||
(wRate < RATE_18M) ) { (wRate < RATE_18M)) {
pMgmt->sNodeDBTable[uNodeIndex].uTxFail[wRate]+=byTxRetry; pMgmt->sNodeDBTable[uNodeIndex].uTxFail[wRate] += byTxRetry;
} else if (byFallBack == AUTO_FB_0) { } else if (byFallBack == AUTO_FB_0) {
for(ii=0;ii<byTxRetry;ii++) { for (ii = 0; ii < byTxRetry; ii++) {
if (ii < 5) if (ii < 5)
wFallBackRate = awHWRetry0[wRate-RATE_18M][ii]; wFallBackRate = awHWRetry0[wRate - RATE_18M][ii];
else else
wFallBackRate = awHWRetry0[wRate-RATE_18M][4]; wFallBackRate = awHWRetry0[wRate - RATE_18M][4];
pMgmt->sNodeDBTable[uNodeIndex].uTxFail[wFallBackRate]++; pMgmt->sNodeDBTable[uNodeIndex].uTxFail[wFallBackRate]++;
} }
} else if (byFallBack == AUTO_FB_1) { } else if (byFallBack == AUTO_FB_1) {
for(ii=0;ii<byTxRetry;ii++) { for (ii = 0; ii < byTxRetry; ii++) {
if (ii < 5) if (ii < 5)
wFallBackRate = awHWRetry1[wRate-RATE_18M][ii]; wFallBackRate = awHWRetry1[wRate-RATE_18M][ii];
else else
...@@ -1569,14 +1569,14 @@ BSSvUpdateNodeTxCounter( ...@@ -1569,14 +1569,14 @@ BSSvUpdateNodeTxCounter(
* Return Value: * Return Value:
* None. * None.
* *
-*/ -*/
void void
BSSvClearNodeDBTable( BSSvClearNodeDBTable(
void *hDeviceContext, void *hDeviceContext,
unsigned int uStartIndex unsigned int uStartIndex
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
...@@ -1588,7 +1588,7 @@ BSSvClearNodeDBTable( ...@@ -1588,7 +1588,7 @@ BSSvClearNodeDBTable(
if (pMgmt->sNodeDBTable[ii].bActive) { if (pMgmt->sNodeDBTable[ii].bActive) {
// check if sTxPSQueue has been initial // check if sTxPSQueue has been initial
if (pMgmt->sNodeDBTable[ii].sTxPSQueue.next != NULL) { if (pMgmt->sNodeDBTable[ii].sTxPSQueue.next != NULL) {
while ((skb = skb_dequeue(&pMgmt->sNodeDBTable[ii].sTxPSQueue)) != NULL){ while ((skb = skb_dequeue(&pMgmt->sNodeDBTable[ii].sTxPSQueue)) != NULL) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "PS skb != NULL %d\n", ii); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "PS skb != NULL %d\n", ii);
dev_kfree_skb(skb); dev_kfree_skb(skb);
} }
...@@ -1603,7 +1603,7 @@ BSSvClearNodeDBTable( ...@@ -1603,7 +1603,7 @@ BSSvClearNodeDBTable(
void s_vCheckSensitivity( void s_vCheckSensitivity(
void *hDeviceContext void *hDeviceContext
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PKnownBSS pBSSList = NULL; PKnownBSS pBSSList = NULL;
...@@ -1624,14 +1624,14 @@ void s_vCheckSensitivity( ...@@ -1624,14 +1624,14 @@ void s_vCheckSensitivity(
long uNumofdBm = 0; long uNumofdBm = 0;
for (ii = 0; ii < RSSI_STAT_COUNT; ii++) { for (ii = 0; ii < RSSI_STAT_COUNT; ii++) {
if (pBSSList->ldBmAverage[ii] != 0) { if (pBSSList->ldBmAverage[ii] != 0) {
uNumofdBm ++; uNumofdBm++;
LocalldBmAverage += pBSSList->ldBmAverage[ii]; LocalldBmAverage += pBSSList->ldBmAverage[ii];
} }
} }
if (uNumofdBm > 0) { if (uNumofdBm > 0) {
LocalldBmAverage = LocalldBmAverage/uNumofdBm; LocalldBmAverage = LocalldBmAverage/uNumofdBm;
for (ii=0;ii<BB_VGA_LEVEL;ii++) { for (ii = 0; ii < BB_VGA_LEVEL; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"LocalldBmAverage:%ld, %ld %02x\n", LocalldBmAverage, pDevice->ldBmThreshold[ii], pDevice->abyBBVGA[ii]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "LocalldBmAverage:%ld, %ld %02x\n", LocalldBmAverage, pDevice->ldBmThreshold[ii], pDevice->abyBBVGA[ii]);
if (LocalldBmAverage < pDevice->ldBmThreshold[ii]) { if (LocalldBmAverage < pDevice->ldBmThreshold[ii]) {
pDevice->byBBVGANew = pDevice->abyBBVGA[ii]; pDevice->byBBVGANew = pDevice->abyBBVGA[ii];
break; break;
...@@ -1640,7 +1640,7 @@ void s_vCheckSensitivity( ...@@ -1640,7 +1640,7 @@ void s_vCheckSensitivity(
if (pDevice->byBBVGANew != pDevice->byBBVGACurrent) { if (pDevice->byBBVGANew != pDevice->byBBVGACurrent) {
pDevice->uBBVGADiffCount++; pDevice->uBBVGADiffCount++;
if (pDevice->uBBVGADiffCount >= BB_VGA_CHANGE_THRESHOLD) if (pDevice->uBBVGADiffCount >= BB_VGA_CHANGE_THRESHOLD)
bScheduleCommand((void *) pDevice, WLAN_CMD_CHANGE_BBSENSITIVITY, NULL); bScheduleCommand((void *)pDevice, WLAN_CMD_CHANGE_BBSENSITIVITY, NULL);
} else { } else {
pDevice->uBBVGADiffCount = 0; pDevice->uBBVGADiffCount = 0;
} }
...@@ -1651,9 +1651,9 @@ void s_vCheckSensitivity( ...@@ -1651,9 +1651,9 @@ void s_vCheckSensitivity(
void void
BSSvClearAnyBSSJoinRecord ( BSSvClearAnyBSSJoinRecord(
void *hDeviceContext void *hDeviceContext
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PSMgmtObject pMgmt = pDevice->pMgmt; PSMgmtObject pMgmt = pDevice->pMgmt;
...@@ -1668,35 +1668,35 @@ BSSvClearAnyBSSJoinRecord ( ...@@ -1668,35 +1668,35 @@ BSSvClearAnyBSSJoinRecord (
#ifdef Calcu_LinkQual #ifdef Calcu_LinkQual
void s_uCalculateLinkQual( void s_uCalculateLinkQual(
void *hDeviceContext void *hDeviceContext
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
unsigned long TxOkRatio, TxCnt; unsigned long TxOkRatio, TxCnt;
unsigned long RxOkRatio,RxCnt; unsigned long RxOkRatio, RxCnt;
unsigned long RssiRatio; unsigned long RssiRatio;
long ldBm; long ldBm;
TxCnt = pDevice->scStatistic.TxNoRetryOkCount + TxCnt = pDevice->scStatistic.TxNoRetryOkCount +
pDevice->scStatistic.TxRetryOkCount + pDevice->scStatistic.TxRetryOkCount +
pDevice->scStatistic.TxFailCount; pDevice->scStatistic.TxFailCount;
RxCnt = pDevice->scStatistic.RxFcsErrCnt + RxCnt = pDevice->scStatistic.RxFcsErrCnt +
pDevice->scStatistic.RxOkCnt; pDevice->scStatistic.RxOkCnt;
TxOkRatio = (TxCnt < 6) ? 4000:((pDevice->scStatistic.TxNoRetryOkCount * 4000) / TxCnt); TxOkRatio = (TxCnt < 6) ? 4000 : ((pDevice->scStatistic.TxNoRetryOkCount * 4000) / TxCnt);
RxOkRatio = (RxCnt < 6) ? 2000:((pDevice->scStatistic.RxOkCnt * 2000) / RxCnt); RxOkRatio = (RxCnt < 6) ? 2000 : ((pDevice->scStatistic.RxOkCnt * 2000) / RxCnt);
//decide link quality //decide link quality
if(pDevice->bLinkPass !=true) if (pDevice->bLinkPass != true)
{ {
// printk("s_uCalculateLinkQual-->Link disconnect and Poor quality**\n"); // printk("s_uCalculateLinkQual-->Link disconnect and Poor quality**\n");
pDevice->scStatistic.LinkQuality = 0; pDevice->scStatistic.LinkQuality = 0;
pDevice->scStatistic.SignalStren = 0; pDevice->scStatistic.SignalStren = 0;
} }
else else
{ {
RFvRSSITodBm(pDevice, (unsigned char)(pDevice->uCurrRSSI), &ldBm); RFvRSSITodBm(pDevice, (unsigned char)(pDevice->uCurrRSSI), &ldBm);
if(-ldBm < 50) { if (-ldBm < 50) {
RssiRatio = 4000; RssiRatio = 4000;
} }
else if(-ldBm > 90) { else if (-ldBm > 90) {
RssiRatio = 0; RssiRatio = 0;
} }
else { else {
...@@ -1704,7 +1704,7 @@ else ...@@ -1704,7 +1704,7 @@ else
} }
pDevice->scStatistic.SignalStren = RssiRatio/40; pDevice->scStatistic.SignalStren = RssiRatio/40;
pDevice->scStatistic.LinkQuality = (RssiRatio+TxOkRatio+RxOkRatio)/100; pDevice->scStatistic.LinkQuality = (RssiRatio+TxOkRatio+RxOkRatio)/100;
} }
pDevice->scStatistic.RxFcsErrCnt = 0; pDevice->scStatistic.RxFcsErrCnt = 0;
pDevice->scStatistic.RxOkCnt = 0; pDevice->scStatistic.RxOkCnt = 0;
pDevice->scStatistic.TxFailCount = 0; pDevice->scStatistic.TxFailCount = 0;
...@@ -1716,7 +1716,7 @@ else ...@@ -1716,7 +1716,7 @@ else
void s_vCheckPreEDThreshold( void s_vCheckPreEDThreshold(
void *hDeviceContext void *hDeviceContext
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
PKnownBSS pBSSList = NULL; PKnownBSS pBSSList = NULL;
......
...@@ -92,13 +92,13 @@ typedef enum _NDIS_802_11_NETWORK_TYPE ...@@ -92,13 +92,13 @@ typedef enum _NDIS_802_11_NETWORK_TYPE
typedef struct tagSERPObject { typedef struct tagSERPObject {
bool bERPExist; bool bERPExist;
unsigned char byERP; unsigned char byERP;
}ERPObject, *PERPObject; } ERPObject, *PERPObject;
typedef struct tagSRSNCapObject { typedef struct tagSRSNCapObject {
bool bRSNCapExist; bool bRSNCapExist;
unsigned short wRSNCap; unsigned short wRSNCap;
}SRSNCapObject, *PSRSNCapObject; } SRSNCapObject, *PSRSNCapObject;
// BSS info(AP) // BSS info(AP)
#pragma pack(1) #pragma pack(1)
...@@ -163,7 +163,7 @@ typedef struct tagKnownBSS { ...@@ -163,7 +163,7 @@ typedef struct tagKnownBSS {
SRSNCapObject sRSNCapObj; SRSNCapObject sRSNCapObj;
unsigned char abyIEs[1024]; // don't move this field !! unsigned char abyIEs[1024]; // don't move this field !!
}__attribute__ ((__packed__)) } __attribute__ ((__packed__))
KnownBSS , *PKnownBSS; KnownBSS , *PKnownBSS;
//2006-1116-01,<Add> by NomadZhao //2006-1116-01,<Add> by NomadZhao
...@@ -248,20 +248,20 @@ BSSpSearchBSSList( ...@@ -248,20 +248,20 @@ BSSpSearchBSSList(
unsigned char *pbyDesireBSSID, unsigned char *pbyDesireBSSID,
unsigned char *pbyDesireSSID, unsigned char *pbyDesireSSID,
CARD_PHY_TYPE ePhyType CARD_PHY_TYPE ePhyType
); );
PKnownBSS PKnownBSS
BSSpAddrIsInBSSList( BSSpAddrIsInBSSList(
void *hDeviceContext, void *hDeviceContext,
unsigned char *abyBSSID, unsigned char *abyBSSID,
PWLAN_IE_SSID pSSID PWLAN_IE_SSID pSSID
); );
void void
BSSvClearBSSList( BSSvClearBSSList(
void *hDeviceContext, void *hDeviceContext,
bool bKeepCurrBSSID bool bKeepCurrBSSID
); );
bool bool
BSSbInsertToBSSList( BSSbInsertToBSSList(
...@@ -282,7 +282,7 @@ BSSbInsertToBSSList( ...@@ -282,7 +282,7 @@ BSSbInsertToBSSList(
unsigned int uIELength, unsigned int uIELength,
unsigned char *pbyIEs, unsigned char *pbyIEs,
void *pRxPacketContext void *pRxPacketContext
); );
bool bool
...@@ -305,7 +305,7 @@ BSSbUpdateToBSSList( ...@@ -305,7 +305,7 @@ BSSbUpdateToBSSList(
unsigned int uIELength, unsigned int uIELength,
unsigned char *pbyIEs, unsigned char *pbyIEs,
void *pRxPacketContext void *pRxPacketContext
); );
bool bool
...@@ -321,13 +321,13 @@ BSSvUpdateAPNode( ...@@ -321,13 +321,13 @@ BSSvUpdateAPNode(
unsigned short *pwCapInfo, unsigned short *pwCapInfo,
PWLAN_IE_SUPP_RATES pItemRates, PWLAN_IE_SUPP_RATES pItemRates,
PWLAN_IE_SUPP_RATES pExtSuppRates PWLAN_IE_SUPP_RATES pExtSuppRates
); );
void void
BSSvSecondCallBack( BSSvSecondCallBack(
void *hDeviceContext void *hDeviceContext
); );
void void
...@@ -337,29 +337,29 @@ BSSvUpdateNodeTxCounter( ...@@ -337,29 +337,29 @@ BSSvUpdateNodeTxCounter(
unsigned char byTsr1, unsigned char byTsr1,
unsigned char *pbyBuffer, unsigned char *pbyBuffer,
unsigned int uFIFOHeaderSize unsigned int uFIFOHeaderSize
); );
void void
BSSvRemoveOneNode( BSSvRemoveOneNode(
void *hDeviceContext, void *hDeviceContext,
unsigned int uNodeIndex unsigned int uNodeIndex
); );
void void
BSSvAddMulticastNode( BSSvAddMulticastNode(
void *hDeviceContext void *hDeviceContext
); );
void void
BSSvClearNodeDBTable( BSSvClearNodeDBTable(
void *hDeviceContext, void *hDeviceContext,
unsigned int uStartIndex unsigned int uStartIndex
); );
void void
BSSvClearAnyBSSJoinRecord( BSSvClearAnyBSSJoinRecord(
void *hDeviceContext void *hDeviceContext
); );
#endif //__BSSDB_H__ #endif //__BSSDB_H__
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment