diff options
Diffstat (limited to 'drivers/staging/vt6655/wroute.c')
-rw-r--r-- | drivers/staging/vt6655/wroute.c | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/drivers/staging/vt6655/wroute.c b/drivers/staging/vt6655/wroute.c index 85302c5e2bac..c39d5ed59ded 100644 --- a/drivers/staging/vt6655/wroute.c +++ b/drivers/staging/vt6655/wroute.c @@ -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) { PSMgmtObject pMgmt = pDevice->pMgmt; PSTxDesc pHeadTD, 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,24 @@ 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, 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 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"); } @@ -117,25 +121,24 @@ bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, unsigned int uData pTransmitKey->wTSC15_0 = pMgmt->sNodeDBTable[uNodeIndex].wTSC15_0; memcpy(pTransmitKey->abyKey, &pMgmt->sNodeDBTable[uNodeIndex].abyWepKey[0], - pTransmitKey->uKeyLength -); + pTransmitKey->uKeyLength); } } - uMACfragNum = cbGetFragCount(pDevice, pTransmitKey, cbFrameBodySize, &pDevice->sTxEthHeader); + uMACfragNum = cbGetFragCount(pDevice, pTransmitKey, + cbFrameBodySize, &pDevice->sTxEthHeader); - if (uMACfragNum > AVAIL_TD(pDevice, TYPE_AC0DMA)) { + if (uMACfragNum > AVAIL_TD(pDevice, TYPE_AC0DMA)) return false; - } - byPktType = (unsigned char)pDevice->byPacketType; + + byPktType = pDevice->byPacketType; if (pDevice->bFixRate) { if (pDevice->eCurrentPHYType == PHY_TYPE_11B) { - if (pDevice->uConnectionRate >= RATE_11M) { + if (pDevice->uConnectionRate >= RATE_11M) pDevice->wCurrentRate = RATE_11M; - } else { - pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate; - } + else + pDevice->wCurrentRate = pDevice->uConnectionRate; } else { if ((pDevice->eCurrentPHYType == PHY_TYPE_11A) && (pDevice->uConnectionRate <= RATE_6M)) { @@ -144,7 +147,7 @@ bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, unsigned int uData if (pDevice->uConnectionRate >= RATE_54M) pDevice->wCurrentRate = RATE_54M; else - pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate; + pDevice->wCurrentRate = pDevice->uConnectionRate; } } } else { @@ -154,12 +157,11 @@ bool ROUTEbRelay(PSDevice pDevice, unsigned char *pbySkbData, unsigned int uData if (pDevice->wCurrentRate <= RATE_11M) byPktType = PK_TYPE_11B; - vGenerateFIFOHeader(pDevice, byPktType, pDevice->pbyTmpBuff, bNeedEncryption, - cbFrameBodySize, TYPE_AC0DMA, pHeadTD, - &pDevice->sTxEthHeader, pbySkbData, pTransmitKey, uNodeIndex, - &uMACfragNum, - &cbHeaderSize -); + vGenerateFIFOHeader(pDevice, byPktType, pDevice->pbyTmpBuff, + bNeedEncryption, cbFrameBodySize, TYPE_AC0DMA, + pHeadTD, &pDevice->sTxEthHeader, pbySkbData, + pTransmitKey, uNodeIndex, &uMACfragNum, + &cbHeaderSize); if (MACbIsRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_PS)) { // Disable PS |