27 #define RTL8225_ANAPARAM_ON 0xa0000b59 28 #define RTL8225_ANAPARAM2_ON 0x860dec11 29 #define RTL8225_ANAPARAM_OFF 0xa00beb59 30 #define RTL8225_ANAPARAM2_OFF 0x840dec11 32 #define min(a,b) (((a)<(b))?(a):(b)) 49 u16 reg80, reg84, reg82;
53 bangdata = (
data << 4) | (
addr & 0xf);
72 for (i = 15; i >= 0; i--) {
73 u16 reg = ( reg80 | ( ( bangdata >> i ) & 1 ) );
97 u16 reg80, reg82, reg84,
out;
116 for (i = 4; i >= 0; i--) {
145 reg80 | (1 << 3) | (1 << 1));
158 for (i = 11; i >= 0; i--) {
164 reg80 | (1 << 3) | (1 << 1));
168 reg80 | (1 << 3) | (1 << 1));
172 reg80 | (1 << 3) | (1 << 1));
186 reg80 | (1 << 3) | (1 << 2));
198 0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0408, 0x0409,
199 0x040a, 0x040b, 0x0502, 0x0503, 0x0504, 0x0505, 0x0540, 0x0541,
200 0x0542, 0x0543, 0x0544, 0x0545, 0x0580, 0x0581, 0x0582, 0x0583,
201 0x0584, 0x0585, 0x0588, 0x0589, 0x058a, 0x058b, 0x0643, 0x0644,
202 0x0645, 0x0680, 0x0681, 0x0682, 0x0683, 0x0684, 0x0685, 0x0688,
203 0x0689, 0x068a, 0x068b, 0x068c, 0x0742, 0x0743, 0x0744, 0x0745,
204 0x0780, 0x0781, 0x0782, 0x0783, 0x0784, 0x0785, 0x0788, 0x0789,
205 0x078a, 0x078b, 0x078c, 0x078d, 0x0790, 0x0791, 0x0792, 0x0793,
206 0x0794, 0x0795, 0x0798, 0x0799, 0x079a, 0x079b, 0x079c, 0x079d,
207 0x07a0, 0x07a1, 0x07a2, 0x07a3, 0x07a4, 0x07a5, 0x07a8, 0x07a9,
208 0x07aa, 0x07ab, 0x07ac, 0x07ad, 0x07b0, 0x07b1, 0x07b2, 0x07b3,
209 0x07b4, 0x07b5, 0x07b8, 0x07b9, 0x07ba, 0x07bb, 0x07bb
213 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e,
214 0x9d, 0x9c, 0x9b, 0x9a, 0x99, 0x98, 0x97, 0x96,
215 0x95, 0x94, 0x93, 0x92, 0x91, 0x90, 0x8f, 0x8e,
216 0x8d, 0x8c, 0x8b, 0x8a, 0x89, 0x88, 0x87, 0x86,
217 0x85, 0x84, 0x83, 0x82, 0x81, 0x80, 0x3f, 0x3e,
218 0x3d, 0x3c, 0x3b, 0x3a, 0x39, 0x38, 0x37, 0x36,
219 0x35, 0x34, 0x33, 0x32, 0x31, 0x30, 0x2f, 0x2e,
220 0x2d, 0x2c, 0x2b, 0x2a, 0x29, 0x28, 0x27, 0x26,
221 0x25, 0x24, 0x23, 0x22, 0x21, 0x20, 0x1f, 0x1e,
222 0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, 0x17, 0x16,
223 0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0f, 0x0e,
224 0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06,
225 0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01,
226 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
227 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
228 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
232 0x23, 0x88, 0x7c, 0xa5,
233 0x23, 0x88, 0x7c, 0xb5,
234 0x23, 0x88, 0x7c, 0xc5,
235 0x33, 0x80, 0x79, 0xc5,
236 0x43, 0x78, 0x76, 0xc5,
237 0x53, 0x60, 0x73, 0xc5,
238 0x63, 0x58, 0x70, 0xc5,
242 0x8d, 0x8d, 0x8d, 0x8d, 0x9d, 0xad, 0xbd
246 0x02, 0x06, 0x0e, 0x1e, 0x3e, 0x7e
250 0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02,
251 0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02,
252 0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02,
253 0x22, 0x21, 0x1d, 0x18, 0x11, 0x0b, 0x06, 0x02,
254 0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03,
255 0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03
259 0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00,
260 0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00,
261 0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00,
262 0x22, 0x21, 0x1d, 0x11, 0x00, 0x00, 0x00, 0x00,
263 0x26, 0x25, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00,
264 0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00
268 0x80, 0x90, 0xa2, 0xb5, 0xcb, 0xe4
272 0x085c, 0x08dc, 0x095c, 0x09dc, 0x0a5c, 0x0adc, 0x0b5c,
273 0x0bdc, 0x0c5c, 0x0cdc, 0x0d5c, 0x0ddc, 0x0e5c, 0x0f72
279 u8 cck_power, ofdm_power;
287 cck_power =
min(cck_power, (
u8)35);
288 ofdm_power =
min(ofdm_power, (
u8)35);
298 for (i = 0; i < 8; i++)
477 0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00
481 0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x04
485 0x33, 0x32, 0x2b, 0x23, 0x1a, 0x11, 0x08, 0x04
489 0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04
495 u8 cck_power, ofdm_power;
504 else if (cck_power == 12)
506 else if (cck_power == 13)
511 for (i = 0; i < 8; i++)
514 cck_power =
min(cck_power, (
u8)35);
515 if (cck_power == 13 || cck_power == 14)
524 ofdm_power =
min(ofdm_power, (
u8)35);
537 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0008, 0x0009,
538 0x000a, 0x000b, 0x0102, 0x0103, 0x0104, 0x0105, 0x0140, 0x0141,
539 0x0142, 0x0143, 0x0144, 0x0145, 0x0180, 0x0181, 0x0182, 0x0183,
540 0x0184, 0x0185, 0x0188, 0x0189, 0x018a, 0x018b, 0x0243, 0x0244,
541 0x0245, 0x0280, 0x0281, 0x0282, 0x0283, 0x0284, 0x0285, 0x0288,
542 0x0289, 0x028a, 0x028b, 0x028c, 0x0342, 0x0343, 0x0344, 0x0345,
543 0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x0388, 0x0389,
544 0x038a, 0x038b, 0x038c, 0x038d, 0x0390, 0x0391, 0x0392, 0x0393,
545 0x0394, 0x0395, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d,
546 0x03a0, 0x03a1, 0x03a2, 0x03a3, 0x03a4, 0x03a5, 0x03a8, 0x03a9,
547 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03b0, 0x03b1, 0x03b2, 0x03b3,
548 0x03b4, 0x03b5, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bb
737 if (reg8 != 0x588 || reg9 != 0x700) {
#define RTL818X_CONFIG3_ANAPARAM_WRITE
#define RTL8225_ANAPARAM_OFF
static const u8 rtl8225z2_tx_power_cck_B[]
static unsigned int unsigned int reg
void rtl818x_write_phy(struct net80211_device *dev, u8 addr, u32 data)
static u8 rtl818x_ioread8(struct rtl818x_priv *priv __unused, u8 *addr)
static void rtl8225z2_rf_set_tx_power(struct net80211_device *dev, int channel)
static void rtl818x_iowrite8(struct rtl818x_priv *priv __unused, u8 *addr, u8 val)
#define RTL818X_EEPROM_CMD_CONFIG
static u16 rtl8225_read(struct net80211_device *dev, u8 addr)
static const u8 rtl8225_tx_power_cck[]
static const u32 rtl8225_chan[]
static void rtl818x_iowrite32(struct rtl818x_priv *priv __unused, u32 *addr, u32 val)
static void rtl8225_write(struct net80211_device *dev, u8 addr, u16 data)
static const u8 rtl8225_tx_power_cck_ch14[]
static const u8 rtl8225_threshold[]
static void rtl8225_write_phy_cck(struct net80211_device *dev, u8 addr, u8 data)
static void rtl8225_write_phy_ofdm(struct net80211_device *dev, u8 addr, u8 data)
static const u8 rtl8225_tx_power_ofdm[]
static void rtl8225z2_rf_init(struct net80211_device *dev)
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
static void rtl8225_rf_stop(struct net80211_device *dev)
uint32_t channel
RNDIS channel.
void * priv
Driver private data.
The iPXE 802.11 MAC layer.
static void rtl8225_rf_set_channel(struct net80211_device *dev, struct net80211_channel *channelp)
#define RTL8225_ANAPARAM2_ON
Structure encapsulating the complete state of an 802.11 device.
static void rtl8225_rf_conf_erp(struct net80211_device *dev)
static const u8 rtl8225_tx_gain_cck_ofdm[]
static void rtl8225x_rf_init(struct net80211_device *dev)
static const u8 rtl8225z2_tx_power_cck[]
int phy_flags
Physical layer options.
static const u8 rtl8225z2_tx_power_cck_A[]
struct rtl818x_rf_ops rtl8225_ops __rtl818x_rf_driver
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
static struct tlan_private * priv
#define RTL818X_EEPROM_CMD_NORMAL
#define RTL8225_ANAPARAM2_OFF
uint8_t data[48]
Additional event data.
static const u8 rtl8225_agc[]
static void rtl818x_iowrite16(struct rtl818x_priv *priv __unused, u16 *addr, u16 val)
static const u16 rtl8225z2_rxgain[]
#define RTL8225_ANAPARAM_ON
static void rtl8225_rf_set_tx_power(struct net80211_device *dev, int channel)
static u16 rtl818x_ioread16(struct rtl818x_priv *priv __unused, u16 *addr)
void rtl818x_set_anaparam(struct rtl818x_priv *priv, u32 anaparam)
u8 channel_nr
A channel number interpreted according to the band.
#define NET80211_PHY_USE_SHORT_SLOT
Whether to use 802.11g short slot operation.
static void rtl8225_rf_init(struct net80211_device *dev)
static const u16 rtl8225bcd_rxgain[]
static const u8 rtl8225z2_tx_power_cck_ch14[]
static const u8 rtl8225_gain[]