Commit 33d33e42 authored by Andres More's avatar Andres More Committed by Greg Kroah-Hartman

Staging: vt6656: code cleanup, fixed 'for' statements

Resolved checkpatch findings, but some long lines warnings.
	ERROR: space required before the open parenthesis '('
	ERROR: spaces required around that
Signed-off-by: default avatarAndres More <more.andres@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent afb97d9a
...@@ -699,12 +699,14 @@ BOOL BSSbUpdateToBSSList(void *hDeviceContext, ...@@ -699,12 +699,14 @@ BOOL BSSbUpdateToBSSList(void *hDeviceContext,
pBSSList->byRSSIStatCnt %= RSSI_STAT_COUNT; pBSSList->byRSSIStatCnt %= RSSI_STAT_COUNT;
pBSSList->ldBmAverage[pBSSList->byRSSIStatCnt] = ldBm; pBSSList->ldBmAverage[pBSSList->byRSSIStatCnt] = ldBm;
ldBmSum = 0; ldBmSum = 0;
for(ii=0, jj=0;ii<RSSI_STAT_COUNT;ii++) { for (ii = 0, jj = 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 =
ldBmSum += pBSSList->ldBmAverage[ii]; max(pBSSList->ldBmAverage[ii], ldBm);
jj++; ldBmSum +=
} pBSSList->ldBmAverage[ii];
jj++;
}
} }
pBSSList->ldBmAverRange = ldBmSum /jj; pBSSList->ldBmAverRange = ldBmSum /jj;
} }
...@@ -1422,21 +1424,25 @@ void BSSvUpdateNodeTxCounter(void *hDeviceContext, ...@@ -1422,21 +1424,25 @@ void BSSvUpdateNodeTxCounter(void *hDeviceContext,
(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) {
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 =
else awHWRetry0[wRate-RATE_18M][ii];
wFallBackRate = awHWRetry0[wRate-RATE_18M][4]; else
pMgmt->sNodeDBTable[0].uTxFail[wFallBackRate]++; wFallBackRate =
} awHWRetry0[wRate-RATE_18M][4];
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 =
else awHWRetry1[wRate-RATE_18M][ii];
wFallBackRate = awHWRetry1[wRate-RATE_18M][4]; else
pMgmt->sNodeDBTable[0].uTxFail[wFallBackRate]++; wFallBackRate =
} awHWRetry1[wRate-RATE_18M][4];
pMgmt->sNodeDBTable[0].uTxFail[wFallBackRate]++;
}
} }
} }
}; };
...@@ -1476,21 +1482,23 @@ void BSSvUpdateNodeTxCounter(void *hDeviceContext, ...@@ -1476,21 +1482,23 @@ void BSSvUpdateNodeTxCounter(void *hDeviceContext,
(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 =
else awHWRetry0[wRate-RATE_18M][ii];
wFallBackRate = awHWRetry0[wRate-RATE_18M][4]; else
pMgmt->sNodeDBTable[uNodeIndex].uTxFail[wFallBackRate]++; wFallBackRate =
awHWRetry0[wRate-RATE_18M][4];
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
wFallBackRate = awHWRetry1[wRate-RATE_18M][4]; wFallBackRate = awHWRetry1[wRate-RATE_18M][4];
pMgmt->sNodeDBTable[uNodeIndex].uTxFail[wFallBackRate]++; pMgmt->sNodeDBTable[uNodeIndex].uTxFail[wFallBackRate]++;
} }
} }
} }
}; };
......
...@@ -457,12 +457,11 @@ void CARDvSetRSPINF(void *pDeviceHandler, BYTE byBBType) ...@@ -457,12 +457,11 @@ void CARDvSetRSPINF(void *pDeviceHandler, BYTE byBBType)
abyData[14] = abySignal[3]; abyData[14] = abySignal[3];
abyData[15] = abyServ[3]; abyData[15] = abyServ[3];
for(i=0;i<9;i++) { for (i = 0; i < 9; i++) {
abyData[16+i*2] = abyTxRate[i]; abyData[16+i*2] = abyTxRate[i];
abyData[16+i*2+1] = abyRsvTime[i]; abyData[16+i*2+1] = abyRsvTime[i];
} }
CONTROLnsRequestOut(pDevice, CONTROLnsRequestOut(pDevice,
MESSAGE_TYPE_WRITE, MESSAGE_TYPE_WRITE,
MAC_REG_RSPINF_B_1, MAC_REG_RSPINF_B_1,
......
...@@ -441,11 +441,10 @@ void CHvInitChannelTable(void *pDeviceHandler) ...@@ -441,11 +441,10 @@ void CHvInitChannelTable(void *pDeviceHandler)
{ {
PSDevice pDevice = (PSDevice) pDeviceHandler; PSDevice pDevice = (PSDevice) pDeviceHandler;
BOOL bMultiBand = FALSE; BOOL bMultiBand = FALSE;
unsigned int ii; unsigned int ii;
for(ii=1;ii<=CB_MAX_CHANNEL;ii++) { for (ii = 1; ii <= CB_MAX_CHANNEL; ii++)
sChannelTbl[ii].bValid = FALSE; sChannelTbl[ii].bValid = FALSE;
}
switch (pDevice->byRFType) { switch (pDevice->byRFType) {
case RF_AL2230: case RF_AL2230:
...@@ -464,43 +463,43 @@ void CHvInitChannelTable(void *pDeviceHandler) ...@@ -464,43 +463,43 @@ void CHvInitChannelTable(void *pDeviceHandler)
if ((pDevice->dwDiagRefCount != 0) || if ((pDevice->dwDiagRefCount != 0) ||
(pDevice->b11hEable == TRUE)) { (pDevice->b11hEable == TRUE)) {
if (bMultiBand == TRUE) { if (bMultiBand == TRUE) {
for(ii=0;ii<CB_MAX_CHANNEL;ii++) { for (ii = 0; ii < CB_MAX_CHANNEL; 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];
//pDevice->abyLocalPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1]; //pDevice->abyLocalPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1];
} }
for(ii=0;ii<CB_MAX_CHANNEL_24G;ii++) { for (ii = 0; ii < CB_MAX_CHANNEL_24G; ii++) {
//pDevice->abyRegPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1]; //pDevice->abyRegPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1];
//pDevice->abyLocalPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1]; //pDevice->abyLocalPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1];
} }
} else { } else {
for(ii=0;ii<CB_MAX_CHANNEL_24G;ii++) { for (ii = 0; ii < CB_MAX_CHANNEL_24G; ii++) {
sChannelTbl[ii+1].bValid = TRUE; sChannelTbl[ii+1].bValid = TRUE;
//pDevice->abyRegPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1]; //pDevice->abyRegPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1];
//pDevice->abyLocalPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1]; //pDevice->abyLocalPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1];
} }
} }
} else if (pDevice->byZoneType <= CCODE_MAX) { } else if (pDevice->byZoneType <= CCODE_MAX) {
if (bMultiBand == TRUE) { if (bMultiBand == TRUE) {
for(ii=0;ii<CB_MAX_CHANNEL;ii++) { for (ii = 0; ii < CB_MAX_CHANNEL; 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;
//pDevice->abyRegPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii]; //pDevice->abyRegPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii];
//pDevice->abyLocalPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii]; //pDevice->abyLocalPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii];
} }
} }
} else { } else {
for(ii=0;ii<CB_MAX_CHANNEL_24G;ii++) { for (ii = 0; ii < CB_MAX_CHANNEL_24G; 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;
//pDevice->abyRegPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii]; //pDevice->abyRegPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii];
//pDevice->abyLocalPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii]; //pDevice->abyLocalPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii];
} }
} }
} }
} }
DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO"Zone=[%d][%c][%c]!!\n",pDevice->byZoneType,ChannelRuleTab[pDevice->byZoneType].chCountryCode[0],ChannelRuleTab[pDevice->byZoneType].chCountryCode[1]); DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO"Zone=[%d][%c][%c]!!\n",pDevice->byZoneType,ChannelRuleTab[pDevice->byZoneType].chCountryCode[0],ChannelRuleTab[pDevice->byZoneType].chCountryCode[1]);
for(ii=0;ii<CB_MAX_CHANNEL;ii++) { for (ii = 0; ii < CB_MAX_CHANNEL; ii++) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Channel[%d] is [%d]\n",sChannelTbl[ii].byChannelNumber,sChannelTbl[ii+1].bValid); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Channel[%d] is [%d]\n",sChannelTbl[ii].byChannelNumber,sChannelTbl[ii+1].bValid);
/*if (pDevice->abyRegPwr[ii+1] == 0) { /*if (pDevice->abyRegPwr[ii+1] == 0) {
pDevice->abyRegPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1]; pDevice->abyRegPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1];
......
...@@ -72,7 +72,7 @@ void s_vResetCounter(PKnownNodeDB psNodeDBTable) ...@@ -72,7 +72,7 @@ void s_vResetCounter(PKnownNodeDB psNodeDBTable)
BYTE ii; BYTE ii;
// clear statistic counter for auto_rate // clear statistic counter for auto_rate
for(ii=0;ii<=MAX_RATE;ii++) { for (ii = 0; ii <= MAX_RATE; ii++) {
psNodeDBTable->uTxOk[ii] = 0; psNodeDBTable->uTxOk[ii] = 0;
psNodeDBTable->uTxFail[ii] = 0; psNodeDBTable->uTxFail[ii] = 0;
} }
...@@ -337,7 +337,7 @@ DWORD dwTxDiff = 0; ...@@ -337,7 +337,7 @@ DWORD dwTxDiff = 0;
psNodeDBTable->uTimeCount = 0; psNodeDBTable->uTimeCount = 0;
} }
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] == TRUE) {
wIdxUpRate = (WORD) ii; wIdxUpRate = (WORD) ii;
...@@ -347,7 +347,7 @@ DWORD dwTxDiff = 0; ...@@ -347,7 +347,7 @@ DWORD dwTxDiff = 0;
} }
} }
for(ii=0;ii<=psNodeDBTable->wTxDataRate;ii++) { for (ii = 0; ii <= psNodeDBTable->wTxDataRate; ii++) {
if ( (psNodeDBTable->uTxOk[ii] != 0) || if ( (psNodeDBTable->uTxOk[ii] != 0) ||
(psNodeDBTable->uTxFail[ii] != 0) ) { (psNodeDBTable->uTxFail[ii] != 0) ) {
dwThroughputTbl[ii] *= psNodeDBTable->uTxOk[ii]; dwThroughputTbl[ii] *= psNodeDBTable->uTxOk[ii];
...@@ -362,7 +362,7 @@ DWORD dwTxDiff = 0; ...@@ -362,7 +362,7 @@ DWORD dwTxDiff = 0;
dwThroughput = dwThroughputTbl[psNodeDBTable->wTxDataRate]; dwThroughput = dwThroughputTbl[psNodeDBTable->wTxDataRate];
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]==TRUE) ) { (bAutoRate[ii]==TRUE) ) {
...@@ -400,7 +400,7 @@ long ldBm; ...@@ -400,7 +400,7 @@ long ldBm;
return; return;
} }
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] == TRUE) {
wIdxUpRate = (WORD) ii; wIdxUpRate = (WORD) ii;
......
...@@ -758,10 +758,11 @@ RXbBulkInProcessData ( ...@@ -758,10 +758,11 @@ RXbBulkInProcessData (
pMgmt->pCurrBSS->byRSSIStatCnt++; pMgmt->pCurrBSS->byRSSIStatCnt++;
pMgmt->pCurrBSS->byRSSIStatCnt %= RSSI_STAT_COUNT; pMgmt->pCurrBSS->byRSSIStatCnt %= RSSI_STAT_COUNT;
pMgmt->pCurrBSS->ldBmAverage[pMgmt->pCurrBSS->byRSSIStatCnt] = ldBm; pMgmt->pCurrBSS->ldBmAverage[pMgmt->pCurrBSS->byRSSIStatCnt] = ldBm;
for(ii=0;ii<RSSI_STAT_COUNT;ii++) { for (ii = 0; ii < RSSI_STAT_COUNT; ii++) {
if (pMgmt->pCurrBSS->ldBmAverage[ii] != 0) { if (pMgmt->pCurrBSS->ldBmAverage[ii] != 0) {
pMgmt->pCurrBSS->ldBmMAX = max(pMgmt->pCurrBSS->ldBmAverage[ii], ldBm); pMgmt->pCurrBSS->ldBmMAX =
} max(pMgmt->pCurrBSS->ldBmAverage[ii], ldBm);
}
} }
} }
*/ */
......
...@@ -232,10 +232,10 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) { ...@@ -232,10 +232,10 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
pDevice->bEncryptionEnable = FALSE; pDevice->bEncryptionEnable = FALSE;
pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
for(uu=0;uu<MAX_KEY_TABLE;uu++) for (uu = 0; uu < MAX_KEY_TABLE; uu++)
MACvDisableKeyEntry(pDevice,uu); MACvDisableKeyEntry(pDevice, uu);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WEP function disable. \n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WEP function disable.\n");
break; break;
} }
......
...@@ -653,7 +653,7 @@ int iwctl_giwrange(struct net_device *dev, ...@@ -653,7 +653,7 @@ int iwctl_giwrange(struct net_device *dev,
// Should be based on cap_rid.country to give only // Should be based on cap_rid.country to give only
// what the current card support // what the current card support
k = 0; k = 0;
for(i = 0; i < 14; i++) { for (i = 0; i < 14; i++) {
range->freq[k].i = i + 1; // List index range->freq[k].i = i + 1; // List index
range->freq[k].m = frequency_list[i] * 100000; range->freq[k].m = frequency_list[i] * 100000;
range->freq[k++].e = 1; // Values in table in MHz -> * 10^5 * 10 range->freq[k++].e = 1; // Values in table in MHz -> * 10^5 * 10
...@@ -669,7 +669,7 @@ int iwctl_giwrange(struct net_device *dev, ...@@ -669,7 +669,7 @@ int iwctl_giwrange(struct net_device *dev,
range->max_qual.noise = 0; range->max_qual.noise = 0;
range->sensitivity = 255; range->sensitivity = 255;
for(i = 0 ; i < 13 ; i++) { for (i = 0 ; i < 13 ; i++) {
range->bitrate[i] = abySupportedRates[i] * 500000; range->bitrate[i] = abySupportedRates[i] * 500000;
if(range->bitrate[i] == 0) if(range->bitrate[i] == 0)
break; break;
...@@ -1057,7 +1057,7 @@ int iwctl_siwrate(struct net_device *dev, ...@@ -1057,7 +1057,7 @@ int iwctl_siwrate(struct net_device *dev,
u8 normvalue = (u8) (wrq->value/500000); u8 normvalue = (u8) (wrq->value/500000);
// Check if rate is valid // Check if rate is valid
for(i = 0 ; i < 13 ; i++) { for (i = 0 ; i < 13 ; i++) {
if(normvalue == abySupportedRates[i]) { if(normvalue == abySupportedRates[i]) {
brate = i; brate = i;
break; break;
...@@ -1067,7 +1067,7 @@ int iwctl_siwrate(struct net_device *dev, ...@@ -1067,7 +1067,7 @@ int iwctl_siwrate(struct net_device *dev,
// -1 designed the max rate (mostly auto mode) // -1 designed the max rate (mostly auto mode)
if(wrq->value == -1) { if(wrq->value == -1) {
// Get the highest available rate // Get the highest available rate
for(i = 0 ; i < 13 ; i++) { for (i = 0 ; i < 13 ; i++) {
if(abySupportedRates[i] == 0) if(abySupportedRates[i] == 0)
break; break;
} }
...@@ -1405,8 +1405,8 @@ int iwctl_siwencode(struct net_device *dev, ...@@ -1405,8 +1405,8 @@ int iwctl_siwencode(struct net_device *dev,
pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
if (pDevice->flags & DEVICE_FLAGS_OPENED) { if (pDevice->flags & DEVICE_FLAGS_OPENED) {
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
for(uu=0;uu<MAX_KEY_TABLE;uu++) for (uu = 0; uu < MAX_KEY_TABLE; uu++)
MACvDisableKeyEntry(pDevice,uu); MACvDisableKeyEntry(pDevice, uu);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
} }
} }
...@@ -1935,14 +1935,14 @@ printk("param->u.wpa_key.set_tx =%d\n",param->u.wpa_key.set_tx); ...@@ -1935,14 +1935,14 @@ printk("param->u.wpa_key.set_tx =%d\n",param->u.wpa_key.set_tx);
printk("param->u.wpa_key.key_index =%d\n",param->u.wpa_key.key_index); printk("param->u.wpa_key.key_index =%d\n",param->u.wpa_key.key_index);
printk("param->u.wpa_key.key_len =%d\n",param->u.wpa_key.key_len); printk("param->u.wpa_key.key_len =%d\n",param->u.wpa_key.key_len);
printk("param->u.wpa_key.key ="); printk("param->u.wpa_key.key =");
for(ii=0;ii<param->u.wpa_key.key_len;ii++) for (ii = 0; ii < param->u.wpa_key.key_len; ii++)
printk("%02x:",param->u.wpa_key.key[ii]); printk(KERN_DEBUG "%02x:", param->u.wpa_key.key[ii]);
printk("\n"); printk("\n");
printk("param->u.wpa_key.seq_len =%d\n",param->u.wpa_key.seq_len); printk("param->u.wpa_key.seq_len =%d\n",param->u.wpa_key.seq_len);
printk("param->u.wpa_key.seq ="); printk("param->u.wpa_key.seq =");
for(ii=0;ii<param->u.wpa_key.seq_len;ii++) for (ii = 0; ii < param->u.wpa_key.seq_len; ii++)
printk("%02x:",param->u.wpa_key.seq[ii]); printk(KERN_DEBUG "%02x:", param->u.wpa_key.seq[ii]);
printk("\n"); printk("\n");
printk("...........\n"); printk("...........\n");
#endif #endif
......
...@@ -485,9 +485,9 @@ BOOL KeybRemoveAllKey( ...@@ -485,9 +485,9 @@ BOOL KeybRemoveAllKey(
if ((pTable->KeyTable[i].bInUse == TRUE) && if ((pTable->KeyTable[i].bInUse == TRUE) &&
IS_ETH_ADDRESS_EQUAL(pTable->KeyTable[i].abyBSSID,pbyBSSID)) { IS_ETH_ADDRESS_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++)
pTable->KeyTable[i].GroupKey[u].bKeyValid = FALSE; pTable->KeyTable[i].GroupKey[u].bKeyValid = FALSE;
}
pTable->KeyTable[i].dwGTKeyIndex = 0; pTable->KeyTable[i].dwGTKeyIndex = 0;
s_vCheckKeyTableValid(pDevice, pTable); s_vCheckKeyTableValid(pDevice, pTable);
return (TRUE); return (TRUE);
...@@ -531,19 +531,13 @@ void KeyvRemoveWEPKey( ...@@ -531,19 +531,13 @@ void KeyvRemoveWEPKey(
return; return;
} }
void KeyvRemoveAllWEPKey( void KeyvRemoveAllWEPKey(void *pDeviceHandler, PSKeyManagement pTable)
void *pDeviceHandler,
PSKeyManagement pTable
)
{ {
PSDevice pDevice = (PSDevice) pDeviceHandler; PSDevice pDevice = (PSDevice) pDeviceHandler;
int i;
int i;
for(i=0;i<MAX_GROUP_KEY;i++) {
KeyvRemoveWEPKey(pDevice,pTable, i);
}
for (i = 0; i < MAX_GROUP_KEY; i++)
KeyvRemoveWEPKey(pDevice, pTable, i);
} }
/* /*
......
...@@ -306,8 +306,8 @@ BYTE pbyData[24]; ...@@ -306,8 +306,8 @@ BYTE pbyData[24];
pbyData[5] = (BYTE)(dwData2>>8); pbyData[5] = (BYTE)(dwData2>>8);
pbyData[6] = (BYTE)(dwData2>>16); pbyData[6] = (BYTE)(dwData2>>16);
pbyData[7] = (BYTE)(dwData2>>24); pbyData[7] = (BYTE)(dwData2>>24);
for(ii=8;ii<24;ii++) for (ii = 8; ii < 24; ii++)
pbyData[ii] = *pbyKey++; pbyData[ii] = *pbyKey++;
CONTROLnsRequestOut(pDevice, CONTROLnsRequestOut(pDevice,
MESSAGE_TYPE_SETKEY, MESSAGE_TYPE_SETKEY,
......
...@@ -407,8 +407,8 @@ static BOOL device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType) ...@@ -407,8 +407,8 @@ static BOOL device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
sInitCmd.byInitClass = (BYTE)InitType; sInitCmd.byInitClass = (BYTE)InitType;
sInitCmd.bExistSWNetAddr = (BYTE) pDevice->bExistSWNetAddr; sInitCmd.bExistSWNetAddr = (BYTE) pDevice->bExistSWNetAddr;
for(ii=0;ii<6;ii++) for (ii = 0; ii < 6; ii++)
sInitCmd.bySWNetAddr[ii] = pDevice->abyCurrentNetAddr[ii]; sInitCmd.bySWNetAddr[ii] = pDevice->abyCurrentNetAddr[ii];
sInitCmd.byShortRetryLimit = pDevice->byShortRetryLimit; sInitCmd.byShortRetryLimit = pDevice->byShortRetryLimit;
sInitCmd.byLongRetryLimit = pDevice->byLongRetryLimit; sInitCmd.byLongRetryLimit = pDevice->byLongRetryLimit;
...@@ -487,10 +487,10 @@ static BOOL device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType) ...@@ -487,10 +487,10 @@ static BOOL device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
if(((pDevice->abyEEPROM[EEP_OFS_ZONETYPE] == ZoneType_Japan) || if(((pDevice->abyEEPROM[EEP_OFS_ZONETYPE] == ZoneType_Japan) ||
(pDevice->abyEEPROM[EEP_OFS_ZONETYPE] == ZoneType_Europe))&& (pDevice->abyEEPROM[EEP_OFS_ZONETYPE] == ZoneType_Europe))&&
(pDevice->byOriginalZonetype == ZoneType_USA)) { (pDevice->byOriginalZonetype == ZoneType_USA)) {
for(ii=11;ii<14;ii++) { for (ii = 11; ii < 14; ii++) {
pDevice->abyCCKPwrTbl[ii] = pDevice->abyCCKPwrTbl[10]; pDevice->abyCCKPwrTbl[ii] = pDevice->abyCCKPwrTbl[10];
pDevice->abyOFDMPwrTbl[ii] = pDevice->abyOFDMPwrTbl[10]; pDevice->abyOFDMPwrTbl[ii] = pDevice->abyOFDMPwrTbl[10];
} }
} }
//{{ RobertYu: 20041124 //{{ RobertYu: 20041124
...@@ -1234,10 +1234,10 @@ device_release_WPADEV(pDevice); ...@@ -1234,10 +1234,10 @@ device_release_WPADEV(pDevice);
pMgmt->bShareKeyAlgorithm = FALSE; pMgmt->bShareKeyAlgorithm = FALSE;
pDevice->bEncryptionEnable = FALSE; pDevice->bEncryptionEnable = FALSE;
pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
for(uu=0;uu<MAX_KEY_TABLE;uu++) for (uu = 0; uu < MAX_KEY_TABLE; uu++)
MACvDisableKeyEntry(pDevice,uu); MACvDisableKeyEntry(pDevice,uu);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
if ((pDevice->flags & DEVICE_FLAGS_UNPLUG) == FALSE) { if ((pDevice->flags & DEVICE_FLAGS_UNPLUG) == FALSE) {
MACbShutdown(pDevice); MACbShutdown(pDevice);
...@@ -1447,12 +1447,12 @@ static int Config_FileGetParameter(unsigned char *string, ...@@ -1447,12 +1447,12 @@ static int Config_FileGetParameter(unsigned char *string,
return FALSE; return FALSE;
//check if current config line is marked by "#" ?? //check if current config line is marked by "#" ??
for(ii=1;;ii++) { for (ii = 1; ; ii++) {
if(memcmp(start_p-ii,"\n",1)==0) if (memcmp(start_p - ii, "\n", 1) == 0)
break; break;
if(memcmp(start_p-ii,"#",1)==0) if (memcmp(start_p - ii, "#", 1) == 0)
return FALSE; return FALSE;
} }
//find target string end point //find target string end point
end_p = kstrstr(start_p,"\n"); end_p = kstrstr(start_p,"\n");
......
...@@ -74,7 +74,7 @@ static DWORD s_dwGetUINT32 (BYTE * p) ...@@ -74,7 +74,7 @@ static DWORD s_dwGetUINT32 (BYTE * p)
{ {
DWORD res = 0; DWORD res = 0;
unsigned int i; unsigned int i;
for(i=0; i<4; i++ ) for (i = 0; i < 4; i++)
res |= (*p++) << (8*i); res |= (*p++) << (8*i);
return res; return res;
} }
...@@ -83,7 +83,7 @@ static void s_vPutUINT32(BYTE *p, DWORD val) ...@@ -83,7 +83,7 @@ static void s_vPutUINT32(BYTE *p, DWORD val)
// Convert from DWORD to BYTE[] in a portable way // Convert from DWORD to BYTE[] in a portable way
{ {
unsigned int i; unsigned int i;
for(i=0; i<4; i++ ) { for (i = 0; i < 4; i++) {
*p++ = (BYTE) (val & 0xff); *p++ = (BYTE) (val & 0xff);
val >>= 8; val >>= 8;
} }
......
...@@ -111,22 +111,21 @@ BOOL WCTLbIsDuplicate (PSCache pCache, PS802_11Header pMACHeader) ...@@ -111,22 +111,21 @@ BOOL WCTLbIsDuplicate (PSCache pCache, PS802_11Header pMACHeader)
* Return Value: index number in Defragment Database * Return Value: index number in Defragment Database
* *
*/ */
unsigned int WCTLuSearchDFCB(PSDevice pDevice, PS802_11Header pMACHeader) 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 == TRUE) &&
(IS_ETH_ADDRESS_EQUAL (&(pDevice->sRxDFCB[ii].abyAddr2[0]), &(pMACHeader->abyAddr2[0]))) (IS_ETH_ADDRESS_EQUAL(&(pDevice->sRxDFCB[ii].abyAddr2[0]),
) { &(pMACHeader->abyAddr2[0])))) {
// return ii;
return(ii); }
} }
} return pDevice->cbDFCB;
return(pDevice->cbDFCB);
} }
/* /*
* Description: * Description:
* Insert received fragment packet in Defragment Database * Insert received fragment packet in Defragment Database
...@@ -147,7 +146,7 @@ unsigned int WCTLuInsertDFCB(PSDevice pDevice, PS802_11Header pMACHeader) ...@@ -147,7 +146,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 == FALSE) {
pDevice->cbFreeDFCB--; pDevice->cbFreeDFCB--;
pDevice->sRxDFCB[ii].uLifetime = pDevice->dwMaxReceiveLifetime; pDevice->sRxDFCB[ii].uLifetime = pDevice->dwMaxReceiveLifetime;
......
...@@ -353,9 +353,9 @@ void vMgrObjectInit(void *hDeviceContext) ...@@ -353,9 +353,9 @@ void vMgrObjectInit(void *hDeviceContext)
pMgmt->pbyPSPacketPool = &pMgmt->byPSPacketPool[0]; pMgmt->pbyPSPacketPool = &pMgmt->byPSPacketPool[0];
pMgmt->pbyMgmtPacketPool = &pMgmt->byMgmtPacketPool[0]; pMgmt->pbyMgmtPacketPool = &pMgmt->byMgmtPacketPool[0];
pMgmt->uCurrChannel = pDevice->uChannel; pMgmt->uCurrChannel = pDevice->uChannel;
for(ii=0;ii<WLAN_BSSID_LEN;ii++) { for (ii = 0; ii < WLAN_BSSID_LEN; ii++)
pMgmt->abyDesireBSSID[ii] = 0xFF; pMgmt->abyDesireBSSID[ii] = 0xFF;
}
pMgmt->sAssocInfo.AssocInfo.Length = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION); pMgmt->sAssocInfo.AssocInfo.Length = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
//memset(pMgmt->abyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN +1); //memset(pMgmt->abyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN +1);
pMgmt->byCSSPK = KEY_CTL_NONE; pMgmt->byCSSPK = KEY_CTL_NONE;
...@@ -4795,21 +4795,21 @@ s_bCipherMatch ( ...@@ -4795,21 +4795,21 @@ s_bCipherMatch (
byMulticastCipher = KEY_CTL_INVALID; byMulticastCipher = KEY_CTL_INVALID;
} }
// check Pairwise Key Cipher /* check Pairwise Key Cipher */
for(i=0;i<pBSSNode->wCSSPKCount;i++) { for (i = 0; i < pBSSNode->wCSSPKCount; i++) {
if ((pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_WEP40) || if ((pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_WEP40) ||
(pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_WEP104)) { (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_WEP104)) {
// this should not happen as defined 802.11i /* this should not happen as defined 802.11i */
byCipherMask |= 0x01; byCipherMask |= 0x01;
} else if (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_TKIP) { } else if (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_TKIP) {
byCipherMask |= 0x02; byCipherMask |= 0x02;
} else if (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_CCMP) { } else if (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_CCMP) {
byCipherMask |= 0x04; byCipherMask |= 0x04;
} else if (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_USE_GROUP) { } else if (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_USE_GROUP) {
// use group key only ignore all others /* use group key only ignore all others */
byCipherMask = 0; byCipherMask = 0;
i = pBSSNode->wCSSPKCount; i = pBSSNode->wCSSPKCount;
} }
} }
} else if ((WLAN_GET_CAP_INFO_PRIVACY(pBSSNode->wCapInfo) != 0) && } else if ((WLAN_GET_CAP_INFO_PRIVACY(pBSSNode->wCapInfo) != 0) &&
...@@ -4828,17 +4828,17 @@ s_bCipherMatch ( ...@@ -4828,17 +4828,17 @@ s_bCipherMatch (
byMulticastCipher = KEY_CTL_INVALID; byMulticastCipher = KEY_CTL_INVALID;
} }
// check Pairwise Key Cipher /* check Pairwise Key Cipher */
for(i=0;i<pBSSNode->wPKCount;i++) { for (i = 0; i < pBSSNode->wPKCount; i++) {
if (pBSSNode->abyPKType[i] == WPA_TKIP) { if (pBSSNode->abyPKType[i] == WPA_TKIP) {
byCipherMask |= 0x02; byCipherMask |= 0x02;
} else if (pBSSNode->abyPKType[i] == WPA_AESCCMP) { } else if (pBSSNode->abyPKType[i] == WPA_AESCCMP) {
byCipherMask |= 0x04; byCipherMask |= 0x04;
} else if (pBSSNode->abyPKType[i] == WPA_NONE) { } else if (pBSSNode->abyPKType[i] == WPA_NONE) {
// use group key only ignore all others /* use group key only ignore all others */
byCipherMask = 0; byCipherMask = 0;
i = pBSSNode->wPKCount; i = pBSSNode->wPKCount;
} }
} }
} }
......
...@@ -148,7 +148,8 @@ WPA_ParseRSN ( ...@@ -148,7 +148,8 @@ WPA_ParseRSN (
{ {
j = 0; j = 0;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wPKCount: %d, sizeof(pBSSList->abyPKType): %zu\n", pRSN->wPKCount, sizeof(pBSSList->abyPKType)); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wPKCount: %d, sizeof(pBSSList->abyPKType): %zu\n", pRSN->wPKCount, sizeof(pBSSList->abyPKType));
for(i = 0; (i < pRSN->wPKCount) && (j < sizeof(pBSSList->abyPKType)/sizeof(BYTE)); i++) { for (i = 0; (i < pRSN->wPKCount) &&
(j < sizeof(pBSSList->abyPKType)/sizeof(BYTE)); i++) {
if(pRSN->len >= 12+i*4+4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*i) if(pRSN->len >= 12+i*4+4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*i)
if ( !memcmp(pRSN->PKSList[i].abyOUI, abyOUI00, 4)) if ( !memcmp(pRSN->PKSList[i].abyOUI, abyOUI00, 4))
pBSSList->abyPKType[j++] = WPA_NONE; pBSSList->abyPKType[j++] = WPA_NONE;
...@@ -180,7 +181,8 @@ WPA_ParseRSN ( ...@@ -180,7 +181,8 @@ WPA_ParseRSN (
j = 0; j = 0;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wAuthCount: %d, sizeof(pBSSList->abyAuthType): %zu\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wAuthCount: %d, sizeof(pBSSList->abyAuthType): %zu\n",
pIE_RSN_Auth->wAuthCount, sizeof(pBSSList->abyAuthType)); pIE_RSN_Auth->wAuthCount, sizeof(pBSSList->abyAuthType));
for(i = 0; (i < pIE_RSN_Auth->wAuthCount) && (j < sizeof(pBSSList->abyAuthType)/sizeof(BYTE)); i++) { for (i = 0; (i < pIE_RSN_Auth->wAuthCount) &&
(j < sizeof(pBSSList->abyAuthType)/sizeof(BYTE)); i++) {
if(pRSN->len >= 14+4+(m+i)*4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*m)+AKC(2)+AKS(4*i) if(pRSN->len >= 14+4+(m+i)*4) { //oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*m)+AKC(2)+AKS(4*i)
if ( !memcmp(pIE_RSN_Auth->AuthKSList[i].abyOUI, abyOUI01, 4)) if ( !memcmp(pIE_RSN_Auth->AuthKSList[i].abyOUI, abyOUI01, 4))
pBSSList->abyAuthType[j++] = WPA_AUTH_IEEE802_1X; pBSSList->abyAuthType[j++] = WPA_AUTH_IEEE802_1X;
......
...@@ -186,7 +186,6 @@ int wpa_set_wpadev(PSDevice pDevice, int val) ...@@ -186,7 +186,6 @@ int wpa_set_wpadev(PSDevice pDevice, int val)
return wpa_release_wpadev(pDevice); return wpa_release_wpadev(pDevice);
} }
/* /*
* Description: * Description:
* Set WPA algorithm & keys * Set WPA algorithm & keys
...@@ -647,9 +646,9 @@ static int wpa_get_scan(PSDevice pDevice, ...@@ -647,9 +646,9 @@ static int wpa_get_scan(PSDevice pDevice,
for (ii = 0; ii < MAX_BSS_NUM; ii++) { for (ii = 0; ii < MAX_BSS_NUM; ii++) {
for(jj=0;jj<MAX_BSS_NUM-ii-1;jj++) { for (jj = 0; jj < MAX_BSS_NUM - ii - 1; jj++) {
if((pMgmt->sBSSList[jj].bActive!=TRUE) || if ((pMgmt->sBSSList[jj].bActive != TRUE) ||
((pMgmt->sBSSList[jj].uRSSI>pMgmt->sBSSList[jj+1].uRSSI) &&(pMgmt->sBSSList[jj+1].bActive!=FALSE))) { ((pMgmt->sBSSList[jj].uRSSI>pMgmt->sBSSList[jj+1].uRSSI) &&(pMgmt->sBSSList[jj+1].bActive!=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