Commit b8314cfc authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

staging:vt6655:datarate: Whitespace cleanups

Neatening only.
git diff -w shows no differences.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9aa69c9a
...@@ -51,10 +51,10 @@ ...@@ -51,10 +51,10 @@
/*--------------------- Static Classes ----------------------------*/ /*--------------------- Static Classes ----------------------------*/
extern unsigned short TxRate_iwconfig; //2008-5-8 <add> by chester extern unsigned short TxRate_iwconfig; //2008-5-8 <add> by chester
/*--------------------- Static Variables --------------------------*/ /*--------------------- Static Variables --------------------------*/
//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 unsigned char acbyIERate[MAX_RATE] = const unsigned char acbyIERate[MAX_RATE] =
{0x02, 0x04, 0x0B, 0x16, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C}; {0x02, 0x04, 0x0B, 0x16, 0x0C, 0x12, 0x18, 0x24, 0x30, 0x48, 0x60, 0x6C};
...@@ -64,21 +64,21 @@ const unsigned char acbyIERate[MAX_RATE] = ...@@ -64,21 +64,21 @@ const unsigned char acbyIERate[MAX_RATE] =
/*--------------------- Static Functions --------------------------*/ /*--------------------- Static Functions --------------------------*/
void s_vResetCounter ( void s_vResetCounter(
PKnownNodeDB psNodeDBTable PKnownNodeDB psNodeDBTable
); );
void void
s_vResetCounter ( s_vResetCounter(
PKnownNodeDB psNodeDBTable PKnownNodeDB psNodeDBTable
) )
{ {
unsigned char ii; unsigned char ii;
// clear statistic counter for auto_rate // clear statistic 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;
} }
...@@ -103,18 +103,18 @@ s_vResetCounter ( ...@@ -103,18 +103,18 @@ s_vResetCounter (
* *
* Return Value: RateIdx * Return Value: RateIdx
* *
-*/ -*/
unsigned char unsigned char
DATARATEbyGetRateIdx ( DATARATEbyGetRateIdx(
unsigned char byRate unsigned char byRate
) )
{ {
unsigned char ii; unsigned char ii;
//Erase basicRate flag. //Erase basicRate flag.
byRate = byRate & 0x7F;//0111 1111 byRate = byRate & 0x7F;//0111 1111
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;
} }
...@@ -137,7 +137,7 @@ DATARATEbyGetRateIdx ( ...@@ -137,7 +137,7 @@ DATARATEbyGetRateIdx (
* *
* Return Value: none * Return Value: none
* *
-*/ -*/
#define AUTORATE_TXCNT_THRESHOLD 20 #define AUTORATE_TXCNT_THRESHOLD 20
#define AUTORATE_INC_THRESHOLD 30 #define AUTORATE_INC_THRESHOLD 30
...@@ -157,18 +157,18 @@ DATARATEbyGetRateIdx ( ...@@ -157,18 +157,18 @@ DATARATEbyGetRateIdx (
* *
* Return Value: RateIdx * Return Value: RateIdx
* *
-*/ -*/
unsigned short unsigned short
wGetRateIdx( wGetRateIdx(
unsigned char byRate unsigned char byRate
) )
{ {
unsigned short ii; unsigned short ii;
//Erase basicRate flag. //Erase basicRate flag.
byRate = byRate & 0x7F;//0111 1111 byRate = byRate & 0x7F;//0111 1111
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;
} }
...@@ -193,9 +193,9 @@ wGetRateIdx( ...@@ -193,9 +193,9 @@ wGetRateIdx(
* *
* Return Value: none * Return Value: none
* *
-*/ -*/
void void
RATEvParseMaxRate ( RATEvParseMaxRate(
void *pDeviceHandler, void *pDeviceHandler,
PWLAN_IE_SUPP_RATES pItemRates, PWLAN_IE_SUPP_RATES pItemRates,
PWLAN_IE_SUPP_RATES pItemExtRates, PWLAN_IE_SUPP_RATES pItemExtRates,
...@@ -205,14 +205,14 @@ RATEvParseMaxRate ( ...@@ -205,14 +205,14 @@ RATEvParseMaxRate (
unsigned short *pwSuppRate, unsigned short *pwSuppRate,
unsigned char *pbyTopCCKRate, unsigned char *pbyTopCCKRate,
unsigned char *pbyTopOFDMRate unsigned char *pbyTopOFDMRate
) )
{ {
PSDevice pDevice = (PSDevice) pDeviceHandler; PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned int ii; unsigned int ii;
unsigned char byHighSuppRate = 0; unsigned char byHighSuppRate = 0;
unsigned char byRate = 0; unsigned char byRate = 0;
unsigned short wOldBasicRate = pDevice->wBasicRate; unsigned short wOldBasicRate = pDevice->wBasicRate;
unsigned int uRateLen; unsigned int uRateLen;
if (pItemRates == NULL) if (pItemRates == NULL)
...@@ -221,7 +221,7 @@ unsigned int uRateLen; ...@@ -221,7 +221,7 @@ unsigned int uRateLen;
*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->eCurrentPHYType != PHY_TYPE_11B) { if (pDevice->eCurrentPHYType != PHY_TYPE_11B) {
if (uRateLen > WLAN_RATES_MAXLEN) if (uRateLen > WLAN_RATES_MAXLEN)
uRateLen = WLAN_RATES_MAXLEN; uRateLen = WLAN_RATES_MAXLEN;
...@@ -236,7 +236,7 @@ unsigned int uRateLen; ...@@ -236,7 +236,7 @@ unsigned int uRateLen;
(bUpdateBasicRate == true)) { (bUpdateBasicRate == true)) {
// Add to basic rate set, update pDevice->byTopCCKBasicRate and pDevice->byTopOFDMBasicRate // Add to basic rate set, update pDevice->byTopCCKBasicRate and pDevice->byTopOFDMBasicRate
CARDbAddBasicRate((void *)pDevice, wGetRateIdx(byRate)); CARDbAddBasicRate((void *)pDevice, wGetRateIdx(byRate));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ParseMaxRate AddBasicRate: %d\n", wGetRateIdx(byRate)); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ParseMaxRate AddBasicRate: %d\n", wGetRateIdx(byRate));
} }
byRate = (unsigned char)(pItemRates->abyRates[ii]&0x7F); byRate = (unsigned char)(pItemRates->abyRates[ii]&0x7F);
if (byHighSuppRate == 0) if (byHighSuppRate == 0)
...@@ -253,13 +253,13 @@ unsigned int uRateLen; ...@@ -253,13 +253,13 @@ unsigned int uRateLen;
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 = (unsigned char)(pItemExtRates->abyRates[ii]); byRate = (unsigned char)(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 pDevice->byTopOFDMBasicRate // Add to basic rate set, update pDevice->byTopCCKBasicRate and pDevice->byTopOFDMBasicRate
CARDbAddBasicRate((void *)pDevice, wGetRateIdx(byRate)); CARDbAddBasicRate((void *)pDevice, wGetRateIdx(byRate));
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ParseMaxRate AddBasicRate: %d\n", wGetRateIdx(byRate)); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ParseMaxRate AddBasicRate: %d\n", wGetRateIdx(byRate));
} }
byRate = (unsigned char)(pItemExtRates->abyRates[ii]&0x7F); byRate = (unsigned char)(pItemExtRates->abyRates[ii]&0x7F);
if (byHighSuppRate == 0) if (byHighSuppRate == 0)
...@@ -269,7 +269,7 @@ unsigned int uRateLen; ...@@ -269,7 +269,7 @@ unsigned int uRateLen;
*pwSuppRate |= (1<<wGetRateIdx(byRate)); *pwSuppRate |= (1<<wGetRateIdx(byRate));
//DBG_PRN_GRP09(("ParseMaxRate : HighSuppRate: %d, %X\n", wGetRateIdx(byRate), byRate)); //DBG_PRN_GRP09(("ParseMaxRate : HighSuppRate: %d, %X\n", wGetRateIdx(byRate), byRate));
} }
} //if(pItemExtRates != NULL) } //if (pItemExtRates != NULL)
if ((pDevice->byPacketType == PK_TYPE_11GB) && CARDbIsOFDMinBasicRate((void *)pDevice)) { if ((pDevice->byPacketType == PK_TYPE_11GB) && CARDbIsOFDMinBasicRate((void *)pDevice)) {
pDevice->byPacketType = PK_TYPE_11GA; pDevice->byPacketType = PK_TYPE_11GA;
...@@ -278,14 +278,14 @@ unsigned int uRateLen; ...@@ -278,14 +278,14 @@ unsigned int uRateLen;
*pbyTopCCKRate = pDevice->byTopCCKBasicRate; *pbyTopCCKRate = pDevice->byTopCCKBasicRate;
*pbyTopOFDMRate = pDevice->byTopOFDMBasicRate; *pbyTopOFDMRate = pDevice->byTopOFDMBasicRate;
*pwMaxSuppRate = wGetRateIdx(byHighSuppRate); *pwMaxSuppRate = wGetRateIdx(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->eCurrentPHYType); CARDvSetRSPINF((void *)pDevice, pDevice->eCurrentPHYType);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Exit ParseMaxRate\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Exit ParseMaxRate\n");
} }
...@@ -303,21 +303,21 @@ unsigned int uRateLen; ...@@ -303,21 +303,21 @@ unsigned int uRateLen;
* *
* Return Value: none * Return Value: none
* *
-*/ -*/
#define AUTORATE_TXCNT_THRESHOLD 20 #define AUTORATE_TXCNT_THRESHOLD 20
#define AUTORATE_INC_THRESHOLD 30 #define AUTORATE_INC_THRESHOLD 30
void void
RATEvTxRateFallBack ( RATEvTxRateFallBack(
void *pDeviceHandler, void *pDeviceHandler,
PKnownNodeDB psNodeDBTable PKnownNodeDB psNodeDBTable
) )
{ {
PSDevice pDevice = (PSDevice) pDeviceHandler; PSDevice pDevice = (PSDevice) pDeviceHandler;
unsigned short wIdxDownRate = 0; unsigned short wIdxDownRate = 0;
unsigned int ii; unsigned int ii;
//unsigned long dwRateTable[MAX_RATE] = {1, 2, 5, 11, 6, 9, 12, 18, 24, 36, 48, 54}; //unsigned long dwRateTable[MAX_RATE] = {1, 2, 5, 11, 6, 9, 12, 18, 24, 36, 48, 54};
bool bAutoRate[MAX_RATE] = {true,true,true,true,false,false,true,true,true,true,true,true}; bool bAutoRate[MAX_RATE] = {true, true, true, true, false, false, true, true, true, true, true, true};
unsigned long dwThroughputTbl[MAX_RATE] = {10, 20, 55, 110, 60, 90, 120, 180, 240, 360, 480, 540}; unsigned long dwThroughputTbl[MAX_RATE] = {10, 20, 55, 110, 60, 90, 120, 180, 240, 360, 480, 540};
unsigned long dwThroughput = 0; unsigned long dwThroughput = 0;
unsigned short wIdxUpRate = 0; unsigned short wIdxUpRate = 0;
...@@ -328,7 +328,7 @@ bool bAutoRate[MAX_RATE] = {true,true,true,true,false,false,true,true,true,tr ...@@ -328,7 +328,7 @@ bool bAutoRate[MAX_RATE] = {true,true,true,true,false,false,true,true,true,tr
return; return;
} }
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];
...@@ -344,7 +344,7 @@ bool bAutoRate[MAX_RATE] = {true,true,true,true,false,false,true,true,true,tr ...@@ -344,7 +344,7 @@ bool bAutoRate[MAX_RATE] = {true,true,true,true,false,false,true,true,true,tr
} }
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 = (unsigned short) ii; wIdxUpRate = (unsigned short) ii;
...@@ -354,25 +354,25 @@ bool bAutoRate[MAX_RATE] = {true,true,true,true,false,false,true,true,true,tr ...@@ -354,25 +354,25 @@ bool bAutoRate[MAX_RATE] = {true,true,true,true,false,false,true,true,true,tr
} }
} }
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, psNodeDBTable->uTxOk[ii], psNodeDBTable->uTxFail[ii], dwThroughputTbl[ii]); // ii, psNodeDBTable->uTxOk[ii], psNodeDBTable->uTxFail[ii], 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 = (unsigned short) ii; wIdxDownRate = (unsigned short) ii;
} }
...@@ -380,17 +380,17 @@ bool bAutoRate[MAX_RATE] = {true,true,true,true,false,false,true,true,true,tr ...@@ -380,17 +380,17 @@ bool bAutoRate[MAX_RATE] = {true,true,true,true,false,false,true,true,true,tr
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 =0 & uTxFail = 0 } else { // adhoc, if uTxOk =0 & uTxFail = 0
if (psNodeDBTable->uTxFail[MAX_RATE] == 0) if (psNodeDBTable->uTxFail[MAX_RATE] == 0)
psNodeDBTable->wTxDataRate = wIdxUpRate; psNodeDBTable->wTxDataRate = wIdxUpRate;
} }
//2008-5-8 <add> by chester //2008-5-8 <add> by chester
TxRate_iwconfig=psNodeDBTable->wTxDataRate; TxRate_iwconfig = psNodeDBTable->wTxDataRate;
s_vResetCounter(psNodeDBTable); s_vResetCounter(psNodeDBTable);
// DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"Rate: %d, U:%d, D:%d\n", psNodeDBTable->wTxDataRate, wIdxUpRate, wIdxDownRate); // DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Rate: %d, U:%d, D:%d\n", psNodeDBTable->wTxDataRate, wIdxUpRate, wIdxDownRate);
return; return;
...@@ -408,13 +408,13 @@ TxRate_iwconfig=psNodeDBTable->wTxDataRate; ...@@ -408,13 +408,13 @@ TxRate_iwconfig=psNodeDBTable->wTxDataRate;
* *
* Return Value: None * Return Value: None
* *
-*/ -*/
unsigned char unsigned char
RATEuSetIE ( RATEuSetIE(
PWLAN_IE_SUPP_RATES pSrcRates, PWLAN_IE_SUPP_RATES pSrcRates,
PWLAN_IE_SUPP_RATES pDstRates, PWLAN_IE_SUPP_RATES pDstRates,
unsigned int uRateLen unsigned int uRateLen
) )
{ {
unsigned int ii, uu, uRateCnt = 0; unsigned int ii, uu, uRateCnt = 0;
...@@ -427,7 +427,7 @@ RATEuSetIE ( ...@@ -427,7 +427,7 @@ RATEuSetIE (
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;
} }
} }
......
...@@ -65,31 +65,31 @@ RATEvParseMaxRate( ...@@ -65,31 +65,31 @@ RATEvParseMaxRate(
unsigned short *pwSuppRate, unsigned short *pwSuppRate,
unsigned char *pbyTopCCKRate, unsigned char *pbyTopCCKRate,
unsigned char *pbyTopOFDMRate unsigned char *pbyTopOFDMRate
); );
void void
RATEvTxRateFallBack( RATEvTxRateFallBack(
void *pDeviceHandler, void *pDeviceHandler,
PKnownNodeDB psNodeDBTable PKnownNodeDB psNodeDBTable
); );
unsigned char unsigned char
RATEuSetIE( RATEuSetIE(
PWLAN_IE_SUPP_RATES pSrcRates, PWLAN_IE_SUPP_RATES pSrcRates,
PWLAN_IE_SUPP_RATES pDstRates, PWLAN_IE_SUPP_RATES pDstRates,
unsigned int uRateLen unsigned int uRateLen
); );
unsigned short unsigned short
wGetRateIdx( wGetRateIdx(
unsigned char byRate unsigned char byRate
); );
unsigned char unsigned char
DATARATEbyGetRateIdx( DATARATEbyGetRateIdx(
unsigned char byRate unsigned char byRate
); );
#endif //__DATARATE_H__ #endif //__DATARATE_H__
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment