Staging: vt6656: code cleanup, fixed 'for' statements
authorAndres More <more.andres@gmail.com>
Thu, 20 May 2010 02:50:00 +0000 (23:50 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Jun 2010 17:34:59 +0000 (10:34 -0700)
Resolved checkpatch findings, but some long lines warnings.
ERROR: space required before the open parenthesis '('
ERROR: spaces required around that

Signed-off-by: Andres More <more.andres@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
15 files changed:
drivers/staging/vt6656/bssdb.c
drivers/staging/vt6656/card.c
drivers/staging/vt6656/channel.c
drivers/staging/vt6656/datarate.c
drivers/staging/vt6656/dpc.c
drivers/staging/vt6656/ioctl.c
drivers/staging/vt6656/iwctl.c
drivers/staging/vt6656/key.c
drivers/staging/vt6656/mac.c
drivers/staging/vt6656/main_usb.c
drivers/staging/vt6656/michael.c
drivers/staging/vt6656/wctl.c
drivers/staging/vt6656/wmgr.c
drivers/staging/vt6656/wpa.c
drivers/staging/vt6656/wpactl.c

index 36ed61b595ca3287b8a28db2e1a15fb459877d1a..8d4b6633b96b1f00b174e4c995082ab947e4af5c 100644 (file)
@@ -699,12 +699,14 @@ BOOL BSSbUpdateToBSSList(void *hDeviceContext,
         pBSSList->byRSSIStatCnt %= RSSI_STAT_COUNT;
         pBSSList->ldBmAverage[pBSSList->byRSSIStatCnt] = ldBm;
         ldBmSum = 0;
-        for(ii=0, jj=0;ii<RSSI_STAT_COUNT;ii++) {
-            if (pBSSList->ldBmAverage[ii] != 0) {
-                pBSSList->ldBmMAX = max(pBSSList->ldBmAverage[ii], ldBm);
-                ldBmSum += pBSSList->ldBmAverage[ii];
-                jj++;
-            }
+       for (ii = 0, jj = 0; ii < RSSI_STAT_COUNT; ii++) {
+               if (pBSSList->ldBmAverage[ii] != 0) {
+                       pBSSList->ldBmMAX =
+                               max(pBSSList->ldBmAverage[ii], ldBm);
+                       ldBmSum +=
+                               pBSSList->ldBmAverage[ii];
+                       jj++;
+               }
         }
         pBSSList->ldBmAverRange = ldBmSum /jj;
     }
@@ -1422,21 +1424,25 @@ void BSSvUpdateNodeTxCounter(void *hDeviceContext,
                      (wRate < RATE_18M) ) {
                     pMgmt->sNodeDBTable[0].uTxFail[wRate]+=byTxRetry;
                 } else if (byFallBack == AUTO_FB_0) {
-                    for(ii=0;ii<byTxRetry;ii++) {
-                        if (ii < 5)
-                            wFallBackRate = awHWRetry0[wRate-RATE_18M][ii];
-                        else
-                            wFallBackRate = awHWRetry0[wRate-RATE_18M][4];
-                        pMgmt->sNodeDBTable[0].uTxFail[wFallBackRate]++;
-                    }
+                       for (ii = 0; ii < byTxRetry; ii++) {
+                               if (ii < 5)
+                                       wFallBackRate =
+                                               awHWRetry0[wRate-RATE_18M][ii];
+                               else
+                                       wFallBackRate =
+                                               awHWRetry0[wRate-RATE_18M][4];
+                               pMgmt->sNodeDBTable[0].uTxFail[wFallBackRate]++;
+                       }
                 } else if (byFallBack == AUTO_FB_1) {
-                    for(ii=0;ii<byTxRetry;ii++) {
-                        if (ii < 5)
-                            wFallBackRate = awHWRetry1[wRate-RATE_18M][ii];
-                        else
-                            wFallBackRate = awHWRetry1[wRate-RATE_18M][4];
-                        pMgmt->sNodeDBTable[0].uTxFail[wFallBackRate]++;
-                    }
+                       for (ii = 0; ii < byTxRetry; ii++) {
+                               if (ii < 5)
+                                       wFallBackRate =
+                                               awHWRetry1[wRate-RATE_18M][ii];
+                               else
+                                       wFallBackRate =
+                                               awHWRetry1[wRate-RATE_18M][4];
+                               pMgmt->sNodeDBTable[0].uTxFail[wFallBackRate]++;
+                       }
                 }
             }
         };
@@ -1476,21 +1482,23 @@ void BSSvUpdateNodeTxCounter(void *hDeviceContext,
                          (wRate < RATE_18M) ) {
                         pMgmt->sNodeDBTable[uNodeIndex].uTxFail[wRate]+=byTxRetry;
                     } else if (byFallBack == AUTO_FB_0) {
-                        for(ii=0;ii<byTxRetry;ii++) {
-                            if (ii < 5)
-                                wFallBackRate = awHWRetry0[wRate-RATE_18M][ii];
-                            else
-                                wFallBackRate = awHWRetry0[wRate-RATE_18M][4];
-                            pMgmt->sNodeDBTable[uNodeIndex].uTxFail[wFallBackRate]++;
+                       for (ii = 0; ii < byTxRetry; ii++) {
+                               if (ii < 5)
+                                       wFallBackRate =
+                                               awHWRetry0[wRate-RATE_18M][ii];
+                               else
+                                       wFallBackRate =
+                                               awHWRetry0[wRate-RATE_18M][4];
+                               pMgmt->sNodeDBTable[uNodeIndex].uTxFail[wFallBackRate]++;
                         }
                     } else if (byFallBack == AUTO_FB_1) {
-                        for(ii=0;ii<byTxRetry;ii++) {
-                            if (ii < 5)
+                     for (ii = 0; ii < byTxRetry; ii++) {
+                       if (ii < 5)
                                 wFallBackRate = awHWRetry1[wRate-RATE_18M][ii];
-                            else
+                       else
                                 wFallBackRate = awHWRetry1[wRate-RATE_18M][4];
-                            pMgmt->sNodeDBTable[uNodeIndex].uTxFail[wFallBackRate]++;
-                        }
+                       pMgmt->sNodeDBTable[uNodeIndex].uTxFail[wFallBackRate]++;
+                     }
                     }
                 }
             };
index fe4ec913ffea9e97dedc2c9960cc5e77a754f265..35bf4fda330d086370e389ea6b920390be96386b 100644 (file)
@@ -457,12 +457,11 @@ void CARDvSetRSPINF(void *pDeviceHandler, BYTE byBBType)
     abyData[14] = abySignal[3];
     abyData[15] = abyServ[3];
 
