Commit 1208f14a authored by Teodora Baluta's avatar Teodora Baluta Committed by Greg Kroah-Hartman

staging: vt6655: delete explicit comparison to bool

This patch fixes the following type of coccinelle detected warnings for
driver vt6655:

WARNING: Comparison to bool
Signed-off-by: default avatarTeodora Baluta <teobaluta@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 938db28b
...@@ -1865,7 +1865,7 @@ BBvCalculateParameter( ...@@ -1865,7 +1865,7 @@ BBvCalculateParameter(
break; break;
case RATE_5M: case RATE_5M:
if (bCCK == false) if (!bCCK)
cbBitCount++; cbBitCount++;
cbUsCount = (cbBitCount * 10) / 55; cbUsCount = (cbBitCount * 10) / 55;
cbTmp = (cbUsCount * 55) / 10; cbTmp = (cbUsCount * 55) / 10;
...@@ -1879,7 +1879,7 @@ BBvCalculateParameter( ...@@ -1879,7 +1879,7 @@ BBvCalculateParameter(
case RATE_11M: case RATE_11M:
if (bCCK == false) if (!bCCK)
cbBitCount++; cbBitCount++;
cbUsCount = cbBitCount / 11; cbUsCount = cbBitCount / 11;
cbTmp = cbUsCount * 11; cbTmp = cbUsCount * 11;
......
...@@ -1053,7 +1053,7 @@ CARDbAdd_PMKID_Candidate( ...@@ -1053,7 +1053,7 @@ CARDbAdd_PMKID_Candidate(
for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) { for (ii = 0; ii < pDevice->gsPMKIDCandidate.NumCandidates; ii++) {
pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[ii]; pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[ii];
if (!memcmp(pCandidateList->BSSID, pbyBSSID, ETH_ALEN)) { if (!memcmp(pCandidateList->BSSID, pbyBSSID, ETH_ALEN)) {
if ((bRSNCapExist == true) && (wRSNCap & BIT0)) { if (bRSNCapExist && (wRSNCap & BIT0)) {
pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED; pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED;
} else { } else {
pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED); pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED);
...@@ -1064,7 +1064,7 @@ CARDbAdd_PMKID_Candidate( ...@@ -1064,7 +1064,7 @@ CARDbAdd_PMKID_Candidate(
// New Candidate // New Candidate
pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[pDevice->gsPMKIDCandidate.NumCandidates]; pCandidateList = &pDevice->gsPMKIDCandidate.CandidateList[pDevice->gsPMKIDCandidate.NumCandidates];
if ((bRSNCapExist == true) && (wRSNCap & BIT0)) { if (bRSNCapExist && (wRSNCap & BIT0)) {
pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED; pCandidateList->Flags |= NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED;
} else { } else {
pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED); pCandidateList->Flags &= ~(NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED);
...@@ -1190,7 +1190,7 @@ CARDbStartMeasure( ...@@ -1190,7 +1190,7 @@ CARDbStartMeasure(
} }
} while (pDevice->uNumOfMeasureEIDs != 0); } while (pDevice->uNumOfMeasureEIDs != 0);
if (bExpired == false) { if (!bExpired) {
MACvSelectPage1(pDevice->PortOffset); MACvSelectPage1(pDevice->PortOffset);
VNSvOutPortD(pDevice->PortOffset + MAC_REG_MSRSTART, LODWORD(qwStartTSF)); VNSvOutPortD(pDevice->PortOffset + MAC_REG_MSRSTART, LODWORD(qwStartTSF));
VNSvOutPortD(pDevice->PortOffset + MAC_REG_MSRSTART + 4, HIDWORD(qwStartTSF)); VNSvOutPortD(pDevice->PortOffset + MAC_REG_MSRSTART + 4, HIDWORD(qwStartTSF));
...@@ -1280,7 +1280,7 @@ CARDbSetQuiet( ...@@ -1280,7 +1280,7 @@ CARDbSetQuiet(
PSDevice pDevice = (PSDevice) pDeviceHandler; PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned int ii = 0; unsigned int ii = 0;
if (bResetQuiet == true) { if (bResetQuiet) {
MACvRegBitsOff(pDevice->PortOffset, MAC_REG_MSRCTL, (MSRCTL_QUIETTXCHK | MSRCTL_QUIETEN)); MACvRegBitsOff(pDevice->PortOffset, MAC_REG_MSRCTL, (MSRCTL_QUIETTXCHK | MSRCTL_QUIETEN));
for (ii = 0; ii < MAX_QUIET_COUNT; ii++) { for (ii = 0; ii < MAX_QUIET_COUNT; ii++) {
pDevice->sQuiet[ii].bEnable = false; pDevice->sQuiet[ii].bEnable = false;
......
...@@ -441,8 +441,8 @@ void init_channel_table(void *pDeviceHandler) ...@@ -441,8 +441,8 @@ void init_channel_table(void *pDeviceHandler)
break; break;
} }
if ((pDevice->dwDiagRefCount != 0) || (pDevice->b11hEnable == true)) { if ((pDevice->dwDiagRefCount != 0) || pDevice->b11hEnable) {
if (bMultiBand == true) { if (bMultiBand) {
for (ii = 0; ii < CARD_MAX_CHANNEL_TBL; ii++) { for (ii = 0; ii < CARD_MAX_CHANNEL_TBL; ii++) {
sChannelTbl[ii + 1].bValid = true; sChannelTbl[ii + 1].bValid = true;
pDevice->abyRegPwr[ii + 1] = pDevice->abyOFDMDefaultPwr[ii + 1]; pDevice->abyRegPwr[ii + 1] = pDevice->abyOFDMDefaultPwr[ii + 1];
...@@ -463,7 +463,7 @@ void init_channel_table(void *pDeviceHandler) ...@@ -463,7 +463,7 @@ void init_channel_table(void *pDeviceHandler)
} }
} }
} else if (pDevice->byZoneType <= CCODE_MAX) { } else if (pDevice->byZoneType <= CCODE_MAX) {
if (bMultiBand == true) { if (bMultiBand) {
for (ii = 0; ii < CARD_MAX_CHANNEL_TBL; ii++) { for (ii = 0; ii < CARD_MAX_CHANNEL_TBL; ii++) {
if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) { if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) {
sChannelTbl[ii + 1].bValid = true; sChannelTbl[ii + 1].bValid = true;
...@@ -531,7 +531,7 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel) ...@@ -531,7 +531,7 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel)
return bResult; return bResult;
} }
if (sChannelTbl[uConnectionChannel].bValid == false) { if (!sChannelTbl[uConnectionChannel].bValid) {
return false; return false;
} }
...@@ -557,7 +557,7 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel) ...@@ -557,7 +557,7 @@ bool set_channel(void *pDeviceHandler, unsigned int uConnectionChannel)
bResult &= RFbSelectChannel(pDevice->PortOffset, pDevice->byRFType, (unsigned char)uConnectionChannel); bResult &= RFbSelectChannel(pDevice->PortOffset, pDevice->byRFType, (unsigned char)uConnectionChannel);
// Init Synthesizer Table // Init Synthesizer Table
if (pDevice->bEnablePSMode == true) if (pDevice->bEnablePSMode)
RFvWriteWakeProgSyn(pDevice->PortOffset, pDevice->byRFType, uConnectionChannel); RFvWriteWakeProgSyn(pDevice->PortOffset, pDevice->byRFType, uConnectionChannel);
//DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "CARDbSetMediaChannel: %d\n", (unsigned char)uConnectionChannel); //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "CARDbSetMediaChannel: %d\n", (unsigned char)uConnectionChannel);
...@@ -766,7 +766,7 @@ unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType) ...@@ -766,7 +766,7 @@ unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
if (ePHYType == PHY_TYPE_11A) { if (ePHYType == PHY_TYPE_11A) {
for (ii = CB_MAX_CHANNEL_24G + 1; ii <= CB_MAX_CHANNEL; ii++) { for (ii = CB_MAX_CHANNEL_24G + 1; ii <= CB_MAX_CHANNEL; ii++) {
if (sChannelTbl[ii].bValid == true) { if (sChannelTbl[ii].bValid) {
if (byOptionChannel == 0) { if (byOptionChannel == 0) {
byOptionChannel = (unsigned char) ii; byOptionChannel = (unsigned char) ii;
} }
...@@ -780,7 +780,7 @@ unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType) ...@@ -780,7 +780,7 @@ unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
} else { } else {
byOptionChannel = 0; byOptionChannel = 0;
for (ii = 1; ii <= CB_MAX_CHANNEL_24G; ii++) { for (ii = 1; ii <= CB_MAX_CHANNEL_24G; ii++) {
if (sChannelTbl[ii].bValid == true) { if (sChannelTbl[ii].bValid) {
if (sChannelTbl[ii].byMAP == 0) { if (sChannelTbl[ii].byMAP == 0) {
aiWeight[ii] += 100; aiWeight[ii] += 100;
} else if (sChannelTbl[ii].byMAP & 0x01) { } else if (sChannelTbl[ii].byMAP & 0x01) {
...@@ -807,7 +807,7 @@ unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType) ...@@ -807,7 +807,7 @@ unsigned char auto_channel_select(void *pDeviceHandler, CARD_PHY_TYPE ePHYType)
} }
} }
for (ii = 1; ii <= CB_MAX_CHANNEL_24G; ii++) { for (ii = 1; ii <= CB_MAX_CHANNEL_24G; ii++) {
if ((sChannelTbl[ii].bValid == true) && if (sChannelTbl[ii].bValid &&
(aiWeight[ii] > aiWeight[byOptionChannel])) { (aiWeight[ii] > aiWeight[byOptionChannel])) {
byOptionChannel = (unsigned char) ii; byOptionChannel = (unsigned char) ii;
} }
......
...@@ -218,8 +218,7 @@ RATEvParseMaxRate( ...@@ -218,8 +218,7 @@ RATEvParseMaxRate(
for (ii = 0; ii < uRateLen; ii++) { for (ii = 0; ii < uRateLen; ii++) {
byRate = (unsigned char)(pItemRates->abyRates[ii]); byRate = (unsigned char)(pItemRates->abyRates[ii]);
if (WLAN_MGMT_IS_BASICRATE(byRate) && if (WLAN_MGMT_IS_BASICRATE(byRate) && bUpdateBasicRate) {
(bUpdateBasicRate == true)) {
// Add to basic rate set, update pDevice->byTopCCKBasicRate and pDevice->byTopOFDMBasicRate // Add to basic rate set, update pDevice->byTopCCKBasicRate and pDevice->byTopOFDMBasicRate
CARDbAddBasicRate((void *)pDevice, wGetRateIdx(byRate)); CARDbAddBasicRate((void *)pDevice, wGetRateIdx(byRate));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ParseMaxRate AddBasicRate: %d\n", wGetRateIdx(byRate)); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ParseMaxRate AddBasicRate: %d\n", wGetRateIdx(byRate));
...@@ -329,7 +328,7 @@ RATEvTxRateFallBack( ...@@ -329,7 +328,7 @@ RATEvTxRateFallBack(
for (ii = 0; ii < MAX_RATE; ii++) { for (ii = 0; ii < MAX_RATE; ii++) {
if (psNodeDBTable->wSuppRate & (0x0001<<ii)) { if (psNodeDBTable->wSuppRate & (0x0001<<ii)) {
if (bAutoRate[ii] == true) { if (bAutoRate[ii]) {
wIdxUpRate = (unsigned short) ii; wIdxUpRate = (unsigned short) ii;
} }
} else { } else {
...@@ -354,8 +353,7 @@ RATEvTxRateFallBack( ...@@ -354,8 +353,7 @@ RATEvTxRateFallBack(
wIdxDownRate = psNodeDBTable->wTxDataRate; wIdxDownRate = psNodeDBTable->wTxDataRate;
for (ii = psNodeDBTable->wTxDataRate; ii > 0;) { for (ii = psNodeDBTable->wTxDataRate; ii > 0;) {
ii--; ii--;
if ((dwThroughputTbl[ii] > dwThroughput) && if ((dwThroughputTbl[ii] > dwThroughput) && bAutoRate[ii]) {
(bAutoRate[ii] == true)) {
dwThroughput = dwThroughputTbl[ii]; dwThroughput = dwThroughputTbl[ii];
wIdxDownRate = (unsigned short) ii; wIdxDownRate = (unsigned short) ii;
} }
......
This diff is collapsed.
...@@ -379,7 +379,7 @@ device_receive_frame( ...@@ -379,7 +379,7 @@ device_receive_frame(
pMACHeader = (PS802_11Header)((unsigned char *)(skb->data) + 8); pMACHeader = (PS802_11Header)((unsigned char *)(skb->data) + 8);
//PLICE_DEBUG<- //PLICE_DEBUG<-
if (pDevice->bMeasureInProgress == true) { if (pDevice->bMeasureInProgress) {
if ((*pbyRsr & RSR_CRCOK) != 0) { if ((*pbyRsr & RSR_CRCOK) != 0) {
pDevice->byBasicMap |= 0x01; pDevice->byBasicMap |= 0x01;
} }
...@@ -436,7 +436,7 @@ device_receive_frame( ...@@ -436,7 +436,7 @@ device_receive_frame(
} }
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
if (s_bAPModeRxCtl(pDevice, pbyFrame, iSANodeIndex) == true) { if (s_bAPModeRxCtl(pDevice, pbyFrame, iSANodeIndex)) {
return false; return false;
} }
} }
...@@ -608,8 +608,7 @@ device_receive_frame( ...@@ -608,8 +608,7 @@ device_receive_frame(
} }
} else { } else {
// discard DATA packet while not associate || BSSID error // discard DATA packet while not associate || BSSID error
if ((pDevice->bLinkPass == false) || if (!pDevice->bLinkPass || !(*pbyRsr & RSR_BSSIDOK)) {
!(*pbyRsr & RSR_BSSIDOK)) {
if (bDeFragRx) { if (bDeFragRx) {
if (!device_alloc_frag_buf(pDevice, &pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx])) { if (!device_alloc_frag_buf(pDevice, &pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx])) {
DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s: can not alloc more frag bufs\n", DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s: can not alloc more frag bufs\n",
...@@ -658,7 +657,7 @@ device_receive_frame( ...@@ -658,7 +657,7 @@ device_receive_frame(
// Now it only supports 802.11g Infrastructure Mode, and support rate must up to 54 Mbps // Now it only supports 802.11g Infrastructure Mode, and support rate must up to 54 Mbps
if (pDevice->bDiversityEnable && (FrameSize > 50) && if (pDevice->bDiversityEnable && (FrameSize > 50) &&
(pDevice->eOPMode == OP_MODE_INFRASTRUCTURE) && (pDevice->eOPMode == OP_MODE_INFRASTRUCTURE) &&
(pDevice->bLinkPass == true)) { pDevice->bLinkPass) {
BBvAntennaDiversity(pDevice, s_byGetRateIdx(*pbyRxRate), 0); BBvAntennaDiversity(pDevice, s_byGetRateIdx(*pbyRxRate), 0);
} }
...@@ -683,7 +682,7 @@ device_receive_frame( ...@@ -683,7 +682,7 @@ device_receive_frame(
// ----------------------------------------------- // -----------------------------------------------
if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) && (pDevice->bEnable8021x == true)) { if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) && pDevice->bEnable8021x) {
unsigned char abyMacHdr[24]; unsigned char abyMacHdr[24];
// Only 802.1x packet incoming allowed // Only 802.1x packet incoming allowed
...@@ -698,7 +697,7 @@ device_receive_frame( ...@@ -698,7 +697,7 @@ device_receive_frame(
if (wEtherType == ETH_P_PAE) { if (wEtherType == ETH_P_PAE) {
skb->dev = pDevice->apdev; skb->dev = pDevice->apdev;
if (bIsWEP == true) { if (bIsWEP) {
// strip IV header(8) // strip IV header(8)
memcpy(&abyMacHdr[0], (skb->data + 4), 24); memcpy(&abyMacHdr[0], (skb->data + 4), 24);
memcpy((skb->data + 4 + cbIVOffset), &abyMacHdr[0], 24); memcpy((skb->data + 4 + cbIVOffset), &abyMacHdr[0], 24);
...@@ -770,8 +769,9 @@ device_receive_frame( ...@@ -770,8 +769,9 @@ device_receive_frame(
//DBG_PRN_GRP12(("LocalL: %lx, LocalR: %lx\n", dwLocalMIC_L, dwLocalMIC_R)); //DBG_PRN_GRP12(("LocalL: %lx, LocalR: %lx\n", dwLocalMIC_L, dwLocalMIC_R));
//DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dwMICKey0= %lx,dwMICKey1= %lx \n", dwMICKey0, dwMICKey1); //DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "dwMICKey0= %lx,dwMICKey1= %lx \n", dwMICKey0, dwMICKey1);
if ((cpu_to_le32(*pdwMIC_L) != dwLocalMIC_L) || (cpu_to_le32(*pdwMIC_R) != dwLocalMIC_R) || if ((cpu_to_le32(*pdwMIC_L) != dwLocalMIC_L) ||
(pDevice->bRxMICFail == true)) { (cpu_to_le32(*pdwMIC_R) != dwLocalMIC_R) ||
pDevice->bRxMICFail) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MIC comparison is fail!\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "MIC comparison is fail!\n");
pDevice->bRxMICFail = false; pDevice->bRxMICFail = false;
//pDevice->s802_11Counter.TKIPLocalMICFailures.QuadPart++; //pDevice->s802_11Counter.TKIPLocalMICFailures.QuadPart++;
...@@ -894,13 +894,13 @@ device_receive_frame( ...@@ -894,13 +894,13 @@ device_receive_frame(
return false; return false;
if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) { if (pMgmt->eCurrMode == WMAC_MODE_ESS_AP) {
if (s_bAPModeRxData(pDevice, if (!s_bAPModeRxData(pDevice,
skb, skb,
FrameSize, FrameSize,
cbHeaderOffset, cbHeaderOffset,
iSANodeIndex, iSANodeIndex,
iDANodeIndex iDANodeIndex
) == false) { )) {
if (bDeFragRx) { if (bDeFragRx) {
if (!device_alloc_frag_buf(pDevice, &pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx])) { if (!device_alloc_frag_buf(pDevice, &pDevice->sRxDFCB[pDevice->uCurrentDFCBIdx])) {
DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s: can not alloc more frag bufs\n", DBG_PRT(MSG_LEVEL_ERR, KERN_ERR "%s: can not alloc more frag bufs\n",
...@@ -1123,7 +1123,7 @@ static bool s_bHandleRxEncryption( ...@@ -1123,7 +1123,7 @@ static bool s_bHandleRxEncryption(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey == NULL\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pKey == NULL\n");
if (byDecMode == KEY_CTL_WEP) { if (byDecMode == KEY_CTL_WEP) {
// pDevice->s802_11Counter.WEPUndecryptableCount.QuadPart++; // pDevice->s802_11Counter.WEPUndecryptableCount.QuadPart++;
} else if (pDevice->bLinkPass == true) { } else if (pDevice->bLinkPass) {
// pDevice->s802_11Counter.DecryptFailureCount.QuadPart++; // pDevice->s802_11Counter.DecryptFailureCount.QuadPart++;
} }
return false; return false;
...@@ -1131,7 +1131,7 @@ static bool s_bHandleRxEncryption( ...@@ -1131,7 +1131,7 @@ static bool s_bHandleRxEncryption(
if (byDecMode != pKey->byCipherSuite) { if (byDecMode != pKey->byCipherSuite) {
if (byDecMode == KEY_CTL_WEP) { if (byDecMode == KEY_CTL_WEP) {
// pDevice->s802_11Counter.WEPUndecryptableCount.QuadPart++; // pDevice->s802_11Counter.WEPUndecryptableCount.QuadPart++;
} else if (pDevice->bLinkPass == true) { } else if (pDevice->bLinkPass) {
// pDevice->s802_11Counter.DecryptFailureCount.QuadPart++; // pDevice->s802_11Counter.DecryptFailureCount.QuadPart++;
} }
*pKeyOut = NULL; *pKeyOut = NULL;
...@@ -1234,7 +1234,7 @@ static bool s_bHostWepRxEncryption( ...@@ -1234,7 +1234,7 @@ static bool s_bHostWepRxEncryption(
if (byDecMode != pKey->byCipherSuite) { if (byDecMode != pKey->byCipherSuite) {
if (byDecMode == KEY_CTL_WEP) { if (byDecMode == KEY_CTL_WEP) {
// pDevice->s802_11Counter.WEPUndecryptableCount.QuadPart++; // pDevice->s802_11Counter.WEPUndecryptableCount.QuadPart++;
} else if (pDevice->bLinkPass == true) { } else if (pDevice->bLinkPass) {
// pDevice->s802_11Counter.DecryptFailureCount.QuadPart++; // pDevice->s802_11Counter.DecryptFailureCount.QuadPart++;
} }
return false; return false;
...@@ -1245,7 +1245,7 @@ static bool s_bHostWepRxEncryption( ...@@ -1245,7 +1245,7 @@ static bool s_bHostWepRxEncryption(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "byDecMode == KEY_CTL_WEP \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "byDecMode == KEY_CTL_WEP \n");
if ((pDevice->byLocalID <= REV_ID_VT3253_A1) || if ((pDevice->byLocalID <= REV_ID_VT3253_A1) ||
(((PSKeyTable)(pKey->pvKeyTable))->bSoftWEP == true) || (((PSKeyTable)(pKey->pvKeyTable))->bSoftWEP == true) ||
(bOnFly == false)) { !bOnFly) {
// Software WEP // Software WEP
// 1. 3253A // 1. 3253A
// 2. WEP 256 // 2. WEP 256
...@@ -1277,7 +1277,7 @@ static bool s_bHostWepRxEncryption( ...@@ -1277,7 +1277,7 @@ static bool s_bHostWepRxEncryption(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "TSC0_15: %x\n", *pwRxTSC15_0); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "TSC0_15: %x\n", *pwRxTSC15_0);
if (byDecMode == KEY_CTL_TKIP) { if (byDecMode == KEY_CTL_TKIP) {
if ((pDevice->byLocalID <= REV_ID_VT3253_A1) || (bOnFly == false)) { if ((pDevice->byLocalID <= REV_ID_VT3253_A1) || !bOnFly) {
// Software TKIP // Software TKIP
// 1. 3253 A // 1. 3253 A
// 2. NotOnFly // 2. NotOnFly
...@@ -1297,7 +1297,7 @@ static bool s_bHostWepRxEncryption( ...@@ -1297,7 +1297,7 @@ static bool s_bHostWepRxEncryption(
} }
if (byDecMode == KEY_CTL_CCMP) { if (byDecMode == KEY_CTL_CCMP) {
if (bOnFly == false) { if (!bOnFly) {
// Software CCMP // Software CCMP
// NotOnFly // NotOnFly
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "soft KEY_CTL_CCMP\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "soft KEY_CTL_CCMP\n");
......
...@@ -494,11 +494,11 @@ static int hostap_set_encryption(PSDevice pDevice, ...@@ -494,11 +494,11 @@ static int hostap_set_encryption(PSDevice pDevice,
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " hostap_set_encryption: alg %d \n", param->u.crypt.alg); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " hostap_set_encryption: alg %d \n", param->u.crypt.alg);
if (param->u.crypt.alg == WPA_ALG_NONE) { if (param->u.crypt.alg == WPA_ALG_NONE) {
if (pMgmt->sNodeDBTable[iNodeIndex].bOnFly == true) { if (pMgmt->sNodeDBTable[iNodeIndex].bOnFly) {
if (KeybRemoveKey(&(pDevice->sKey), if (!KeybRemoveKey(&(pDevice->sKey),
param->sta_addr, param->sta_addr,
pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex, pMgmt->sNodeDBTable[iNodeIndex].dwKeyIndex,
pDevice->PortOffset) == false) { pDevice->PortOffset)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybRemoveKey fail \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybRemoveKey fail \n");
} }
pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false; pMgmt->sNodeDBTable[iNodeIndex].bOnFly = false;
...@@ -556,7 +556,7 @@ static int hostap_set_encryption(PSDevice pDevice, ...@@ -556,7 +556,7 @@ static int hostap_set_encryption(PSDevice pDevice,
(unsigned char *)abyKey, (unsigned char *)abyKey,
KEY_CTL_WEP, KEY_CTL_WEP,
pDevice->PortOffset, pDevice->PortOffset,
pDevice->byLocalID) == true) { pDevice->byLocalID)) {
pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true; pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true;
} else { } else {
...@@ -623,7 +623,7 @@ static int hostap_set_encryption(PSDevice pDevice, ...@@ -623,7 +623,7 @@ static int hostap_set_encryption(PSDevice pDevice,
(unsigned char *)abyKey, (unsigned char *)abyKey,
byKeyDecMode, byKeyDecMode,
pDevice->PortOffset, pDevice->PortOffset,
pDevice->byLocalID) == true) { pDevice->byLocalID)) {
pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true; pMgmt->sNodeDBTable[iNodeIndex].bOnFly = true;
} else { } else {
...@@ -635,7 +635,7 @@ static int hostap_set_encryption(PSDevice pDevice, ...@@ -635,7 +635,7 @@ static int hostap_set_encryption(PSDevice pDevice,
} }
if (bKeyTableFull == true) { if (bKeyTableFull) {
wKeyCtl &= 0x7F00; // clear all key control filed wKeyCtl &= 0x7F00; // clear all key control filed
wKeyCtl |= (byKeyDecMode << 4); wKeyCtl |= (byKeyDecMode << 4);
wKeyCtl |= (byKeyDecMode); wKeyCtl |= (byKeyDecMode);
......
...@@ -64,13 +64,12 @@ s_vCheckKeyTableValid(PSKeyManagement pTable, unsigned long dwIoBase) ...@@ -64,13 +64,12 @@ s_vCheckKeyTableValid(PSKeyManagement pTable, unsigned long dwIoBase)
int i; int i;
for (i = 0; i < MAX_KEY_TABLE; i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
if ((pTable->KeyTable[i].bInUse == true) && if (pTable->KeyTable[i].bInUse &&
(pTable->KeyTable[i].PairwiseKey.bKeyValid == false) && !pTable->KeyTable[i].PairwiseKey.bKeyValid &&
(pTable->KeyTable[i].GroupKey[0].bKeyValid == false) && !pTable->KeyTable[i].GroupKey[0].bKeyValid &&
(pTable->KeyTable[i].GroupKey[1].bKeyValid == false) && !pTable->KeyTable[i].GroupKey[1].bKeyValid &&
(pTable->KeyTable[i].GroupKey[2].bKeyValid == false) && !pTable->KeyTable[i].GroupKey[2].bKeyValid &&
(pTable->KeyTable[i].GroupKey[3].bKeyValid == false) !pTable->KeyTable[i].GroupKey[3].bKeyValid) {
) {
pTable->KeyTable[i].bInUse = false; pTable->KeyTable[i].bInUse = false;
pTable->KeyTable[i].wKeyCtl = 0; pTable->KeyTable[i].wKeyCtl = 0;
pTable->KeyTable[i].bSoftWEP = false; pTable->KeyTable[i].bSoftWEP = false;
...@@ -140,17 +139,17 @@ bool KeybGetKey( ...@@ -140,17 +139,17 @@ bool KeybGetKey(
*pKey = NULL; *pKey = NULL;
for (i = 0; i < MAX_KEY_TABLE; i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
if ((pTable->KeyTable[i].bInUse == true) && if (pTable->KeyTable[i].bInUse &&
ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) {
if (dwKeyIndex == 0xFFFFFFFF) { if (dwKeyIndex == 0xFFFFFFFF) {
if (pTable->KeyTable[i].PairwiseKey.bKeyValid == true) { if (pTable->KeyTable[i].PairwiseKey.bKeyValid) {
*pKey = &(pTable->KeyTable[i].PairwiseKey); *pKey = &(pTable->KeyTable[i].PairwiseKey);
return true; return true;
} else { } else {
return false; return false;
} }
} else if (dwKeyIndex < MAX_GROUP_KEY) { } else if (dwKeyIndex < MAX_GROUP_KEY) {
if (pTable->KeyTable[i].GroupKey[dwKeyIndex].bKeyValid == true) { if (pTable->KeyTable[i].GroupKey[dwKeyIndex].bKeyValid) {
*pKey = &(pTable->KeyTable[i].GroupKey[dwKeyIndex]); *pKey = &(pTable->KeyTable[i].GroupKey[dwKeyIndex]);
return true; return true;
} else { } else {
...@@ -202,12 +201,11 @@ bool KeybSetKey( ...@@ -202,12 +201,11 @@ bool KeybSetKey(
j = (MAX_KEY_TABLE-1); j = (MAX_KEY_TABLE-1);
for (i = 0; i < (MAX_KEY_TABLE - 1); i++) { for (i = 0; i < (MAX_KEY_TABLE - 1); i++) {
if ((pTable->KeyTable[i].bInUse == false) && if (!pTable->KeyTable[i].bInUse && (j == (MAX_KEY_TABLE-1))) {
(j == (MAX_KEY_TABLE-1))) {
// found empty table // found empty table
j = i; j = i;
} }
if ((pTable->KeyTable[i].bInUse == true) && if (pTable->KeyTable[i].bInUse &&
ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) {
// found table already exist // found table already exist
if ((dwKeyIndex & PAIRWISE_KEY) != 0) { if ((dwKeyIndex & PAIRWISE_KEY) != 0) {
...@@ -384,7 +382,7 @@ bool KeybRemoveKey( ...@@ -384,7 +382,7 @@ bool KeybRemoveKey(
} }
for (i = 0; i < MAX_KEY_TABLE; i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
if ((pTable->KeyTable[i].bInUse == true) && if (pTable->KeyTable[i].bInUse &&
ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) {
if ((dwKeyIndex & PAIRWISE_KEY) != 0) { if ((dwKeyIndex & PAIRWISE_KEY) != 0) {
pTable->KeyTable[i].PairwiseKey.bKeyValid = false; pTable->KeyTable[i].PairwiseKey.bKeyValid = false;
...@@ -428,7 +426,7 @@ bool KeybRemoveAllKey( ...@@ -428,7 +426,7 @@ bool KeybRemoveAllKey(
int i, u; int i, u;
for (i = 0; i < MAX_KEY_TABLE; i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
if ((pTable->KeyTable[i].bInUse == true) && if (pTable->KeyTable[i].bInUse &&
ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) {
pTable->KeyTable[i].PairwiseKey.bKeyValid = false; pTable->KeyTable[i].PairwiseKey.bKeyValid = false;
for (u = 0; u < MAX_GROUP_KEY; u++) { for (u = 0; u < MAX_GROUP_KEY; u++) {
...@@ -461,7 +459,7 @@ void KeyvRemoveWEPKey( ...@@ -461,7 +459,7 @@ void KeyvRemoveWEPKey(
) )
{ {
if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) { if ((dwKeyIndex & 0x000000FF) < MAX_GROUP_KEY) {
if (pTable->KeyTable[MAX_KEY_TABLE-1].bInUse == true) { if (pTable->KeyTable[MAX_KEY_TABLE-1].bInUse) {
if (pTable->KeyTable[MAX_KEY_TABLE-1].GroupKey[dwKeyIndex & 0x000000FF].byCipherSuite == KEY_CTL_WEP) { if (pTable->KeyTable[MAX_KEY_TABLE-1].GroupKey[dwKeyIndex & 0x000000FF].byCipherSuite == KEY_CTL_WEP) {
pTable->KeyTable[MAX_KEY_TABLE-1].GroupKey[dwKeyIndex & 0x000000FF].bKeyValid = false; pTable->KeyTable[MAX_KEY_TABLE-1].GroupKey[dwKeyIndex & 0x000000FF].bKeyValid = false;
if ((dwKeyIndex & 0x7FFFFFFF) == (pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex & 0x7FFFFFFF)) { if ((dwKeyIndex & 0x7FFFFFFF) == (pTable->KeyTable[MAX_KEY_TABLE-1].dwGTKeyIndex & 0x7FFFFFFF)) {
...@@ -511,10 +509,10 @@ bool KeybGetTransmitKey( ...@@ -511,10 +509,10 @@ bool KeybGetTransmitKey(
*pKey = NULL; *pKey = NULL;
for (i = 0; i < MAX_KEY_TABLE; i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
if ((pTable->KeyTable[i].bInUse == true) && if (pTable->KeyTable[i].bInUse &&
ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) {
if (dwKeyType == PAIRWISE_KEY) { if (dwKeyType == PAIRWISE_KEY) {
if (pTable->KeyTable[i].PairwiseKey.bKeyValid == true) { if (pTable->KeyTable[i].PairwiseKey.bKeyValid) {
*pKey = &(pTable->KeyTable[i].PairwiseKey); *pKey = &(pTable->KeyTable[i].PairwiseKey);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybGetTransmitKey:"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybGetTransmitKey:");
...@@ -535,7 +533,7 @@ bool KeybGetTransmitKey( ...@@ -535,7 +533,7 @@ bool KeybGetTransmitKey(
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ERROR: dwGTKeyIndex == 0 !!!\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ERROR: dwGTKeyIndex == 0 !!!\n");
return false; return false;
} }
if (pTable->KeyTable[i].GroupKey[(pTable->KeyTable[i].dwGTKeyIndex&0x000000FF)].bKeyValid == true) { if (pTable->KeyTable[i].GroupKey[(pTable->KeyTable[i].dwGTKeyIndex&0x000000FF)].bKeyValid) {
*pKey = &(pTable->KeyTable[i].GroupKey[(pTable->KeyTable[i].dwGTKeyIndex&0x000000FF)]); *pKey = &(pTable->KeyTable[i].GroupKey[(pTable->KeyTable[i].dwGTKeyIndex&0x000000FF)]);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybGetTransmitKey:"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "KeybGetTransmitKey:");
...@@ -583,8 +581,8 @@ bool KeybCheckPairewiseKey( ...@@ -583,8 +581,8 @@ bool KeybCheckPairewiseKey(
*pKey = NULL; *pKey = NULL;
for (i = 0; i < MAX_KEY_TABLE; i++) { for (i = 0; i < MAX_KEY_TABLE; i++) {
if ((pTable->KeyTable[i].bInUse == true) && if (pTable->KeyTable[i].bInUse &&
(pTable->KeyTable[i].PairwiseKey.bKeyValid == true)) { pTable->KeyTable[i].PairwiseKey.bKeyValid) {
*pKey = &(pTable->KeyTable[i].PairwiseKey); *pKey = &(pTable->KeyTable[i].PairwiseKey);
return true; return true;
} }
...@@ -657,7 +655,7 @@ bool KeybSetDefaultKey( ...@@ -657,7 +655,7 @@ bool KeybSetDefaultKey(
pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl |= 0x4000; // disable on-fly disable address match pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl |= 0x4000; // disable on-fly disable address match
pTable->KeyTable[MAX_KEY_TABLE-1].bSoftWEP = true; pTable->KeyTable[MAX_KEY_TABLE-1].bSoftWEP = true;
} else { } else {
if (pTable->KeyTable[MAX_KEY_TABLE-1].bSoftWEP == false) if (!pTable->KeyTable[MAX_KEY_TABLE-1].bSoftWEP)
pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl |= 0xC000; // enable on-fly disable address match pTable->KeyTable[MAX_KEY_TABLE-1].wKeyCtl |= 0xC000; // enable on-fly disable address match
} }
...@@ -740,7 +738,7 @@ bool KeybSetAllGroupKey( ...@@ -740,7 +738,7 @@ bool KeybSetAllGroupKey(
} }
for (i = 0; i < MAX_KEY_TABLE - 1; i++) { for (i = 0; i < MAX_KEY_TABLE - 1; i++) {
if (pTable->KeyTable[i].bInUse == true) { if (pTable->KeyTable[i].bInUse) {
// found table already exist // found table already exist
// Group key // Group key
pKey = &(pTable->KeyTable[i].GroupKey[dwKeyIndex & 0x000000FF]); pKey = &(pTable->KeyTable[i].GroupKey[dwKeyIndex & 0x000000FF]);
......
...@@ -957,13 +957,13 @@ bool MACbSafeStop(unsigned long dwIoBase) ...@@ -957,13 +957,13 @@ bool MACbSafeStop(unsigned long dwIoBase)
{ {
MACvRegBitsOff(dwIoBase, MAC_REG_TCR, TCR_AUTOBCNTX); MACvRegBitsOff(dwIoBase, MAC_REG_TCR, TCR_AUTOBCNTX);
if (MACbSafeRxOff(dwIoBase) == false) { if (!MACbSafeRxOff(dwIoBase)) {
DBG_PORT80(0xA1); DBG_PORT80(0xA1);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " MACbSafeRxOff == false)\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " MACbSafeRxOff == false)\n");
MACbSafeSoftwareReset(dwIoBase); MACbSafeSoftwareReset(dwIoBase);
return false; return false;
} }
if (MACbSafeTxOff(dwIoBase) == false) { if (!MACbSafeTxOff(dwIoBase)) {
DBG_PORT80(0xA2); DBG_PORT80(0xA2);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " MACbSafeTxOff == false)\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " MACbSafeTxOff == false)\n");
MACbSafeSoftwareReset(dwIoBase); MACbSafeSoftwareReset(dwIoBase);
......
...@@ -284,16 +284,15 @@ PSbSendNullPacket( ...@@ -284,16 +284,15 @@ PSbSendNullPacket(
PSMgmtObject pMgmt = pDevice->pMgmt; PSMgmtObject pMgmt = pDevice->pMgmt;
unsigned int uIdx; unsigned int uIdx;
if (pDevice->bLinkPass == false) { if (!pDevice->bLinkPass) {
return false; return false;
} }
#ifdef TxInSleep #ifdef TxInSleep
if ((pDevice->bEnablePSMode == false) && if (!pDevice->bEnablePSMode && !pDevice->fTxDataInSleep) {
(pDevice->fTxDataInSleep == false)) {
return false; return false;
} }
#else #else
if (pDevice->bEnablePSMode == false) { if (!pDevice->bEnablePSMode) {
return false; return false;
} }
#endif #endif
......
...@@ -976,7 +976,7 @@ bool RFbSetPower( ...@@ -976,7 +976,7 @@ bool RFbSetPower(
} }
bResult = RFbRawSetPower(pDevice, byPwr, uRATE); bResult = RFbRawSetPower(pDevice, byPwr, uRATE);
if (bResult == true) { if (bResult) {
pDevice->byCurPwr = byPwr; pDevice->byCurPwr = byPwr;
} }
return bResult; return bResult;
......
...@@ -494,7 +494,7 @@ VNTWIFIvUpdateNodeTxCounter( ...@@ -494,7 +494,7 @@ VNTWIFIvUpdateNodeTxCounter(
} }
} }
pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts++; pMgmt->sNodeDBTable[uNodeIndex].uTxAttempts++;
if (bTxOk == true) { if (bTxOk) {
// 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]++;
pMgmt->sNodeDBTable[uNodeIndex].uTxOk[wRate]++; pMgmt->sNodeDBTable[uNodeIndex].uTxOk[wRate]++;
...@@ -584,7 +584,7 @@ VNTWIFIbyGetKeyCypher( ...@@ -584,7 +584,7 @@ VNTWIFIbyGetKeyCypher(
{ {
PSMgmtObject pMgmt = (PSMgmtObject)pMgmtHandle; PSMgmtObject pMgmt = (PSMgmtObject)pMgmtHandle;
if (bGroupKey == true) { if (bGroupKey) {
return pMgmt->byCSSGK; return pMgmt->byCSSGK;
} else { } else {
return pMgmt->byCSSPK; return pMgmt->byCSSPK;
...@@ -731,7 +731,7 @@ VNTWIFIbMeasureReport( ...@@ -731,7 +731,7 @@ VNTWIFIbMeasureReport(
pMgmt->uLengthOfRepEIDs += (2 + pMgmt->pCurrMeasureEIDRep->len); pMgmt->uLengthOfRepEIDs += (2 + pMgmt->pCurrMeasureEIDRep->len);
pMgmt->pCurrMeasureEIDRep = (PWLAN_IE_MEASURE_REP) pbyCurrentEID; pMgmt->pCurrMeasureEIDRep = (PWLAN_IE_MEASURE_REP) pbyCurrentEID;
} }
if (bEndOfReport == true) { if (bEndOfReport) {
IEEE11hbMSRRepTx(pMgmt); IEEE11hbMSRRepTx(pMgmt);
} }
//spin_unlock_irq(&pDevice->lock); //spin_unlock_irq(&pDevice->lock);
......
...@@ -317,7 +317,7 @@ vCommandTimer( ...@@ -317,7 +317,7 @@ vCommandTimer(
if (pDevice->dwDiagRefCount != 0) if (pDevice->dwDiagRefCount != 0)
return; return;
if (pDevice->bCmdRunning != true) if (!pDevice->bCmdRunning)
return; return;
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
...@@ -326,7 +326,7 @@ vCommandTimer( ...@@ -326,7 +326,7 @@ vCommandTimer(
case WLAN_CMD_SCAN_START: case WLAN_CMD_SCAN_START:
pDevice->byReAssocCount = 0; pDevice->byReAssocCount = 0;
if (pDevice->bRadioOff == true) { if (pDevice->bRadioOff) {
s_bCommandComplete(pDevice); s_bCommandComplete(pDevice);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
return; return;
...@@ -393,7 +393,7 @@ vCommandTimer( ...@@ -393,7 +393,7 @@ vCommandTimer(
vAdHocBeaconStop(pDevice); vAdHocBeaconStop(pDevice);
if (set_channel(pMgmt->pAdapter, pMgmt->uScanChannel) == true) { if (set_channel(pMgmt->pAdapter, pMgmt->uScanChannel)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "SCAN Channel: %d\n", pMgmt->uScanChannel); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "SCAN Channel: %d\n", pMgmt->uScanChannel);
} else { } else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "SET SCAN Channel Fail: %d\n", pMgmt->uScanChannel); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "SET SCAN Channel Fail: %d\n", pMgmt->uScanChannel);
...@@ -408,7 +408,7 @@ vCommandTimer( ...@@ -408,7 +408,7 @@ vCommandTimer(
} }
if ((pMgmt->b11hEnable == false) || if (!pMgmt->b11hEnable ||
(pMgmt->uScanChannel < CB_MAX_CHANNEL_24G)) { (pMgmt->uScanChannel < CB_MAX_CHANNEL_24G)) {
s_vProbeChannel(pDevice); s_vProbeChannel(pDevice);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
...@@ -498,7 +498,7 @@ vCommandTimer( ...@@ -498,7 +498,7 @@ vCommandTimer(
case WLAN_CMD_SSID_START: case WLAN_CMD_SSID_START:
pDevice->byReAssocCount = 0; pDevice->byReAssocCount = 0;
if (pDevice->bRadioOff == true) { if (pDevice->bRadioOff) {
s_bCommandComplete(pDevice); s_bCommandComplete(pDevice);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
return; return;
...@@ -659,7 +659,7 @@ vCommandTimer( ...@@ -659,7 +659,7 @@ vCommandTimer(
netif_wake_queue(pDevice->dev); netif_wake_queue(pDevice->dev);
} }
#ifdef TxInSleep #ifdef TxInSleep
if (pDevice->IsTxDataTrigger != false) { //TxDataTimer is not triggered at the first time if (pDevice->IsTxDataTrigger) { //TxDataTimer is not triggered at the first time
del_timer(&pDevice->sTimerTxData); del_timer(&pDevice->sTimerTxData);
init_timer(&pDevice->sTimerTxData); init_timer(&pDevice->sTimerTxData);
pDevice->sTimerTxData.data = (unsigned long) pDevice; pDevice->sTimerTxData.data = (unsigned long) pDevice;
...@@ -694,7 +694,7 @@ vCommandTimer( ...@@ -694,7 +694,7 @@ vCommandTimer(
pMgmt->eCurrState = WMAC_STATE_IDLE; pMgmt->eCurrState = WMAC_STATE_IDLE;
pMgmt->eCurrMode = WMAC_MODE_STANDBY; pMgmt->eCurrMode = WMAC_MODE_STANDBY;
pDevice->bLinkPass = false; pDevice->bLinkPass = false;
if (pDevice->bEnableHostWEP == true) if (pDevice->bEnableHostWEP)
BSSvClearNodeDBTable(pDevice, 1); BSSvClearNodeDBTable(pDevice, 1);
else else
BSSvClearNodeDBTable(pDevice, 0); BSSvClearNodeDBTable(pDevice, 0);
...@@ -776,7 +776,7 @@ vCommandTimer( ...@@ -776,7 +776,7 @@ vCommandTimer(
case WLAN_CMD_RADIO_START: case WLAN_CMD_RADIO_START:
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "eCommandState == WLAN_CMD_RADIO_START\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "eCommandState == WLAN_CMD_RADIO_START\n");
if (pDevice->bRadioCmd == true) if (pDevice->bRadioCmd)
CARDbRadioPowerOn(pDevice); CARDbRadioPowerOn(pDevice);
else else
CARDbRadioPowerOff(pDevice); CARDbRadioPowerOff(pDevice);
...@@ -948,7 +948,7 @@ bool bScheduleCommand( ...@@ -948,7 +948,7 @@ bool bScheduleCommand(
ADD_ONE_WITH_WRAP_AROUND(pDevice->uCmdEnqueueIdx, CMD_Q_SIZE); ADD_ONE_WITH_WRAP_AROUND(pDevice->uCmdEnqueueIdx, CMD_Q_SIZE);
pDevice->cbFreeCmdQueue--; pDevice->cbFreeCmdQueue--;
if (pDevice->bCmdRunning == false) { if (!pDevice->bCmdRunning) {
s_bCommandComplete(pDevice); s_bCommandComplete(pDevice);
} else { } else {
} }
...@@ -1031,8 +1031,8 @@ BSSvSecondTxData( ...@@ -1031,8 +1031,8 @@ BSSvSecondTxData(
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
#if 1 #if 1
if (((pDevice->bLinkPass == true) && (pMgmt->eAuthenMode < WMAC_AUTH_WPA)) || //open && sharekey linking if ((pDevice->bLinkPass && (pMgmt->eAuthenMode < WMAC_AUTH_WPA)) || //open && sharekey linking
(pDevice->fWPA_Authened == true)) { //wpa linking pDevice->fWPA_Authened) { //wpa linking
#else #else
if (pDevice->bLinkPass == true) { if (pDevice->bLinkPass == true) {
#endif #endif
......
...@@ -110,7 +110,7 @@ unsigned int WCTLuSearchDFCB(PSDevice pDevice, PS802_11Header pMACHeader) ...@@ -110,7 +110,7 @@ unsigned int WCTLuSearchDFCB(PSDevice pDevice, PS802_11Header pMACHeader)
unsigned int ii; unsigned int ii;
for (ii = 0; ii < pDevice->cbDFCB; ii++) { for (ii = 0; ii < pDevice->cbDFCB; ii++) {
if ((pDevice->sRxDFCB[ii].bInUse == true) && if (pDevice->sRxDFCB[ii].bInUse &&
ether_addr_equal(pDevice->sRxDFCB[ii].abyAddr2, ether_addr_equal(pDevice->sRxDFCB[ii].abyAddr2,
pMACHeader->abyAddr2)) { pMACHeader->abyAddr2)) {
// //
...@@ -141,7 +141,7 @@ unsigned int WCTLuInsertDFCB(PSDevice pDevice, PS802_11Header pMACHeader) ...@@ -141,7 +141,7 @@ unsigned int WCTLuInsertDFCB(PSDevice pDevice, PS802_11Header pMACHeader)
if (pDevice->cbFreeDFCB == 0) if (pDevice->cbFreeDFCB == 0)
return pDevice->cbDFCB; return pDevice->cbDFCB;
for (ii = 0; ii < pDevice->cbDFCB; ii++) { for (ii = 0; ii < pDevice->cbDFCB; ii++) {
if (pDevice->sRxDFCB[ii].bInUse == false) { if (!pDevice->sRxDFCB[ii].bInUse) {
pDevice->cbFreeDFCB--; pDevice->cbFreeDFCB--;
pDevice->sRxDFCB[ii].uLifetime = pDevice->dwMaxReceiveLifetime; pDevice->sRxDFCB[ii].uLifetime = pDevice->dwMaxReceiveLifetime;
pDevice->sRxDFCB[ii].bInUse = true; pDevice->sRxDFCB[ii].bInUse = true;
...@@ -174,7 +174,7 @@ bool WCTLbHandleFragment(PSDevice pDevice, PS802_11Header pMACHeader, unsigned i ...@@ -174,7 +174,7 @@ bool WCTLbHandleFragment(PSDevice pDevice, PS802_11Header pMACHeader, unsigned i
{ {
unsigned int uHeaderSize; unsigned int uHeaderSize;
if (bWEP == true) { if (bWEP) {
uHeaderSize = 28; uHeaderSize = 28;
if (bExtIV) if (bExtIV)
// ExtIV // ExtIV
......
This diff is collapsed.
...@@ -241,7 +241,7 @@ WPA_SearchRSN( ...@@ -241,7 +241,7 @@ WPA_SearchRSN(
int ii; int ii;
unsigned char byPKType = WPA_NONE; unsigned char byPKType = WPA_NONE;
if (pBSSList->bWPAValid == false) if (!pBSSList->bWPAValid)
return false; return false;
switch (byCmd) { switch (byCmd) {
......
...@@ -192,7 +192,7 @@ WPA2vParseRSN( ...@@ -192,7 +192,7 @@ WPA2vParseRSN(
break; break;
} //for } //for
if (bUseGK == true) { if (bUseGK) {
if (j != 1) { if (j != 1) {
// invalid CSS, This should be only PK CSS. // invalid CSS, This should be only PK CSS.
return; return;
...@@ -335,7 +335,7 @@ WPA2uSetIEs( ...@@ -335,7 +335,7 @@ WPA2uSetIEs(
pRSNIEs->len += 2; pRSNIEs->len += 2;
if ((pMgmt->gsPMKIDCache.BSSIDInfoCount > 0) && if ((pMgmt->gsPMKIDCache.BSSIDInfoCount > 0) &&
(pMgmt->bRoaming == true) && pMgmt->bRoaming &&
(pMgmt->eAuthenMode == WMAC_AUTH_WPA2)) { (pMgmt->eAuthenMode == WMAC_AUTH_WPA2)) {
// RSN PMKID // RSN PMKID
pwPMKID = (unsigned short *)(&pRSNIEs->abyRSN[18]); // Point to PMKID count pwPMKID = (unsigned short *)(&pRSNIEs->abyRSN[18]); // Point to PMKID count
......
...@@ -341,22 +341,22 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel) ...@@ -341,22 +341,22 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
// If is_broadcast_ether_addr, set the key as every key entry's group key. // If is_broadcast_ether_addr, set the key as every key entry's group key.
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Groupe Key Assign.\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Groupe Key Assign.\n");
if ((KeybSetAllGroupKey(&(pDevice->sKey), if (KeybSetAllGroupKey(&(pDevice->sKey),
dwKeyIndex, dwKeyIndex,
param->u.wpa_key.key_len, param->u.wpa_key.key_len,
(PQWORD) &(KeyRSC), (PQWORD) &(KeyRSC),
(unsigned char *)abyKey, (unsigned char *)abyKey,
byKeyDecMode, byKeyDecMode,
pDevice->PortOffset, pDevice->PortOffset,
pDevice->byLocalID) == true) && pDevice->byLocalID) &&
(KeybSetDefaultKey(&(pDevice->sKey), KeybSetDefaultKey(&(pDevice->sKey),
dwKeyIndex, dwKeyIndex,
param->u.wpa_key.key_len, param->u.wpa_key.key_len,
(PQWORD) &(KeyRSC), (PQWORD) &(KeyRSC),
(unsigned char *)abyKey, (unsigned char *)abyKey,
byKeyDecMode, byKeyDecMode,
pDevice->PortOffset, pDevice->PortOffset,
pDevice->byLocalID) == true)) { pDevice->byLocalID)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "GROUP Key Assign.\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "GROUP Key Assign.\n");
} else { } else {
...@@ -389,7 +389,7 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel) ...@@ -389,7 +389,7 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
(unsigned char *)abyKey, (unsigned char *)abyKey,
byKeyDecMode, byKeyDecMode,
pDevice->PortOffset, pDevice->PortOffset,
pDevice->byLocalID) == true) { pDevice->byLocalID)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Pairwise Key Set\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Pairwise Key Set\n");
} else { } else {
...@@ -804,7 +804,7 @@ static int wpa_set_associate(PSDevice pDevice, ...@@ -804,7 +804,7 @@ static int wpa_set_associate(PSDevice pDevice,
else else
pDevice->bEncryptionEnable = false; pDevice->bEncryptionEnable = false;
if (!((pMgmt->eAuthenMode == WMAC_AUTH_SHAREKEY) || if (!((pMgmt->eAuthenMode == WMAC_AUTH_SHAREKEY) ||
((pMgmt->eAuthenMode == WMAC_AUTH_OPEN) && (bWepEnabled == true)))) //DavidWang //20080717-06,<Modify> by chester//Not to initial WEP ((pMgmt->eAuthenMode == WMAC_AUTH_OPEN) && bWepEnabled))) //DavidWang //20080717-06,<Modify> by chester//Not to initial WEP
KeyvInitTable(&pDevice->sKey, pDevice->PortOffset); KeyvInitTable(&pDevice->sKey, pDevice->PortOffset);
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
pDevice->bLinkPass = false; pDevice->bLinkPass = false;
......
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