u16 out, select;
u8 bit;
u32 bangdata = (data << 4) | (adr & 0xf);
- struct r8180_priv *priv = ieee80211_priv(dev);
out = read_nic_word(dev, RFPinsOutput) & 0xfff3;
select = read_nic_word(dev, RFPinsSelect);
write_nic_word(dev, RFPinsSelect, select | 0x7 |
- ((priv->card_type == USB) ? 0 : SW_CONTROL_GPIO));
+ SW_CONTROL_GPIO);
force_pci_posting(dev);
udelay(10);
force_pci_posting(dev);
udelay(10);
- write_nic_word(dev, RFPinsOutput, out |
- ((priv->card_type == USB) ? 4 : BB_HOST_BANG_EN));
+ write_nic_word(dev, RFPinsOutput, out | BB_HOST_BANG_EN);
- write_nic_word(dev, RFPinsSelect, select |
- ((priv->card_type == USB) ? 0 : SW_CONTROL_GPIO));
+ write_nic_word(dev, RFPinsSelect, select | SW_CONTROL_GPIO);
- if (priv->card_type == USB)
- mdelay(2);
- else
- rtl8185_rf_pins_enable(dev);
+ rtl8185_rf_pins_enable(dev);
}
static const u16 rtl8225bcd_rxgain[] = {
u8 cck_power_level = 0xff & priv->chtxpwr[ch];
u8 ofdm_power_level = 0xff & priv->chtxpwr_ofdm[ch];
- if (priv->card_type == USB) {
- max_cck_power_level = 11;
- max_ofdm_power_level = 25;
- min_ofdm_power_level = 10;
- } else {
- max_cck_power_level = 35;
- max_ofdm_power_level = 35;
- min_ofdm_power_level = 0;
- }
+ max_cck_power_level = 35;
+ max_ofdm_power_level = 35;
+ min_ofdm_power_level = 0;
if (cck_power_level > max_cck_power_level)
cck_power_level = max_cck_power_level;
priv->chan = channel;
- if (priv->card_type != USB)
- rtl8225_host_pci_init(dev);
+ rtl8225_host_pci_init(dev);
write_nic_dword(dev, RF_TIMING, 0x000a8008);
write_rtl8225(dev, 0x4, 0x8c3); mdelay(1);
write_rtl8225(dev, 0x5, 0xc72); mdelay(1);
write_rtl8225(dev, 0x6, 0xe6); mdelay(1);
- write_rtl8225(dev, 0x7, ((priv->card_type == USB)? 0x82a : rtl8225_chan[channel])); mdelay(1);
+ write_rtl8225(dev, 0x7, rtl8225_chan[channel]); mdelay(1);
write_rtl8225(dev, 0x8, 0x3f); mdelay(1);
write_rtl8225(dev, 0x9, 0x335); mdelay(1);
write_rtl8225(dev, 0xa, 0x9d4); mdelay(1);
write_rtl8225(dev, 0x2, 0xc4d);
- if (priv->card_type == USB) {
- mdelay(200);
-
- write_rtl8225(dev, 0x2, 0x44d);
- mdelay(100);
- }
-
/* FIXME!! rtl8187 we have to check if calibrarion
* is successful and eventually cal. again (repeat
* the two write on reg 2)
write_rtl8225(dev, 0x0, 0x2bf);
- if (priv->card_type != USB)
- rtl8185_rf_pins_enable(dev);
-
for (i = 0; i < 128; i++) {
data = rtl8225_agc[i];
write_phy_ofdm(dev, 0x00, 0x01); mdelay(1);
write_phy_ofdm(dev, 0x01, 0x02); mdelay(1);
- write_phy_ofdm(dev, 0x02, ((priv->card_type == USB) ? 0x42 : 0x62)); mdelay(1);
+ write_phy_ofdm(dev, 0x02, 0x62); mdelay(1);
write_phy_ofdm(dev, 0x03, 0x00); mdelay(1);
write_phy_ofdm(dev, 0x04, 0x00); mdelay(1);
write_phy_ofdm(dev, 0x05, 0x00); mdelay(1);
write_phy_cck(dev, 0x6, 0xfc); mdelay(1);
write_phy_cck(dev, 0x7, 0x78); mdelay(1);
write_phy_cck(dev, 0x8, 0x2e); mdelay(1);
- write_phy_cck(dev, 0x10, ((priv->card_type == USB) ? 0x9b: 0x93)); mdelay(1);
+ write_phy_cck(dev, 0x10, 0x93); mdelay(1);
write_phy_cck(dev, 0x11, 0x88); mdelay(1);
write_phy_cck(dev, 0x12, 0x47); mdelay(1);
write_phy_cck(dev, 0x13, 0xd0);
/* switch to high-speed 3-wire
* last digit. 2 for both cck and ofdm
*/
- if (priv->card_type == USB)
- write_nic_dword(dev, 0x94, 0x3dc00002);
- else {
- write_nic_dword(dev, 0x94, 0x15c00002);
- rtl8185_rf_pins_enable(dev);
- }
+ write_nic_dword(dev, 0x94, 0x15c00002);
+ rtl8185_rf_pins_enable(dev);
rtl8225_rf_set_chan(dev, priv->chan);
}