[PATCH 2/7] vt6655: Fix most of checkpatch.pl errors in wroute
wroute.h: Fixed all line-over-80-character errors. No errors remain. wroute.c: Fixed line-over-80-character errors, bracing errors and C99-comments. Three warnings remain, fixing them would deteriorate readability. One warning on a memory barrier without comment in line 189 will be fixed in a later commit because it's purpose is not yet known. Signed-off-by: Michael Gunselmann Signed-off-by: Martin Hofmann --- drivers/staging/vt6655/wroute.c | 71 - drivers/staging/vt6655/wroute.h | 3 +- 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/drivers/staging/vt6655/wroute.c b/drivers/staging/vt6655/wroute.c index 85302c5..f8899b6 100644 --- a/drivers/staging/vt6655/wroute.c +++ b/drivers/staging/vt6655/wroute.c @@ -44,7 +44,7 @@ /*- Static Variables --*/ static int msglevel = MSG_LEVEL_INFO; -//static int msglevel=MSG_LEVEL_DEBUG; +/* static int msglevel=MSG_LEVEL_DEBUG; */ /*- Static Functions --*/ /*- Export Variables --*/ @@ -63,7 +63,8 @@ static int msglevel = MSG_LEVEL_INFO; * Return Value: true if packet duplicate; otherwise false * */ -bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, unsigned int uDataLen, unsigned int uNodeIndex) +bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, +unsigned int uDataLen, unsigned int uNodeIndex) { PSMgmtObjectpMgmt = pDevice->pMgmt; PSTxDescpHeadTD, pLastTD; @@ -78,7 +79,8 @@ bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, unsigned int uData unsigned char *pbyBSSID; if (AVAIL_TD(pDevice, TYPE_AC0DMA) <= 0) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Relay can't allocate TD1..\n"); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO + "Relay can't allocate TD1..\n"); return false; } @@ -86,22 +88,25 @@ bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, unsigned int uData pHeadTD->m_td1TD1.byTCR = (TCR_EDP | TCR_STP); - memcpy(pDevice->sTxEthHeader.abyDstAddr, (unsigned char *)pbySkbData, ETH_HLEN); + memcpy(pDevice->sTxEthHeader.abyDstAddr, + (unsigned char *)pbySkbData, ETH_HLEN); cbFrameBodySize = uDataLen - ETH_HLEN; - if (ntohs(pDevice->sTxEthHeader.wType) > ETH_DATA_LEN) { + if (ntohs(pDevice->sTxEthHeader.wType) > ETH_DATA_LEN) cbFrameBodySize += 8; - } if (pDevice->bEncryptionEnable == true) { bNeedEncryption = true; - // get group key + /* get group key */ pbyBSSID = pDevice->abyBroadcastAddr; - if (KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == false) { + if (KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, + GROUP_KEY, &pTransmitKey) == false) { pTransmitKey = NULL; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "KEY is NULL. [%d]\n", pDevice->pMgmt->eCurrMode); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG + "KEY is NULL. [%d]\n", + pDevice->pMgmt->eCurrMode); } else { DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "Get GTK.\n"); } @@ -110,11 +115,16 @@ bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, unsigned int uData if (pDevice->bEnableHostWEP) { if (uNodeIndex < MAX_NODE_NUM + 1) { pTransmitKey = &STempKey; - pTransmitKey->byCipherSuite = pMgmt->sNodeDBTable[uNodeIndex].byCipherSuite; - pTransmitKey->dwKeyIndex = pMgmt->sNodeDBTable[uNodeIndex].dwKeyIndex; - pTransmitKey->uKeyLength = pMgmt->sNodeDBTable[uNodeIndex].uWepKeyLength; - pTransmitKey->dwTSC47_16 = pMgmt->sNodeDBTable[uNodeIndex].dwTSC47_16; - pTransmitKey->wTSC15_0 = pMgmt->sNodeDBTable[uNodeIndex].wTSC15_0; + pTransmitKey->byCipherSuite = + pMgmt->sNodeDBTable[uNodeIndex].byCipherSuite; + pTransmitKey->dwKeyIndex = + pMgmt->sNodeDBTable[uNodeIndex].dwKeyIndex; + pTransmitKey->uKeyLength = + pMgmt->sNodeDBTable[uNodeIndex].uWepKeyLength; + pTransmitKey->dwTSC47_16 = +
[PATCH 6/7] vt6655: Remove typedefs in 80211hdr.h
From: Martin Hofmann The file 80211hdr.h contained typedefs for 5 types. To satisfy checkpatch, this commit removes them. In 10 other files, every occurence of a now deleted type has been substituted with the correct struct ... syntax. Signed-off-by: Martin Hofmann Signed-off-by: Michael Gunselmann --- drivers/staging/vt6655/80211hdr.h | 31 - drivers/staging/vt6655/80211mgr.c | 48 +++ drivers/staging/vt6655/80211mgr.h | 26 ++--- drivers/staging/vt6655/IEEE11h.c | 14 ++-- drivers/staging/vt6655/dpc.c | 2 +- drivers/staging/vt6655/mib.c | 4 ++-- drivers/staging/vt6655/power.c| 4 ++-- drivers/staging/vt6655/rxtx.c | 7 +++--- drivers/staging/vt6655/wcmd.c | 2 +- drivers/staging/vt6655/wmgr.c | 24 ++-- drivers/staging/vt6655/wmgr.h | 6 ++--- 11 files changed, 83 insertions(+), 85 deletions(-) diff --git a/drivers/staging/vt6655/80211hdr.h b/drivers/staging/vt6655/80211hdr.h index cacf137..067274c 100644 --- a/drivers/staging/vt6655/80211hdr.h +++ b/drivers/staging/vt6655/80211hdr.h @@ -266,31 +266,29 @@ #define IEEE_ADDR_UNIVERSAL 0x02 #define IEEE_ADDR_GROUP 0x01 -typedef struct { +struct IEEE_ADDR { unsigned char abyAddr[6]; -} IEEE_ADDR, *PIEEE_ADDR; +}; /* 802.11 Header Format */ -typedef struct tagWLAN_80211HDR_A2 { +struct WLAN_80211HDR_A2 { unsigned short wFrameCtl; unsigned short wDurationID; unsigned char abyAddr1[WLAN_ADDR_LEN]; unsigned char abyAddr2[WLAN_ADDR_LEN]; -} __attribute__ ((__packed__)) -WLAN_80211HDR_A2, *PWLAN_80211HDR_A2; +} __attribute__((__packed__)); -typedef struct tagWLAN_80211HDR_A3 { +struct WLAN_80211HDR_A3 { unsigned short wFrameCtl; unsigned short wDurationID; unsigned char abyAddr1[WLAN_ADDR_LEN]; unsigned char abyAddr2[WLAN_ADDR_LEN]; unsigned char abyAddr3[WLAN_ADDR_LEN]; unsigned short wSeqCtl; -} __attribute__ ((__packed__)) -WLAN_80211HDR_A3, *PWLAN_80211HDR_A3; +} __attribute__((__packed__)); -typedef struct tagWLAN_80211HDR_A4 { +struct WLAN_80211HDR_A4 { unsigned short wFrameCtl; unsigned short wDurationID; unsigned char abyAddr1[WLAN_ADDR_LEN]; @@ -298,14 +296,13 @@ typedef struct tagWLAN_80211HDR_A4 { unsigned char abyAddr3[WLAN_ADDR_LEN]; unsigned short wSeqCtl; unsigned char abyAddr4[WLAN_ADDR_LEN]; -} __attribute__ ((__packed__)) -WLAN_80211HDR_A4, *PWLAN_80211HDR_A4; - -typedef union tagUWLAN_80211HDR { - WLAN_80211HDR_A2sA2; - WLAN_80211HDR_A3sA3; - WLAN_80211HDR_A4sA4; -} UWLAN_80211HDR, *PUWLAN_80211HDR; +} __attribute__((__packed__)); + +union UWLAN_80211HDR { + struct WLAN_80211HDR_A2 sA2; + struct WLAN_80211HDR_A3 sA3; + struct WLAN_80211HDR_A4 sA4; +}; /*- Export Classes */ diff --git a/drivers/staging/vt6655/80211mgr.c b/drivers/staging/vt6655/80211mgr.c index 7949d58..e586e51 100644 --- a/drivers/staging/vt6655/80211mgr.c +++ b/drivers/staging/vt6655/80211mgr.c @@ -88,7 +88,7 @@ vMgrEncodeBeacon( PWLAN_FR_BEACON pFrame ) { - pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; + pFrame->pHdr = (union UWLAN_80211HDR *)pFrame->pBuf; /* Fixed Fields */ pFrame->pqwTimestamp = (PQWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -121,7 +121,7 @@ vMgrDecodeBeacon( { PWLAN_IEpItem; - pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; + pFrame->pHdr = (union UWLAN_80211HDR *)pFrame->pBuf; /* Fixed Fields */ pFrame->pqwTimestamp = (PQWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -236,7 +236,7 @@ vMgrEncodeIBSSATIM( PWLAN_FR_IBSSATIM pFrame ) { - pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; + pFrame->pHdr = (union UWLAN_80211HDR *)pFrame->pBuf; pFrame->len = WLAN_HDR_ADDR3_LEN; return; @@ -258,7 +258,7 @@ vMgrDecodeIBSSATIM( PWLAN_FR_IBSSATIM pFrame ) { - pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; + pFrame->pHdr = (union UWLAN_80211HDR *)pFrame->pBuf; return; } @@ -279,7 +279,7 @@ vMgrEncodeDisassociation( PWLAN_FR_DISASSOC pFrame ) { - pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; + pFrame->pHdr = (union UWLAN_80211HDR *)pFrame->pBuf; /* Fixed Fields */ pFrame->pwReason = (unsigned short *)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)) @@ -305,7 +305,7 @@ vMgrDecodeDisassociation( PWLAN_FR_DISASSOC pFrame ) { - pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf; + pFrame->pHdr = (union UWLAN_80211HDR *)pFrame->pBuf; /* Fixed Fields */ pFrame->pwReason = (unsigned short
[PATCH 4/7] vt6655: Fixed most of the checkpatch warnings in wpa2
wpa2.h: Checkpatch does no longer complain about anything wpa2.c: Checkpatch complains about some lines that are longer than 80 characters. Breaking them would deteriorate the readability so these lines were not touched. vntwifi.c: Fixing style problems in wpa2.h made it necessary to adjust variable declarations that depended on typedefs in wpa2.h. The checkpatch cleanup of this file still remains. Signed-off-by: Michael Gunselmann Signed-off-by: Martin Hofmann --- drivers/staging/vt6655/vntwifi.c | 4 +- drivers/staging/vt6655/wpa2.c| 186 ++- drivers/staging/vt6655/wpa2.h| 12 +-- 3 files changed, 114 insertions(+), 88 deletions(-) diff --git a/drivers/staging/vt6655/vntwifi.c b/drivers/staging/vt6655/vntwifi.c index e78aedf..d6f63d0 100644 --- a/drivers/staging/vt6655/vntwifi.c +++ b/drivers/staging/vt6655/vntwifi.c @@ -644,7 +644,7 @@ VNTWIFIbSetPMKIDCache( return false; } pMgmt->gsPMKIDCache.BSSIDInfoCount = ulCount; - memcpy(pMgmt->gsPMKIDCache.BSSIDInfo, pPMKIDInfo, (ulCount*sizeof(PMKIDInfo))); + memcpy(pMgmt->gsPMKIDCache.BSSIDInfo, pPMKIDInfo, (ulCount*sizeof(struct PMKIDInfo))); return true; } @@ -695,7 +695,7 @@ VNTWIFIbMeasureReport( //spin_lock_irq(&pDevice->lock); if ((pvMeasureEID != NULL) && - (pMgmt->uLengthOfRepEIDs < (WLAN_A3FR_MAXLEN - sizeof(MEASEURE_REP) - sizeof(WLAN_80211HDR_A3) - 3)) + (pMgmt->uLengthOfRepEIDs < (WLAN_A3FR_MAXLEN - sizeof(MEASEURE_REP) - sizeof(struct WLAN_80211HDR_A3) - 3)) ) { pMgmt->pCurrMeasureEIDRep->byElementID = WLAN_EID_MEASURE_REP; pMgmt->pCurrMeasureEIDRep->len = 3; diff --git a/drivers/staging/vt6655/wpa2.c b/drivers/staging/vt6655/wpa2.c index 2013122..3443556 100644 --- a/drivers/staging/vt6655/wpa2.c +++ b/drivers/staging/vt6655/wpa2.c @@ -37,7 +37,7 @@ /*- Static Definitions -*/ static int msglevel = MSG_LEVEL_INFO; -//static int msglevel=MSG_LEVEL_DEBUG; +/* static int msglevel=MSG_LEVEL_DEBUG; */ /*- Static Classes */ /*- Static Variables --*/ @@ -121,19 +121,19 @@ WPA2vParseRSN( WPA2_ClearRSN(pBSSNode); - if (pRSN->len == 2) { // ver(2) - if ((pRSN->byElementID == WLAN_EID_RSN) && (pRSN->wVersion == 1)) { + if (pRSN->len == 2) { /* ver(2) */ + if ((pRSN->byElementID == WLAN_EID_RSN) + && (pRSN->wVersion == 1)) pBSSNode->bWPA2Valid = true; - } return; } - if (pRSN->len < 6) { // ver(2) + GK(4) - // invalid CSS, P802.11i/D10.0, p31 + if (pRSN->len < 6) { /* ver(2) + GK(4) */ + /* invalid CSS, P802.11i/D10.0, p31 */ return; } - // information element header makes sense + /* information element header makes sense */ if ((pRSN->byElementID == WLAN_EID_RSN) && (pRSN->wVersion == 1)) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Legal 802.11i RSN\n"); @@ -148,97 +148,121 @@ WPA2vParseRSN( else if (!memcmp(pbyOUI, abyOUIWEP104, 4)) pBSSNode->byCSSGK = WLAN_11i_CSS_WEP104; else if (!memcmp(pbyOUI, abyOUIGK, 4)) { - // invalid CSS, P802.11i/D10.0, p32 + /* invalid CSS, P802.11i/D10.0, p32 */ return; } else - // any vendor checks here + /* any vendor checks here */ pBSSNode->byCSSGK = WLAN_11i_CSS_UNKNOWN; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "802.11i CSS: %X\n", pBSSNode->byCSSGK); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO + "802.11i CSS: %X\n", pBSSNode->byCSSGK); if (pRSN->len == 6) { pBSSNode->bWPA2Valid = true; return; } - if (pRSN->len >= 8) { // ver(2) + GK(4) + PK count(2) - pBSSNode->wCSSPKCount = *((unsigned short *)&(pRSN->abyRSN[4])); + if (pRSN->len >= 8) { /* ver(2) + GK(4) + PK count(2) */ + pBSSNode->wCSSPKCount = + *((unsigned short *)&(pRSN->abyRSN[4])); j = 0; pbyOUI = &(pRSN->abyRSN[6]); - for (i = 0; (i < pBSSNode->wCSSPKCount) && (j <
[PATCH 5/7] vt6655: Fixed most of the checkpatch warnings in wpa
wpa.h: Checkpatch does no longer complain about anything. wpactl.c: Some long-line-warnings still remain but fixing them would deteriorate code readability. Signed-off-by: Michael Gunselmann Signed-off-by: Martin Hofmann --- drivers/staging/vt6655/wpa.c | 156 --- drivers/staging/vt6655/wpa.h | 2 +- 2 files changed, 102 insertions(+), 56 deletions(-) diff --git a/drivers/staging/vt6655/wpa.c b/drivers/staging/vt6655/wpa.c index 990ea0f..fdd2722 100644 --- a/drivers/staging/vt6655/wpa.c +++ b/drivers/staging/vt6655/wpa.c @@ -116,14 +116,17 @@ WPA_ParseRSN( DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "WPA_ParseRSN: [%d]\n", pRSN->len); - // information element header makes sense - if ((pRSN->len >= 6) // oui1(4)+ver(2) - && (pRSN->byElementID == WLAN_EID_RSN_WPA) && !memcmp(pRSN->abyOUI, abyOUI01, 4) + /* information element header makes sense */ + if ((pRSN->len >= 6) /* oui1(4)+ver(2) */ + && (pRSN->byElementID == WLAN_EID_RSN_WPA) + && !memcmp(pRSN->abyOUI, abyOUI01, 4) && (pRSN->wVersion == 1)) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Legal RSN\n"); - // update each variable if pRSN is long enough to contain the variable - if (pRSN->len >= 10) //oui1(4)+ver(2)+GKSuite(4) - { + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO + "Legal RSN\n"); + /* update each variable if pRSN is +* long enough to contain the variable +*/ + if (pRSN->len >= 10) { /* oui1(4)+ver(2)+GKSuite(4) */ if (!memcmp(pRSN->abyMulticast, abyOUI01, 4)) pBSSList->byGKType = WPA_WEP40; else if (!memcmp(pRSN->abyMulticast, abyOUI02, 4)) @@ -135,80 +138,117 @@ WPA_ParseRSN( else if (!memcmp(pRSN->abyMulticast, abyOUI05, 4)) pBSSList->byGKType = WPA_WEP104; else - // any vendor checks here + /* any vendor checks here */ pBSSList->byGKType = WPA_NONE; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "byGKType: %x\n", pBSSList->byGKType); + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO + "byGKType: %x\n", pBSSList->byGKType); } - if (pRSN->len >= 12) //oui1(4)+ver(2)+GKS(4)+PKSCnt(2) - { + if (pRSN->len >= 12) { /* oui1(4)+ver(2)+GKS(4)+PKSCnt(2) */ 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 < ARRAY_SIZE(pBSSList->abyPKType)); 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; - else if (!memcmp(pRSN->PKSList[i].abyOUI, abyOUI02, 4)) - pBSSList->abyPKType[j++] = WPA_TKIP; - else if (!memcmp(pRSN->PKSList[i].abyOUI, abyOUI03, 4)) - pBSSList->abyPKType[j++] = WPA_AESWRAP; - else if (!memcmp(pRSN->PKSList[i].abyOUI, abyOUI04, 4)) - pBSSList->abyPKType[j++] = WPA_AESCCMP; + 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 < ARRAY_SIZE(pBSSList->abyPKType)); i++) { + /* oui1(4)+ver(2)+GKS(4)+PKSCnt(2)+PKS(4*i) */ + if (pRSN->len >= 12+i*4+4) { + if (!memcmp(pRSN->PKSList[i].abyOUI, + abyOUI00, 4)) + pBSSList->abyPKType[j++] = + WPA_NONE; + else if (!memcmp(pRSN->PKSList[i].abyOUI, +
[PATCH 0/7] vt6655: Cleanup of checkpatch errors
This patch series cleans up all checkpatch errors and some warnings in some files of the vt6655 driver in staging. The reference git tree is linux-next. Some checkpatch warnings were not fixed, they are commented in the particular patches. Not all files of the driver were cleaned up in this patch series. The patches should not incorporate functional changes. -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/7] vt6655: Fixed most of the checkpatch warnings in wpactl
wpactl.h: Checkpatch does no longer complain about anything wpactl.c: The following errors and warnings remain: ERROR: need consistens spacing around '&' in line 364, 372 and 411 This is okay, 'cause we need pointers to the corresponding variables. WARNING: Prefer netdev_err [...] to printk This is also okay, 'cause we check if kmalloc failed or not. This is not a device-related error. hostap.c and iwctl.c: wpactl.h used the typedef statement, which was removed while fixing checkpatch-errors. For this to work one statement in hostap.c was adjusted. The ckecpatch cleanup of these two files still remains. Signed-off-by: Michael Gunselmann Signed-off-by: Martin Hofmann --- drivers/staging/vt6655/hostap.c | 2 +- drivers/staging/vt6655/iwctl.c | 2 +- drivers/staging/vt6655/wpactl.c | 300 drivers/staging/vt6655/wpactl.h | 16 +-- 4 files changed, 190 insertions(+), 130 deletions(-) diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c index ca54b79..6eecd53 100644 --- a/drivers/staging/vt6655/hostap.c +++ b/drivers/staging/vt6655/hostap.c @@ -454,7 +454,7 @@ static int hostap_set_encryption(PSDevice pDevice, unsigned long dwKeyIndex = 0; unsigned char abyKey[MAX_KEY_LEN]; unsigned char abySeq[MAX_KEY_LEN]; - NDIS_802_11_KEY_RSC KeyRSC; + unsigned long long KeyRSC; unsigned char byKeyDecMode = KEY_CTL_WEP; int ret = 0; int iNodeIndex = -1; diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c index 2db4bc8..ac3fc16 100644 --- a/drivers/staging/vt6655/iwctl.c +++ b/drivers/staging/vt6655/iwctl.c @@ -1827,7 +1827,7 @@ int iwctl_siwencodeext(struct net_device *dev, struct iw_encode_ext *ext = (struct iw_encode_ext *)extra; struct viawget_wpa_param *param = NULL; //original member - wpa_alg alg_name; + enum wpa_alg alg_name; u8 addr[6]; int key_idx, set_tx = 0; u8 seq[IW_ENCODE_SEQ_MAX_SIZE]; diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c index ee83704..41e9933 100644 --- a/drivers/staging/vt6655/wpactl.c +++ b/drivers/staging/vt6655/wpactl.c @@ -51,7 +51,7 @@ static const int frequency_list[] = { /*- Static Classes */ /*- Static Variables --*/ -//static int msglevel=MSG_LEVEL_DEBUG; +/* static int msglevel=MSG_LEVEL_DEBUG; */ static int msglevel = MSG_LEVEL_INFO; /*- Static Functions --*/ @@ -90,7 +90,8 @@ static int wpa_init_wpadev(PSDevice pDevice) struct net_device *dev = pDevice->dev; 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) return -ENOMEM; @@ -103,7 +104,8 @@ static int wpa_init_wpadev(PSDevice pDevice) pDevice->wpadev->mem_end = dev->mem_end; ret = register_netdev(pDevice->wpadev); if (ret) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: register_netdev(WPA) failed!\n", + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO + "%s: register_netdev(WPA) failed!\n", dev->name); free_netdev(pDevice->wpadev); return -1; @@ -115,7 +117,8 @@ static int wpa_init_wpadev(PSDevice pDevice) return -ENOMEM; } - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Registered netdev %s for WPA management\n", + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO + "%s: Registered netdev %s for WPA management\n", dev->name, pDevice->wpadev->name); return 0; @@ -142,7 +145,8 @@ static int wpa_release_wpadev(PSDevice pDevice) } if (pDevice->wpadev) { - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "%s: Netdevice %s unregistered\n", + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO + "%s: Netdevice %s unregistered\n", pDevice->dev->name, pDevice->wpadev->name); unregister_netdev(pDevice->wpadev); free_netdev(pDevice->wpadev); @@ -196,7 +200,7 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel) unsigned char abyKey[MAX_KEY_LEN]; unsigned char abySeq[MAX_KEY_LEN]; QWORD KeyRSC
[PATCH 1/7] vt6655: Remove unused macros in 80211hdr.h
From: Martin Hofmann The file 80211hdr.h contained 4 macros (in both little and big endain fashion) that were not used in the driver. Thus, this patch removes them. Signed-off-by: Martin Hofmann Signed-off-by: Michael Gunselmann --- drivers/staging/vt6655/80211hdr.h | 8 1 file changed, 8 deletions(-) diff --git a/drivers/staging/vt6655/80211hdr.h b/drivers/staging/vt6655/80211hdr.h index ba53340..cacf137 100644 --- a/drivers/staging/vt6655/80211hdr.h +++ b/drivers/staging/vt6655/80211hdr.h @@ -155,17 +155,13 @@ #ifdef __BIG_ENDIAN /* GET & SET Frame Control bit */ -#define WLAN_GET_FC_PRVER(n)unsigned short)(n) >> 8) & (BIT0 | BIT1)) #define WLAN_GET_FC_FTYPE(n)unsigned short)(n) >> 8) & (BIT2 | BIT3)) >> 2) #define WLAN_GET_FC_FSTYPE(n) unsigned short)(n) >> 8) & (BIT4|BIT5|BIT6|BIT7)) >> 4) #define WLAN_GET_FC_TODS(n) unsigned short)(n) << 8) & (BIT8)) >> 8) #define WLAN_GET_FC_FROMDS(n) unsigned short)(n) << 8) & (BIT9)) >> 9) #define WLAN_GET_FC_MOREFRAG(n) unsigned short)(n) << 8) & (BIT10)) >> 10) -#define WLAN_GET_FC_RETRY(n)unsigned short)(n) << 8) & (BIT11)) >> 11) #define WLAN_GET_FC_PWRMGT(n) unsigned short)(n) << 8) & (BIT12)) >> 12) -#define WLAN_GET_FC_MOREDATA(n) unsigned short)(n) << 8) & (BIT13)) >> 13) #define WLAN_GET_FC_ISWEP(n)unsigned short)(n) << 8) & (BIT14)) >> 14) -#define WLAN_GET_FC_ORDER(n)unsigned short)(n) << 8) & (BIT15)) >> 15) /* Sequence Field bit */ #define WLAN_GET_SEQ_FRGNUM(n) (((unsigned short)(n) >> 8) & (BIT0|BIT1|BIT2|BIT3)) @@ -188,17 +184,13 @@ #else /* GET & SET Frame Control bit */ -#define WLAN_GET_FC_PRVER(n)(((unsigned short)(n)) & (BIT0 | BIT1)) #define WLAN_GET_FC_FTYPE(n)unsigned short)(n)) & (BIT2 | BIT3)) >> 2) #define WLAN_GET_FC_FSTYPE(n) unsigned short)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4) #define WLAN_GET_FC_TODS(n) unsigned short)(n)) & (BIT8)) >> 8) #define WLAN_GET_FC_FROMDS(n) unsigned short)(n)) & (BIT9)) >> 9) #define WLAN_GET_FC_MOREFRAG(n) unsigned short)(n)) & (BIT10)) >> 10) -#define WLAN_GET_FC_RETRY(n)unsigned short)(n)) & (BIT11)) >> 11) #define WLAN_GET_FC_PWRMGT(n) unsigned short)(n)) & (BIT12)) >> 12) -#define WLAN_GET_FC_MOREDATA(n) unsigned short)(n)) & (BIT13)) >> 13) #define WLAN_GET_FC_ISWEP(n)unsigned short)(n)) & (BIT14)) >> 14) -#define WLAN_GET_FC_ORDER(n)unsigned short)(n)) & (BIT15)) >> 15) /* Sequence Field bit */ #define WLAN_GET_SEQ_FRGNUM(n) (((unsigned short)(n)) & (BIT0|BIT1|BIT2|BIT3)) -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel