staging:vt6655:wroute: Whitespace cleanups

Neatening only.
git diff -w shows no differences.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Joe Perches 2013-03-18 10:45:15 -07:00 committed by Greg Kroah-Hartman
parent f9cf92bfc6
commit 180071a1c3
2 changed files with 105 additions and 105 deletions

View File

@ -43,7 +43,7 @@
/*--------------------- Static Classes ----------------------------*/ /*--------------------- Static Classes ----------------------------*/
/*--------------------- Static Variables --------------------------*/ /*--------------------- Static Variables --------------------------*/
static int msglevel =MSG_LEVEL_INFO; static int msglevel = MSG_LEVEL_INFO;
//static int msglevel =MSG_LEVEL_DEBUG; //static int msglevel =MSG_LEVEL_DEBUG;
/*--------------------- Static Functions --------------------------*/ /*--------------------- Static Functions --------------------------*/
@ -65,134 +65,134 @@ static int msglevel =MSG_LEVEL_INFO;
* Return Value: true if packet duplicate; otherwise false * 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; PSMgmtObject pMgmt = pDevice->pMgmt;
PSTxDesc pHeadTD, pLastTD; PSTxDesc pHeadTD, pLastTD;
unsigned int cbFrameBodySize; unsigned int cbFrameBodySize;
unsigned int uMACfragNum; unsigned int uMACfragNum;
unsigned char byPktType; unsigned char byPktType;
bool bNeedEncryption = false; bool bNeedEncryption = false;
SKeyItem STempKey; SKeyItem STempKey;
PSKeyItem pTransmitKey = NULL; PSKeyItem pTransmitKey = NULL;
unsigned int cbHeaderSize; unsigned int cbHeaderSize;
unsigned int ii; unsigned int ii;
unsigned char *pbyBSSID; unsigned char *pbyBSSID;
if (AVAIL_TD(pDevice, TYPE_AC0DMA)<=0) { 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; return false;
} }
pHeadTD = pDevice->apCurrTD[TYPE_AC0DMA]; pHeadTD = pDevice->apCurrTD[TYPE_AC0DMA];
pHeadTD->m_td1TD1.byTCR = (TCR_EDP|TCR_STP); 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; cbFrameBodySize = uDataLen - ETH_HLEN;
if (ntohs(pDevice->sTxEthHeader.wType) > ETH_DATA_LEN) { if (ntohs(pDevice->sTxEthHeader.wType) > ETH_DATA_LEN) {
cbFrameBodySize += 8; cbFrameBodySize += 8;
} }
if (pDevice->bEncryptionEnable == true) { if (pDevice->bEncryptionEnable == true) {
bNeedEncryption = true; bNeedEncryption = true;
// get group key // get group key
pbyBSSID = pDevice->abyBroadcastAddr; pbyBSSID = pDevice->abyBroadcastAddr;
if(KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == false) { if (KeybGetTransmitKey(&(pDevice->sKey), pbyBSSID, GROUP_KEY, &pTransmitKey) == false) {
pTransmitKey = NULL; 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 { } else {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG"Get GTK.\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_DEBUG "Get GTK.\n");
} }
} }
if (pDevice->bEnableHostWEP) { if (pDevice->bEnableHostWEP) {
if (uNodeIndex < MAX_NODE_NUM + 1) { if (uNodeIndex < MAX_NODE_NUM + 1) {
pTransmitKey = &STempKey; pTransmitKey = &STempKey;
pTransmitKey->byCipherSuite = pMgmt->sNodeDBTable[uNodeIndex].byCipherSuite; pTransmitKey->byCipherSuite = pMgmt->sNodeDBTable[uNodeIndex].byCipherSuite;
pTransmitKey->dwKeyIndex = pMgmt->sNodeDBTable[uNodeIndex].dwKeyIndex; pTransmitKey->dwKeyIndex = pMgmt->sNodeDBTable[uNodeIndex].dwKeyIndex;
pTransmitKey->uKeyLength = pMgmt->sNodeDBTable[uNodeIndex].uWepKeyLength; pTransmitKey->uKeyLength = pMgmt->sNodeDBTable[uNodeIndex].uWepKeyLength;
pTransmitKey->dwTSC47_16 = pMgmt->sNodeDBTable[uNodeIndex].dwTSC47_16; pTransmitKey->dwTSC47_16 = pMgmt->sNodeDBTable[uNodeIndex].dwTSC47_16;
pTransmitKey->wTSC15_0 = pMgmt->sNodeDBTable[uNodeIndex].wTSC15_0; pTransmitKey->wTSC15_0 = pMgmt->sNodeDBTable[uNodeIndex].wTSC15_0;
memcpy(pTransmitKey->abyKey, memcpy(pTransmitKey->abyKey,
&pMgmt->sNodeDBTable[uNodeIndex].abyWepKey[0], &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; return false;
} }
byPktType = (unsigned char)pDevice->byPacketType; byPktType = (unsigned char)pDevice->byPacketType;
if (pDevice->bFixRate) { if (pDevice->bFixRate) {
if (pDevice->eCurrentPHYType == PHY_TYPE_11B) { if (pDevice->eCurrentPHYType == PHY_TYPE_11B) {
if (pDevice->uConnectionRate >= RATE_11M) { if (pDevice->uConnectionRate >= RATE_11M) {
pDevice->wCurrentRate = RATE_11M; pDevice->wCurrentRate = RATE_11M;
} else { } else {
pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate; pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate;
} }
} else { } else {
if ((pDevice->eCurrentPHYType == PHY_TYPE_11A) && if ((pDevice->eCurrentPHYType == PHY_TYPE_11A) &&
(pDevice->uConnectionRate <= RATE_6M)) { (pDevice->uConnectionRate <= RATE_6M)) {
pDevice->wCurrentRate = RATE_6M; pDevice->wCurrentRate = RATE_6M;
} else { } else {
if (pDevice->uConnectionRate >= RATE_54M) if (pDevice->uConnectionRate >= RATE_54M)
pDevice->wCurrentRate = RATE_54M; pDevice->wCurrentRate = RATE_54M;
else else
pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate; pDevice->wCurrentRate = (unsigned short)pDevice->uConnectionRate;
} }
} }
} }
else { else {
pDevice->wCurrentRate = pDevice->pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate; pDevice->wCurrentRate = pDevice->pMgmt->sNodeDBTable[uNodeIndex].wTxDataRate;
} }
if (pDevice->wCurrentRate <= RATE_11M) if (pDevice->wCurrentRate <= RATE_11M)
byPktType = PK_TYPE_11B; byPktType = PK_TYPE_11B;
vGenerateFIFOHeader(pDevice, byPktType, pDevice->pbyTmpBuff, bNeedEncryption, vGenerateFIFOHeader(pDevice, byPktType, pDevice->pbyTmpBuff, bNeedEncryption,
cbFrameBodySize, TYPE_AC0DMA, pHeadTD, cbFrameBodySize, TYPE_AC0DMA, pHeadTD,
&pDevice->sTxEthHeader, pbySkbData, pTransmitKey, uNodeIndex, &pDevice->sTxEthHeader, pbySkbData, pTransmitKey, uNodeIndex,
&uMACfragNum, &uMACfragNum,
&cbHeaderSize &cbHeaderSize
); );
if (MACbIsRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_PS)) { if (MACbIsRegBitsOn(pDevice->PortOffset, MAC_REG_PSCTL, PSCTL_PS)) {
// Disable PS // Disable PS
MACbPSWakeup(pDevice->PortOffset); MACbPSWakeup(pDevice->PortOffset);
} }
pDevice->bPWBitOn = false; pDevice->bPWBitOn = false;
pLastTD = pHeadTD; pLastTD = pHeadTD;
for (ii = 0; ii < uMACfragNum; ii++) { for (ii = 0; ii < uMACfragNum; ii++) {
// Poll Transmit the adapter // Poll Transmit the adapter
wmb(); wmb();
pHeadTD->m_td0TD0.f1Owner=OWNED_BY_NIC; pHeadTD->m_td0TD0.f1Owner = OWNED_BY_NIC;
wmb(); wmb();
if (ii == (uMACfragNum - 1)) if (ii == (uMACfragNum - 1))
pLastTD = pHeadTD; pLastTD = pHeadTD;
pHeadTD = pHeadTD->next; pHeadTD = pHeadTD->next;
} }
pLastTD->pTDInfo->skb = 0; pLastTD->pTDInfo->skb = 0;
pLastTD->pTDInfo->byFlags = 0; pLastTD->pTDInfo->byFlags = 0;
pDevice->apCurrTD[TYPE_AC0DMA] = pHeadTD; pDevice->apCurrTD[TYPE_AC0DMA] = pHeadTD;
MACvTransmitAC0(pDevice->PortOffset); MACvTransmitAC0(pDevice->PortOffset);
return true; return true;
} }

View File

@ -39,7 +39,7 @@
/*--------------------- Export Functions --------------------------*/ /*--------------------- Export Functions --------------------------*/
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);
#endif // __WROUTE_H__ #endif // __WROUTE_H__