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

staging:vt6655:baseband: 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 659b4d97
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
/*--------------------- Static Definitions -------------------------*/ /*--------------------- Static Definitions -------------------------*/
//static int msglevel =MSG_LEVEL_DEBUG; //static int msglevel =MSG_LEVEL_DEBUG;
static int msglevel =MSG_LEVEL_INFO; static int msglevel = MSG_LEVEL_INFO;
/*--------------------- Static Classes ----------------------------*/ /*--------------------- Static Classes ----------------------------*/
...@@ -1724,36 +1724,36 @@ static ...@@ -1724,36 +1724,36 @@ static
void void
s_vChangeAntenna( s_vChangeAntenna(
PSDevice pDevice PSDevice pDevice
); );
static static
void void
s_vChangeAntenna ( s_vChangeAntenna(
PSDevice pDevice PSDevice pDevice
) )
{ {
#ifdef PLICE_DEBUG #ifdef PLICE_DEBUG
//printk("Enter s_vChangeAntenna:original RxMode is %d,TxMode is %d\n",pDevice->byRxAntennaMode,pDevice->byTxAntennaMode); //printk("Enter s_vChangeAntenna:original RxMode is %d,TxMode is %d\n",pDevice->byRxAntennaMode,pDevice->byTxAntennaMode);
#endif #endif
if ( pDevice->dwRxAntennaSel == 0) { if (pDevice->dwRxAntennaSel == 0) {
pDevice->dwRxAntennaSel=1; pDevice->dwRxAntennaSel = 1;
if (pDevice->bTxRxAntInv == true) if (pDevice->bTxRxAntInv == true)
BBvSetRxAntennaMode(pDevice->PortOffset, ANT_A); BBvSetRxAntennaMode(pDevice->PortOffset, ANT_A);
else else
BBvSetRxAntennaMode(pDevice->PortOffset, ANT_B); BBvSetRxAntennaMode(pDevice->PortOffset, ANT_B);
} else { } else {
pDevice->dwRxAntennaSel=0; pDevice->dwRxAntennaSel = 0;
if (pDevice->bTxRxAntInv == true) if (pDevice->bTxRxAntInv == true)
BBvSetRxAntennaMode(pDevice->PortOffset, ANT_B); BBvSetRxAntennaMode(pDevice->PortOffset, ANT_B);
else else
BBvSetRxAntennaMode(pDevice->PortOffset, ANT_A); BBvSetRxAntennaMode(pDevice->PortOffset, ANT_A);
} }
if ( pDevice->dwTxAntennaSel == 0) { if (pDevice->dwTxAntennaSel == 0) {
pDevice->dwTxAntennaSel=1; pDevice->dwTxAntennaSel = 1;
BBvSetTxAntennaMode(pDevice->PortOffset, ANT_B); BBvSetTxAntennaMode(pDevice->PortOffset, ANT_B);
} else { } else {
pDevice->dwTxAntennaSel=0; pDevice->dwTxAntennaSel = 0;
BBvSetTxAntennaMode(pDevice->PortOffset, ANT_A); BBvSetTxAntennaMode(pDevice->PortOffset, ANT_A);
} }
} }
...@@ -1775,12 +1775,12 @@ s_vChangeAntenna ( ...@@ -1775,12 +1775,12 @@ s_vChangeAntenna (
* *
*/ */
unsigned int unsigned int
BBuGetFrameTime ( BBuGetFrameTime(
unsigned char byPreambleType, unsigned char byPreambleType,
unsigned char byPktType, unsigned char byPktType,
unsigned int cbFrameLength, unsigned int cbFrameLength,
unsigned short wRate unsigned short wRate
) )
{ {
unsigned int uFrameTime; unsigned int uFrameTime;
unsigned int uPreamble; unsigned int uPreamble;
...@@ -1794,7 +1794,7 @@ BBuGetFrameTime ( ...@@ -1794,7 +1794,7 @@ BBuGetFrameTime (
return 0; return 0;
} }
uRate = (unsigned int) awcFrameTime[uRateIdx]; uRate = (unsigned int)awcFrameTime[uRateIdx];
if (uRateIdx <= 3) { //CCK mode if (uRateIdx <= 3) { //CCK mode
...@@ -1806,7 +1806,7 @@ BBuGetFrameTime ( ...@@ -1806,7 +1806,7 @@ BBuGetFrameTime (
uFrameTime = (cbFrameLength * 80) / uRate; //????? uFrameTime = (cbFrameLength * 80) / uRate; //?????
uTmp = (uFrameTime * uRate) / 80; uTmp = (uFrameTime * uRate) / 80;
if (cbFrameLength != uTmp) { if (cbFrameLength != uTmp) {
uFrameTime ++; uFrameTime++;
} }
return (uPreamble + uFrameTime); return (uPreamble + uFrameTime);
...@@ -1814,11 +1814,11 @@ BBuGetFrameTime ( ...@@ -1814,11 +1814,11 @@ BBuGetFrameTime (
else { else {
uFrameTime = (cbFrameLength * 8 + 22) / uRate; //???????? uFrameTime = (cbFrameLength * 8 + 22) / uRate; //????????
uTmp = ((uFrameTime * uRate) - 22) / 8; uTmp = ((uFrameTime * uRate) - 22) / 8;
if(cbFrameLength != uTmp) { if (cbFrameLength != uTmp) {
uFrameTime ++; uFrameTime++;
} }
uFrameTime = uFrameTime * 4; //??????? uFrameTime = uFrameTime * 4; //???????
if(byPktType != PK_TYPE_11A) { if (byPktType != PK_TYPE_11A) {
uFrameTime += 6; //?????? uFrameTime += 6; //??????
} }
return (20 + uFrameTime); //?????? return (20 + uFrameTime); //??????
...@@ -1842,7 +1842,7 @@ BBuGetFrameTime ( ...@@ -1842,7 +1842,7 @@ BBuGetFrameTime (
* *
*/ */
void void
BBvCalculateParameter ( BBvCalculateParameter(
PSDevice pDevice, PSDevice pDevice,
unsigned int cbFrameLength, unsigned int cbFrameLength,
unsigned short wRate, unsigned short wRate,
...@@ -1850,7 +1850,7 @@ BBvCalculateParameter ( ...@@ -1850,7 +1850,7 @@ BBvCalculateParameter (
unsigned short *pwPhyLen, unsigned short *pwPhyLen,
unsigned char *pbyPhySrv, unsigned char *pbyPhySrv,
unsigned char *pbyPhySgn unsigned char *pbyPhySgn
) )
{ {
unsigned int cbBitCount; unsigned int cbBitCount;
unsigned int cbUsCount = 0; unsigned int cbUsCount = 0;
...@@ -1863,12 +1863,12 @@ BBvCalculateParameter ( ...@@ -1863,12 +1863,12 @@ BBvCalculateParameter (
bExtBit = false; bExtBit = false;
switch (wRate) { switch (wRate) {
case RATE_1M : case RATE_1M:
cbUsCount = cbBitCount; cbUsCount = cbBitCount;
*pbyPhySgn = 0x00; *pbyPhySgn = 0x00;
break; break;
case RATE_2M : case RATE_2M:
cbUsCount = cbBitCount / 2; cbUsCount = cbBitCount / 2;
if (byPreambleType == 1) if (byPreambleType == 1)
*pbyPhySgn = 0x09; *pbyPhySgn = 0x09;
...@@ -1876,27 +1876,27 @@ BBvCalculateParameter ( ...@@ -1876,27 +1876,27 @@ BBvCalculateParameter (
*pbyPhySgn = 0x01; *pbyPhySgn = 0x01;
break; break;
case RATE_5M : case RATE_5M:
if (bCCK == false) if (bCCK == false)
cbBitCount ++; cbBitCount++;
cbUsCount = (cbBitCount * 10) / 55; cbUsCount = (cbBitCount * 10) / 55;
cbTmp = (cbUsCount * 55) / 10; cbTmp = (cbUsCount * 55) / 10;
if (cbTmp != cbBitCount) if (cbTmp != cbBitCount)
cbUsCount ++; cbUsCount++;
if (byPreambleType == 1) if (byPreambleType == 1)
*pbyPhySgn = 0x0a; *pbyPhySgn = 0x0a;
else // long preamble else // long preamble
*pbyPhySgn = 0x02; *pbyPhySgn = 0x02;
break; break;
case RATE_11M : case RATE_11M:
if (bCCK == false) if (bCCK == false)
cbBitCount ++; cbBitCount++;
cbUsCount = cbBitCount / 11; cbUsCount = cbBitCount / 11;
cbTmp = cbUsCount * 11; cbTmp = cbUsCount * 11;
if (cbTmp != cbBitCount) { if (cbTmp != cbBitCount) {
cbUsCount ++; cbUsCount++;
if ((cbBitCount - cbTmp) <= 3) if ((cbBitCount - cbTmp) <= 3)
bExtBit = true; bExtBit = true;
} }
...@@ -1906,8 +1906,8 @@ BBvCalculateParameter ( ...@@ -1906,8 +1906,8 @@ BBvCalculateParameter (
*pbyPhySgn = 0x03; *pbyPhySgn = 0x03;
break; break;
case RATE_6M : case RATE_6M:
if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9B; //1001 1011 *pbyPhySgn = 0x9B; //1001 1011
} }
else {//11g, 2.4GHZ else {//11g, 2.4GHZ
...@@ -1915,8 +1915,8 @@ BBvCalculateParameter ( ...@@ -1915,8 +1915,8 @@ BBvCalculateParameter (
} }
break; break;
case RATE_9M : case RATE_9M:
if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9F; //1001 1111 *pbyPhySgn = 0x9F; //1001 1111
} }
else {//11g, 2.4GHZ else {//11g, 2.4GHZ
...@@ -1924,8 +1924,8 @@ BBvCalculateParameter ( ...@@ -1924,8 +1924,8 @@ BBvCalculateParameter (
} }
break; break;
case RATE_12M : case RATE_12M:
if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9A; //1001 1010 *pbyPhySgn = 0x9A; //1001 1010
} }
else {//11g, 2.4GHZ else {//11g, 2.4GHZ
...@@ -1933,8 +1933,8 @@ BBvCalculateParameter ( ...@@ -1933,8 +1933,8 @@ BBvCalculateParameter (
} }
break; break;
case RATE_18M : case RATE_18M:
if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9E; //1001 1110 *pbyPhySgn = 0x9E; //1001 1110
} }
else {//11g, 2.4GHZ else {//11g, 2.4GHZ
...@@ -1942,8 +1942,8 @@ BBvCalculateParameter ( ...@@ -1942,8 +1942,8 @@ BBvCalculateParameter (
} }
break; break;
case RATE_24M : case RATE_24M:
if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x99; //1001 1001 *pbyPhySgn = 0x99; //1001 1001
} }
else {//11g, 2.4GHZ else {//11g, 2.4GHZ
...@@ -1951,8 +1951,8 @@ BBvCalculateParameter ( ...@@ -1951,8 +1951,8 @@ BBvCalculateParameter (
} }
break; break;
case RATE_36M : case RATE_36M:
if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9D; //1001 1101 *pbyPhySgn = 0x9D; //1001 1101
} }
else {//11g, 2.4GHZ else {//11g, 2.4GHZ
...@@ -1960,8 +1960,8 @@ BBvCalculateParameter ( ...@@ -1960,8 +1960,8 @@ BBvCalculateParameter (
} }
break; break;
case RATE_48M : case RATE_48M:
if(byPacketType == PK_TYPE_11A) {//11a, 5GHZ if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x98; //1001 1000 *pbyPhySgn = 0x98; //1001 1000
} }
else {//11g, 2.4GHZ else {//11g, 2.4GHZ
...@@ -1969,7 +1969,7 @@ BBvCalculateParameter ( ...@@ -1969,7 +1969,7 @@ BBvCalculateParameter (
} }
break; break;
case RATE_54M : case RATE_54M:
if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9C; //1001 1100 *pbyPhySgn = 0x9C; //1001 1100
} }
...@@ -1978,7 +1978,7 @@ BBvCalculateParameter ( ...@@ -1978,7 +1978,7 @@ BBvCalculateParameter (
} }
break; break;
default : default:
if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ if (byPacketType == PK_TYPE_11A) {//11a, 5GHZ
*pbyPhySgn = 0x9C; //1001 1100 *pbyPhySgn = 0x9C; //1001 1100
} }
...@@ -2013,7 +2013,7 @@ BBvCalculateParameter ( ...@@ -2013,7 +2013,7 @@ BBvCalculateParameter (
* Return Value: true if succeeded; false if failed. * Return Value: true if succeeded; false if failed.
* *
*/ */
bool BBbReadEmbedded (unsigned long dwIoBase, unsigned char byBBAddr, unsigned char *pbyData) bool BBbReadEmbedded(unsigned long dwIoBase, unsigned char byBBAddr, unsigned char *pbyData)
{ {
unsigned short ww; unsigned short ww;
unsigned char byValue; unsigned char byValue;
...@@ -2035,7 +2035,7 @@ bool BBbReadEmbedded (unsigned long dwIoBase, unsigned char byBBAddr, unsigned c ...@@ -2035,7 +2035,7 @@ bool BBbReadEmbedded (unsigned long dwIoBase, unsigned char byBBAddr, unsigned c
if (ww == W_MAX_TIMEOUT) { if (ww == W_MAX_TIMEOUT) {
DBG_PORT80(0x30); DBG_PORT80(0x30);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x30)\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x30)\n");
return false; return false;
} }
return true; return true;
...@@ -2056,7 +2056,7 @@ bool BBbReadEmbedded (unsigned long dwIoBase, unsigned char byBBAddr, unsigned c ...@@ -2056,7 +2056,7 @@ bool BBbReadEmbedded (unsigned long dwIoBase, unsigned char byBBAddr, unsigned c
* Return Value: true if succeeded; false if failed. * Return Value: true if succeeded; false if failed.
* *
*/ */
bool BBbWriteEmbedded (unsigned long dwIoBase, unsigned char byBBAddr, unsigned char byData) bool BBbWriteEmbedded(unsigned long dwIoBase, unsigned char byBBAddr, unsigned char byData)
{ {
unsigned short ww; unsigned short ww;
unsigned char byValue; unsigned char byValue;
...@@ -2077,7 +2077,7 @@ bool BBbWriteEmbedded (unsigned long dwIoBase, unsigned char byBBAddr, unsigned ...@@ -2077,7 +2077,7 @@ bool BBbWriteEmbedded (unsigned long dwIoBase, unsigned char byBBAddr, unsigned
if (ww == W_MAX_TIMEOUT) { if (ww == W_MAX_TIMEOUT) {
DBG_PORT80(0x31); DBG_PORT80(0x31);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO" DBG_PORT80(0x31)\n"); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO " DBG_PORT80(0x31)\n");
return false; return false;
} }
return true; return true;
...@@ -2098,7 +2098,7 @@ bool BBbWriteEmbedded (unsigned long dwIoBase, unsigned char byBBAddr, unsigned ...@@ -2098,7 +2098,7 @@ bool BBbWriteEmbedded (unsigned long dwIoBase, unsigned char byBBAddr, unsigned
* Return Value: true if all TestBits are set; false otherwise. * Return Value: true if all TestBits are set; false otherwise.
* *
*/ */
bool BBbIsRegBitsOn (unsigned long dwIoBase, unsigned char byBBAddr, unsigned char byTestBits) bool BBbIsRegBitsOn(unsigned long dwIoBase, unsigned char byBBAddr, unsigned char byTestBits)
{ {
unsigned char byOrgData; unsigned char byOrgData;
...@@ -2121,7 +2121,7 @@ bool BBbIsRegBitsOn (unsigned long dwIoBase, unsigned char byBBAddr, unsigned ch ...@@ -2121,7 +2121,7 @@ bool BBbIsRegBitsOn (unsigned long dwIoBase, unsigned char byBBAddr, unsigned ch
* Return Value: true if all TestBits are clear; false otherwise. * Return Value: true if all TestBits are clear; false otherwise.
* *
*/ */
bool BBbIsRegBitsOff (unsigned long dwIoBase, unsigned char byBBAddr, unsigned char byTestBits) bool BBbIsRegBitsOff(unsigned long dwIoBase, unsigned char byBBAddr, unsigned char byTestBits)
{ {
unsigned char byOrgData; unsigned char byOrgData;
...@@ -2144,7 +2144,7 @@ bool BBbIsRegBitsOff (unsigned long dwIoBase, unsigned char byBBAddr, unsigned c ...@@ -2144,7 +2144,7 @@ bool BBbIsRegBitsOff (unsigned long dwIoBase, unsigned char byBBAddr, unsigned c
* *
*/ */
bool BBbVT3253Init (PSDevice pDevice) bool BBbVT3253Init(PSDevice pDevice)
{ {
bool bResult = true; bool bResult = true;
int ii; int ii;
...@@ -2155,14 +2155,14 @@ bool BBbVT3253Init (PSDevice pDevice) ...@@ -2155,14 +2155,14 @@ bool BBbVT3253Init (PSDevice pDevice)
if (byRFType == RF_RFMD2959) { if (byRFType == RF_RFMD2959) {
if (byLocalID <= REV_ID_VT3253_A1) { if (byLocalID <= REV_ID_VT3253_A1) {
for (ii = 0; ii < CB_VT3253_INIT_FOR_RFMD; ii++) { for (ii = 0; ii < CB_VT3253_INIT_FOR_RFMD; ii++) {
bResult &= BBbWriteEmbedded(dwIoBase,byVT3253InitTab_RFMD[ii][0],byVT3253InitTab_RFMD[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253InitTab_RFMD[ii][0], byVT3253InitTab_RFMD[ii][1]);
} }
} else { } else {
for (ii = 0; ii < CB_VT3253B0_INIT_FOR_RFMD; ii++) { for (ii = 0; ii < CB_VT3253B0_INIT_FOR_RFMD; ii++) {
bResult &= BBbWriteEmbedded(dwIoBase,byVT3253B0_RFMD[ii][0],byVT3253B0_RFMD[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_RFMD[ii][0], byVT3253B0_RFMD[ii][1]);
} }
for (ii = 0; ii < CB_VT3253B0_AGC_FOR_RFMD2959; ii++) { for (ii = 0; ii < CB_VT3253B0_AGC_FOR_RFMD2959; ii++) {
bResult &= BBbWriteEmbedded(dwIoBase,byVT3253B0_AGC4_RFMD2959[ii][0],byVT3253B0_AGC4_RFMD2959[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC4_RFMD2959[ii][0], byVT3253B0_AGC4_RFMD2959[ii][1]);
} }
VNSvOutPortD(dwIoBase + MAC_REG_ITRTMSET, 0x23); VNSvOutPortD(dwIoBase + MAC_REG_ITRTMSET, 0x23);
MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT0); MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT0);
...@@ -2175,12 +2175,12 @@ bool BBbVT3253Init (PSDevice pDevice) ...@@ -2175,12 +2175,12 @@ bool BBbVT3253Init (PSDevice pDevice)
pDevice->ldBmThreshold[1] = -50; pDevice->ldBmThreshold[1] = -50;
pDevice->ldBmThreshold[2] = 0; pDevice->ldBmThreshold[2] = 0;
pDevice->ldBmThreshold[3] = 0; pDevice->ldBmThreshold[3] = 0;
} else if ((byRFType == RF_AIROHA) || (byRFType == RF_AL2230S) ) { } else if ((byRFType == RF_AIROHA) || (byRFType == RF_AL2230S)) {
for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++) { for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++) {
bResult &= BBbWriteEmbedded(dwIoBase,byVT3253B0_AIROHA2230[ii][0],byVT3253B0_AIROHA2230[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AIROHA2230[ii][0], byVT3253B0_AIROHA2230[ii][1]);
} }
for (ii = 0; ii < CB_VT3253B0_AGC; ii++) { for (ii = 0; ii < CB_VT3253B0_AGC; ii++) {
bResult &= BBbWriteEmbedded(dwIoBase,byVT3253B0_AGC[ii][0],byVT3253B0_AGC[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
} }
pDevice->abyBBVGA[0] = 0x1C; pDevice->abyBBVGA[0] = 0x1C;
pDevice->abyBBVGA[1] = 0x10; pDevice->abyBBVGA[1] = 0x10;
...@@ -2192,10 +2192,10 @@ bool BBbVT3253Init (PSDevice pDevice) ...@@ -2192,10 +2192,10 @@ bool BBbVT3253Init (PSDevice pDevice)
pDevice->ldBmThreshold[3] = 0; pDevice->ldBmThreshold[3] = 0;
} else if (byRFType == RF_UW2451) { } else if (byRFType == RF_UW2451) {
for (ii = 0; ii < CB_VT3253B0_INIT_FOR_UW2451; ii++) { for (ii = 0; ii < CB_VT3253B0_INIT_FOR_UW2451; ii++) {
bResult &= BBbWriteEmbedded(dwIoBase,byVT3253B0_UW2451[ii][0],byVT3253B0_UW2451[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_UW2451[ii][0], byVT3253B0_UW2451[ii][1]);
} }
for (ii = 0; ii < CB_VT3253B0_AGC; ii++) { for (ii = 0; ii < CB_VT3253B0_AGC; ii++) {
bResult &= BBbWriteEmbedded(dwIoBase,byVT3253B0_AGC[ii][0],byVT3253B0_AGC[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
} }
VNSvOutPortB(dwIoBase + MAC_REG_ITRTMSET, 0x23); VNSvOutPortB(dwIoBase + MAC_REG_ITRTMSET, 0x23);
MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT0); MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT0);
...@@ -2210,28 +2210,28 @@ bool BBbVT3253Init (PSDevice pDevice) ...@@ -2210,28 +2210,28 @@ bool BBbVT3253Init (PSDevice pDevice)
pDevice->ldBmThreshold[3] = 0; pDevice->ldBmThreshold[3] = 0;
} else if (byRFType == RF_UW2452) { } else if (byRFType == RF_UW2452) {
for (ii = 0; ii < CB_VT3253B0_INIT_FOR_UW2451; ii++) { for (ii = 0; ii < CB_VT3253B0_INIT_FOR_UW2451; ii++) {
bResult &= BBbWriteEmbedded(dwIoBase,byVT3253B0_UW2451[ii][0],byVT3253B0_UW2451[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_UW2451[ii][0], byVT3253B0_UW2451[ii][1]);
} }
// Init ANT B select,TX Config CR09 = 0x61->0x45, 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted) // Init ANT B select,TX Config CR09 = 0x61->0x45, 0x45->0x41(VC1/VC2 define, make the ANT_A, ANT_B inverted)
//bResult &= BBbWriteEmbedded(dwIoBase,0x09,0x41); //bResult &= BBbWriteEmbedded(dwIoBase,0x09,0x41);
// Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted) // Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted)
//bResult &= BBbWriteEmbedded(dwIoBase,0x0a,0x28); //bResult &= BBbWriteEmbedded(dwIoBase,0x0a,0x28);
// Select VC1/VC2, CR215 = 0x02->0x06 // Select VC1/VC2, CR215 = 0x02->0x06
bResult &= BBbWriteEmbedded(dwIoBase,0xd7,0x06); bResult &= BBbWriteEmbedded(dwIoBase, 0xd7, 0x06);
//{{RobertYu:20050125, request by Jack //{{RobertYu:20050125, request by Jack
bResult &= BBbWriteEmbedded(dwIoBase,0x90,0x20); bResult &= BBbWriteEmbedded(dwIoBase, 0x90, 0x20);
bResult &= BBbWriteEmbedded(dwIoBase,0x97,0xeb); bResult &= BBbWriteEmbedded(dwIoBase, 0x97, 0xeb);
//}} //}}
//{{RobertYu:20050221, request by Jack //{{RobertYu:20050221, request by Jack
bResult &= BBbWriteEmbedded(dwIoBase,0xa6,0x00); bResult &= BBbWriteEmbedded(dwIoBase, 0xa6, 0x00);
bResult &= BBbWriteEmbedded(dwIoBase,0xa8,0x30); bResult &= BBbWriteEmbedded(dwIoBase, 0xa8, 0x30);
//}} //}}
bResult &= BBbWriteEmbedded(dwIoBase,0xb0,0x58); bResult &= BBbWriteEmbedded(dwIoBase, 0xb0, 0x58);
for (ii = 0; ii < CB_VT3253B0_AGC; ii++) { for (ii = 0; ii < CB_VT3253B0_AGC; ii++) {
bResult &= BBbWriteEmbedded(dwIoBase,byVT3253B0_AGC[ii][0],byVT3253B0_AGC[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
} }
//VNSvOutPortB(dwIoBase + MAC_REG_ITRTMSET, 0x23); // RobertYu: 20050104, 20050131 disable PA_Delay //VNSvOutPortB(dwIoBase + MAC_REG_ITRTMSET, 0x23); // RobertYu: 20050104, 20050131 disable PA_Delay
//MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT0); // RobertYu: 20050104, 20050131 disable PA_Delay //MACvRegBitsOn(dwIoBase, MAC_REG_PAPEDELAY, BIT0); // RobertYu: 20050104, 20050131 disable PA_Delay
...@@ -2248,10 +2248,10 @@ bool BBbVT3253Init (PSDevice pDevice) ...@@ -2248,10 +2248,10 @@ bool BBbVT3253Init (PSDevice pDevice)
} else if (byRFType == RF_VT3226) { } else if (byRFType == RF_VT3226) {
for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++) { for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++) {
bResult &= BBbWriteEmbedded(dwIoBase,byVT3253B0_AIROHA2230[ii][0],byVT3253B0_AIROHA2230[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AIROHA2230[ii][0], byVT3253B0_AIROHA2230[ii][1]);
} }
for (ii = 0; ii < CB_VT3253B0_AGC; ii++) { for (ii = 0; ii < CB_VT3253B0_AGC; ii++) {
bResult &= BBbWriteEmbedded(dwIoBase,byVT3253B0_AGC[ii][0],byVT3253B0_AGC[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
} }
pDevice->abyBBVGA[0] = 0x1C; pDevice->abyBBVGA[0] = 0x1C;
pDevice->abyBBVGA[1] = 0x10; pDevice->abyBBVGA[1] = 0x10;
...@@ -2266,7 +2266,7 @@ bool BBbVT3253Init (PSDevice pDevice) ...@@ -2266,7 +2266,7 @@ bool BBbVT3253Init (PSDevice pDevice)
//{{ RobertYu: 20050104 //{{ RobertYu: 20050104
} else if (byRFType == RF_AIROHA7230) { } else if (byRFType == RF_AIROHA7230) {
for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++) { for (ii = 0; ii < CB_VT3253B0_INIT_FOR_AIROHA2230; ii++) {
bResult &= BBbWriteEmbedded(dwIoBase,byVT3253B0_AIROHA2230[ii][0],byVT3253B0_AIROHA2230[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AIROHA2230[ii][0], byVT3253B0_AIROHA2230[ii][1]);
} }
//{{ RobertYu:20050223, request by JerryChung //{{ RobertYu:20050223, request by JerryChung
...@@ -2275,11 +2275,11 @@ bool BBbVT3253Init (PSDevice pDevice) ...@@ -2275,11 +2275,11 @@ bool BBbVT3253Init (PSDevice pDevice)
// Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted) // Init ANT B select,RX Config CR10 = 0x28->0x2A, 0x2A->0x28(VC1/VC2 define, make the ANT_A, ANT_B inverted)
//bResult &= BBbWriteEmbedded(dwIoBase,0x0a,0x28); //bResult &= BBbWriteEmbedded(dwIoBase,0x0a,0x28);
// Select VC1/VC2, CR215 = 0x02->0x06 // Select VC1/VC2, CR215 = 0x02->0x06
bResult &= BBbWriteEmbedded(dwIoBase,0xd7,0x06); bResult &= BBbWriteEmbedded(dwIoBase, 0xd7, 0x06);
//}} //}}
for (ii = 0; ii < CB_VT3253B0_AGC; ii++) { for (ii = 0; ii < CB_VT3253B0_AGC; ii++) {
bResult &= BBbWriteEmbedded(dwIoBase,byVT3253B0_AGC[ii][0],byVT3253B0_AGC[ii][1]); bResult &= BBbWriteEmbedded(dwIoBase, byVT3253B0_AGC[ii][0], byVT3253B0_AGC[ii][1]);
} }
pDevice->abyBBVGA[0] = 0x1C; pDevice->abyBBVGA[0] = 0x1C;
pDevice->abyBBVGA[1] = 0x10; pDevice->abyBBVGA[1] = 0x10;
...@@ -2319,7 +2319,7 @@ bool BBbVT3253Init (PSDevice pDevice) ...@@ -2319,7 +2319,7 @@ bool BBbVT3253Init (PSDevice pDevice)
* Return Value: none * Return Value: none
* *
*/ */
void BBvReadAllRegs (unsigned long dwIoBase, unsigned char *pbyBBRegs) void BBvReadAllRegs(unsigned long dwIoBase, unsigned char *pbyBBRegs)
{ {
int ii; int ii;
unsigned char byBase = 1; unsigned char byBase = 1;
...@@ -2344,7 +2344,7 @@ void BBvReadAllRegs (unsigned long dwIoBase, unsigned char *pbyBBRegs) ...@@ -2344,7 +2344,7 @@ void BBvReadAllRegs (unsigned long dwIoBase, unsigned char *pbyBBRegs)
*/ */
void BBvLoopbackOn (PSDevice pDevice) void BBvLoopbackOn(PSDevice pDevice)
{ {
unsigned char byData; unsigned char byData;
unsigned long dwIoBase = pDevice->PortOffset; unsigned long dwIoBase = pDevice->PortOffset;
...@@ -2398,7 +2398,7 @@ void BBvLoopbackOn (PSDevice pDevice) ...@@ -2398,7 +2398,7 @@ void BBvLoopbackOn (PSDevice pDevice)
* Return Value: none * Return Value: none
* *
*/ */
void BBvLoopbackOff (PSDevice pDevice) void BBvLoopbackOff(PSDevice pDevice)
{ {
unsigned char byData; unsigned char byData;
unsigned long dwIoBase = pDevice->PortOffset; unsigned long dwIoBase = pDevice->PortOffset;
...@@ -2437,10 +2437,10 @@ void BBvLoopbackOff (PSDevice pDevice) ...@@ -2437,10 +2437,10 @@ void BBvLoopbackOff (PSDevice pDevice)
* *
*/ */
void void
BBvSetShortSlotTime (PSDevice pDevice) BBvSetShortSlotTime(PSDevice pDevice)
{ {
unsigned char byBBRxConf=0; unsigned char byBBRxConf = 0;
unsigned char byBBVGA=0; unsigned char byBBVGA = 0;
BBbReadEmbedded(pDevice->PortOffset, 0x0A, &byBBRxConf);//CR10 BBbReadEmbedded(pDevice->PortOffset, 0x0A, &byBBRxConf);//CR10
...@@ -2462,7 +2462,7 @@ BBvSetShortSlotTime (PSDevice pDevice) ...@@ -2462,7 +2462,7 @@ BBvSetShortSlotTime (PSDevice pDevice)
void BBvSetVGAGainOffset(PSDevice pDevice, unsigned char byData) void BBvSetVGAGainOffset(PSDevice pDevice, unsigned char byData)
{ {
unsigned char byBBRxConf=0; unsigned char byBBRxConf = 0;
BBbWriteEmbedded(pDevice->PortOffset, 0xE7, byData); BBbWriteEmbedded(pDevice->PortOffset, 0xE7, byData);
...@@ -2493,7 +2493,7 @@ void BBvSetVGAGainOffset(PSDevice pDevice, unsigned char byData) ...@@ -2493,7 +2493,7 @@ void BBvSetVGAGainOffset(PSDevice pDevice, unsigned char byData)
* *
*/ */
void void
BBvSoftwareReset (unsigned long dwIoBase) BBvSoftwareReset(unsigned long dwIoBase)
{ {
BBbWriteEmbedded(dwIoBase, 0x50, 0x40); BBbWriteEmbedded(dwIoBase, 0x50, 0x40);
BBbWriteEmbedded(dwIoBase, 0x50, 0); BBbWriteEmbedded(dwIoBase, 0x50, 0);
...@@ -2514,7 +2514,7 @@ BBvSoftwareReset (unsigned long dwIoBase) ...@@ -2514,7 +2514,7 @@ BBvSoftwareReset (unsigned long dwIoBase)
* *
*/ */
void void
BBvPowerSaveModeON (unsigned long dwIoBase) BBvPowerSaveModeON(unsigned long dwIoBase)
{ {
unsigned char byOrgData; unsigned char byOrgData;
...@@ -2536,7 +2536,7 @@ BBvPowerSaveModeON (unsigned long dwIoBase) ...@@ -2536,7 +2536,7 @@ BBvPowerSaveModeON (unsigned long dwIoBase)
* *
*/ */
void void
BBvPowerSaveModeOFF (unsigned long dwIoBase) BBvPowerSaveModeOFF(unsigned long dwIoBase)
{ {
unsigned char byOrgData; unsigned char byOrgData;
...@@ -2560,7 +2560,7 @@ BBvPowerSaveModeOFF (unsigned long dwIoBase) ...@@ -2560,7 +2560,7 @@ BBvPowerSaveModeOFF (unsigned long dwIoBase)
*/ */
void void
BBvSetTxAntennaMode (unsigned long dwIoBase, unsigned char byAntennaMode) BBvSetTxAntennaMode(unsigned long dwIoBase, unsigned char byAntennaMode)
{ {
unsigned char byBBTxConf; unsigned char byBBTxConf;
...@@ -2602,7 +2602,7 @@ BBvSetTxAntennaMode (unsigned long dwIoBase, unsigned char byAntennaMode) ...@@ -2602,7 +2602,7 @@ BBvSetTxAntennaMode (unsigned long dwIoBase, unsigned char byAntennaMode)
*/ */
void void
BBvSetRxAntennaMode (unsigned long dwIoBase, unsigned char byAntennaMode) BBvSetRxAntennaMode(unsigned long dwIoBase, unsigned char byAntennaMode)
{ {
unsigned char byBBRxConf; unsigned char byBBRxConf;
...@@ -2633,14 +2633,14 @@ BBvSetRxAntennaMode (unsigned long dwIoBase, unsigned char byAntennaMode) ...@@ -2633,14 +2633,14 @@ BBvSetRxAntennaMode (unsigned long dwIoBase, unsigned char byAntennaMode)
* *
*/ */
void void
BBvSetDeepSleep (unsigned long dwIoBase, unsigned char byLocalID) BBvSetDeepSleep(unsigned long dwIoBase, unsigned char byLocalID)
{ {
BBbWriteEmbedded(dwIoBase, 0x0C, 0x17);//CR12 BBbWriteEmbedded(dwIoBase, 0x0C, 0x17);//CR12
BBbWriteEmbedded(dwIoBase, 0x0D, 0xB9);//CR13 BBbWriteEmbedded(dwIoBase, 0x0D, 0xB9);//CR13
} }
void void
BBvExitDeepSleep (unsigned long dwIoBase, unsigned char byLocalID) BBvExitDeepSleep(unsigned long dwIoBase, unsigned char byLocalID)
{ {
BBbWriteEmbedded(dwIoBase, 0x0C, 0x00);//CR12 BBbWriteEmbedded(dwIoBase, 0x0C, 0x00);//CR12
BBbWriteEmbedded(dwIoBase, 0x0D, 0x01);//CR13 BBbWriteEmbedded(dwIoBase, 0x0D, 0x01);//CR13
...@@ -2650,28 +2650,28 @@ BBvExitDeepSleep (unsigned long dwIoBase, unsigned char byLocalID) ...@@ -2650,28 +2650,28 @@ BBvExitDeepSleep (unsigned long dwIoBase, unsigned char byLocalID)
static static
unsigned long unsigned long
s_ulGetRatio (PSDevice pDevice) s_ulGetRatio(PSDevice pDevice)
{ {
unsigned long ulRatio = 0; unsigned long ulRatio = 0;
unsigned long ulMaxPacket; unsigned long ulMaxPacket;
unsigned long ulPacketNum; unsigned long ulPacketNum;
//This is a thousand-ratio //This is a thousand-ratio
ulMaxPacket = pDevice->uNumSQ3[RATE_54M]; ulMaxPacket = pDevice->uNumSQ3[RATE_54M];
if ( pDevice->uNumSQ3[RATE_54M] != 0 ) { if (pDevice->uNumSQ3[RATE_54M] != 0) {
ulPacketNum = pDevice->uNumSQ3[RATE_54M]; ulPacketNum = pDevice->uNumSQ3[RATE_54M];
ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt);
//ulRatio = (pDevice->uNumSQ3[RATE_54M] * 1000 / pDevice->uDiversityCnt); //ulRatio = (pDevice->uNumSQ3[RATE_54M] * 1000 / pDevice->uDiversityCnt);
ulRatio += TOP_RATE_54M; ulRatio += TOP_RATE_54M;
} }
if ( pDevice->uNumSQ3[RATE_48M] > ulMaxPacket ) { if (pDevice->uNumSQ3[RATE_48M] > ulMaxPacket) {
ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M]; ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M];
ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt);
//ulRatio = (pDevice->uNumSQ3[RATE_48M] * 1000 / pDevice->uDiversityCnt); //ulRatio = (pDevice->uNumSQ3[RATE_48M] * 1000 / pDevice->uDiversityCnt);
ulRatio += TOP_RATE_48M; ulRatio += TOP_RATE_48M;
ulMaxPacket = pDevice->uNumSQ3[RATE_48M]; ulMaxPacket = pDevice->uNumSQ3[RATE_48M];
} }
if ( pDevice->uNumSQ3[RATE_36M] > ulMaxPacket ) { if (pDevice->uNumSQ3[RATE_36M] > ulMaxPacket) {
ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M] + ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M] +
pDevice->uNumSQ3[RATE_36M]; pDevice->uNumSQ3[RATE_36M];
ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt);
...@@ -2679,7 +2679,7 @@ unsigned long ulPacketNum; ...@@ -2679,7 +2679,7 @@ unsigned long ulPacketNum;
ulRatio += TOP_RATE_36M; ulRatio += TOP_RATE_36M;
ulMaxPacket = pDevice->uNumSQ3[RATE_36M]; ulMaxPacket = pDevice->uNumSQ3[RATE_36M];
} }
if ( pDevice->uNumSQ3[RATE_24M] > ulMaxPacket ) { if (pDevice->uNumSQ3[RATE_24M] > ulMaxPacket) {
ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M] + ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M] +
pDevice->uNumSQ3[RATE_36M] + pDevice->uNumSQ3[RATE_24M]; pDevice->uNumSQ3[RATE_36M] + pDevice->uNumSQ3[RATE_24M];
ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt);
...@@ -2687,7 +2687,7 @@ unsigned long ulPacketNum; ...@@ -2687,7 +2687,7 @@ unsigned long ulPacketNum;
ulRatio += TOP_RATE_24M; ulRatio += TOP_RATE_24M;
ulMaxPacket = pDevice->uNumSQ3[RATE_24M]; ulMaxPacket = pDevice->uNumSQ3[RATE_24M];
} }
if ( pDevice->uNumSQ3[RATE_18M] > ulMaxPacket ) { if (pDevice->uNumSQ3[RATE_18M] > ulMaxPacket) {
ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M] + ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M] +
pDevice->uNumSQ3[RATE_36M] + pDevice->uNumSQ3[RATE_24M] + pDevice->uNumSQ3[RATE_36M] + pDevice->uNumSQ3[RATE_24M] +
pDevice->uNumSQ3[RATE_18M]; pDevice->uNumSQ3[RATE_18M];
...@@ -2696,7 +2696,7 @@ unsigned long ulPacketNum; ...@@ -2696,7 +2696,7 @@ unsigned long ulPacketNum;
ulRatio += TOP_RATE_18M; ulRatio += TOP_RATE_18M;
ulMaxPacket = pDevice->uNumSQ3[RATE_18M]; ulMaxPacket = pDevice->uNumSQ3[RATE_18M];
} }
if ( pDevice->uNumSQ3[RATE_12M] > ulMaxPacket ) { if (pDevice->uNumSQ3[RATE_12M] > ulMaxPacket) {
ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M] + ulPacketNum = pDevice->uNumSQ3[RATE_54M] + pDevice->uNumSQ3[RATE_48M] +
pDevice->uNumSQ3[RATE_36M] + pDevice->uNumSQ3[RATE_24M] + pDevice->uNumSQ3[RATE_36M] + pDevice->uNumSQ3[RATE_24M] +
pDevice->uNumSQ3[RATE_18M] + pDevice->uNumSQ3[RATE_12M]; pDevice->uNumSQ3[RATE_18M] + pDevice->uNumSQ3[RATE_12M];
...@@ -2705,7 +2705,7 @@ unsigned long ulPacketNum; ...@@ -2705,7 +2705,7 @@ unsigned long ulPacketNum;
ulRatio += TOP_RATE_12M; ulRatio += TOP_RATE_12M;
ulMaxPacket = pDevice->uNumSQ3[RATE_12M]; ulMaxPacket = pDevice->uNumSQ3[RATE_12M];
} }
if ( pDevice->uNumSQ3[RATE_11M] > ulMaxPacket ) { if (pDevice->uNumSQ3[RATE_11M] > ulMaxPacket) {
ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M] - ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M] -
pDevice->uNumSQ3[RATE_2M] - pDevice->uNumSQ3[RATE_5M] - pDevice->uNumSQ3[RATE_2M] - pDevice->uNumSQ3[RATE_5M] -
pDevice->uNumSQ3[RATE_6M] - pDevice->uNumSQ3[RATE_9M]; pDevice->uNumSQ3[RATE_6M] - pDevice->uNumSQ3[RATE_9M];
...@@ -2714,7 +2714,7 @@ unsigned long ulPacketNum; ...@@ -2714,7 +2714,7 @@ unsigned long ulPacketNum;
ulRatio += TOP_RATE_11M; ulRatio += TOP_RATE_11M;
ulMaxPacket = pDevice->uNumSQ3[RATE_11M]; ulMaxPacket = pDevice->uNumSQ3[RATE_11M];
} }
if ( pDevice->uNumSQ3[RATE_9M] > ulMaxPacket ) { if (pDevice->uNumSQ3[RATE_9M] > ulMaxPacket) {
ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M] - ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M] -
pDevice->uNumSQ3[RATE_2M] - pDevice->uNumSQ3[RATE_5M] - pDevice->uNumSQ3[RATE_2M] - pDevice->uNumSQ3[RATE_5M] -
pDevice->uNumSQ3[RATE_6M]; pDevice->uNumSQ3[RATE_6M];
...@@ -2723,7 +2723,7 @@ unsigned long ulPacketNum; ...@@ -2723,7 +2723,7 @@ unsigned long ulPacketNum;
ulRatio += TOP_RATE_9M; ulRatio += TOP_RATE_9M;
ulMaxPacket = pDevice->uNumSQ3[RATE_9M]; ulMaxPacket = pDevice->uNumSQ3[RATE_9M];
} }
if ( pDevice->uNumSQ3[RATE_6M] > ulMaxPacket ) { if (pDevice->uNumSQ3[RATE_6M] > ulMaxPacket) {
ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M] - ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M] -
pDevice->uNumSQ3[RATE_2M] - pDevice->uNumSQ3[RATE_5M]; pDevice->uNumSQ3[RATE_2M] - pDevice->uNumSQ3[RATE_5M];
ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt);
...@@ -2731,7 +2731,7 @@ unsigned long ulPacketNum; ...@@ -2731,7 +2731,7 @@ unsigned long ulPacketNum;
ulRatio += TOP_RATE_6M; ulRatio += TOP_RATE_6M;
ulMaxPacket = pDevice->uNumSQ3[RATE_6M]; ulMaxPacket = pDevice->uNumSQ3[RATE_6M];
} }
if ( pDevice->uNumSQ3[RATE_5M] > ulMaxPacket ) { if (pDevice->uNumSQ3[RATE_5M] > ulMaxPacket) {
ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M] - ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M] -
pDevice->uNumSQ3[RATE_2M]; pDevice->uNumSQ3[RATE_2M];
ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt);
...@@ -2739,14 +2739,14 @@ unsigned long ulPacketNum; ...@@ -2739,14 +2739,14 @@ unsigned long ulPacketNum;
ulRatio += TOP_RATE_55M; ulRatio += TOP_RATE_55M;
ulMaxPacket = pDevice->uNumSQ3[RATE_5M]; ulMaxPacket = pDevice->uNumSQ3[RATE_5M];
} }
if ( pDevice->uNumSQ3[RATE_2M] > ulMaxPacket ) { if (pDevice->uNumSQ3[RATE_2M] > ulMaxPacket) {
ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M]; ulPacketNum = pDevice->uDiversityCnt - pDevice->uNumSQ3[RATE_1M];
ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt);
//ulRatio = (pDevice->uNumSQ3[RATE_2M] * 1000 / pDevice->uDiversityCnt); //ulRatio = (pDevice->uNumSQ3[RATE_2M] * 1000 / pDevice->uDiversityCnt);
ulRatio += TOP_RATE_2M; ulRatio += TOP_RATE_2M;
ulMaxPacket = pDevice->uNumSQ3[RATE_2M]; ulMaxPacket = pDevice->uNumSQ3[RATE_2M];
} }
if ( pDevice->uNumSQ3[RATE_1M] > ulMaxPacket ) { if (pDevice->uNumSQ3[RATE_1M] > ulMaxPacket) {
ulPacketNum = pDevice->uDiversityCnt; ulPacketNum = pDevice->uDiversityCnt;
ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt); ulRatio = (ulPacketNum * 1000 / pDevice->uDiversityCnt);
//ulRatio = (pDevice->uNumSQ3[RATE_1M] * 1000 / pDevice->uDiversityCnt); //ulRatio = (pDevice->uNumSQ3[RATE_1M] * 1000 / pDevice->uDiversityCnt);
...@@ -2758,7 +2758,7 @@ unsigned long ulPacketNum; ...@@ -2758,7 +2758,7 @@ unsigned long ulPacketNum;
void void
BBvClearAntDivSQ3Value (PSDevice pDevice) BBvClearAntDivSQ3Value(PSDevice pDevice)
{ {
unsigned int ii; unsigned int ii;
...@@ -2785,7 +2785,7 @@ BBvClearAntDivSQ3Value (PSDevice pDevice) ...@@ -2785,7 +2785,7 @@ BBvClearAntDivSQ3Value (PSDevice pDevice)
*/ */
void void
BBvAntennaDiversity (PSDevice pDevice, unsigned char byRxRate, unsigned char bySQ3) BBvAntennaDiversity(PSDevice pDevice, unsigned char byRxRate, unsigned char bySQ3)
{ {
if ((byRxRate >= MAX_RATE) || (pDevice->wAntDiversityMaxRate >= MAX_RATE)) { if ((byRxRate >= MAX_RATE) || (pDevice->wAntDiversityMaxRate >= MAX_RATE)) {
...@@ -2799,17 +2799,17 @@ BBvAntennaDiversity (PSDevice pDevice, unsigned char byRxRate, unsigned char byS ...@@ -2799,17 +2799,17 @@ BBvAntennaDiversity (PSDevice pDevice, unsigned char byRxRate, unsigned char byS
if (pDevice->byAntennaState == 0) { if (pDevice->byAntennaState == 0) {
if (pDevice->uDiversityCnt > pDevice->ulDiversityNValue) { if (pDevice->uDiversityCnt > pDevice->ulDiversityNValue) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"ulDiversityNValue=[%d],54M-[%d]\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "ulDiversityNValue=[%d],54M-[%d]\n",
(int)pDevice->ulDiversityNValue, (int)pDevice->uNumSQ3[(int)pDevice->wAntDiversityMaxRate]); (int)pDevice->ulDiversityNValue, (int)pDevice->uNumSQ3[(int)pDevice->wAntDiversityMaxRate]);
if (pDevice->uNumSQ3[pDevice->wAntDiversityMaxRate] < pDevice->uDiversityCnt/2) { if (pDevice->uNumSQ3[pDevice->wAntDiversityMaxRate] < pDevice->uDiversityCnt/2) {
pDevice->ulRatio_State0 = s_ulGetRatio(pDevice); pDevice->ulRatio_State0 = s_ulGetRatio(pDevice);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"SQ3_State0, rate = [%08x]\n", (int)pDevice->ulRatio_State0); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "SQ3_State0, rate = [%08x]\n", (int)pDevice->ulRatio_State0);
if ( pDevice->byTMax == 0 ) if (pDevice->byTMax == 0)
return; return;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"1.[%08x], uNumSQ3[%d]=%d, %d\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "1.[%08x], uNumSQ3[%d]=%d, %d\n",
(int)pDevice->ulRatio_State0, (int)pDevice->wAntDiversityMaxRate, (int)pDevice->ulRatio_State0, (int)pDevice->wAntDiversityMaxRate,
(int)pDevice->uNumSQ3[(int)pDevice->wAntDiversityMaxRate], (int)pDevice->uDiversityCnt); (int)pDevice->uNumSQ3[(int)pDevice->wAntDiversityMaxRate], (int)pDevice->uDiversityCnt);
#ifdef PLICE_DEBUG #ifdef PLICE_DEBUG
...@@ -2837,11 +2837,11 @@ BBvAntennaDiversity (PSDevice pDevice, unsigned char byRxRate, unsigned char byS ...@@ -2837,11 +2837,11 @@ BBvAntennaDiversity (PSDevice pDevice, unsigned char byRxRate, unsigned char byS
del_timer(&pDevice->TimerSQ3Tmax1); del_timer(&pDevice->TimerSQ3Tmax1);
pDevice->ulRatio_State1 = s_ulGetRatio(pDevice); pDevice->ulRatio_State1 = s_ulGetRatio(pDevice);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"RX:SQ3_State1, rate0 = %08x,rate1 = %08x\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "RX:SQ3_State1, rate0 = %08x,rate1 = %08x\n",
(int)pDevice->ulRatio_State0,(int)pDevice->ulRatio_State1); (int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1);
if (pDevice->ulRatio_State1 < pDevice->ulRatio_State0) { if (pDevice->ulRatio_State1 < pDevice->ulRatio_State0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"2.[%08x][%08x], uNumSQ3[%d]=%d, %d\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "2.[%08x][%08x], uNumSQ3[%d]=%d, %d\n",
(int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1, (int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1,
(int)pDevice->wAntDiversityMaxRate, (int)pDevice->wAntDiversityMaxRate,
(int)pDevice->uNumSQ3[(int)pDevice->wAntDiversityMaxRate], (int)pDevice->uDiversityCnt); (int)pDevice->uNumSQ3[(int)pDevice->wAntDiversityMaxRate], (int)pDevice->uDiversityCnt);
...@@ -2872,19 +2872,19 @@ BBvAntennaDiversity (PSDevice pDevice, unsigned char byRxRate, unsigned char byS ...@@ -2872,19 +2872,19 @@ BBvAntennaDiversity (PSDevice pDevice, unsigned char byRxRate, unsigned char byS
* *
* Return Value: none * Return Value: none
* *
-*/ -*/
void void
TimerSQ3CallBack ( TimerSQ3CallBack(
void *hDeviceContext void *hDeviceContext
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"TimerSQ3CallBack..."); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "TimerSQ3CallBack...");
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"3.[%08x][%08x], %d\n",(int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1, (int)pDevice->uDiversityCnt); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "3.[%08x][%08x], %d\n", (int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1, (int)pDevice->uDiversityCnt);
#ifdef PLICE_DEBUG #ifdef PLICE_DEBUG
//printk("TimerSQ3CallBack1:call s_vChangeAntenna\n"); //printk("TimerSQ3CallBack1:call s_vChangeAntenna\n");
#endif #endif
...@@ -2920,16 +2920,16 @@ TimerSQ3CallBack ( ...@@ -2920,16 +2920,16 @@ TimerSQ3CallBack (
* *
* Return Value: none * Return Value: none
* *
-*/ -*/
void void
TimerState1CallBack ( TimerState1CallBack(
void *hDeviceContext void *hDeviceContext
) )
{ {
PSDevice pDevice = (PSDevice)hDeviceContext; PSDevice pDevice = (PSDevice)hDeviceContext;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"TimerState1CallBack..."); DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "TimerState1CallBack...");
spin_lock_irq(&pDevice->lock); spin_lock_irq(&pDevice->lock);
if (pDevice->uDiversityCnt < pDevice->ulDiversityMValue/100) { if (pDevice->uDiversityCnt < pDevice->ulDiversityMValue/100) {
...@@ -2944,11 +2944,11 @@ TimerState1CallBack ( ...@@ -2944,11 +2944,11 @@ TimerState1CallBack (
add_timer(&pDevice->TimerSQ3Tmax2); add_timer(&pDevice->TimerSQ3Tmax2);
} else { } else {
pDevice->ulRatio_State1 = s_ulGetRatio(pDevice); pDevice->ulRatio_State1 = s_ulGetRatio(pDevice);
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"SQ3_State1, rate0 = %08x,rate1 = %08x\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "SQ3_State1, rate0 = %08x,rate1 = %08x\n",
(int)pDevice->ulRatio_State0,(int)pDevice->ulRatio_State1); (int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1);
if ( pDevice->ulRatio_State1 < pDevice->ulRatio_State0 ) { if (pDevice->ulRatio_State1 < pDevice->ulRatio_State0) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"2.[%08x][%08x], uNumSQ3[%d]=%d, %d\n", DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "2.[%08x][%08x], uNumSQ3[%d]=%d, %d\n",
(int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1, (int)pDevice->ulRatio_State0, (int)pDevice->ulRatio_State1,
(int)pDevice->wAntDiversityMaxRate, (int)pDevice->wAntDiversityMaxRate,
(int)pDevice->uNumSQ3[(int)pDevice->wAntDiversityMaxRate], (int)pDevice->uDiversityCnt); (int)pDevice->uNumSQ3[(int)pDevice->wAntDiversityMaxRate], (int)pDevice->uDiversityCnt);
......
...@@ -72,14 +72,14 @@ ...@@ -72,14 +72,14 @@
/*--------------------- Export Macros ------------------------------*/ /*--------------------- Export Macros ------------------------------*/
#define BBvClearFOE(dwIoBase) \ #define BBvClearFOE(dwIoBase) \
{ \ { \
BBbWriteEmbedded(dwIoBase, 0xB1, 0); \ BBbWriteEmbedded(dwIoBase, 0xB1, 0); \
} }
#define BBvSetFOE(dwIoBase) \ #define BBvSetFOE(dwIoBase) \
{ \ { \
BBbWriteEmbedded(dwIoBase, 0xB1, 0x0C); \ BBbWriteEmbedded(dwIoBase, 0xB1, 0x0C); \
} }
/*--------------------- Export Classes ----------------------------*/ /*--------------------- Export Classes ----------------------------*/
...@@ -94,10 +94,10 @@ BBuGetFrameTime( ...@@ -94,10 +94,10 @@ BBuGetFrameTime(
unsigned char byPktType, unsigned char byPktType,
unsigned int cbFrameLength, unsigned int cbFrameLength,
unsigned short wRate unsigned short wRate
); );
void void
BBvCalculateParameter ( BBvCalculateParameter(
PSDevice pDevice, PSDevice pDevice,
unsigned int cbFrameLength, unsigned int cbFrameLength,
unsigned short wRate, unsigned short wRate,
...@@ -105,7 +105,7 @@ BBvCalculateParameter ( ...@@ -105,7 +105,7 @@ BBvCalculateParameter (
unsigned short *pwPhyLen, unsigned short *pwPhyLen,
unsigned char *pbyPhySrv, unsigned char *pbyPhySrv,
unsigned char *pbyPhySgn unsigned char *pbyPhySgn
); );
bool BBbReadEmbedded(unsigned long dwIoBase, unsigned char byBBAddr, unsigned char *pbyData); bool BBbReadEmbedded(unsigned long dwIoBase, unsigned char byBBAddr, unsigned char *pbyData);
bool BBbWriteEmbedded(unsigned long dwIoBase, unsigned char byBBAddr, unsigned char byData); bool BBbWriteEmbedded(unsigned long dwIoBase, unsigned char byBBAddr, unsigned char byData);
...@@ -131,17 +131,17 @@ void BBvExitDeepSleep(unsigned long dwIoBase, unsigned char byLocalID); ...@@ -131,17 +131,17 @@ void BBvExitDeepSleep(unsigned long dwIoBase, unsigned char byLocalID);
// timer for antenna diversity // timer for antenna diversity
void void
TimerSQ3CallBack ( TimerSQ3CallBack(
void *hDeviceContext void *hDeviceContext
); );
void void
TimerState1CallBack( TimerState1CallBack(
void *hDeviceContext void *hDeviceContext
); );
void BBvAntennaDiversity(PSDevice pDevice, unsigned char byRxRate, unsigned char bySQ3); void BBvAntennaDiversity(PSDevice pDevice, unsigned char byRxRate, unsigned char bySQ3);
void void
BBvClearAntDivSQ3Value (PSDevice pDevice); BBvClearAntDivSQ3Value(PSDevice pDevice);
#endif // __BASEBAND_H__ #endif // __BASEBAND_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