Commit 8daba6b9 authored by Larry Finger's avatar Larry Finger Committed by Greg Kroah-Hartman

Staging: r8187se: Remove two private variables that have a fixed value

For the RTL8187SE, the variable priv->rf_chip is always RF_ZEBRA4
and priv->RegThreeWireMode is always HW_THREE_WIRE_SI. Remove these
2 variables.
Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent b1b7621b
...@@ -366,7 +366,6 @@ typedef struct r8180_priv ...@@ -366,7 +366,6 @@ typedef struct r8180_priv
short diversity; short diversity;
u8 cs_treshold; u8 cs_treshold;
short rcr_csense; short rcr_csense;
short rf_chip;
u32 key0[4]; u32 key0[4];
short (*rf_set_sens)(struct net_device *dev,short sens); short (*rf_set_sens)(struct net_device *dev,short sens);
void (*rf_set_chan)(struct net_device *dev,short ch); void (*rf_set_chan)(struct net_device *dev,short ch);
...@@ -479,9 +478,6 @@ typedef struct r8180_priv ...@@ -479,9 +478,6 @@ typedef struct r8180_priv
u8 retry_rts; u8 retry_rts;
u16 rts; u16 rts;
//add for RF power on power off by lizhaoming 080512
u8 RegThreeWireMode; // See "Three wire mode" defined above, 2006.05.31, by rcnjko.
//by amy for led //by amy for led
LED_STRATEGY_8185 LedStrategy; LED_STRATEGY_8185 LedStrategy;
//by amy for led //by amy for led
......
...@@ -663,11 +663,8 @@ unsigned char STRENGTH_MAP[] = { ...@@ -663,11 +663,8 @@ unsigned char STRENGTH_MAP[] = {
void rtl8180_RSSI_calc(struct net_device *dev, u8 *rssi, u8 *qual) void rtl8180_RSSI_calc(struct net_device *dev, u8 *rssi, u8 *qual)
{ {
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
u32 temp; u32 temp;
u32 temp2; u32 temp2;
u32 temp3;
u32 lsb;
u32 q; u32 q;
u32 orig_qual; u32 orig_qual;
u8 _rssi; u8 _rssi;
...@@ -689,88 +686,6 @@ void rtl8180_RSSI_calc(struct net_device *dev, u8 *rssi, u8 *qual) ...@@ -689,88 +686,6 @@ void rtl8180_RSSI_calc(struct net_device *dev, u8 *rssi, u8 *qual)
*qual = temp; *qual = temp;
temp2 = *rssi; temp2 = *rssi;
switch(priv->rf_chip){
case RFCHIPID_RFMD:
lsb = temp2 & 1;
temp2 &= 0x7e;
if ( !lsb || !(temp2 <= 0x3c) ) {
temp2 = 0x64;
} else {
temp2 = 100 * temp2 / 0x3c;
}
*rssi = temp2 & 0xff;
_rssi = temp2 & 0xff;
break;
case RFCHIPID_INTERSIL:
lsb = temp2;
temp2 &= 0xfffffffe;
temp2 *= 251;
temp3 = temp2;
temp2 <<= 6;
temp3 += temp2;
temp3 <<= 1;
temp2 = 0x4950df;
temp2 -= temp3;
lsb &= 1;
if ( temp2 <= 0x3e0000 ) {
if ( temp2 < 0xffef0000 )
temp2 = 0xffef0000;
} else {
temp2 = 0x3e0000;
}
if ( !lsb ) {
temp2 -= 0xf0000;
} else {
temp2 += 0xf0000;
}
temp3 = 0x4d0000;
temp3 -= temp2;
temp3 *= 100;
temp3 = temp3 / 0x6d;
temp3 >>= 0x10;
_rssi = temp3 & 0xff;
*rssi = temp3 & 0xff;
break;
case RFCHIPID_GCT:
lsb = temp2 & 1;
temp2 &= 0x7e;
if ( ! lsb || !(temp2 <= 0x3c) ){
temp2 = 0x64;
} else {
temp2 = (100 * temp2) / 0x3c;
}
*rssi = temp2 & 0xff;
_rssi = temp2 & 0xff;
break;
case RFCHIPID_PHILIPS:
if( orig_qual <= 0x4e ){
_rssi = STRENGTH_MAP[orig_qual];
*rssi = _rssi;
} else {
orig_qual -= 0x80;
if ( !orig_qual ){
_rssi = 1;
*rssi = 1;
} else {
_rssi = 0x32;
*rssi = 0x32;
}
}
break;
case RFCHIPID_MAXIM:
lsb = temp2 & 1;
temp2 &= 0x7e;
temp2 >>= 1;
temp2 += 0x42;
if( lsb != 0 ){
temp2 += 0xa;
}
*rssi = temp2 & 0xff;
_rssi = temp2 & 0xff;
break;
}
if ( _rssi < 0x64 ){ if ( _rssi < 0x64 ){
if ( _rssi == 0 ) { if ( _rssi == 0 ) {
*rssi = 1; *rssi = 1;
...@@ -2707,8 +2622,6 @@ short rtl8180_init(struct net_device *dev) ...@@ -2707,8 +2622,6 @@ short rtl8180_init(struct net_device *dev)
priv->txbeaconcount = 2; priv->txbeaconcount = 2;
priv->rx_skb_complete = 1; priv->rx_skb_complete = 1;
priv->RegThreeWireMode = HW_THREE_WIRE_SI;
priv->RFChangeInProgress = false; priv->RFChangeInProgress = false;
priv->SetRFPowerStateInProgress = false; priv->SetRFPowerStateInProgress = false;
priv->RFProgType = 0; priv->RFProgType = 0;
...@@ -2999,9 +2912,6 @@ short rtl8180_init(struct net_device *dev) ...@@ -2999,9 +2912,6 @@ short rtl8180_init(struct net_device *dev)
priv->cs_treshold = (eeprom_val & 0xff00) >> 8; priv->cs_treshold = (eeprom_val & 0xff00) >> 8;
eeprom_93cx6_read(&eeprom, RFCHIPID, &eeprom_val); eeprom_93cx6_read(&eeprom, RFCHIPID, &eeprom_val);
priv->rf_chip = 0xff & eeprom_val;
priv->rf_chip = RF_ZEBRA4;
priv->rf_sleep = rtl8225z4_rf_sleep; priv->rf_sleep = rtl8225z4_rf_sleep;
priv->rf_wakeup = rtl8225z4_rf_wakeup; priv->rf_wakeup = rtl8225z4_rf_wakeup;
DMESGW("**PLEASE** REPORT SUCCESSFUL/UNSUCCESSFUL TO Realtek!"); DMESGW("**PLEASE** REPORT SUCCESSFUL/UNSUCCESSFUL TO Realtek!");
......
...@@ -282,30 +282,13 @@ DIG_Zebra( ...@@ -282,30 +282,13 @@ DIG_Zebra(
// Dispatch DIG implementation according to RF. // Dispatch DIG implementation according to RF.
// //
void void
DynamicInitGain( DynamicInitGain(struct net_device *dev)
struct net_device *dev
)
{ {
struct r8180_priv *priv = ieee80211_priv(dev); DIG_Zebra(dev);
switch(priv->rf_chip)
{
case RF_ZEBRA2: // [AnnieWorkaround] For Zebra2, 2005-08-01.
case RF_ZEBRA4:
DIG_Zebra( dev );
break;
default:
printk("DynamicInitGain(): unknown RFChipID(%d) !!!\n", priv->rf_chip);
break;
}
} }
void rtl8180_hw_dig_wq (struct work_struct *work) void rtl8180_hw_dig_wq (struct work_struct *work)
{ {
// struct r8180_priv *priv = container_of(work, struct r8180_priv, watch_dog_wq);
// struct ieee80211_device * ieee = (struct ieee80211_device*)
// container_of(work, struct ieee80211_device, watch_dog_wq);
struct delayed_work *dwork = to_delayed_work(work); struct delayed_work *dwork = to_delayed_work(work);
struct ieee80211_device *ieee = container_of(dwork,struct ieee80211_device,hw_dig_wq); struct ieee80211_device *ieee = container_of(dwork,struct ieee80211_device,hw_dig_wq);
struct net_device *dev = ieee->dev; struct net_device *dev = ieee->dev;
...@@ -1310,44 +1293,24 @@ SetAntenna8185( ...@@ -1310,44 +1293,24 @@ SetAntenna8185(
switch(u1bAntennaIndex) switch(u1bAntennaIndex)
{ {
case 0: case 0:
switch(priv->rf_chip) /* Mac register, main antenna */
{
case RF_ZEBRA2:
case RF_ZEBRA4:
// Mac register, main antenna
write_nic_byte(dev, ANTSEL, 0x03); write_nic_byte(dev, ANTSEL, 0x03);
//base band /* base band */
write_phy_cck(dev,0x11, 0x9b); // Config CCK RX antenna. write_phy_cck(dev, 0x11, 0x9b); /* Config CCK RX antenna. */
write_phy_ofdm(dev, 0x0d, 0x5c); // Config OFDM RX antenna. write_phy_ofdm(dev, 0x0d, 0x5c); /* Config OFDM RX antenna. */
bAntennaSwitched = true; bAntennaSwitched = true;
break; break;
default:
printk("SetAntenna8185: unknown RFChipID(%d)\n", priv->rf_chip);
break;
}
break;
case 1: case 1:
switch(priv->rf_chip) /* Mac register, aux antenna */
{
case RF_ZEBRA2:
case RF_ZEBRA4:
// Mac register, aux antenna
write_nic_byte(dev, ANTSEL, 0x00); write_nic_byte(dev, ANTSEL, 0x00);
//base band /* base band */
write_phy_cck(dev, 0x11, 0xbb); // Config CCK RX antenna. write_phy_cck(dev, 0x11, 0xbb); /* Config CCK RX antenna. */
write_phy_ofdm(dev, 0x0d, 0x54); // Config OFDM RX antenna. write_phy_ofdm(dev, 0x0d, 0x54); /* Config OFDM RX antenna. */
bAntennaSwitched = true; bAntennaSwitched = true;
break;
default:
printk("SetAntenna8185: unknown RFChipID(%d)\n", priv->rf_chip);
break;
}
break; break;
default: default:
......
...@@ -854,31 +854,6 @@ bool SetZebraRFPowerState8185(struct net_device *dev, ...@@ -854,31 +854,6 @@ bool SetZebraRFPowerState8185(struct net_device *dev,
btConfig3 = read_nic_byte(dev, CONFIG3); btConfig3 = read_nic_byte(dev, CONFIG3);
write_nic_byte(dev, CONFIG3, (btConfig3 | CONFIG3_PARM_En)); write_nic_byte(dev, CONFIG3, (btConfig3 | CONFIG3_PARM_En));
switch (priv->rf_chip) {
case RF_ZEBRA2:
switch (eRFPowerState) {
case eRfOn:
RF_WriteReg(dev,0x4,0x9FF);
write_nic_dword(dev, ANAPARAM, ANAPARM_ON);
write_nic_dword(dev, ANAPARAM2, ANAPARM2_ON);
write_nic_byte(dev, CONFIG4, priv->RFProgType);
/* turn on CCK and OFDM */
u1bTmp = read_nic_byte(dev, 0x24E);
write_nic_byte(dev, 0x24E, (u1bTmp & (~(BIT5 | BIT6))));
break;
case eRfSleep:
break;
case eRfOff:
break;
default:
bResult = false;
break;
}
break;
case RF_ZEBRA4:
switch (eRFPowerState) { switch (eRFPowerState) {
case eRfOn: case eRfOn:
write_nic_word(dev, 0x37C, 0x00EC); write_nic_word(dev, 0x37C, 0x00EC);
...@@ -896,8 +871,8 @@ bool SetZebraRFPowerState8185(struct net_device *dev, ...@@ -896,8 +871,8 @@ bool SetZebraRFPowerState8185(struct net_device *dev,
RF_WriteReg(dev, 0x4, 0x0972); udelay(500); RF_WriteReg(dev, 0x4, 0x0972); udelay(500);
/* turn on BB */ /* turn on BB */
write_phy_ofdm(dev,0x10,0x40); write_phy_ofdm(dev, 0x10, 0x40);
write_phy_ofdm(dev,0x12,0x40); write_phy_ofdm(dev, 0x12, 0x40);
/* Avoid power down at init time. */ /* Avoid power down at init time. */
write_nic_byte(dev, CONFIG4, priv->RFProgType); write_nic_byte(dev, CONFIG4, priv->RFProgType);
...@@ -911,7 +886,7 @@ bool SetZebraRFPowerState8185(struct net_device *dev, ...@@ -911,7 +886,7 @@ bool SetZebraRFPowerState8185(struct net_device *dev,
QueueID++; QueueID++;
continue; continue;
} else { } else {
priv->TxPollingTimes ++; priv->TxPollingTimes++;
if (priv->TxPollingTimes >= LPS_MAX_SLEEP_WAITING_TIMES_87SE) { if (priv->TxPollingTimes >= LPS_MAX_SLEEP_WAITING_TIMES_87SE) {
bActionAllowed = false; bActionAllowed = false;
break; break;
...@@ -999,8 +974,7 @@ bool SetZebraRFPowerState8185(struct net_device *dev, ...@@ -999,8 +974,7 @@ bool SetZebraRFPowerState8185(struct net_device *dev,
{ {
int i = 0; int i = 0;
while (true) while (true) {
{
u8 tmp24F = read_nic_byte(dev, 0x24f); u8 tmp24F = read_nic_byte(dev, 0x24f);
if ((tmp24F == 0x01) || (tmp24F == 0x09)) { if ((tmp24F == 0x01) || (tmp24F == 0x09)) {
...@@ -1027,12 +1001,6 @@ bool SetZebraRFPowerState8185(struct net_device *dev, ...@@ -1027,12 +1001,6 @@ bool SetZebraRFPowerState8185(struct net_device *dev,
write_nic_word(dev, 0x37C, 0x00FC); write_nic_word(dev, 0x37C, 0x00FC);
} }
break; break;
default:
bResult = false;
printk("SetZebraRFPowerState8185(): unknown state to set: 0x%X!!!\n", eRFPowerState);
break;
}
break;
} }
btConfig3 &= ~(CONFIG3_PARM_En); btConfig3 &= ~(CONFIG3_PARM_En);
......
...@@ -238,22 +238,9 @@ PlatformIORead4Byte( ...@@ -238,22 +238,9 @@ PlatformIORead4Byte(
return data; return data;
} }
void void SetOutputEnableOfRfPins(struct net_device *dev)
SetOutputEnableOfRfPins(
struct net_device *dev
)
{ {
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
switch(priv->rf_chip)
{
case RFCHIPID_RTL8225:
case RF_ZEBRA2:
case RF_ZEBRA4:
write_nic_word(dev, RFPinsEnable, 0x1bff); write_nic_word(dev, RFPinsEnable, 0x1bff);
//write_nic_word(dev, RFPinsEnable, 0x1fff);
break;
}
} }
void void
...@@ -603,109 +590,25 @@ HwThreeWire( ...@@ -603,109 +590,25 @@ HwThreeWire(
void void
RF_WriteReg( RF_WriteReg(struct net_device *dev, u8 offset, u32 data)
struct net_device *dev,
u8 offset,
u32 data
)
{ {
//RFReg reg;
u32 data2Write; u32 data2Write;
u8 len; u8 len;
u8 low2high;
//u32 RF_Read = 0;
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
switch(priv->rf_chip)
{
case RFCHIPID_RTL8225:
case RF_ZEBRA2: // Annie 2006-05-12.
case RF_ZEBRA4: //by amy
switch(priv->RegThreeWireMode)
{
case SW_THREE_WIRE:
{ // Perform SW 3-wire programming by driver.
data2Write = (data << 4) | (u32)(offset & 0x0f);
len = 16;
low2high = 0;
ZEBRA_RFSerialWrite(dev, data2Write, len, low2high);
}
break;
case HW_THREE_WIRE:
{ // Pure HW 3-wire.
data2Write = (data << 4) | (u32)(offset & 0x0f);
len = 16;
HwThreeWire(
dev,
(u8 *)(&data2Write), // pDataBuf,
len, // nDataBufBitCnt,
0, // bHold,
1); // bWrite
}
break;
case HW_THREE_WIRE_PI: //Parallel Interface
{ // Pure HW 3-wire.
data2Write = (data << 4) | (u32)(offset & 0x0f);
len = 16;
HwHSSIThreeWire(
dev,
(u8*)(&data2Write), // pDataBuf,
len, // nDataBufBitCnt,
0, // bSI
1); // bWrite
//printk("33333\n");
}
break;
case HW_THREE_WIRE_SI: //Serial Interface /* Pure HW 3-wire. */
{ // Pure HW 3-wire.
data2Write = (data << 4) | (u32)(offset & 0x0f); data2Write = (data << 4) | (u32)(offset & 0x0f);
len = 16; len = 16;
// printk(" enter ZEBRA_RFSerialWrite\n ");
// low2high = 0;
// ZEBRA_RFSerialWrite(dev, data2Write, len, low2high);
HwHSSIThreeWire(
dev,
(u8*)(&data2Write), // pDataBuf,
len, // nDataBufBitCnt,
1, // bSI
1); // bWrite
// printk(" exit ZEBRA_RFSerialWrite\n ");
}
break;
default:
DMESGE("RF_WriteReg(): invalid RegThreeWireMode(%d) !!!", priv->RegThreeWireMode);
break;
}
break;
default: HwHSSIThreeWire(dev, (u8 *)(&data2Write), len, 1, 1);
DMESGE("RF_WriteReg(): unknown RFChipID: %#X", priv->rf_chip);
break;
}
} }
void void
ZEBRA_RFSerialRead( ZEBRA_RFSerialRead(struct net_device *dev, u32 data2Write, u8 wLength,
struct net_device *dev, u32 *data2Read, u8 rLength, u8 low2high)
u32 data2Write,
u8 wLength,
u32 *data2Read,
u8 rLength,
u8 low2high
)
{ {
ThreeWireReg twreg; ThreeWireReg twreg;
int i; int i;
u16 oval,oval2,oval3,tmp, wReg80; u16 oval, oval2, oval3, tmp, wReg80;
u32 mask; u32 mask;
u8 u1bTmp; u8 u1bTmp;
ThreeWireReg tdata; ThreeWireReg tdata;
...@@ -818,71 +721,16 @@ ZEBRA_RFSerialRead( ...@@ -818,71 +721,16 @@ ZEBRA_RFSerialRead(
} }
u32 u32 RF_ReadReg(struct net_device *dev, u8 offset)
RF_ReadReg(
struct net_device *dev,
u8 offset
)
{ {
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
u32 data2Write; u32 data2Write;
u8 wlen; u8 wlen;
u8 rlen;
u8 low2high;
u32 dataRead; u32 dataRead;
switch(priv->rf_chip) data2Write = ((u32)(offset & 0x0f));
{ wlen = 16;
case RFCHIPID_RTL8225: HwHSSIThreeWire(dev, (u8 *)(&data2Write), wlen, 1, 0);
case RF_ZEBRA2: dataRead = data2Write;
case RF_ZEBRA4:
switch(priv->RegThreeWireMode)
{
case HW_THREE_WIRE_PI: // For 87S Parallel Interface.
{
data2Write = ((u32)(offset&0x0f));
wlen=16;
HwHSSIThreeWire(
dev,
(u8*)(&data2Write), // pDataBuf,
wlen, // nDataBufBitCnt,
0, // bSI
0); // bWrite
dataRead= data2Write;
}
break;
case HW_THREE_WIRE_SI: // For 87S Serial Interface.
{
data2Write = ((u32)(offset&0x0f)) ;
wlen=16;
HwHSSIThreeWire(
dev,
(u8*)(&data2Write), // pDataBuf,
wlen, // nDataBufBitCnt,
1, // bSI
0 // bWrite
);
dataRead= data2Write;
}
break;
// Perform SW 3-wire programming by driver.
default:
{
data2Write = ((u32)(offset&0x1f)) << 27; // For Zebra E-cut. 2005.04.11, by rcnjko.
wlen = 6;
rlen = 12;
low2high = 0;
ZEBRA_RFSerialRead(dev, data2Write, wlen,&dataRead,rlen, low2high);
}
break;
}
break;
default:
dataRead = 0;
break;
}
return dataRead; return dataRead;
} }
...@@ -1291,83 +1139,61 @@ UpdateInitialGain( ...@@ -1291,83 +1139,61 @@ UpdateInitialGain(
return; return;
} }
switch(priv->rf_chip) switch (priv->InitialGain) {
{ case 1: /* m861dBm */
case RF_ZEBRA4:
// Dynamic set initial gain, follow 87B
switch(priv->InitialGain)
{
case 1: //m861dBm
//DMESG("RTL8187 + 8225 Initial Gain State 1: -82 dBm \n");
write_phy_ofdm(dev, 0x17, 0x26); mdelay(1); write_phy_ofdm(dev, 0x17, 0x26); mdelay(1);
write_phy_ofdm(dev, 0x24, 0x86); mdelay(1); write_phy_ofdm(dev, 0x24, 0x86); mdelay(1);
write_phy_ofdm(dev, 0x05, 0xfa); mdelay(1); write_phy_ofdm(dev, 0x05, 0xfa); mdelay(1);
break; break;
case 2: //m862dBm case 2: /* m862dBm */
//DMESG("RTL8187 + 8225 Initial Gain State 2: -82 dBm \n");
write_phy_ofdm(dev, 0x17, 0x36); mdelay(1); write_phy_ofdm(dev, 0x17, 0x36); mdelay(1);
write_phy_ofdm(dev, 0x24, 0x86); mdelay(1); write_phy_ofdm(dev, 0x24, 0x86); mdelay(1);
write_phy_ofdm(dev, 0x05, 0xfa); mdelay(1); write_phy_ofdm(dev, 0x05, 0xfa); mdelay(1);
break; break;
case 3: //m863dBm case 3: /* m863dBm */
//DMESG("RTL8187 + 8225 Initial Gain State 3: -82 dBm \n");
write_phy_ofdm(dev, 0x17, 0x36); mdelay(1); write_phy_ofdm(dev, 0x17, 0x36); mdelay(1);
write_phy_ofdm(dev, 0x24, 0x86); mdelay(1); write_phy_ofdm(dev, 0x24, 0x86); mdelay(1);
write_phy_ofdm(dev, 0x05, 0xfb); mdelay(1); write_phy_ofdm(dev, 0x05, 0xfb); mdelay(1);
break; break;
case 4: //m864dBm case 4: /* m864dBm */
//DMESG("RTL8187 + 8225 Initial Gain State 4: -78 dBm \n");
write_phy_ofdm(dev, 0x17, 0x46); mdelay(1); write_phy_ofdm(dev, 0x17, 0x46); mdelay(1);
write_phy_ofdm(dev, 0x24, 0x86); mdelay(1); write_phy_ofdm(dev, 0x24, 0x86); mdelay(1);
write_phy_ofdm(dev, 0x05, 0xfb); mdelay(1); write_phy_ofdm(dev, 0x05, 0xfb); mdelay(1);
break; break;
case 5: //m82dBm case 5: /* m82dBm */
//DMESG("RTL8187 + 8225 Initial Gain State 5: -74 dBm \n");
write_phy_ofdm(dev, 0x17, 0x46); mdelay(1); write_phy_ofdm(dev, 0x17, 0x46); mdelay(1);
write_phy_ofdm(dev, 0x24, 0x96); mdelay(1); write_phy_ofdm(dev, 0x24, 0x96); mdelay(1);
write_phy_ofdm(dev, 0x05, 0xfb); mdelay(1); write_phy_ofdm(dev, 0x05, 0xfb); mdelay(1);
break; break;
case 6: //m78dBm case 6: /* m78dBm */
//DMESG ("RTL8187 + 8225 Initial Gain State 6: -70 dBm \n");
write_phy_ofdm(dev, 0x17, 0x56); mdelay(1); write_phy_ofdm(dev, 0x17, 0x56); mdelay(1);
write_phy_ofdm(dev, 0x24, 0x96); mdelay(1); write_phy_ofdm(dev, 0x24, 0x96); mdelay(1);
write_phy_ofdm(dev, 0x05, 0xfc); mdelay(1); write_phy_ofdm(dev, 0x05, 0xfc); mdelay(1);
break; break;
case 7: //m74dBm case 7: /* m74dBm */
//DMESG("RTL8187 + 8225 Initial Gain State 7: -66 dBm \n");
write_phy_ofdm(dev, 0x17, 0x56); mdelay(1); write_phy_ofdm(dev, 0x17, 0x56); mdelay(1);
write_phy_ofdm(dev, 0x24, 0xa6); mdelay(1); write_phy_ofdm(dev, 0x24, 0xa6); mdelay(1);
write_phy_ofdm(dev, 0x05, 0xfc); mdelay(1); write_phy_ofdm(dev, 0x05, 0xfc); mdelay(1);
break; break;
case 8: case 8:
//DMESG("RTL8187 + 8225 Initial Gain State 8:\n");
write_phy_ofdm(dev, 0x17, 0x66); mdelay(1); write_phy_ofdm(dev, 0x17, 0x66); mdelay(1);
write_phy_ofdm(dev, 0x24, 0xb6); mdelay(1); write_phy_ofdm(dev, 0x24, 0xb6); mdelay(1);
write_phy_ofdm(dev, 0x05, 0xfc); mdelay(1); write_phy_ofdm(dev, 0x05, 0xfc); mdelay(1);
break; break;
default: /* MP */
default: //MP
//DMESG("RTL8187 + 8225 Initial Gain State 1: -82 dBm (default)\n");
write_phy_ofdm(dev, 0x17, 0x26); mdelay(1); write_phy_ofdm(dev, 0x17, 0x26); mdelay(1);
write_phy_ofdm(dev, 0x24, 0x86); mdelay(1); write_phy_ofdm(dev, 0x24, 0x86); mdelay(1);
write_phy_ofdm(dev, 0x05, 0xfa); mdelay(1); write_phy_ofdm(dev, 0x05, 0xfa); mdelay(1);
break; break;
} }
break;
default:
DMESG("UpdateInitialGain(): unknown RFChipID: %#X\n", priv->rf_chip);
break;
}
} }
// //
// Description: // Description:
...@@ -1397,14 +1223,8 @@ PhyConfig8185( ...@@ -1397,14 +1223,8 @@ PhyConfig8185(
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
write_nic_dword(dev, RCR, priv->ReceiveConfig); write_nic_dword(dev, RCR, priv->ReceiveConfig);
priv->RFProgType = read_nic_byte(dev, CONFIG4) & 0x03; priv->RFProgType = read_nic_byte(dev, CONFIG4) & 0x03;
// RF config /* RF config */
switch(priv->rf_chip) ZEBRA_Config_85BASIC_HardCode(dev);
{
case RF_ZEBRA2:
case RF_ZEBRA4:
ZEBRA_Config_85BASIC_HardCode( dev);
break;
}
//{by amy 080312 //{by amy 080312
// Set default initial gain state to 4, approved by SD3 DZ, by Bruce, 2007-06-06. // Set default initial gain state to 4, approved by SD3 DZ, by Bruce, 2007-06-06.
if(priv->bDigMechanism) if(priv->bDigMechanism)
...@@ -1614,19 +1434,8 @@ GetSupportedWirelessMode8185( ...@@ -1614,19 +1434,8 @@ GetSupportedWirelessMode8185(
) )
{ {
u8 btSupportedWirelessMode = 0; u8 btSupportedWirelessMode = 0;
struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev);
switch(priv->rf_chip)
{
case RF_ZEBRA2:
case RF_ZEBRA4:
btSupportedWirelessMode = (WIRELESS_MODE_B | WIRELESS_MODE_G); btSupportedWirelessMode = (WIRELESS_MODE_B | WIRELESS_MODE_G);
break;
default:
btSupportedWirelessMode = WIRELESS_MODE_B;
break;
}
return btSupportedWirelessMode; return btSupportedWirelessMode;
} }
...@@ -1881,23 +1690,11 @@ ActSetWirelessMode8185( ...@@ -1881,23 +1690,11 @@ ActSetWirelessMode8185(
} }
// 2. Swtich band: RF or BB specific actions, /* 2. Swtich band: RF or BB specific actions,
// for example, refresh tables in omc8255, or change initial gain if necessary. * for example, refresh tables in omc8255, or change initial gain if necessary.
switch(priv->rf_chip) * Nothing to do for Zebra to switch band.
{ * Update current wireless mode if we swtich to specified band successfully. */
case RF_ZEBRA2:
case RF_ZEBRA4:
{
// Nothing to do for Zebra to switch band.
// Update current wireless mode if we swtich to specified band successfully.
ieee->mode = (WIRELESS_MODE)btWirelessMode; ieee->mode = (WIRELESS_MODE)btWirelessMode;
}
break;
default:
DMESGW("ActSetWirelessMode8185(): unsupported RF: 0x%X !!!\n", priv->rf_chip);
break;
}
// 3. Change related setting. // 3. Change related setting.
if( ieee->mode == WIRELESS_MODE_A ){ if( ieee->mode == WIRELESS_MODE_A ){
...@@ -2108,18 +1905,7 @@ SetRFPowerState( ...@@ -2108,18 +1905,7 @@ SetRFPowerState(
return bResult; return bResult;
} }
switch(priv->rf_chip)
{
case RF_ZEBRA2:
case RF_ZEBRA4:
bResult = SetZebraRFPowerState8185(dev, eRFPowerState); bResult = SetZebraRFPowerState8185(dev, eRFPowerState);
break;
default:
printk("SetRFPowerState8185(): unknown RFChipID: 0x%X!!!\n", priv->rf_chip);
break;;
}
// printk("<--------- SetRFPowerState(): bResult(%d)\n", bResult);
return bResult; return bResult;
} }
......
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