23 #include <linux/pci.h>
30 static const int grf5101_encode[] = {
42 phy_config = grf5101_encode[(data >> 8) & 0xF];
43 phy_config |= grf5101_encode[(data >> 4) & 0xF] << 4;
44 phy_config |= grf5101_encode[data & 0xF] << 8;
45 phy_config |= grf5101_encode[(addr >> 1) & 0xF] << 12;
46 phy_config |= (addr & 1) << 16;
47 phy_config |= grf5101_encode[(data & 0xf000) >> 12] << 24;
50 phy_config |= 0x90000000;
52 rtl818x_iowrite32(priv,
72 static u8 grf5101_rf_calc_rssi(
u8 agc,
u8 sq)
81 static void grf5101_rf_set_channel(
struct ieee80211_hw *dev,
86 u32 txpw = priv->
channels[channel - 1].hw_value & 0xFF;
87 u32 chan = channel - 1;
90 write_grf5101(dev, 0x15, 0x0);
91 write_grf5101(dev, 0x06, txpw);
92 write_grf5101(dev, 0x15, 0x10);
93 write_grf5101(dev, 0x15, 0x0);
96 write_grf5101(dev, 0x07, 0x0);
97 write_grf5101(dev, 0x0B, chan);
98 write_grf5101(dev, 0x07, 0x1000);
100 grf5101_write_phy_antenna(dev, channel);
109 anaparam &= 0x000fffff;
110 anaparam |= 0x3f900000;
113 write_grf5101(dev, 0x07, 0x0);
114 write_grf5101(dev, 0x1f, 0x45);
115 write_grf5101(dev, 0x1f, 0x5);
116 write_grf5101(dev, 0x00, 0x8e4);
125 write_grf5101(dev, 0x1f, 0x0);
126 write_grf5101(dev, 0x1f, 0x0);
127 write_grf5101(dev, 0x1f, 0x40);
128 write_grf5101(dev, 0x1f, 0x60);
129 write_grf5101(dev, 0x1f, 0x61);
130 write_grf5101(dev, 0x1f, 0x61);
131 write_grf5101(dev, 0x00, 0xae4);
132 write_grf5101(dev, 0x1f, 0x1);
133 write_grf5101(dev, 0x1f, 0x41);
134 write_grf5101(dev, 0x1f, 0x61);
136 write_grf5101(dev, 0x01, 0x1a23);
137 write_grf5101(dev, 0x02, 0x4971);
138 write_grf5101(dev, 0x03, 0x41de);
139 write_grf5101(dev, 0x04, 0x2d80);
140 write_grf5101(dev, 0x05, 0x68ff);
141 write_grf5101(dev, 0x06, 0x0);
142 write_grf5101(dev, 0x07, 0x0);
143 write_grf5101(dev, 0x08, 0x7533);
144 write_grf5101(dev, 0x09, 0xc401);
145 write_grf5101(dev, 0x0a, 0x0);
146 write_grf5101(dev, 0x0c, 0x1c7);
147 write_grf5101(dev, 0x0d, 0x29d3);
148 write_grf5101(dev, 0x0e, 0x2e8);
149 write_grf5101(dev, 0x10, 0x192);
150 write_grf5101(dev, 0x11, 0x248);
151 write_grf5101(dev, 0x12, 0x0);
152 write_grf5101(dev, 0x13, 0x20c4);
153 write_grf5101(dev, 0x14, 0xf4fc);
154 write_grf5101(dev, 0x15, 0x0);
155 write_grf5101(dev, 0x16, 0x1500);
157 write_grf5101(dev, 0x07, 0x1000);
167 grf5101_write_phy_antenna(dev, 1);
171 if (rtl818x_ioread8(priv, &priv->
map->CONFIG2) &
186 .init = grf5101_rf_init,
187 .stop = grf5101_rf_stop,
188 .set_chan = grf5101_rf_set_channel,
189 .calc_rssi = grf5101_rf_calc_rssi,