staging: vt6656: fixed indentation and unnecessary space errors

Fixed the indentation errors and removed unnecessary space
warnings to comply with coding style

Signed-off-by: Nandini Hanumanthagowda <nandu.hgowda@gmail.com>
Reviewed-by: Lisa Nguyen <lisa@xenapiadmin.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Nandini Hanumanthagowda 2013-10-24 00:20:11 +05:30 committed by Greg Kroah-Hartman
parent 2467635ee3
commit 3cef1a2e8c
1 changed files with 167 additions and 170 deletions

View File

@ -44,9 +44,9 @@
#include "rf.h" #include "rf.h"
/* static int msglevel = MSG_LEVEL_DEBUG; */ /* static int msglevel = MSG_LEVEL_DEBUG; */
static int msglevel =MSG_LEVEL_INFO; static int msglevel = MSG_LEVEL_INFO;
const u8 acbyIERate[MAX_RATE] = const u8 acbyIERate[MAX_RATE] = {0x02, 0x04, 0x0B, 0x16, 0x0C, 0x12, 0x18,
{0x02, 0x04, 0x0B, 0x16, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; 0x24, 0x30, 0x48, 0x60, 0x6C};
#define AUTORATE_TXOK_CNT 0x0400 #define AUTORATE_TXOK_CNT 0x0400
#define AUTORATE_TXFAIL_CNT 0x0064 #define AUTORATE_TXFAIL_CNT 0x0064
@ -56,13 +56,13 @@ void s_vResetCounter(PKnownNodeDB psNodeDBTable);
void s_vResetCounter(PKnownNodeDB psNodeDBTable) void s_vResetCounter(PKnownNodeDB psNodeDBTable)
{ {
u8 ii; u8 ii;
/* clear statistics counter for auto_rate */ /* clear statistics counter for auto_rate */
for (ii = 0; ii <= MAX_RATE; ii++) { for (ii = 0; ii <= MAX_RATE; ii++) {
psNodeDBTable->uTxOk[ii] = 0; psNodeDBTable->uTxOk[ii] = 0;
psNodeDBTable->uTxFail[ii] = 0; psNodeDBTable->uTxFail[ii] = 0;
} }
} }
/*+ /*+
@ -97,21 +97,18 @@ void s_vResetCounter(PKnownNodeDB psNodeDBTable)
* Return Value: RateIdx * Return Value: RateIdx
* *
-*/ -*/
u16 u16 RATEwGetRateIdx(u8 byRate)
RATEwGetRateIdx(
u8 byRate
)
{ {
u16 ii; u16 ii;
/* erase BasicRate flag */ /* erase BasicRate flag */
byRate = byRate & 0x7F; byRate = byRate & 0x7F;
for (ii = 0; ii < MAX_RATE; ii ++) { for (ii = 0; ii < MAX_RATE; ii++) {
if (acbyIERate[ii] == byRate) if (acbyIERate[ii] == byRate)
return ii; return ii;
} }
return 0; return 0;
} }
/*+ /*+
@ -139,7 +136,7 @@ void RATEvParseMaxRate(struct vnt_private *pDevice,
int bUpdateBasicRate, u16 *pwMaxBasicRate, u16 *pwMaxSuppRate, int bUpdateBasicRate, u16 *pwMaxBasicRate, u16 *pwMaxSuppRate,
u16 *pwSuppRate, u8 *pbyTopCCKRate, u8 *pbyTopOFDMRate) u16 *pwSuppRate, u8 *pbyTopCCKRate, u8 *pbyTopOFDMRate)
{ {
int ii; int ii;
u8 byHighSuppRate = 0, byRate = 0; u8 byHighSuppRate = 0, byRate = 0;
u16 wOldBasicRate = pDevice->wBasicRate; u16 wOldBasicRate = pDevice->wBasicRate;
u32 uRateLen; u32 uRateLen;
@ -147,83 +144,88 @@ void RATEvParseMaxRate(struct vnt_private *pDevice,
if (pItemRates == NULL) if (pItemRates == NULL)
return; return;
*pwSuppRate = 0; *pwSuppRate = 0;
uRateLen = pItemRates->len; uRateLen = pItemRates->len;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ParseMaxRate Len: %d\n", uRateLen); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ParseMaxRate Len: %d\n", uRateLen);
if (pDevice->byBBType != BB_TYPE_11B) { if (pDevice->byBBType != BB_TYPE_11B) {
if (uRateLen > WLAN_RATES_MAXLEN) if (uRateLen > WLAN_RATES_MAXLEN)
uRateLen = WLAN_RATES_MAXLEN; uRateLen = WLAN_RATES_MAXLEN;
} else { } else {
if (uRateLen > WLAN_RATES_MAXLEN_11B) if (uRateLen > WLAN_RATES_MAXLEN_11B)
uRateLen = WLAN_RATES_MAXLEN_11B; uRateLen = WLAN_RATES_MAXLEN_11B;
} }
for (ii = 0; ii < uRateLen; ii++) { for (ii = 0; ii < uRateLen; ii++) {
byRate = (u8)(pItemRates->abyRates[ii]); byRate = (u8)(pItemRates->abyRates[ii]);
if (WLAN_MGMT_IS_BASICRATE(byRate) && if (WLAN_MGMT_IS_BASICRATE(byRate) &&
(bUpdateBasicRate == true)) { (bUpdateBasicRate == true)) {
/* /*
* add to basic rate set, update pDevice->byTopCCKBasicRate and * add to basic rate set, update pDevice->byTopCCKBasicRate and
* pDevice->byTopOFDMBasicRate * pDevice->byTopOFDMBasicRate
*/ */
CARDbAddBasicRate((void *)pDevice, RATEwGetRateIdx(byRate)); CARDbAddBasicRate((void *)pDevice, RATEwGetRateIdx(byRate));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ParseMaxRate AddBasicRate: %d\n", RATEwGetRateIdx(byRate)); DBG_PRT(MSG_LEVEL_DEBUG,
} KERN_INFO"ParseMaxRate AddBasicRate: %d\n",
byRate = (u8)(pItemRates->abyRates[ii]&0x7F); RATEwGetRateIdx(byRate));
if (byHighSuppRate == 0) }
byHighSuppRate = byRate; byRate = (u8)(pItemRates->abyRates[ii]&0x7F);
if (byRate > byHighSuppRate) if (byHighSuppRate == 0)
byHighSuppRate = byRate; byHighSuppRate = byRate;
*pwSuppRate |= (1<<RATEwGetRateIdx(byRate)); if (byRate > byHighSuppRate)
} byHighSuppRate = byRate;
if ((pItemExtRates != NULL) && (pItemExtRates->byElementID == WLAN_EID_EXTSUPP_RATES) && *pwSuppRate |= (1<<RATEwGetRateIdx(byRate));
(pDevice->byBBType != BB_TYPE_11B)) { }
if ((pItemExtRates != NULL) && (pItemExtRates->byElementID == WLAN_EID_EXTSUPP_RATES) &&
(pDevice->byBBType != BB_TYPE_11B)) {
unsigned int uExtRateLen = pItemExtRates->len; unsigned int uExtRateLen = pItemExtRates->len;
if (uExtRateLen > WLAN_RATES_MAXLEN) if (uExtRateLen > WLAN_RATES_MAXLEN)
uExtRateLen = WLAN_RATES_MAXLEN; uExtRateLen = WLAN_RATES_MAXLEN;
for (ii = 0; ii < uExtRateLen ; ii++) { for (ii = 0; ii < uExtRateLen; ii++) {
byRate = (u8)(pItemExtRates->abyRates[ii]); byRate = (u8)(pItemExtRates->abyRates[ii]);
/* select highest basic rate */ /* select highest basic rate */
if (WLAN_MGMT_IS_BASICRATE(pItemExtRates->abyRates[ii])) { if (WLAN_MGMT_IS_BASICRATE(pItemExtRates->abyRates[ii])) {
/* /*
* add to basic rate set, update pDevice->byTopCCKBasicRate and * add to basic rate set, update pDevice->byTopCCKBasicRate and
* pDevice->byTopOFDMBasicRate * pDevice->byTopOFDMBasicRate
*/ */
CARDbAddBasicRate((void *)pDevice, RATEwGetRateIdx(byRate)); CARDbAddBasicRate((void *)pDevice, RATEwGetRateIdx(byRate));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ParseMaxRate AddBasicRate: %d\n", RATEwGetRateIdx(byRate)); DBG_PRT(MSG_LEVEL_DEBUG,
} KERN_INFO"ParseMaxRate AddBasicRate: %d\n",
byRate = (u8)(pItemExtRates->abyRates[ii]&0x7F); RATEwGetRateIdx(byRate));
if (byHighSuppRate == 0) }
byHighSuppRate = byRate; byRate = (u8)(pItemExtRates->abyRates[ii]&0x7F);
if (byRate > byHighSuppRate) if (byHighSuppRate == 0)
byHighSuppRate = byRate; byHighSuppRate = byRate;
*pwSuppRate |= (1<<RATEwGetRateIdx(byRate)); if (byRate > byHighSuppRate)
byHighSuppRate = byRate;
*pwSuppRate |= (1<<RATEwGetRateIdx(byRate));
/* DBG_PRN_GRP09(("ParseMaxRate : HighSuppRate: %d, %X\n", /* DBG_PRN_GRP09(("ParseMaxRate : HighSuppRate: %d, %X\n",
RATEwGetRateIdx(byRate), byRate)); */ * RATEwGetRateIdx(byRate), byRate));
} */
} }
}
if ((pDevice->byPacketType == PK_TYPE_11GB) if ((pDevice->byPacketType == PK_TYPE_11GB)
&& CARDbIsOFDMinBasicRate((void *)pDevice)) { && CARDbIsOFDMinBasicRate((void *)pDevice)) {
pDevice->byPacketType = PK_TYPE_11GA; pDevice->byPacketType = PK_TYPE_11GA;
} }
*pbyTopCCKRate = pDevice->byTopCCKBasicRate; *pbyTopCCKRate = pDevice->byTopCCKBasicRate;
*pbyTopOFDMRate = pDevice->byTopOFDMBasicRate; *pbyTopOFDMRate = pDevice->byTopOFDMBasicRate;
*pwMaxSuppRate = RATEwGetRateIdx(byHighSuppRate); *pwMaxSuppRate = RATEwGetRateIdx(byHighSuppRate);
if ((pDevice->byPacketType==PK_TYPE_11B) || (pDevice->byPacketType==PK_TYPE_11GB)) if ((pDevice->byPacketType == PK_TYPE_11B) || (pDevice->byPacketType == PK_TYPE_11GB))
*pwMaxBasicRate = pDevice->byTopCCKBasicRate; *pwMaxBasicRate = pDevice->byTopCCKBasicRate;
else else
*pwMaxBasicRate = pDevice->byTopOFDMBasicRate; *pwMaxBasicRate = pDevice->byTopOFDMBasicRate;
if (wOldBasicRate != pDevice->wBasicRate) if (wOldBasicRate != pDevice->wBasicRate)
CARDvSetRSPINF((void *)pDevice, pDevice->byBBType); CARDvSetRSPINF((void *)pDevice, pDevice->byBBType);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Exit ParseMaxRate\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Exit ParseMaxRate\n");
} }
/*+ /*+
@ -263,71 +265,71 @@ void RATEvTxRateFallBack(struct vnt_private *pDevice,
psNodeDBTable->uTimeCount++; psNodeDBTable->uTimeCount++;
if (psNodeDBTable->uTxFail[MAX_RATE] > psNodeDBTable->uTxOk[MAX_RATE]) if (psNodeDBTable->uTxFail[MAX_RATE] > psNodeDBTable->uTxOk[MAX_RATE])
dwTxDiff = psNodeDBTable->uTxFail[MAX_RATE] - psNodeDBTable->uTxOk[MAX_RATE]; dwTxDiff = psNodeDBTable->uTxFail[MAX_RATE] - psNodeDBTable->uTxOk[MAX_RATE];
if ((psNodeDBTable->uTxOk[MAX_RATE] < AUTORATE_TXOK_CNT) && if ((psNodeDBTable->uTxOk[MAX_RATE] < AUTORATE_TXOK_CNT) &&
(dwTxDiff < AUTORATE_TXFAIL_CNT) && (dwTxDiff < AUTORATE_TXFAIL_CNT) &&
(psNodeDBTable->uTimeCount < AUTORATE_TIMEOUT)) { (psNodeDBTable->uTimeCount < AUTORATE_TIMEOUT)) {
return; return;
} }
if (psNodeDBTable->uTimeCount >= AUTORATE_TIMEOUT) { if (psNodeDBTable->uTimeCount >= AUTORATE_TIMEOUT) {
psNodeDBTable->uTimeCount = 0; psNodeDBTable->uTimeCount = 0;
} }
for (ii = 0; ii < MAX_RATE; ii++) { for (ii = 0; ii < MAX_RATE; ii++) {
if (psNodeDBTable->wSuppRate & (0x0001<<ii)) { if (psNodeDBTable->wSuppRate & (0x0001<<ii)) {
if (bAutoRate[ii] == true) { if (bAutoRate[ii] == true) {
wIdxUpRate = (u16) ii; wIdxUpRate = (u16) ii;
} }
} else { } else {
bAutoRate[ii] = false; bAutoRate[ii] = false;
} }
} }
for (ii = 0; ii <= psNodeDBTable->wTxDataRate; ii++) { for (ii = 0; ii <= psNodeDBTable->wTxDataRate; ii++) {
if ( (psNodeDBTable->uTxOk[ii] != 0) || if ((psNodeDBTable->uTxOk[ii] != 0) ||
(psNodeDBTable->uTxFail[ii] != 0) ) { (psNodeDBTable->uTxFail[ii] != 0)) {
dwThroughputTbl[ii] *= psNodeDBTable->uTxOk[ii]; dwThroughputTbl[ii] *= psNodeDBTable->uTxOk[ii];
if (ii < RATE_11M) { if (ii < RATE_11M) {
psNodeDBTable->uTxFail[ii] *= 4; psNodeDBTable->uTxFail[ii] *= 4;
} }
dwThroughputTbl[ii] /= (psNodeDBTable->uTxOk[ii] + psNodeDBTable->uTxFail[ii]); dwThroughputTbl[ii] /= (psNodeDBTable->uTxOk[ii] + psNodeDBTable->uTxFail[ii]);
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Rate %d,Ok: %d, Fail:%d, Throughput:%d\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Rate %d,Ok: %d, Fail:%d, Throughput:%d\n",
ii, (int)psNodeDBTable->uTxOk[ii], (int)psNodeDBTable->uTxFail[ii], (int)dwThroughputTbl[ii]); ii, (int)psNodeDBTable->uTxOk[ii], (int)psNodeDBTable->uTxFail[ii], (int)dwThroughputTbl[ii]);
} }
dwThroughput = dwThroughputTbl[psNodeDBTable->wTxDataRate]; dwThroughput = dwThroughputTbl[psNodeDBTable->wTxDataRate];
wIdxDownRate = psNodeDBTable->wTxDataRate; wIdxDownRate = psNodeDBTable->wTxDataRate;
for (ii = psNodeDBTable->wTxDataRate; ii > 0;) { for (ii = psNodeDBTable->wTxDataRate; ii > 0;) {
ii--; ii--;
if ( (dwThroughputTbl[ii] > dwThroughput) && if ((dwThroughputTbl[ii] > dwThroughput) &&
(bAutoRate[ii]==true) ) { (bAutoRate[ii] == true)) {
dwThroughput = dwThroughputTbl[ii]; dwThroughput = dwThroughputTbl[ii];
wIdxDownRate = (u16) ii; wIdxDownRate = (u16) ii;
} }
} }
psNodeDBTable->wTxDataRate = wIdxDownRate; psNodeDBTable->wTxDataRate = wIdxDownRate;
if (psNodeDBTable->uTxOk[MAX_RATE]) { if (psNodeDBTable->uTxOk[MAX_RATE]) {
if (psNodeDBTable->uTxOk[MAX_RATE] > if (psNodeDBTable->uTxOk[MAX_RATE] >
(psNodeDBTable->uTxFail[MAX_RATE] * 4) ) { (psNodeDBTable->uTxFail[MAX_RATE] * 4)) {
psNodeDBTable->wTxDataRate = wIdxUpRate; psNodeDBTable->wTxDataRate = wIdxUpRate;
} }
} else { /* adhoc, if uTxOk(total) == 0 & uTxFail(total) == 0 */ } else { /* adhoc, if uTxOk(total) == 0 & uTxFail(total) == 0 */
if (psNodeDBTable->uTxFail[MAX_RATE] == 0) if (psNodeDBTable->uTxFail[MAX_RATE] == 0)
psNodeDBTable->wTxDataRate = wIdxUpRate; psNodeDBTable->wTxDataRate = wIdxUpRate;
} }
if (pDevice->byBBType == BB_TYPE_11A) { if (pDevice->byBBType == BB_TYPE_11A) {
if (psNodeDBTable->wTxDataRate <= RATE_11M) if (psNodeDBTable->wTxDataRate <= RATE_11M)
psNodeDBTable->wTxDataRate = RATE_6M; psNodeDBTable->wTxDataRate = RATE_6M;
} }
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"uTxOk[MAX_RATE] %d, uTxFail[MAX_RATE]:%d\n",(int)psNodeDBTable->uTxOk[MAX_RATE], (int)psNodeDBTable->uTxFail[MAX_RATE]); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"uTxOk[MAX_RATE] %d, uTxFail[MAX_RATE]:%d\n", (int)psNodeDBTable->uTxOk[MAX_RATE], (int)psNodeDBTable->uTxFail[MAX_RATE]);
s_vResetCounter(psNodeDBTable); s_vResetCounter(psNodeDBTable);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Rate: %d, U:%d, D:%d\n", (int)psNodeDBTable->wTxDataRate, (int)wIdxUpRate, (int)wIdxDownRate); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Rate: %d, U:%d, D:%d\n", (int)psNodeDBTable->wTxDataRate, (int)wIdxUpRate, (int)wIdxDownRate);
return; return;
} }
/*+ /*+
@ -343,29 +345,24 @@ void RATEvTxRateFallBack(struct vnt_private *pDevice,
* Return Value: None * Return Value: None
* *
-*/ -*/
u8 u8 RATEuSetIE(PWLAN_IE_SUPP_RATES pSrcRates, PWLAN_IE_SUPP_RATES pDstRates,
RATEuSetIE ( unsigned int uRateLen)
PWLAN_IE_SUPP_RATES pSrcRates,
PWLAN_IE_SUPP_RATES pDstRates,
unsigned int uRateLen
)
{ {
unsigned int ii, uu, uRateCnt = 0; unsigned int ii, uu, uRateCnt = 0;
if ((pSrcRates == NULL) || (pDstRates == NULL)) if ((pSrcRates == NULL) || (pDstRates == NULL))
return 0; return 0;
if (pSrcRates->len == 0) if (pSrcRates->len == 0)
return 0; return 0;
for (ii = 0; ii < uRateLen; ii++) { for (ii = 0; ii < uRateLen; ii++) {
for (uu = 0; uu < pSrcRates->len; uu++) { for (uu = 0; uu < pSrcRates->len; uu++) {
if ((pSrcRates->abyRates[uu] & 0x7F) == acbyIERate[ii]) { if ((pSrcRates->abyRates[uu] & 0x7F) == acbyIERate[ii]) {
pDstRates->abyRates[uRateCnt ++] = pSrcRates->abyRates[uu]; pDstRates->abyRates[uRateCnt++] = pSrcRates->abyRates[uu];
break; break;
} }
} }
} }
return (u8)uRateCnt; return (u8)uRateCnt;
} }