22 #include <linux/pci.h>
29 static const u32 max2820_chan[] = {
51 phy_config = 0x90 + (data & 0xf);
55 phy_config += (data >> 4) & 0xff;
57 rtl818x_iowrite32(priv,
77 static u8 max2820_rf_calc_rssi(
u8 agc,
u8 sq)
90 return 65 * agc / 100;
93 static void max2820_rf_set_channel(
struct ieee80211_hw *dev,
99 unsigned int chan_idx = channel - 1;
100 u32 txpw = priv->
channels[chan_idx].hw_value & 0xFF;
101 u32 chan = max2820_chan[chan_idx];
107 max2820_write_phy_antenna(dev, channel);
108 write_max2820(dev, 3, chan);
114 write_max2820(dev, 1, 0);
123 write_max2820(dev, 0, 0x007);
124 write_max2820(dev, 1, 0x01e);
125 write_max2820(dev, 2, 0x001);
127 max2820_rf_set_channel(dev,
NULL);
129 write_max2820(dev, 4, 0x313);
135 write_max2820(dev, 5, 0x00f);
145 max2820_write_phy_antenna(dev, 1);
149 if (rtl818x_ioread8(priv, &priv->
map->CONFIG2) &
160 max2820_rf_set_channel(dev,
NULL);
165 .init = max2820_rf_init,
166 .stop = max2820_rf_stop,
167 .set_chan = max2820_rf_set_channel,
168 .calc_rssi = max2820_rf_calc_rssi,