-    for(i=0;i<9;i++) {
-        abyData[16+i*2] = abyTxRate[i];
-        abyData[16+i*2+1] = abyRsvTime[i];
+    for (i = 0; i < 9; i++) {
+       abyData[16+i*2] = abyTxRate[i];
+       abyData[16+i*2+1] = abyRsvTime[i];
     }
 
-
     CONTROLnsRequestOut(pDevice,
                         MESSAGE_TYPE_WRITE,
                         MAC_REG_RSPINF_B_1,
index f49b6e1333945ff3bd89151faebe0fee47ba0b70..6ad03e492edb6ed62300c958f249f1887ebee4a3 100644 (file)
@@ -441,11 +441,10 @@ void CHvInitChannelTable(void *pDeviceHandler)
 {
     PSDevice    pDevice = (PSDevice) pDeviceHandler;
     BOOL        bMultiBand = FALSE;
-    unsigned int        ii;
+    unsigned int ii;
 
-    for(ii=1;ii<=CB_MAX_CHANNEL;ii++) {
-        sChannelTbl[ii].bValid = FALSE;
-    }
+    for (ii = 1; ii <= CB_MAX_CHANNEL; ii++)
+       sChannelTbl[ii].bValid = FALSE;
 
     switch (pDevice->byRFType) {
         case RF_AL2230:
@@ -464,43 +463,43 @@ void CHvInitChannelTable(void *pDeviceHandler)
     if ((pDevice->dwDiagRefCount != 0) ||
         (pDevice->b11hEable == TRUE)) {
         if (bMultiBand == TRUE) {
-            for(ii=0;ii<CB_MAX_CHANNEL;ii++) {
-                sChannelTbl[ii+1].bValid = TRUE;
+               for (ii = 0; ii < CB_MAX_CHANNEL; ii++) {
+                       sChannelTbl[ii+1].bValid = TRUE;
                 //pDevice->abyRegPwr[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->abyLocalPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1];
-            }
+               }
         } else {
-            for(ii=0;ii<CB_MAX_CHANNEL_24G;ii++) {
-                sChannelTbl[ii+1].bValid = TRUE;
+               for (ii = 0; ii < CB_MAX_CHANNEL_24G; ii++) {
+                       sChannelTbl[ii+1].bValid = TRUE;
                 //pDevice->abyRegPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1];
                 //pDevice->abyLocalPwr[ii+1] = pDevice->abyCCKDefaultPwr[ii+1];
-            }
+               }
         }
     } else if (pDevice->byZoneType <= CCODE_MAX) {
         if (bMultiBand == TRUE) {
-            for(ii=0;ii<CB_MAX_CHANNEL;ii++) {
-                if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) {
-                    sChannelTbl[ii+1].bValid = TRUE;
+               for (ii = 0; ii < CB_MAX_CHANNEL; ii++) {
+                       if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) {
+                               sChannelTbl[ii+1].bValid = TRUE;
                     //pDevice->abyRegPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii];
                     //pDevice->abyLocalPwr[ii+1] = ChannelRuleTab[pDevice->byZoneType].byPower[ii];
-                }
-            }
+                       }
+               }
         } else {
-            for(ii=0;ii<CB_MAX_CHANNEL_24G;ii++) {
-                if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) {
-                    sChannelTbl[ii+1].bValid = TRUE;
+               for (ii = 0; ii < CB_MAX_CHANNEL_24G; ii++) {
+                       if (ChannelRuleTab[pDevice->byZoneType].bChannelIdxList[ii] != 0) {
+                               sChannelTbl[ii+1].bValid = TRUE;
                     //pDevice->abyRegPwr[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]);
-    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);
         /*if (pDevice->abyRegPwr[ii+1] == 0) {
             pDevice->abyRegPwr[ii+1] = pDevice->abyOFDMDefaultPwr[ii+1];
index 2e183ddbfd0e92123884676389a49eb29d6a2966..51dc540da2fb6480140809291b8dbb334cf50580 100644 (file)
@@ -72,7 +72,7 @@ void s_vResetCounter(PKnownNodeDB psNodeDBTable)
     BYTE            ii;
 
     // 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->uTxFail[ii] = 0;
     }
@@ -337,7 +337,7 @@ DWORD           dwTxDiff = 0;
         psNodeDBTable->uTimeCount = 0;
     }
 
-    for(ii=0;ii<MAX_RATE;ii++) {
+    for (ii = 0; ii < MAX_RATE; ii++) {
         if (psNodeDBTable->wSuppRate & (0x0001<<ii)) {
             if (bAutoRate[ii] == TRUE) {
                 wIdxUpRate = (WORD) ii;
@@ -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) ||
              (psNodeDBTable->uTxFail[ii] != 0) ) {
             dwThroughputTbl[ii] *= psNodeDBTable->uTxOk[ii];
@@ -362,7 +362,7 @@ DWORD           dwTxDiff = 0;
     dwThroughput = dwThroughputTbl[psNodeDBTable->wTxDataRate];
 
     wIdxDownRate = psNodeDBTable->wTxDataRate;
-    for(ii = psNodeDBTable->wTxDataRate; ii > 0;) {
+    for (ii = psNodeDBTable->wTxDataRate; ii > 0;) {
         ii--;
         if ( (dwThroughputTbl[ii] > dwThroughput) &&
              (bAutoRate[ii]==TRUE) ) {
@@ -400,7 +400,7 @@ long  ldBm;
         return;
     }
 
-    for(ii=0;ii<MAX_RATE;ii++) {
+    for (ii = 0; ii < MAX_RATE; ii++) {
         if (psNodeDBTable->wSuppRate & (0x0001<<ii)) {
             if (bAutoRate[ii] == TRUE) {
                 wIdxUpRate = (WORD) ii;
index 9afe76cacef58d0f93e6a8047e48d04ecf7281b9..dd4648d1de9ac776f8101e0f384fc9dd7633326d 100644 (file)
@@ -758,10 +758,11 @@ RXbBulkInProcessData (
         pMgmt->pCurrBSS->byRSSIStatCnt++;
         pMgmt->pCurrBSS->byRSSIStatCnt %= RSSI_STAT_COUNT;
         pMgmt->pCurrBSS->ldBmAverage[pMgmt->pCurrBSS->byRSSIStatCnt] = ldBm;
-        for(ii=0;ii<RSSI_STAT_COUNT;ii++) {
-            if (pMgmt->pCurrBSS->ldBmAverage[ii] != 0) {
-            pMgmt->pCurrBSS->ldBmMAX = max(pMgmt->pCurrBSS->ldBmAverage[ii], ldBm);
-            }
+       for (ii = 0; ii < RSSI_STAT_COUNT; ii++) {
+               if (pMgmt->pCurrBSS->ldBmAverage[ii] != 0) {
+                       pMgmt->pCurrBSS->ldBmMAX =
+                               max(pMgmt->pCurrBSS->ldBmAverage[ii], ldBm);
+               }
         }
     }
 */
index 19a84b66b0975d5631ef108139efdae343267b2d..7c32125fbd514c764ba5c3bb88a38c8a996a94b2 100644 (file)
@@ -232,10 +232,10 @@ int private_ioctl(PSDevice pDevice, struct ifreq *rq) {
             pDevice->bEncryptionEnable = FALSE;
             pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
             spin_lock_irq(&pDevice->lock);
-            for(uu=0;uu<MAX_KEY_TABLE;uu++)
-                MACvDisableKeyEntry(pDevice,uu);
+           for (uu = 0; uu < MAX_KEY_TABLE; uu++)
+               MACvDisableKeyEntry(pDevice, uu);
             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;
         }
 
index fa40522d4a9aaa14207aff1983f9bf2107c939bc..8f28dbb8de530bf3f995a10ee15e5d4949868086 100644 (file)
@@ -653,7 +653,7 @@ int iwctl_giwrange(struct net_device *dev,
                // Should be based on cap_rid.country to give only
                //  what the current card support
                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].m = frequency_list[i] * 100000;
                        range->freq[k++].e = 1; // Values in table in MHz -> * 10^5 * 10
@@ -669,7 +669,7 @@ int iwctl_giwrange(struct net_device *dev,
                range->max_qual.noise = 0;
                range->sensitivity = 255;
 
-               for(i = 0 ; i < 13 ; i++) {
+               for (i = 0 ; i < 13 ; i++) {
                        range->bitrate[i] = abySupportedRates[i] * 500000;
                        if(range->bitrate[i] == 0)
                                break;
@@ -1057,7 +1057,7 @@ int iwctl_siwrate(struct net_device *dev,
                u8      normvalue = (u8) (wrq->value/500000);
 
                // Check if rate is valid
-               for(i = 0 ; i < 13 ; i++) {
+               for (i = 0 ; i < 13 ; i++) {
                        if(normvalue == abySupportedRates[i]) {
                                brate = i;
                                break;
@@ -1067,7 +1067,7 @@ int iwctl_siwrate(struct net_device *dev,
        // -1 designed the max rate (mostly auto mode)
        if(wrq->value == -1) {
                // Get the highest available rate
-               for(i = 0 ; i < 13 ; i++) {
+               for (i = 0 ; i < 13 ; i++) {
                        if(abySupportedRates[i] == 0)
                                break;
                }
@@ -1405,8 +1405,8 @@ int iwctl_siwencode(struct net_device *dev,
         pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
         if (pDevice->flags & DEVICE_FLAGS_OPENED) {
             spin_lock_irq(&pDevice->lock);
-            for(uu=0;uu<MAX_KEY_TABLE;uu++)
-                MACvDisableKeyEntry(pDevice,uu);
+           for (uu = 0; uu < MAX_KEY_TABLE; uu++)
+               MACvDisableKeyEntry(pDevice, uu);
             spin_unlock_irq(&pDevice->lock);
         }
        }
@@ -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_len =%d\n",param->u.wpa_key.key_len);
 printk("param->u.wpa_key.key =");
-for(ii=0;ii<param->u.wpa_key.key_len;ii++)
-       printk("%02x:",param->u.wpa_key.key[ii]);
-         printk("\n");
+for (ii = 0; ii < param->u.wpa_key.key_len; ii++)
+       printk(KERN_DEBUG "%02x:", param->u.wpa_key.key[ii]);
+printk("\n");
 printk("param->u.wpa_key.seq_len =%d\n",param->u.wpa_key.seq_len);
 printk("param->u.wpa_key.seq =");
-for(ii=0;ii<param->u.wpa_key.seq_len;ii++)
-       printk("%02x:",param->u.wpa_key.seq[ii]);
-         printk("\n");
+for (ii = 0; ii < param->u.wpa_key.seq_len; ii++)
+       printk(KERN_DEBUG "%02x:", param->u.wpa_key.seq[ii]);
+printk("\n");
 
 printk("...........\n");
 #endif
index b0890c181e7dcb9d235f8e94ba48a55f680bb852..6a77ce35e708c91c6a4f95651c841384a895098d 100644 (file)
@@ -485,9 +485,9 @@ BOOL KeybRemoveAllKey(
         if ((pTable->KeyTable[i].bInUse == TRUE) &&
             IS_ETH_ADDRESS_EQUAL(pTable->KeyTable[i].abyBSSID,pbyBSSID)) {
             pTable->KeyTable[i].PairwiseKey.bKeyValid = FALSE;
-            for(u=0;u<MAX_GROUP_KEY;u++) {
-                pTable->KeyTable[i].GroupKey[u].bKeyValid = FALSE;
-            }
+           for (u = 0; u < MAX_GROUP_KEY; u++)
+               pTable->KeyTable[i].GroupKey[u].bKeyValid = FALSE;
+
             pTable->KeyTable[i].dwGTKeyIndex = 0;
             s_vCheckKeyTableValid(pDevice, pTable);
             return (TRUE);
@@ -531,19 +531,13 @@ void KeyvRemoveWEPKey(
     return;
 }
 
-void KeyvRemoveAllWEPKey(
-    void *pDeviceHandler,
-    PSKeyManagement pTable
-    )
+void KeyvRemoveAllWEPKey(void *pDeviceHandler, PSKeyManagement pTable)
 {
-    PSDevice    pDevice = (PSDevice) pDeviceHandler;
-
-    int i;
-
-    for(i=0;i<MAX_GROUP_KEY;i++) {
-        KeyvRemoveWEPKey(pDevice,pTable, i);
-    }
+       PSDevice pDevice = (PSDevice) pDeviceHandler;
+       int i;
 
+       for (i = 0; i < MAX_GROUP_KEY; i++)
+               KeyvRemoveWEPKey(pDevice, pTable, i);
 }
 
 /*
index 0ab3db025f33322edd3204ace770609d4879635c..33698edde4fb443562fe3bb887580a8b5735c01c 100644 (file)
@@ -306,8 +306,8 @@ BYTE            pbyData[24];
     pbyData[5] = (BYTE)(dwData2>>8);
     pbyData[6] = (BYTE)(dwData2>>16);
     pbyData[7] = (BYTE)(dwData2>>24);
-    for(ii=8;ii<24;ii++)
-        pbyData[ii] = *pbyKey++;
+    for (ii = 8; ii < 24; ii++)
+       pbyData[ii] = *pbyKey++;
 
     CONTROLnsRequestOut(pDevice,
                         MESSAGE_TYPE_SETKEY,
index 098b0455e3255c6029d1092c0a77172902210b46..804047d4a44853946dc80b0c340bbe4959176549 100644 (file)
@@ -407,8 +407,8 @@ static BOOL device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
 
     sInitCmd.byInitClass = (BYTE)InitType;
     sInitCmd.bExistSWNetAddr = (BYTE) pDevice->bExistSWNetAddr;
-    for(ii=0;ii<6;ii++)
-        sInitCmd.bySWNetAddr[ii] = pDevice->abyCurrentNetAddr[ii];
+    for (ii = 0; ii < 6; ii++)
+       sInitCmd.bySWNetAddr[ii] = pDevice->abyCurrentNetAddr[ii];
     sInitCmd.byShortRetryLimit = pDevice->byShortRetryLimit;
     sInitCmd.byLongRetryLimit = pDevice->byLongRetryLimit;
 
@@ -487,10 +487,10 @@ static BOOL device_init_registers(PSDevice pDevice, DEVICE_INIT_TYPE InitType)
           if(((pDevice->abyEEPROM[EEP_OFS_ZONETYPE] == ZoneType_Japan) ||
                (pDevice->abyEEPROM[EEP_OFS_ZONETYPE] == ZoneType_Europe))&&
             (pDevice->byOriginalZonetype == ZoneType_USA)) {
-           for(ii=11;ii<14;ii++) {
-                pDevice->abyCCKPwrTbl[ii] = pDevice->abyCCKPwrTbl[10];
-              pDevice->abyOFDMPwrTbl[ii] = pDevice->abyOFDMPwrTbl[10];
-           }
+               for (ii = 11; ii < 14; ii++) {
+                       pDevice->abyCCKPwrTbl[ii] = pDevice->abyCCKPwrTbl[10];
+                       pDevice->abyOFDMPwrTbl[ii] = pDevice->abyOFDMPwrTbl[10];
+               }
          }
 
         //{{ RobertYu: 20041124
@@ -1234,10 +1234,10 @@ device_release_WPADEV(pDevice);
         pMgmt->bShareKeyAlgorithm = FALSE;
         pDevice->bEncryptionEnable = FALSE;
         pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
-            spin_lock_irq(&pDevice->lock);
-            for(uu=0;uu<MAX_KEY_TABLE;uu++)
+       spin_lock_irq(&pDevice->lock);
+       for (uu = 0; uu < MAX_KEY_TABLE; uu++)
                 MACvDisableKeyEntry(pDevice,uu);
-            spin_unlock_irq(&pDevice->lock);
+       spin_unlock_irq(&pDevice->lock);
 
     if ((pDevice->flags & DEVICE_FLAGS_UNPLUG) == FALSE) {
         MACbShutdown(pDevice);
@@ -1447,12 +1447,12 @@ static int Config_FileGetParameter(unsigned char *string,
        return FALSE;
 
 //check if current config line is marked by "#" ??
-for(ii=1;;ii++) {
-  if(memcmp(start_p-ii,"\n",1)==0)
-      break;
-  if(memcmp(start_p-ii,"#",1)==0)
-      return FALSE;
-}
+    for (ii = 1; ; ii++) {
+       if (memcmp(start_p - ii, "\n", 1) == 0)
+               break;
+       if (memcmp(start_p - ii, "#", 1) == 0)
+               return FALSE;
+    }
 
 //find target string end point
      end_p = kstrstr(start_p,"\n");
index 671a8cf33e23e38df2f3575c1a1efec112810520..4d419814f27f63c60cf386b442ad988b14de0ff1 100644 (file)
@@ -74,7 +74,7 @@ static DWORD s_dwGetUINT32 (BYTE * p)
 {
        DWORD res = 0;
        unsigned int i;
-       for(i=0; i<4; i++ )
+       for (i = 0; i < 4; i++)
                res |= (*p++) << (8*i);
        return res;
 }
@@ -83,7 +83,7 @@ static void s_vPutUINT32(BYTE *p, DWORD val)
 // Convert from DWORD to BYTE[] in a portable way
 {
        unsigned int i;
-       for(i=0; i<4; i++ ) {
+       for (i = 0; i < 4; i++) {
                *p++ = (BYTE) (val & 0xff);
                val >>= 8;
        }
index 857ce0bc00a486ef4db46e22ee318e1932e17215..0a41bbe24e6c27ad269912bad5abea5e89cdb9d5 100644 (file)
@@ -111,22 +111,21 @@ BOOL WCTLbIsDuplicate (PSCache pCache, PS802_11Header pMACHeader)
  * Return Value: index number in Defragment Database
  *
  */
+
 unsigned int WCTLuSearchDFCB(PSDevice pDevice, PS802_11Header pMACHeader)
 {
        unsigned int ii;
 
-    for(ii=0;ii<pDevice->cbDFCB;ii++) {
-        if ((pDevice->sRxDFCB[ii].bInUse == TRUE) &&
-            (IS_ETH_ADDRESS_EQUAL (&(pDevice->sRxDFCB[ii].abyAddr2[0]), &(pMACHeader->abyAddr2[0])))
-            ) {
-            //
-            return(ii);
-        }
-    }
-    return(pDevice->cbDFCB);
+       for (ii = 0; ii < pDevice->cbDFCB; ii++) {
+               if ((pDevice->sRxDFCB[ii].bInUse == TRUE) &&
+                   (IS_ETH_ADDRESS_EQUAL(&(pDevice->sRxDFCB[ii].abyAddr2[0]),
+                                         &(pMACHeader->abyAddr2[0])))) {
+                       return ii;
+               }
+       }
+       return pDevice->cbDFCB;
 }
 
-
 /*
  * Description:
  *      Insert received fragment packet in Defragment Database
@@ -147,7 +146,7 @@ unsigned int WCTLuInsertDFCB(PSDevice pDevice, PS802_11Header pMACHeader)
 
     if (pDevice->cbFreeDFCB == 0)
         return(pDevice->cbDFCB);
-    for(ii=0;ii<pDevice->cbDFCB;ii++) {
+    for (ii = 0; ii < pDevice->cbDFCB; ii++) {
         if (pDevice->sRxDFCB[ii].bInUse == FALSE) {
             pDevice->cbFreeDFCB--;
             pDevice->sRxDFCB[ii].uLifetime = pDevice->dwMaxReceiveLifetime;
index 93c15f0580fe449933ea47322ab3103be0e0fafa..2bca1589ddb1fd78c10810ecd96930db2d509186 100644 (file)
@@ -353,9 +353,9 @@ void vMgrObjectInit(void *hDeviceContext)
     pMgmt->pbyPSPacketPool = &pMgmt->byPSPacketPool[0];
     pMgmt->pbyMgmtPacketPool = &pMgmt->byMgmtPacketPool[0];
     pMgmt->uCurrChannel = pDevice->uChannel;
-    for(ii=0;ii<WLAN_BSSID_LEN;ii++) {
-        pMgmt->abyDesireBSSID[ii] = 0xFF;
-    }
+    for (ii = 0; ii < WLAN_BSSID_LEN; ii++)
+       pMgmt->abyDesireBSSID[ii] = 0xFF;
+
     pMgmt->sAssocInfo.AssocInfo.Length = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
     //memset(pMgmt->abyDesireSSID, 0, WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN +1);
     pMgmt->byCSSPK = KEY_CTL_NONE;
@@ -4795,21 +4795,21 @@ s_bCipherMatch (
             byMulticastCipher = KEY_CTL_INVALID;
         }
 
-        // check Pairwise Key Cipher
-        for(i=0;i<pBSSNode->wCSSPKCount;i++) {
-            if ((pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_WEP40) ||
-                (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_WEP104)) {
-                // this should not happen as defined 802.11i
-                byCipherMask |= 0x01;
-            } else if (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_TKIP) {
-                byCipherMask |= 0x02;
-            } else if (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_CCMP) {
-                byCipherMask |= 0x04;
-            } else if (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_USE_GROUP) {
-                // use group key only ignore all others
-                byCipherMask = 0;
-                i = pBSSNode->wCSSPKCount;
-            }
+       /* check Pairwise Key Cipher */
+       for (i = 0; i < pBSSNode->wCSSPKCount; i++) {
+               if ((pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_WEP40) ||
+                   (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_WEP104)) {
+                       /* this should not happen as defined 802.11i */
+                       byCipherMask |= 0x01;
+               } else if (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_TKIP) {
+                       byCipherMask |= 0x02;
+               } else if (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_CCMP) {
+                       byCipherMask |= 0x04;
+               } else if (pBSSNode->abyCSSPK[i] == WLAN_11i_CSS_USE_GROUP) {
+                       /* use group key only ignore all others */
+                       byCipherMask = 0;
+                       i = pBSSNode->wCSSPKCount;
+               }
         }
 
     } else if ((WLAN_GET_CAP_INFO_PRIVACY(pBSSNode->wCapInfo) != 0) &&
@@ -4828,17 +4828,17 @@ s_bCipherMatch (
             byMulticastCipher = KEY_CTL_INVALID;
         }
 
-        // check Pairwise Key Cipher
-        for(i=0;i<pBSSNode->wPKCount;i++) {
-            if (pBSSNode->abyPKType[i] == WPA_TKIP) {
-                byCipherMask |= 0x02;
-            } else if (pBSSNode->abyPKType[i] == WPA_AESCCMP) {
-                byCipherMask |= 0x04;
-            } else if (pBSSNode->abyPKType[i] == WPA_NONE) {
-                // use group key only ignore all others
-                byCipherMask = 0;
-                i = pBSSNode->wPKCount;
-            }
+       /* check Pairwise Key Cipher */
+       for (i = 0; i < pBSSNode->wPKCount; i++) {
+               if (pBSSNode->abyPKType[i] == WPA_TKIP) {
+                       byCipherMask |= 0x02;
+               } else if (pBSSNode->abyPKType[i] == WPA_AESCCMP) {
+                       byCipherMask |= 0x04;
+               } else if (pBSSNode->abyPKType[i] == WPA_NONE) {
+                       /* use group key only ignore all others */
+                       byCipherMask = 0;
+                       i = pBSSNode->wPKCount;
+               }
         }
     }
 
index 1fa6c9b88ed320fd0166b4144c08772df0f9c067..f492778ee8b6e91694646bc8c0744ff0b1543532 100644 (file)
@@ -148,7 +148,8 @@ WPA_ParseRSN (
         {
             j = 0;
             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 ( !memcmp(pRSN->PKSList[i].abyOUI, abyOUI00, 4))
                         pBSSList->abyPKType[j++] = WPA_NONE;
@@ -180,7 +181,8 @@ WPA_ParseRSN (
             j = 0;
             DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"wAuthCount: %d, sizeof(pBSSList->abyAuthType): %zu\n",
                           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 ( !memcmp(pIE_RSN_Auth->AuthKSList[i].abyOUI, abyOUI01, 4))
                         pBSSList->abyAuthType[j++] = WPA_AUTH_IEEE802_1X;
index 961f583368a1825ee19f84f18996aa338b74ec72..c886722a54bc17f9ebc4230e54997891953078bc 100644 (file)
@@ -186,7 +186,6 @@ int wpa_set_wpadev(PSDevice pDevice, int val)
                return wpa_release_wpadev(pDevice);
 }
 
-
 /*
  * Description:
  *      Set WPA algorithm & keys
@@ -647,9 +646,9 @@ static int wpa_get_scan(PSDevice pDevice,
 
     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))) {