Commit 19440266 authored by Malcolm Priestley's avatar Malcolm Priestley Committed by Greg Kroah-Hartman

staging: vt6656: clean up BBvUpdatePreEDThreshold

Camel case changes
pDevice -> priv
bScanning -> scanning

White space cleanup
Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6d5485af
...@@ -1408,277 +1408,269 @@ void TimerSQ3Tmax3CallBack(struct vnt_private *pDevice) ...@@ -1408,277 +1408,269 @@ void TimerSQ3Tmax3CallBack(struct vnt_private *pDevice)
spin_unlock_irq(&pDevice->lock); spin_unlock_irq(&pDevice->lock);
} }
void BBvUpdatePreEDThreshold(struct vnt_private *pDevice, int bScanning) void BBvUpdatePreEDThreshold(struct vnt_private *priv, int scanning)
{ {
u8 cr_201 = 0x0, cr_206 = 0x0; u8 cr_201 = 0x0, cr_206 = 0x0;
u8 ed_inx = pDevice->byBBPreEDIndex; u8 ed_inx = priv->byBBPreEDIndex;
switch(pDevice->byRFType) switch (priv->byRFType) {
{ case RF_AL2230:
case RF_AL2230: case RF_AL2230S:
case RF_AL2230S: case RF_AIROHA7230:
case RF_AIROHA7230: if (scanning) { /* Max sensitivity */
//RobertYu:20060627, update new table ed_inx = 0;
cr_206 = 0x30;
if( bScanning ) break;
{ // need Max sensitivity //RSSI -69, -70,.... }
ed_inx = 0;
cr_206 = 0x30;
break;
}
if(pDevice->byBBPreEDRSSI <= 45) { // RSSI 0, -1,-2,....-45 if (priv->byBBPreEDRSSI <= 45) {
ed_inx = 20; ed_inx = 20;
cr_201 = 0xff; cr_201 = 0xff;
} else if(pDevice->byBBPreEDRSSI <= 46) { //RSSI -46 } else if (priv->byBBPreEDRSSI <= 46) {
ed_inx = 19; ed_inx = 19;
cr_201 = 0x1a; cr_201 = 0x1a;
} else if(pDevice->byBBPreEDRSSI <= 47) { //RSSI -47 } else if (priv->byBBPreEDRSSI <= 47) {
ed_inx = 18; ed_inx = 18;
cr_201 = 0x15; cr_201 = 0x15;
} else if(pDevice->byBBPreEDRSSI <= 49) { //RSSI -48, -49 } else if (priv->byBBPreEDRSSI <= 49) {
ed_inx = 17; ed_inx = 17;
cr_201 = 0xe; cr_201 = 0xe;
} else if(pDevice->byBBPreEDRSSI <= 51) { //RSSI -50, -51 } else if (priv->byBBPreEDRSSI <= 51) {
ed_inx = 16; ed_inx = 16;
cr_201 = 0x9; cr_201 = 0x9;
} else if(pDevice->byBBPreEDRSSI <= 53) { //RSSI -52, -53 } else if (priv->byBBPreEDRSSI <= 53) {
ed_inx = 15; ed_inx = 15;
cr_201 = 0x6; cr_201 = 0x6;
} else if(pDevice->byBBPreEDRSSI <= 55) { //RSSI -54, -55 } else if (priv->byBBPreEDRSSI <= 55) {
ed_inx = 14; ed_inx = 14;
cr_201 = 0x3; cr_201 = 0x3;
} else if(pDevice->byBBPreEDRSSI <= 56) { //RSSI -56 } else if (priv->byBBPreEDRSSI <= 56) {
ed_inx = 13; ed_inx = 13;
cr_201 = 0x2; cr_201 = 0x2;
cr_206 = 0xa0; cr_206 = 0xa0;
} else if(pDevice->byBBPreEDRSSI <= 57) { //RSSI -57 } else if (priv->byBBPreEDRSSI <= 57) {
ed_inx = 12; ed_inx = 12;
cr_201 = 0x2; cr_201 = 0x2;
cr_206 = 0x20; cr_206 = 0x20;
} else if(pDevice->byBBPreEDRSSI <= 58) { //RSSI -58 } else if (priv->byBBPreEDRSSI <= 58) {
ed_inx = 11; ed_inx = 11;
cr_201 = 0x1; cr_201 = 0x1;
cr_206 = 0xa0; cr_206 = 0xa0;
} else if(pDevice->byBBPreEDRSSI <= 59) { //RSSI -59 } else if (priv->byBBPreEDRSSI <= 59) {
ed_inx = 10; ed_inx = 10;
cr_201 = 0x1; cr_201 = 0x1;
cr_206 = 0x54; cr_206 = 0x54;
} else if(pDevice->byBBPreEDRSSI <= 60) { //RSSI -60 } else if (priv->byBBPreEDRSSI <= 60) {
ed_inx = 9; ed_inx = 9;
cr_201 = 0x1; cr_201 = 0x1;
cr_206 = 0x18; cr_206 = 0x18;
} else if(pDevice->byBBPreEDRSSI <= 61) { //RSSI -61 } else if (priv->byBBPreEDRSSI <= 61) {
ed_inx = 8; ed_inx = 8;
cr_206 = 0xe3; cr_206 = 0xe3;
} else if(pDevice->byBBPreEDRSSI <= 62) { //RSSI -62 } else if (priv->byBBPreEDRSSI <= 62) {
ed_inx = 7; ed_inx = 7;
cr_206 = 0xb9; cr_206 = 0xb9;
} else if(pDevice->byBBPreEDRSSI <= 63) { //RSSI -63 } else if (priv->byBBPreEDRSSI <= 63) {
ed_inx = 6; ed_inx = 6;
cr_206 = 0x93; cr_206 = 0x93;
} else if(pDevice->byBBPreEDRSSI <= 64) { //RSSI -64 } else if (priv->byBBPreEDRSSI <= 64) {
ed_inx = 5; ed_inx = 5;
cr_206 = 0x79; cr_206 = 0x79;
} else if(pDevice->byBBPreEDRSSI <= 65) { //RSSI -65 } else if (priv->byBBPreEDRSSI <= 65) {
ed_inx = 4; ed_inx = 4;
cr_206 = 0x62; cr_206 = 0x62;
} else if(pDevice->byBBPreEDRSSI <= 66) { //RSSI -66 } else if (priv->byBBPreEDRSSI <= 66) {
ed_inx = 3; ed_inx = 3;
cr_206 = 0x51; cr_206 = 0x51;
} else if(pDevice->byBBPreEDRSSI <= 67) { //RSSI -67 } else if (priv->byBBPreEDRSSI <= 67) {
ed_inx = 2; ed_inx = 2;
cr_206 = 0x43; cr_206 = 0x43;
} else if(pDevice->byBBPreEDRSSI <= 68) { //RSSI -68 } else if (priv->byBBPreEDRSSI <= 68) {
ed_inx = 1; ed_inx = 1;
cr_206 = 0x36; cr_206 = 0x36;
} else { //RSSI -69, -70,.... } else {
ed_inx = 0; ed_inx = 0;
cr_206 = 0x30; cr_206 = 0x30;
} }
break; break;
case RF_VT3226: case RF_VT3226:
case RF_VT3226D0: case RF_VT3226D0:
//RobertYu:20060627, update new table if (scanning) { /* Max sensitivity */
ed_inx = 0;
cr_206 = 0x24;
break;
}
if( bScanning ) if (priv->byBBPreEDRSSI <= 41) {
{ // need Max sensitivity //RSSI -69, -70, ... ed_inx = 22;
ed_inx = 0; cr_201 = 0xff;
cr_206 = 0x24; } else if (priv->byBBPreEDRSSI <= 42) {
break; ed_inx = 21;
} cr_201 = 0x36;
} else if (priv->byBBPreEDRSSI <= 43) {
ed_inx = 20;
cr_201 = 0x26;
} else if (priv->byBBPreEDRSSI <= 45) {
ed_inx = 19;
cr_201 = 0x18;
} else if (priv->byBBPreEDRSSI <= 47) {
ed_inx = 18;
cr_201 = 0x11;
} else if (priv->byBBPreEDRSSI <= 49) {
ed_inx = 17;
cr_201 = 0xa;
} else if (priv->byBBPreEDRSSI <= 51) {
ed_inx = 16;
cr_201 = 0x7;
} else if (priv->byBBPreEDRSSI <= 53) {
ed_inx = 15;
cr_201 = 0x4;
} else if (priv->byBBPreEDRSSI <= 55) {
ed_inx = 14;
cr_201 = 0x2;
cr_206 = 0xc0;
} else if (priv->byBBPreEDRSSI <= 56) {
ed_inx = 13;
cr_201 = 0x2;
cr_206 = 0x30;
} else if (priv->byBBPreEDRSSI <= 57) {
ed_inx = 12;
cr_201 = 0x1;
cr_206 = 0xb0;
} else if (priv->byBBPreEDRSSI <= 58) {
ed_inx = 11;
cr_201 = 0x1;
cr_206 = 0x70;
} else if (priv->byBBPreEDRSSI <= 59) {
ed_inx = 10;
cr_201 = 0x1;
cr_206 = 0x30;
} else if (priv->byBBPreEDRSSI <= 60) {
ed_inx = 9;
cr_206 = 0xea;
} else if (priv->byBBPreEDRSSI <= 61) {
ed_inx = 8;
cr_206 = 0xc0;
} else if (priv->byBBPreEDRSSI <= 62) {
ed_inx = 7;
cr_206 = 0x9c;
} else if (priv->byBBPreEDRSSI <= 63) {
ed_inx = 6;
cr_206 = 0x80;
} else if (priv->byBBPreEDRSSI <= 64) {
ed_inx = 5;
cr_206 = 0x68;
} else if (priv->byBBPreEDRSSI <= 65) {
ed_inx = 4;
cr_206 = 0x52;
} else if (priv->byBBPreEDRSSI <= 66) {
ed_inx = 3;
cr_206 = 0x43;
} else if (priv->byBBPreEDRSSI <= 67) {
ed_inx = 2;
cr_206 = 0x36;
} else if (priv->byBBPreEDRSSI <= 68) {
ed_inx = 1;
cr_206 = 0x2d;
} else {
ed_inx = 0;
cr_206 = 0x24;
}
break;
if(pDevice->byBBPreEDRSSI <= 41) { // RSSI 0, -1,-2,....-41 case RF_VT3342A0:
ed_inx = 22; if (scanning) { /* need Max sensitivity */
cr_201 = 0xff; ed_inx = 0;
} else if(pDevice->byBBPreEDRSSI <= 42) { //RSSI -42 cr_206 = 0x38;
ed_inx = 21; break;
cr_201 = 0x36; }
} else if(pDevice->byBBPreEDRSSI <= 43) { //RSSI -43
ed_inx = 20;
cr_201 = 0x26;
} else if(pDevice->byBBPreEDRSSI <= 45) { //RSSI -44, -45
ed_inx = 19;
cr_201 = 0x18;
} else if(pDevice->byBBPreEDRSSI <= 47) { //RSSI -46, -47
ed_inx = 18;
cr_201 = 0x11;
} else if(pDevice->byBBPreEDRSSI <= 49) { //RSSI -48, -49
ed_inx = 17;
cr_201 = 0xa;
} else if(pDevice->byBBPreEDRSSI <= 51) { //RSSI -50, -51
ed_inx = 16;
cr_201 = 0x7;
} else if(pDevice->byBBPreEDRSSI <= 53) { //RSSI -52, -53
ed_inx = 15;
cr_201 = 0x4;
} else if(pDevice->byBBPreEDRSSI <= 55) { //RSSI -54, -55
ed_inx = 14;
cr_201 = 0x2;
cr_206 = 0xc0;
} else if(pDevice->byBBPreEDRSSI <= 56) { //RSSI -56
ed_inx = 13;
cr_201 = 0x2;
cr_206 = 0x30;
} else if(pDevice->byBBPreEDRSSI <= 57) { //RSSI -57
ed_inx = 12;
cr_201 = 0x1;
cr_206 = 0xb0;
} else if(pDevice->byBBPreEDRSSI <= 58) { //RSSI -58
ed_inx = 11;
cr_201 = 0x1;
cr_206 = 0x70;
} else if(pDevice->byBBPreEDRSSI <= 59) { //RSSI -59
ed_inx = 10;
cr_201 = 0x1;
cr_206 = 0x30;
} else if(pDevice->byBBPreEDRSSI <= 60) { //RSSI -60
ed_inx = 9;
cr_206 = 0xea;
} else if(pDevice->byBBPreEDRSSI <= 61) { //RSSI -61
ed_inx = 8;
cr_206 = 0xc0;
} else if(pDevice->byBBPreEDRSSI <= 62) { //RSSI -62
ed_inx = 7;
cr_206 = 0x9c;
} else if(pDevice->byBBPreEDRSSI <= 63) { //RSSI -63
ed_inx = 6;
cr_206 = 0x80;
} else if(pDevice->byBBPreEDRSSI <= 64) { //RSSI -64
ed_inx = 5;
cr_206 = 0x68;
} else if(pDevice->byBBPreEDRSSI <= 65) { //RSSI -65
ed_inx = 4;
cr_206 = 0x52;
} else if(pDevice->byBBPreEDRSSI <= 66) { //RSSI -66
ed_inx = 3;
cr_206 = 0x43;
} else if(pDevice->byBBPreEDRSSI <= 67) { //RSSI -67
ed_inx = 2;
cr_206 = 0x36;
} else if(pDevice->byBBPreEDRSSI <= 68) { //RSSI -68
ed_inx = 1;
cr_206 = 0x2d;
} else { //RSSI -69, -70, ...
ed_inx = 0;
cr_206 = 0x24;
}
break;
case RF_VT3342A0: //RobertYu:20060627, testing table
if( bScanning )
{ // need Max sensitivity //RSSI -67, -68, ...
ed_inx = 0;
cr_206 = 0x38;
break;
}
if(pDevice->byBBPreEDRSSI <= 41) { // RSSI 0, -1,-2,....-41 if (priv->byBBPreEDRSSI <= 41) {
ed_inx = 20; ed_inx = 20;
cr_201 = 0xff; cr_201 = 0xff;
} else if(pDevice->byBBPreEDRSSI <= 42) { //RSSI -42 } else if (priv->byBBPreEDRSSI <= 42) {
ed_inx = 19; ed_inx = 19;
cr_201 = 0x36; cr_201 = 0x36;
} else if(pDevice->byBBPreEDRSSI <= 43) { //RSSI -43 } else if (priv->byBBPreEDRSSI <= 43) {
ed_inx = 18; ed_inx = 18;
cr_201 = 0x26; cr_201 = 0x26;
} else if(pDevice->byBBPreEDRSSI <= 45) { //RSSI -44, -45 } else if (priv->byBBPreEDRSSI <= 45) {
ed_inx = 17; ed_inx = 17;
cr_201 = 0x18; cr_201 = 0x18;
} else if(pDevice->byBBPreEDRSSI <= 47) { //RSSI -46, -47 } else if (priv->byBBPreEDRSSI <= 47) {
ed_inx = 16; ed_inx = 16;
cr_201 = 0x11; cr_201 = 0x11;
} else if(pDevice->byBBPreEDRSSI <= 49) { //RSSI -48, -49 } else if (priv->byBBPreEDRSSI <= 49) {
ed_inx = 15; ed_inx = 15;
cr_201 = 0xa; cr_201 = 0xa;
} else if(pDevice->byBBPreEDRSSI <= 51) { //RSSI -50, -51 } else if (priv->byBBPreEDRSSI <= 51) {
ed_inx = 14; ed_inx = 14;
cr_201 = 0x7; cr_201 = 0x7;
} else if(pDevice->byBBPreEDRSSI <= 53) { //RSSI -52, -53 } else if (priv->byBBPreEDRSSI <= 53) {
ed_inx = 13; ed_inx = 13;
cr_201 = 0x4; cr_201 = 0x4;
} else if(pDevice->byBBPreEDRSSI <= 55) { //RSSI -54, -55 } else if (priv->byBBPreEDRSSI <= 55) {
ed_inx = 12; ed_inx = 12;
cr_201 = 0x2; cr_201 = 0x2;
cr_206 = 0xc0; cr_206 = 0xc0;
} else if(pDevice->byBBPreEDRSSI <= 56) { //RSSI -56 } else if (priv->byBBPreEDRSSI <= 56) {
ed_inx = 11; ed_inx = 11;
cr_201 = 0x2; cr_201 = 0x2;
cr_206 = 0x30; cr_206 = 0x30;
} else if(pDevice->byBBPreEDRSSI <= 57) { //RSSI -57 } else if (priv->byBBPreEDRSSI <= 57) {
ed_inx = 10; ed_inx = 10;
cr_201 = 0x1; cr_201 = 0x1;
cr_206 = 0xb0; cr_206 = 0xb0;
} else if(pDevice->byBBPreEDRSSI <= 58) { //RSSI -58 } else if (priv->byBBPreEDRSSI <= 58) {
ed_inx = 9; ed_inx = 9;
cr_201 = 0x1; cr_201 = 0x1;
cr_206 = 0x70; cr_206 = 0x70;
} else if(pDevice->byBBPreEDRSSI <= 59) { //RSSI -59 } else if (priv->byBBPreEDRSSI <= 59) {
ed_inx = 8; ed_inx = 8;
cr_201 = 0x1; cr_201 = 0x1;
cr_206 = 0x30; cr_206 = 0x30;
} else if(pDevice->byBBPreEDRSSI <= 60) { //RSSI -60 } else if (priv->byBBPreEDRSSI <= 60) {
ed_inx = 7; ed_inx = 7;
cr_206 = 0xea; cr_206 = 0xea;
} else if(pDevice->byBBPreEDRSSI <= 61) { //RSSI -61 } else if (priv->byBBPreEDRSSI <= 61) {
ed_inx = 6; ed_inx = 6;
cr_206 = 0xc0; cr_206 = 0xc0;
} else if(pDevice->byBBPreEDRSSI <= 62) { //RSSI -62 } else if (priv->byBBPreEDRSSI <= 62) {
ed_inx = 5; ed_inx = 5;
cr_206 = 0x9c; cr_206 = 0x9c;
} else if(pDevice->byBBPreEDRSSI <= 63) { //RSSI -63 } else if (priv->byBBPreEDRSSI <= 63) {
ed_inx = 4; ed_inx = 4;
cr_206 = 0x80; cr_206 = 0x80;
} else if(pDevice->byBBPreEDRSSI <= 64) { //RSSI -64 } else if (priv->byBBPreEDRSSI <= 64) {
ed_inx = 3; ed_inx = 3;
cr_206 = 0x68; cr_206 = 0x68;
} else if(pDevice->byBBPreEDRSSI <= 65) { //RSSI -65 } else if (priv->byBBPreEDRSSI <= 65) {
ed_inx = 2; ed_inx = 2;
cr_206 = 0x52; cr_206 = 0x52;
} else if(pDevice->byBBPreEDRSSI <= 66) { //RSSI -66 } else if (priv->byBBPreEDRSSI <= 66) {
ed_inx = 1; ed_inx = 1;
cr_206 = 0x43; cr_206 = 0x43;
} else { //RSSI -67, -68, ... } else {
ed_inx = 0; ed_inx = 0;
cr_206 = 0x38; cr_206 = 0x38;
} }
break; break;
} }
if (ed_inx == pDevice->byBBPreEDIndex && !bScanning) if (ed_inx == priv->byBBPreEDIndex && !scanning)
return; return;
pDevice->byBBPreEDIndex = ed_inx; priv->byBBPreEDIndex = ed_inx;
dev_dbg(&pDevice->usb->dev, "%s byBBPreEDRSSI %d\n", dev_dbg(&priv->usb->dev, "%s byBBPreEDRSSI %d\n",
__func__, pDevice->byBBPreEDRSSI); __func__, priv->byBBPreEDRSSI);
if (!cr_201 && !cr_206) if (!cr_201 && !cr_206)
return; return;
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xc9, cr_201); ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0xc9, cr_201);
ControlvWriteByte(pDevice, MESSAGE_REQUEST_BBREG, 0xce, cr_206); ControlvWriteByte(priv, MESSAGE_REQUEST_BBREG, 0xce, cr_206);
} }
...@@ -107,6 +107,6 @@ void BBvSetAntennaMode(struct vnt_private *, u8 byAntennaMode); ...@@ -107,6 +107,6 @@ void BBvSetAntennaMode(struct vnt_private *, u8 byAntennaMode);
int BBbVT3184Init(struct vnt_private *); int BBbVT3184Init(struct vnt_private *);
void BBvSetDeepSleep(struct vnt_private *); void BBvSetDeepSleep(struct vnt_private *);
void BBvExitDeepSleep(struct vnt_private *); void BBvExitDeepSleep(struct vnt_private *);
void BBvUpdatePreEDThreshold(struct vnt_private *, int bScanning); void BBvUpdatePreEDThreshold(struct vnt_private *, int scanning);
#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