diff options
Diffstat (limited to 'drivers/staging/vt6655')
-rw-r--r-- | drivers/staging/vt6655/80211mgr.c | 16 | ||||
-rw-r--r-- | drivers/staging/vt6655/aes_ccmp.c | 20 | ||||
-rw-r--r-- | drivers/staging/vt6655/baseband.c | 7 | ||||
-rw-r--r-- | drivers/staging/vt6655/bssdb.c | 11 | ||||
-rw-r--r-- | drivers/staging/vt6655/device_main.c | 4 | ||||
-rw-r--r-- | drivers/staging/vt6655/dpc.c | 7 | ||||
-rw-r--r-- | drivers/staging/vt6655/hostap.c | 30 | ||||
-rw-r--r-- | drivers/staging/vt6655/iwctl.c | 6 | ||||
-rw-r--r-- | drivers/staging/vt6655/key.c | 10 | ||||
-rw-r--r-- | drivers/staging/vt6655/michael.h | 10 | ||||
-rw-r--r-- | drivers/staging/vt6655/rf.c | 56 | ||||
-rw-r--r-- | drivers/staging/vt6655/tkip.c | 4 | ||||
-rw-r--r-- | drivers/staging/vt6655/vntwifi.c | 22 | ||||
-rw-r--r-- | drivers/staging/vt6655/wcmd.c | 2 | ||||
-rw-r--r-- | drivers/staging/vt6655/wctl.c | 8 | ||||
-rw-r--r-- | drivers/staging/vt6655/wmgr.c | 3 | ||||
-rw-r--r-- | drivers/staging/vt6655/wpa.c | 12 | ||||
-rw-r--r-- | drivers/staging/vt6655/wpactl.c | 2 | ||||
-rw-r--r-- | drivers/staging/vt6655/wroute.c | 2 | ||||
-rw-r--r-- | drivers/staging/vt6655/wroute.h | 2 |
20 files changed, 88 insertions, 146 deletions
diff --git a/drivers/staging/vt6655/80211mgr.c b/drivers/staging/vt6655/80211mgr.c index 76c8490b0734..7949d58ad7d1 100644 --- a/drivers/staging/vt6655/80211mgr.c +++ b/drivers/staging/vt6655/80211mgr.c @@ -165,9 +165,8 @@ vMgrDecodeBeacon( break; case WLAN_EID_RSN: - if (pFrame->pRSN == NULL) { + if (pFrame->pRSN == NULL) pFrame->pRSN = (PWLAN_IE_RSN)pItem; - } break; case WLAN_EID_RSN_WPA: if (pFrame->pRSNWPA == NULL) { @@ -382,9 +381,8 @@ vMgrDecodeAssocRequest( break; case WLAN_EID_RSN: - if (pFrame->pRSN == NULL) { + if (pFrame->pRSN == NULL) pFrame->pRSN = (PWLAN_IE_RSN)pItem; - } break; case WLAN_EID_RSN_WPA: if (pFrame->pRSNWPA == NULL) { @@ -556,9 +554,8 @@ vMgrDecodeReassocRequest( break; case WLAN_EID_RSN: - if (pFrame->pRSN == NULL) { + if (pFrame->pRSN == NULL) pFrame->pRSN = (PWLAN_IE_RSN)pItem; - } break; case WLAN_EID_RSN_WPA: if (pFrame->pRSNWPA == NULL) { @@ -742,9 +739,8 @@ vMgrDecodeProbeResponse( break; case WLAN_EID_RSN: - if (pFrame->pRSN == NULL) { + if (pFrame->pRSN == NULL) pFrame->pRSN = (PWLAN_IE_RSN)pItem; - } break; case WLAN_EID_RSN_WPA: if (pFrame->pRSNWPA == NULL) { @@ -858,9 +854,9 @@ vMgrDecodeAuthen( pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) + WLAN_AUTHEN_OFF_CHALLENGE); - if ((((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len)) && (pItem->byElementID == WLAN_EID_CHALLENGE)) { + if (((unsigned char *)pItem) < (pFrame->pBuf + pFrame->len) && + pItem->byElementID == WLAN_EID_CHALLENGE) pFrame->pChallenge = (PWLAN_IE_CHALLENGE)pItem; - } return; } diff --git a/drivers/staging/vt6655/aes_ccmp.c b/drivers/staging/vt6655/aes_ccmp.c index fc056fc61995..82b0bd1c056a 100644 --- a/drivers/staging/vt6655/aes_ccmp.c +++ b/drivers/staging/vt6655/aes_ccmp.c @@ -46,7 +46,7 @@ * SBOX Table */ -unsigned char sbox_table[256] = +static unsigned char sbox_table[256] = { 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, @@ -66,7 +66,7 @@ unsigned char sbox_table[256] = 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 }; -unsigned char dot2_table[256] = { +static unsigned char dot2_table[256] = { 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e, 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e, 0x40, 0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e, @@ -85,7 +85,7 @@ unsigned char dot2_table[256] = { 0xfb, 0xf9, 0xff, 0xfd, 0xf3, 0xf1, 0xf7, 0xf5, 0xeb, 0xe9, 0xef, 0xed, 0xe3, 0xe1, 0xe7, 0xe5 }; -unsigned char dot3_table[256] = { +static unsigned char dot3_table[256] = { 0x00, 0x03, 0x06, 0x05, 0x0c, 0x0f, 0x0a, 0x09, 0x18, 0x1b, 0x1e, 0x1d, 0x14, 0x17, 0x12, 0x11, 0x30, 0x33, 0x36, 0x35, 0x3c, 0x3f, 0x3a, 0x39, 0x28, 0x2b, 0x2e, 0x2d, 0x24, 0x27, 0x22, 0x21, 0x60, 0x63, 0x66, 0x65, 0x6c, 0x6f, 0x6a, 0x69, 0x78, 0x7b, 0x7e, 0x7d, 0x74, 0x77, 0x72, 0x71, @@ -110,7 +110,7 @@ unsigned char dot3_table[256] = { /*--------------------- Export Functions --------------------------*/ -void xor_128(unsigned char *a, unsigned char *b, unsigned char *out) +static void xor_128(unsigned char *a, unsigned char *b, unsigned char *out) { unsigned long *dwPtrA = (unsigned long *)a; unsigned long *dwPtrB = (unsigned long *)b; @@ -122,7 +122,7 @@ void xor_128(unsigned char *a, unsigned char *b, unsigned char *out) (*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++); } -void xor_32(unsigned char *a, unsigned char *b, unsigned char *out) +static void xor_32(unsigned char *a, unsigned char *b, unsigned char *out) { unsigned long *dwPtrA = (unsigned long *)a; unsigned long *dwPtrB = (unsigned long *)b; @@ -131,7 +131,7 @@ void xor_32(unsigned char *a, unsigned char *b, unsigned char *out) (*dwPtrOut++) = (*dwPtrA++) ^ (*dwPtrB++); } -void AddRoundKey(unsigned char *key, int round) +static void AddRoundKey(unsigned char *key, int round) { unsigned char sbox_key[4]; unsigned char rcon_table[10] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36}; @@ -149,7 +149,7 @@ void AddRoundKey(unsigned char *key, int round) xor_32(&key[12], &key[8], &key[12]); } -void SubBytes(unsigned char *in, unsigned char *out) +static void SubBytes(unsigned char *in, unsigned char *out) { int i; @@ -158,7 +158,7 @@ void SubBytes(unsigned char *in, unsigned char *out) } } -void ShiftRows(unsigned char *in, unsigned char *out) +static void ShiftRows(unsigned char *in, unsigned char *out) { out[0] = in[0]; out[1] = in[5]; @@ -178,7 +178,7 @@ void ShiftRows(unsigned char *in, unsigned char *out) out[15] = in[11]; } -void MixColumns(unsigned char *in, unsigned char *out) +static void MixColumns(unsigned char *in, unsigned char *out) { out[0] = dot2_table[in[0]] ^ dot3_table[in[1]] ^ in[2] ^ in[3]; out[1] = in[0] ^ dot2_table[in[1]] ^ dot3_table[in[2]] ^ in[3]; @@ -186,7 +186,7 @@ void MixColumns(unsigned char *in, unsigned char *out) out[3] = dot3_table[in[0]] ^ in[1] ^ in[2] ^ dot2_table[in[3]]; } -void AESv128(unsigned char *key, unsigned char *data, unsigned char *ciphertext) +static void AESv128(unsigned char *key, unsigned char *data, unsigned char *ciphertext) { int i; int round; diff --git a/drivers/staging/vt6655/baseband.c b/drivers/staging/vt6655/baseband.c index c26418d806fb..959568a1eb6a 100644 --- a/drivers/staging/vt6655/baseband.c +++ b/drivers/staging/vt6655/baseband.c @@ -2434,13 +2434,12 @@ void BBvSetVGAGainOffset(PSDevice pDevice, unsigned char byData) BBbReadEmbedded(pDevice->PortOffset, 0x0A, &byBBRxConf);//CR10 // patch for 3253B0 Baseband with Cardbus module - if (byData == pDevice->abyBBVGA[0]) { + if (byData == pDevice->abyBBVGA[0]) byBBRxConf |= 0x20;//0010 0000 - } else if (pDevice->bShortSlotTime) { + else if (pDevice->bShortSlotTime) byBBRxConf &= 0xDF;//1101 1111 - } else { + else byBBRxConf |= 0x20;//0010 0000 - } pDevice->byBBVGACurrent = byData; BBbWriteEmbedded(pDevice->PortOffset, 0x0A, byBBRxConf);//CR10 } diff --git a/drivers/staging/vt6655/bssdb.c b/drivers/staging/vt6655/bssdb.c index f983915168b7..a23b591eeac3 100644 --- a/drivers/staging/vt6655/bssdb.c +++ b/drivers/staging/vt6655/bssdb.c @@ -148,7 +148,8 @@ BSSpSearchBSSList( if (pDevice->bLinkPass == false) pCurrBSS->bSelected = false; if ((pCurrBSS->bActive) && (pCurrBSS->bSelected == false)) { - if (!compare_ether_addr(pCurrBSS->abyBSSID, pbyBSSID)) { + if (ether_addr_equal(pCurrBSS->abyBSSID, + pbyBSSID)) { if (pSSID != NULL) { // compare ssid if (!memcmp(pSSID->abySSID, @@ -275,7 +276,8 @@ BSSvClearBSSList( for (ii = 0; ii < MAX_BSS_NUM; ii++) { if (bKeepCurrBSSID) { if (pMgmt->sBSSList[ii].bActive && - !compare_ether_addr(pMgmt->sBSSList[ii].abyBSSID, pMgmt->abyCurrBSSID)) { + ether_addr_equal(pMgmt->sBSSList[ii].abyBSSID, + pMgmt->abyCurrBSSID)) { // bKeepCurrBSSID = false; continue; } @@ -318,7 +320,7 @@ BSSpAddrIsInBSSList( for (ii = 0; ii < MAX_BSS_NUM; ii++) { pBSSList = &(pMgmt->sBSSList[ii]); if (pBSSList->bActive) { - if (!compare_ether_addr(pBSSList->abyBSSID, abyBSSID)) { + if (ether_addr_equal(pBSSList->abyBSSID, abyBSSID)) { if (pSSID->len == ((PWLAN_IE_SSID)pBSSList->abySSID)->len) { if (memcmp(pSSID->abySSID, ((PWLAN_IE_SSID)pBSSList->abySSID)->abySSID, @@ -733,7 +735,8 @@ BSSDBbIsSTAInNodeDB(void *pMgmtObject, unsigned char *abyDstAddr, // Index = 0 reserved for AP Node for (ii = 1; ii < (MAX_NODE_NUM + 1); ii++) { if (pMgmt->sNodeDBTable[ii].bActive) { - if (!compare_ether_addr(abyDstAddr, pMgmt->sNodeDBTable[ii].abyMACAddr)) { + if (ether_addr_equal(abyDstAddr, + pMgmt->sNodeDBTable[ii].abyMACAddr)) { *puNodeIndex = ii; return true; } diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 7f36a7103c3e..e93fdc88d844 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -1153,10 +1153,6 @@ static void device_free_info(PSDevice pDevice) { pci_release_regions(pDevice->pcid); if (dev) free_netdev(dev); - - if (pDevice->pcid) { - pci_set_drvdata(pDevice->pcid, NULL); - } } static bool device_init_rings(PSDevice pDevice) { diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c index a9533f3f2529..0ff51cb4a207 100644 --- a/drivers/staging/vt6655/dpc.c +++ b/drivers/staging/vt6655/dpc.c @@ -172,9 +172,9 @@ s_vProcessRxMACHeader(PSDevice pDevice, unsigned char *pbyRxBufferAddr, }; pbyRxBuffer = (unsigned char *)(pbyRxBufferAddr + cbHeaderSize); - if (!compare_ether_addr(pbyRxBuffer, &pDevice->abySNAP_Bridgetunnel[0])) { + if (ether_addr_equal(pbyRxBuffer, pDevice->abySNAP_Bridgetunnel)) { cbHeaderSize += 6; - } else if (!compare_ether_addr(pbyRxBuffer, &pDevice->abySNAP_RFC1042[0])) { + } else if (ether_addr_equal(pbyRxBuffer, pDevice->abySNAP_RFC1042)) { cbHeaderSize += 6; pwType = (unsigned short *)(pbyRxBufferAddr + cbHeaderSize); if ((*pwType != TYPE_PKT_IPX) && (*pwType != cpu_to_le16(0xF380))) { @@ -420,7 +420,8 @@ device_receive_frame( s_vGetDASA(skb->data+4, &cbHeaderSize, &pDevice->sRxEthHeader); // filter packet send from myself - if (!compare_ether_addr((unsigned char *)&(pDevice->sRxEthHeader.abySrcAddr[0]), pDevice->abyCurrentNetAddr)) + if (ether_addr_equal(pDevice->sRxEthHeader.abySrcAddr, + pDevice->abyCurrentNetAddr)) return false; if ((pMgmt->eCurrMode == WMAC_MODE_ESS_AP) || (pMgmt->eCurrMode == WMAC_MODE_IBSS_STA)) { diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c index 8acff44a9e75..ab8b2ba6eedd 100644 --- a/drivers/staging/vt6655/hostap.c +++ b/drivers/staging/vt6655/hostap.c @@ -143,7 +143,8 @@ static int hostap_disable_hostapd(PSDevice pDevice, int rtnl_locked) DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n", pDevice->dev->name, pDevice->apdev->name); } - free_netdev(pDevice->apdev); + if (pDevice->apdev) + free_netdev(pDevice->apdev); pDevice->apdev = NULL; pDevice->bEnable8021x = false; pDevice->bEnableHostWEP = false; @@ -720,7 +721,6 @@ static int hostap_get_encryption(PSDevice pDevice, * Return Value: * */ - int vt6655_hostap_ioctl(PSDevice pDevice, struct iw_point *p) { struct viawget_hostapd_param *param; @@ -731,7 +731,7 @@ int vt6655_hostap_ioctl(PSDevice pDevice, struct iw_point *p) p->length > VIAWGET_HOSTAPD_MAX_BUF_SIZE || !p->pointer) return -EINVAL; - param = kmalloc((int)p->length, (int)GFP_KERNEL); + param = kmalloc((int)p->length, GFP_KERNEL); if (param == NULL) return -ENOMEM; @@ -755,8 +755,8 @@ int vt6655_hostap_ioctl(PSDevice pDevice, struct iw_point *p) break; case VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR \n"); - return -EOPNOTSUPP; - break; + ret = -EOPNOTSUPP; + goto out; case VIAWGET_HOSTAPD_FLUSH: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_FLUSH \n"); spin_lock_irq(&pDevice->lock); @@ -790,40 +790,36 @@ int vt6655_hostap_ioctl(PSDevice pDevice, struct iw_point *p) DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_FLAGS_STA \n"); ret = hostap_set_flags_sta(pDevice, param); break; - case VIAWGET_HOSTAPD_MLME: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_MLME \n"); - return -EOPNOTSUPP; - + ret = -EOPNOTSUPP; + goto out; case VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT \n"); ret = hostap_set_generic_element(pDevice, param); break; - case VIAWGET_HOSTAPD_SCAN_REQ: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_SCAN_REQ \n"); - return -EOPNOTSUPP; - + ret = -EOPNOTSUPP; + goto out; case VIAWGET_HOSTAPD_STA_CLEAR_STATS: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "VIAWGET_HOSTAPD_STA_CLEAR_STATS \n"); - return -EOPNOTSUPP; - + ret = -EOPNOTSUPP; + goto out; default: DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "vt6655_hostap_ioctl: unknown cmd=%d\n", (int)param->cmd); - return -EOPNOTSUPP; - break; + ret = -EOPNOTSUPP; + goto out; } if ((ret == 0) && ap_ioctl) { if (copy_to_user(p->pointer, param, p->length)) { ret = -EFAULT; - goto out; } } out: kfree(param); - return ret; } diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c index 9de698ef25f5..4bff8aa96be7 100644 --- a/drivers/staging/vt6655/iwctl.c +++ b/drivers/staging/vt6655/iwctl.c @@ -663,7 +663,8 @@ int iwctl_siwap(struct net_device *dev, unsigned int ii, uSameBssidNum = 0; for (ii = 0; ii < MAX_BSS_NUM; ii++) { if (pMgmt->sBSSList[ii].bActive && - !compare_ether_addr(pMgmt->sBSSList[ii].abyBSSID, pMgmt->abyDesireBSSID)) { + ether_addr_equal(pMgmt->sBSSList[ii].abyBSSID, + pMgmt->abyDesireBSSID)) { uSameBssidNum++; } } @@ -840,7 +841,8 @@ int iwctl_siwessid(struct net_device *dev, // by means of judging if there are two same BSSID exist in list ? for (ii = 0; ii < MAX_BSS_NUM; ii++) { if (pMgmt->sBSSList[ii].bActive && - !compare_ether_addr(pMgmt->sBSSList[ii].abyBSSID, pCurr->abyBSSID)) { + ether_addr_equal(pMgmt->sBSSList[ii].abyBSSID, + pCurr->abyBSSID)) { uSameBssidNum++; } } diff --git a/drivers/staging/vt6655/key.c b/drivers/staging/vt6655/key.c index 92b84b5ea115..04c1304d16e5 100644 --- a/drivers/staging/vt6655/key.c +++ b/drivers/staging/vt6655/key.c @@ -141,7 +141,7 @@ bool KeybGetKey( *pKey = NULL; for (i = 0; i < MAX_KEY_TABLE; i++) { if ((pTable->KeyTable[i].bInUse == true) && - !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { + ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { if (dwKeyIndex == 0xFFFFFFFF) { if (pTable->KeyTable[i].PairwiseKey.bKeyValid == true) { *pKey = &(pTable->KeyTable[i].PairwiseKey); @@ -208,7 +208,7 @@ bool KeybSetKey( j = i; } if ((pTable->KeyTable[i].bInUse == true) && - !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { + ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { // found table already exist if ((dwKeyIndex & PAIRWISE_KEY) != 0) { // Pairwise key @@ -385,7 +385,7 @@ bool KeybRemoveKey( for (i = 0; i < MAX_KEY_TABLE; i++) { if ((pTable->KeyTable[i].bInUse == true) && - !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { + ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { if ((dwKeyIndex & PAIRWISE_KEY) != 0) { pTable->KeyTable[i].PairwiseKey.bKeyValid = false; s_vCheckKeyTableValid(pTable, dwIoBase); @@ -429,7 +429,7 @@ bool KeybRemoveAllKey( for (i = 0; i < MAX_KEY_TABLE; i++) { if ((pTable->KeyTable[i].bInUse == true) && - !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { + ether_addr_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; @@ -512,7 +512,7 @@ bool KeybGetTransmitKey( *pKey = NULL; for (i = 0; i < MAX_KEY_TABLE; i++) { if ((pTable->KeyTable[i].bInUse == true) && - !compare_ether_addr(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { + ether_addr_equal(pTable->KeyTable[i].abyBSSID, pbyBSSID)) { if (dwKeyType == PAIRWISE_KEY) { if (pTable->KeyTable[i].PairwiseKey.bKeyValid == true) { *pKey = &(pTable->KeyTable[i].PairwiseKey); diff --git a/drivers/staging/vt6655/michael.h b/drivers/staging/vt6655/michael.h index 0828d18ad528..387d20623aa3 100644 --- a/drivers/staging/vt6655/michael.h +++ b/drivers/staging/vt6655/michael.h @@ -39,18 +39,18 @@ void MIC_vInit(unsigned long dwK0, unsigned long dwK1); void MIC_vUnInit(void); -// Append bytes to the message to be MICed +/* Append bytes to the message to be MICed */ void MIC_vAppend(unsigned char *src, unsigned int nBytes); -// Get the MIC result. Destination should accept 8 bytes of result. -// This also resets the message to empty. +/* Get the MIC result. Destination should accept 8 bytes of result. */ +/* This also resets the message to empty. */ void MIC_vGetMIC(unsigned long *pdwL, unsigned long *pdwR); /*--------------------- Export Macros ------------------------------*/ -// Rotation functions on 32 bit values +/* Rotation functions on 32 bit values */ #define ROL32(A, n) \ (((A) << (n)) | (((A)>>(32-(n))) & ((1UL << (n)) - 1))) #define ROR32(A, n) ROL32((A), 32-(n)) -#endif //__MICHAEL_H__ +#endif /*__MICHAEL_H__ */ diff --git a/drivers/staging/vt6655/rf.c b/drivers/staging/vt6655/rf.c index 6948984a25ab..ce173cc16c19 100644 --- a/drivers/staging/vt6655/rf.c +++ b/drivers/staging/vt6655/rf.c @@ -55,7 +55,7 @@ /*--------------------- Static Variables --------------------------*/ -const unsigned long dwAL2230InitTable[CB_AL2230_INIT_SEQ] = { +static const unsigned long dwAL2230InitTable[CB_AL2230_INIT_SEQ] = { 0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // 0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // 0x01A00200+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // @@ -73,7 +73,7 @@ const unsigned long dwAL2230InitTable[CB_AL2230_INIT_SEQ] = { 0x00580F00+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW }; -const unsigned long dwAL2230ChannelTable0[CB_MAX_CHANNEL] = { +static const unsigned long dwAL2230ChannelTable0[CB_MAX_CHANNEL] = { 0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz 0x03F79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz 0x03E79000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 3, Tf = 2422MHz @@ -90,7 +90,7 @@ const unsigned long dwAL2230ChannelTable0[CB_MAX_CHANNEL] = { 0x03E7C000+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW // channel = 14, Tf = 2412M }; -const unsigned long dwAL2230ChannelTable1[CB_MAX_CHANNEL] = { +static const unsigned long dwAL2230ChannelTable1[CB_MAX_CHANNEL] = { 0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz 0x0B333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz 0x03333100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 3, Tf = 2422MHz @@ -107,7 +107,7 @@ const unsigned long dwAL2230ChannelTable1[CB_MAX_CHANNEL] = { 0x06666100+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW // channel = 14, Tf = 2412M }; -unsigned long dwAL2230PowerTable[AL2230_PWR_IDX_LEN] = { +static unsigned long dwAL2230PowerTable[AL2230_PWR_IDX_LEN] = { 0x04040900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, 0x04041900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, 0x04042900+(BY_AL2230_REG_LEN<<3)+IFREGCTL_REGW, @@ -177,7 +177,7 @@ unsigned long dwAL2230PowerTable[AL2230_PWR_IDX_LEN] = { //{{ RobertYu:20050104 // 40MHz reference frequency // Need to Pull PLLON(PE3) low when writing channel registers through 3-wire. -const unsigned long dwAL7230InitTable[CB_AL7230_INIT_SEQ] = { +static const unsigned long dwAL7230InitTable[CB_AL7230_INIT_SEQ] = { 0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel1 // Need modify for 11a 0x13333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel1 // Need modify for 11a 0x841FF200+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11a: 451FE2 @@ -200,7 +200,7 @@ const unsigned long dwAL7230InitTable[CB_AL7230_INIT_SEQ] = { 0x1ABA8F00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW // Need modify for 11a: 12BACF }; -const unsigned long dwAL7230InitTableAMode[CB_AL7230_INIT_SEQ] = { +static const unsigned long dwAL7230InitTableAMode[CB_AL7230_INIT_SEQ] = { 0x0FF52000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel184 // Need modify for 11b/g 0x00000100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Channel184 // Need modify for 11b/g 0x451FE200+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // Need modify for 11b/g @@ -219,7 +219,7 @@ const unsigned long dwAL7230InitTableAMode[CB_AL7230_INIT_SEQ] = { 0x12BACF00+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW // Need modify for 11b/g }; -const unsigned long dwAL7230ChannelTable0[CB_MAX_CHANNEL] = { +static const unsigned long dwAL7230ChannelTable0[CB_MAX_CHANNEL] = { 0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz 0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz 0x00379000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 3, Tf = 2422MHz @@ -285,7 +285,7 @@ const unsigned long dwAL7230ChannelTable0[CB_MAX_CHANNEL] = { 0x0FF61000+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW // channel = 165, Tf = 5825MHz (56) }; -const unsigned long dwAL7230ChannelTable1[CB_MAX_CHANNEL] = { +static const unsigned long dwAL7230ChannelTable1[CB_MAX_CHANNEL] = { 0x13333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz 0x1B333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz 0x03333100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 3, Tf = 2422MHz @@ -349,7 +349,7 @@ const unsigned long dwAL7230ChannelTable1[CB_MAX_CHANNEL] = { 0x02AAA100+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW // channel = 165, Tf = 5825MHz (56) }; -const unsigned long dwAL7230ChannelTable2[CB_MAX_CHANNEL] = { +static const unsigned long dwAL7230ChannelTable2[CB_MAX_CHANNEL] = { 0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 1, Tf = 2412MHz 0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 2, Tf = 2417MHz 0x7FD78400+(BY_AL7230_REG_LEN<<3)+IFREGCTL_REGW, // channel = 3, Tf = 2422MHz @@ -428,7 +428,7 @@ const unsigned long dwAL7230ChannelTable2[CB_MAX_CHANNEL] = { * Return Value: true if succeeded; false if failed. * */ -bool s_bAL7230Init(unsigned long dwIoBase) +static bool s_bAL7230Init(unsigned long dwIoBase) { int ii; bool bResult; @@ -471,7 +471,7 @@ bool s_bAL7230Init(unsigned long dwIoBase) } // Need to Pull PLLON low when writing channel registers through 3-wire interface -bool s_bAL7230SelectChannel(unsigned long dwIoBase, unsigned char byChannel) +static bool s_bAL7230SelectChannel(unsigned long dwIoBase, unsigned char byChannel) { bool bResult; @@ -631,7 +631,7 @@ bool IFRFbWriteEmbedded(unsigned long dwIoBase, unsigned long dwData) * Return Value: true if succeeded; false if failed. * */ -bool RFbAL2230Init(unsigned long dwIoBase) +static bool RFbAL2230Init(unsigned long dwIoBase) { int ii; bool bResult; @@ -678,7 +678,7 @@ bool RFbAL2230Init(unsigned long dwIoBase) return bResult; } -bool RFbAL2230SelectChannel(unsigned long dwIoBase, unsigned char byChannel) +static bool RFbAL2230SelectChannel(unsigned long dwIoBase, unsigned char byChannel) { bool bResult; @@ -776,36 +776,6 @@ bool RFbInit( } /* - * Description: RF ShutDown function - * - * Parameters: - * In: - * byBBType - * byRFType - * Out: - * none - * - * Return Value: true if succeeded; false if failed. - * - */ -bool RFbShutDown( - PSDevice pDevice -) -{ - bool bResult = true; - - switch (pDevice->byRFType) { - case RF_AIROHA7230: - bResult = IFRFbWriteEmbedded(pDevice->PortOffset, 0x1ABAEF00 + (BY_AL7230_REG_LEN << 3) + IFREGCTL_REGW); - break; - default: - bResult = true; - break; - } - return bResult; -} - -/* * Description: Select channel * * Parameters: diff --git a/drivers/staging/vt6655/tkip.c b/drivers/staging/vt6655/tkip.c index b3e087e19034..e7c17c6f7ea5 100644 --- a/drivers/staging/vt6655/tkip.c +++ b/drivers/staging/vt6655/tkip.c @@ -55,7 +55,7 @@ /* The 2nd table is the same as the 1st but with the upper and lower */ /* bytes swapped. To allow an endian tolerant implementation, the byte */ /* halves have been expressed independently here. */ -const unsigned char TKIP_Sbox_Lower[256] = { +static const unsigned char TKIP_Sbox_Lower[256] = { 0xA5, 0x84, 0x99, 0x8D, 0x0D, 0xBD, 0xB1, 0x54, 0x50, 0x03, 0xA9, 0x7D, 0x19, 0x62, 0xE6, 0x9A, 0x45, 0x9D, 0x40, 0x87, 0x15, 0xEB, 0xC9, 0x0B, @@ -90,7 +90,7 @@ const unsigned char TKIP_Sbox_Lower[256] = { 0xC3, 0xB0, 0x77, 0x11, 0xCB, 0xFC, 0xD6, 0x3A }; -const unsigned char TKIP_Sbox_Upper[256] = { +static const unsigned char TKIP_Sbox_Upper[256] = { 0xC6, 0xF8, 0xEE, 0xF6, 0xFF, 0xD6, 0xDE, 0x91, 0x60, 0x02, 0xCE, 0x56, 0xE7, 0xB5, 0x4D, 0xEC, 0x8F, 0x1F, 0x89, 0xFA, 0xEF, 0xB2, 0x8E, 0xFB, diff --git a/drivers/staging/vt6655/vntwifi.c b/drivers/staging/vt6655/vntwifi.c index d8f4f8e7d05e..d2bdb71fe62d 100644 --- a/drivers/staging/vt6655/vntwifi.c +++ b/drivers/staging/vt6655/vntwifi.c @@ -752,25 +752,3 @@ VNTWIFIbChannelSwitch( //spin_unlock_irq(&pDevice->lock); return true; } - -/* - bool - VNTWIFIbRadarPresent( - void *pMgmtObject, - unsigned char byChannel -) { - PSMgmtObject pMgmt = (PSMgmtObject) pMgmtObject; - if ((pMgmt->eCurrMode == WMAC_MODE_IBSS_STA) && - (byChannel == (unsigned char) pMgmt->uCurrChannel) && - (pMgmt->bSwitchChannel != true) && - (pMgmt->b11hEnable == true)) { - if (!compare_ether_addr(pMgmt->abyIBSSDFSOwner, CARDpGetCurrentAddress(pMgmt->pAdapter))) { - pMgmt->byNewChannel = CARDbyAutoChannelSelect(pMgmt->pAdapter,(unsigned char) pMgmt->uCurrChannel); - pMgmt->bSwitchChannel = true; - } - BEACONbSendBeacon(pMgmt); - CARDbChannelSwitch(pMgmt->pAdapter, 0, pMgmt->byNewChannel, 10); - } - return true; - } -*/ diff --git a/drivers/staging/vt6655/wcmd.c b/drivers/staging/vt6655/wcmd.c index d551653537b4..9c57eefe78fb 100644 --- a/drivers/staging/vt6655/wcmd.c +++ b/drivers/staging/vt6655/wcmd.c @@ -233,7 +233,7 @@ s_vProbeChannel( * * * Return Value: - * A ptr to Tx frame or NULL on allocation failue + * A ptr to Tx frame or NULL on allocation failure * -*/ diff --git a/drivers/staging/vt6655/wctl.c b/drivers/staging/vt6655/wctl.c index 9eb81b4eee80..f05f9f55398b 100644 --- a/drivers/staging/vt6655/wctl.c +++ b/drivers/staging/vt6655/wctl.c @@ -75,8 +75,8 @@ bool WCTLbIsDuplicate(PSCache pCache, PS802_11Header pMACHeader) for (ii = 0; ii < DUPLICATE_RX_CACHE_LENGTH; ii++) { pCacheEntry = &(pCache->asCacheEntry[uIndex]); if ((pCacheEntry->wFmSequence == pMACHeader->wSeqCtl) && - (!compare_ether_addr(&(pCacheEntry->abyAddr2[0]), &(pMACHeader->abyAddr2[0]))) -) { + ether_addr_equal(pCacheEntry->abyAddr2, + pMACHeader->abyAddr2)) { /* Duplicate match */ return true; } @@ -111,8 +111,8 @@ unsigned int WCTLuSearchDFCB(PSDevice pDevice, PS802_11Header pMACHeader) for (ii = 0; ii < pDevice->cbDFCB; ii++) { if ((pDevice->sRxDFCB[ii].bInUse == true) && - (!compare_ether_addr(&(pDevice->sRxDFCB[ii].abyAddr2[0]), &(pMACHeader->abyAddr2[0]))) -) { + ether_addr_equal(pDevice->sRxDFCB[ii].abyAddr2, + pMACHeader->abyAddr2)) { // return ii; } diff --git a/drivers/staging/vt6655/wmgr.c b/drivers/staging/vt6655/wmgr.c index 9938813f997a..ed4b32b6d9ce 100644 --- a/drivers/staging/vt6655/wmgr.c +++ b/drivers/staging/vt6655/wmgr.c @@ -1680,7 +1680,8 @@ s_vMgrRxDeauthentication( vMgrDecodeDeauthen(&sFrame); DBG_PRT(MSG_LEVEL_NOTICE, KERN_INFO "AP deauthed me, reason=%d.\n", cpu_to_le16((*(sFrame.pwReason)))); // TODO: update BSS list for specific BSSID if pre-authentication case - if (!compare_ether_addr(sFrame.pHdr->sA3.abyAddr3, pMgmt->abyCurrBSSID)) { + if (ether_addr_equal(sFrame.pHdr->sA3.abyAddr3, + pMgmt->abyCurrBSSID)) { if (pMgmt->eCurrState >= WMAC_STATE_AUTHPENDING) { pMgmt->sNodeDBTable[0].bActive = false; pMgmt->eCurrMode = WMAC_MODE_STANDBY; diff --git a/drivers/staging/vt6655/wpa.c b/drivers/staging/vt6655/wpa.c index c5293bbcdab5..b697fa6c3b16 100644 --- a/drivers/staging/vt6655/wpa.c +++ b/drivers/staging/vt6655/wpa.c @@ -45,12 +45,12 @@ /*--------------------- Static Variables --------------------------*/ static int msglevel = MSG_LEVEL_INFO; -const unsigned char abyOUI00[4] = { 0x00, 0x50, 0xf2, 0x00 }; -const unsigned char abyOUI01[4] = { 0x00, 0x50, 0xf2, 0x01 }; -const unsigned char abyOUI02[4] = { 0x00, 0x50, 0xf2, 0x02 }; -const unsigned char abyOUI03[4] = { 0x00, 0x50, 0xf2, 0x03 }; -const unsigned char abyOUI04[4] = { 0x00, 0x50, 0xf2, 0x04 }; -const unsigned char abyOUI05[4] = { 0x00, 0x50, 0xf2, 0x05 }; +static const unsigned char abyOUI00[4] = { 0x00, 0x50, 0xf2, 0x00 }; +static const unsigned char abyOUI01[4] = { 0x00, 0x50, 0xf2, 0x01 }; +static const unsigned char abyOUI02[4] = { 0x00, 0x50, 0xf2, 0x02 }; +static const unsigned char abyOUI03[4] = { 0x00, 0x50, 0xf2, 0x03 }; +static const unsigned char abyOUI04[4] = { 0x00, 0x50, 0xf2, 0x04 }; +static const unsigned char abyOUI05[4] = { 0x00, 0x50, 0xf2, 0x05 }; /*+ * diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c index e8d9ecd2913a..044368a46c53 100644 --- a/drivers/staging/vt6655/wpactl.c +++ b/drivers/staging/vt6655/wpactl.c @@ -394,7 +394,7 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel) } else { // Key Table Full - if (!compare_ether_addr(¶m->addr[0], pDevice->abyBSSID)) { + if (ether_addr_equal(param->addr, pDevice->abyBSSID)) { //DBG_PRN_WLAN03(("return NDIS_STATUS_INVALID_DATA -Key Table Full.2\n")); //spin_unlock_irq(&pDevice->lock); return -EINVAL; diff --git a/drivers/staging/vt6655/wroute.c b/drivers/staging/vt6655/wroute.c index b61328fbee87..85302c5e2bac 100644 --- a/drivers/staging/vt6655/wroute.c +++ b/drivers/staging/vt6655/wroute.c @@ -179,7 +179,7 @@ bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, unsigned int uData pHeadTD = pHeadTD->next; } - pLastTD->pTDInfo->skb = 0; + pLastTD->pTDInfo->skb = NULL; pLastTD->pTDInfo->byFlags = 0; pDevice->apCurrTD[TYPE_AC0DMA] = pHeadTD; diff --git a/drivers/staging/vt6655/wroute.h b/drivers/staging/vt6655/wroute.h index 5ecc190ae775..3abc1d36f89d 100644 --- a/drivers/staging/vt6655/wroute.h +++ b/drivers/staging/vt6655/wroute.h @@ -41,4 +41,4 @@ bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, unsigned int uDataLen, unsigned int uNodeIndex); -#endif // __WROUTE_H__ +#endif /* __WROUTE_H__ */ |