提交 f9cf92bf 编写于 作者: J Joe Perches 提交者: Greg Kroah-Hartman

staging:vt6655:wpactl: Whitespace cleanups

Neatening only.
git diff -w shows no differences.
Signed-off-by: NJoe Perches <joe@perches.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 3e28383f
...@@ -54,7 +54,7 @@ static const int frequency_list[] = { ...@@ -54,7 +54,7 @@ static const int frequency_list[] = {
/*--------------------- Static Variables --------------------------*/ /*--------------------- Static Variables --------------------------*/
//static int msglevel =MSG_LEVEL_DEBUG; //static int msglevel =MSG_LEVEL_DEBUG;
static int msglevel =MSG_LEVEL_INFO; static int msglevel = MSG_LEVEL_INFO;
/*--------------------- Static Functions --------------------------*/ /*--------------------- Static Functions --------------------------*/
...@@ -70,7 +70,7 @@ static void wpadev_setup(struct net_device *dev) ...@@ -70,7 +70,7 @@ static void wpadev_setup(struct net_device *dev)
dev->addr_len = ETH_ALEN; dev->addr_len = ETH_ALEN;
dev->tx_queue_len = 1000; dev->tx_queue_len = 1000;
memset(dev->broadcast,0xFF, ETH_ALEN); memset(dev->broadcast, 0xFF, ETH_ALEN);
dev->flags = IFF_BROADCAST|IFF_MULTICAST; dev->flags = IFF_BROADCAST|IFF_MULTICAST;
} }
...@@ -93,7 +93,7 @@ static int wpa_init_wpadev(PSDevice pDevice) ...@@ -93,7 +93,7 @@ static int wpa_init_wpadev(PSDevice pDevice)
{ {
PSDevice wpadev_priv; PSDevice wpadev_priv;
struct net_device *dev = pDevice->dev; struct net_device *dev = pDevice->dev;
int ret=0; int ret = 0;
pDevice->wpadev = alloc_netdev(sizeof(PSDevice), "vntwpa", wpadev_setup); pDevice->wpadev = alloc_netdev(sizeof(PSDevice), "vntwpa", wpadev_setup);
if (pDevice->wpadev == NULL) if (pDevice->wpadev == NULL)
...@@ -199,9 +199,9 @@ int wpa_set_wpadev(PSDevice pDevice, int val) ...@@ -199,9 +199,9 @@ int wpa_set_wpadev(PSDevice pDevice, int val)
* *
*/ */
int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel) int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
{ {
struct viawget_wpa_param *param=ctx; struct viawget_wpa_param *param = ctx;
PSMgmtObject pMgmt = pDevice->pMgmt; PSMgmtObject pMgmt = pDevice->pMgmt;
unsigned long dwKeyIndex = 0; unsigned long dwKeyIndex = 0;
unsigned char abyKey[MAX_KEY_LEN]; unsigned char abyKey[MAX_KEY_LEN];
...@@ -225,14 +225,14 @@ int wpa_set_wpadev(PSDevice pDevice, int val) ...@@ -225,14 +225,14 @@ int wpa_set_wpadev(PSDevice pDevice, int val)
pDevice->byKeyIndex = 0; pDevice->byKeyIndex = 0;
pDevice->bTransmitKey = false; pDevice->bTransmitKey = false;
KeyvRemoveAllWEPKey(&(pDevice->sKey), pDevice->PortOffset); KeyvRemoveAllWEPKey(&(pDevice->sKey), pDevice->PortOffset);
for (uu=0; uu<MAX_KEY_TABLE; uu++) { for (uu = 0; uu < MAX_KEY_TABLE; uu++) {
MACvDisableKeyEntry(pDevice->PortOffset, uu); MACvDisableKeyEntry(pDevice->PortOffset, uu);
} }
return ret; return ret;
} }
//spin_unlock_irq(&pDevice->lock); //spin_unlock_irq(&pDevice->lock);
if(param->u.wpa_key.key && fcpfkernel) { if (param->u.wpa_key.key && fcpfkernel) {
memcpy(&abyKey[0], param->u.wpa_key.key, param->u.wpa_key.key_len); memcpy(&abyKey[0], param->u.wpa_key.key, param->u.wpa_key.key_len);
} }
else { else {
...@@ -242,7 +242,7 @@ int wpa_set_wpadev(PSDevice pDevice, int val) ...@@ -242,7 +242,7 @@ int wpa_set_wpadev(PSDevice pDevice, int val)
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
return -EINVAL; return -EINVAL;
} }
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
} }
dwKeyIndex = (unsigned long)(param->u.wpa_key.key_index); dwKeyIndex = (unsigned long)(param->u.wpa_key.key_index);
...@@ -273,7 +273,7 @@ spin_lock_irq(&pDevice->lock); ...@@ -273,7 +273,7 @@ spin_lock_irq(&pDevice->lock);
} }
//spin_unlock_irq(&pDevice->lock); //spin_unlock_irq(&pDevice->lock);
if(param->u.wpa_key.seq && fcpfkernel) { if (param->u.wpa_key.seq && fcpfkernel) {
memcpy(&abySeq[0], param->u.wpa_key.seq, param->u.wpa_key.seq_len); memcpy(&abySeq[0], param->u.wpa_key.seq, param->u.wpa_key.seq_len);
} }
else { else {
...@@ -283,11 +283,11 @@ spin_lock_irq(&pDevice->lock); ...@@ -283,11 +283,11 @@ spin_lock_irq(&pDevice->lock);
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
return -EINVAL; return -EINVAL;
} }
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
} }
if (param->u.wpa_key.seq_len > 0) { if (param->u.wpa_key.seq_len > 0) {
for (ii = 0 ; ii < param->u.wpa_key.seq_len ; ii++) { for (ii = 0; ii < param->u.wpa_key.seq_len; ii++) {
if (ii < 4) if (ii < 4)
LODWORD(KeyRSC) |= (abySeq[ii] << (ii * 8)); LODWORD(KeyRSC) |= (abySeq[ii] << (ii * 8));
else else
...@@ -372,7 +372,7 @@ spin_lock_irq(&pDevice->lock); ...@@ -372,7 +372,7 @@ spin_lock_irq(&pDevice->lock);
(unsigned char *)abyKey, (unsigned char *)abyKey,
byKeyDecMode, byKeyDecMode,
pDevice->PortOffset, pDevice->PortOffset,
pDevice->byLocalID) == true) ) { pDevice->byLocalID) == true)) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "GROUP Key Assign.\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "GROUP Key Assign.\n");
} else { } else {
...@@ -437,7 +437,7 @@ spin_lock_irq(&pDevice->lock); ...@@ -437,7 +437,7 @@ spin_lock_irq(&pDevice->lock);
pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[byKeyIndex][2], pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[byKeyIndex][2],
pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[byKeyIndex][3], pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[byKeyIndex][3],
pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[byKeyIndex][4] pMgmt->sNodeDBTable[iNodeIndex].abyWepKey[byKeyIndex][4]
); );
*/ */
return ret; return ret;
...@@ -475,7 +475,7 @@ static int wpa_set_wpa(PSDevice pDevice, ...@@ -475,7 +475,7 @@ static int wpa_set_wpa(PSDevice pDevice,
/* /*
* Description: * Description:
* set disassociate * set disassociate
* *
...@@ -528,7 +528,7 @@ static int wpa_set_scan(PSDevice pDevice, ...@@ -528,7 +528,7 @@ static int wpa_set_scan(PSDevice pDevice,
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
BSSvClearBSSList((void *)pDevice, pDevice->bLinkPass); BSSvClearBSSList((void *)pDevice, pDevice->bLinkPass);
bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, NULL); bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, NULL);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
return ret; return ret;
...@@ -639,17 +639,17 @@ static int wpa_get_scan(PSDevice pDevice, ...@@ -639,17 +639,17 @@ 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))) {
memcpy(ptempBSS,&pMgmt->sBSSList[jj],sizeof(KnownBSS)); memcpy(ptempBSS, &pMgmt->sBSSList[jj], sizeof(KnownBSS));
memcpy(&pMgmt->sBSSList[jj],&pMgmt->sBSSList[jj+1],sizeof(KnownBSS)); memcpy(&pMgmt->sBSSList[jj], &pMgmt->sBSSList[jj + 1], sizeof(KnownBSS));
memcpy(&pMgmt->sBSSList[jj+1],ptempBSS,sizeof(KnownBSS)); memcpy(&pMgmt->sBSSList[jj + 1], ptempBSS, sizeof(KnownBSS));
} }
...@@ -667,7 +667,7 @@ static int wpa_get_scan(PSDevice pDevice, ...@@ -667,7 +667,7 @@ static int wpa_get_scan(PSDevice pDevice,
// pMgmt->sBSSList[ii].uRSSI); // pMgmt->sBSSList[ii].uRSSI);
#endif #endif
//******mike:bubble sort by stronger RSSI*****// //******mike:bubble sort by stronger RSSI*****//
...@@ -691,7 +691,7 @@ static int wpa_get_scan(PSDevice pDevice, ...@@ -691,7 +691,7 @@ static int wpa_get_scan(PSDevice pDevice,
} }
scan_buf = (struct viawget_scan_result *)pBuf; scan_buf = (struct viawget_scan_result *)pBuf;
pBSS = &(pMgmt->sBSSList[0]); pBSS = &(pMgmt->sBSSList[0]);
for (ii = 0, jj = 0; ii < MAX_BSS_NUM ; ii++) { for (ii = 0, jj = 0; ii < MAX_BSS_NUM; ii++) {
pBSS = &(pMgmt->sBSSList[ii]); pBSS = &(pMgmt->sBSSList[ii]);
if (pBSS->bActive) { if (pBSS->bActive) {
if (jj >= count) if (jj >= count)
...@@ -716,7 +716,7 @@ static int wpa_get_scan(PSDevice pDevice, ...@@ -716,7 +716,7 @@ static int wpa_get_scan(PSDevice pDevice,
memcpy(scan_buf->rsn_ie, pBSS->byRSNIE, pBSS->wRSNLen); memcpy(scan_buf->rsn_ie, pBSS->byRSNIE, pBSS->wRSNLen);
} }
scan_buf = (struct viawget_scan_result *)((unsigned char *)scan_buf + sizeof(struct viawget_scan_result)); scan_buf = (struct viawget_scan_result *)((unsigned char *)scan_buf + sizeof(struct viawget_scan_result));
jj ++; jj++;
} }
} }
...@@ -757,7 +757,7 @@ static int wpa_set_associate(PSDevice pDevice, ...@@ -757,7 +757,7 @@ static int wpa_set_associate(PSDevice pDevice,
unsigned char abyNullAddr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; unsigned char abyNullAddr[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
unsigned char abyWPAIE[64]; unsigned char abyWPAIE[64];
int ret = 0; int ret = 0;
bool bWepEnabled=false; bool bWepEnabled = false;
// set key type & algorithm // set key type & algorithm
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pairwise_suite = %d\n", param->u.wpa_associate.pairwise_suite); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pairwise_suite = %d\n", param->u.wpa_associate.pairwise_suite);
...@@ -790,10 +790,10 @@ static int wpa_set_associate(PSDevice pDevice, ...@@ -790,10 +790,10 @@ static int wpa_set_associate(PSDevice pDevice,
// set bssid // set bssid
if (memcmp(param->u.wpa_associate.bssid, &abyNullAddr[0], 6) != 0) if (memcmp(param->u.wpa_associate.bssid, &abyNullAddr[0], 6) != 0)
memcpy(pMgmt->abyDesireBSSID, param->u.wpa_associate.bssid, 6); memcpy(pMgmt->abyDesireBSSID, param->u.wpa_associate.bssid, 6);
else else
{ {
bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, pItemSSID->abySSID); bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, pItemSSID->abySSID);
} }
if (param->u.wpa_associate.wpa_ie_len == 0) { if (param->u.wpa_associate.wpa_ie_len == 0) {
if (param->u.wpa_associate.auth_alg & AUTH_ALG_SHARED_KEY) if (param->u.wpa_associate.auth_alg & AUTH_ALG_SHARED_KEY)
...@@ -824,7 +824,7 @@ else ...@@ -824,7 +824,7 @@ else
case CIPHER_WEP40: case CIPHER_WEP40:
case CIPHER_WEP104: case CIPHER_WEP104:
pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled; pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
bWepEnabled=true; bWepEnabled = true;
break; break;
case CIPHER_NONE: case CIPHER_NONE:
if (param->u.wpa_associate.group_suite == CIPHER_CCMP) if (param->u.wpa_associate.group_suite == CIPHER_CCMP)
...@@ -844,7 +844,7 @@ else ...@@ -844,7 +844,7 @@ else
pMgmt->bShareKeyAlgorithm = true; pMgmt->bShareKeyAlgorithm = true;
} }
else if (pMgmt->eAuthenMode == WMAC_AUTH_OPEN) { else if (pMgmt->eAuthenMode == WMAC_AUTH_OPEN) {
if(!bWepEnabled) pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled; if (!bWepEnabled) pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
else pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled; else pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
//pMgmt->eAuthenMode = WMAC_AUTH_OPEN; //pMgmt->eAuthenMode = WMAC_AUTH_OPEN;
//pMgmt->bShareKeyAlgorithm = false; //20080717-06,<Modify> by chester//Fix Open mode, WEP encryption //pMgmt->bShareKeyAlgorithm = false; //20080717-06,<Modify> by chester//Fix Open mode, WEP encryption
...@@ -856,8 +856,8 @@ else ...@@ -856,8 +856,8 @@ else
pDevice->bEncryptionEnable = true; pDevice->bEncryptionEnable = true;
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 == true)))) //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;
...@@ -866,21 +866,21 @@ if (!((pMgmt->eAuthenMode == WMAC_AUTH_SHAREKEY) || ...@@ -866,21 +866,21 @@ if (!((pMgmt->eAuthenMode == WMAC_AUTH_SHAREKEY) ||
netif_stop_queue(pDevice->dev); netif_stop_queue(pDevice->dev);
//20080701-02,<Add> by Mike Liu //20080701-02,<Add> by Mike Liu
/*******search if ap_scan=2 ,which is associating request in hidden ssid mode ****/ /*******search if ap_scan=2 ,which is associating request in hidden ssid mode ****/
{ {
PKnownBSS pCurr = NULL; PKnownBSS pCurr = NULL;
pCurr = BSSpSearchBSSList(pDevice, pCurr = BSSpSearchBSSList(pDevice,
pMgmt->abyDesireBSSID, pMgmt->abyDesireBSSID,
pMgmt->abyDesireSSID, pMgmt->abyDesireSSID,
pMgmt->eConfigPHYMode pMgmt->eConfigPHYMode
); );
if (pCurr == NULL){ if (pCurr == NULL) {
printk("wpa_set_associate---->hidden mode site survey before associate.......\n"); printk("wpa_set_associate---->hidden mode site survey before associate.......\n");
bScheduleCommand((void *) pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID); bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, pMgmt->abyDesireSSID);
}
} }
}
/****************************************************************/ /****************************************************************/
bScheduleCommand((void *) pDevice, WLAN_CMD_SSID, NULL); bScheduleCommand((void *)pDevice, WLAN_CMD_SSID, NULL);
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
return ret; return ret;
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
typedef enum { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP } wpa_alg; typedef enum { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP } wpa_alg;
typedef enum { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP, typedef enum { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP,
CIPHER_WEP104 } wpa_cipher; CIPHER_WEP104 } wpa_cipher;
typedef enum { KEY_MGMT_802_1X, KEY_MGMT_CCKM,KEY_MGMT_PSK, KEY_MGMT_NONE, typedef enum { KEY_MGMT_802_1X, KEY_MGMT_CCKM, KEY_MGMT_PSK, KEY_MGMT_NONE,
KEY_MGMT_802_1X_NO_WPA, KEY_MGMT_WPA_NONE } wpa_key_mgmt; KEY_MGMT_802_1X_NO_WPA, KEY_MGMT_WPA_NONE } wpa_key_mgmt;
#define AUTH_ALG_OPEN_SYSTEM 0x01 #define AUTH_ALG_OPEN_SYSTEM 0x01
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册