#include <unistd.h>#include <gpxe/pci.h>#include <gpxe/net80211.h>#include "rtl818x.h"Go to the source code of this file.
Defines | |
| #define | RTL8225_ANAPARAM_ON 0xa0000b59 |
| #define | RTL8225_ANAPARAM2_ON 0x860dec11 |
| #define | RTL8225_ANAPARAM_OFF 0xa00beb59 |
| #define | RTL8225_ANAPARAM2_OFF 0x840dec11 |
| #define | min(a, b) (((a)<(b))?(a):(b)) |
| #define | ARRAY_SIZE(a) (int)(sizeof(a)/sizeof((a)[0])) |
Functions | |
| FILE_LICENCE (GPL2_ONLY) | |
| static void | rtl8225_write_phy_ofdm (struct net80211_device *dev, u8 addr, u8 data) |
| static void | rtl8225_write_phy_cck (struct net80211_device *dev, u8 addr, u8 data) |
| static void | rtl8225_write (struct net80211_device *dev, u8 addr, u16 data) |
| static u16 | rtl8225_read (struct net80211_device *dev, u8 addr) |
| static void | rtl8225_rf_set_tx_power (struct net80211_device *dev, int channel) |
| static void | rtl8225_rf_init (struct net80211_device *dev) |
| static void | rtl8225z2_rf_set_tx_power (struct net80211_device *dev, int channel) |
| static void | rtl8225z2_rf_init (struct net80211_device *dev) |
| static void | rtl8225x_rf_init (struct net80211_device *dev) |
| static void | rtl8225_rf_stop (struct net80211_device *dev) |
| static void | rtl8225_rf_set_channel (struct net80211_device *dev, struct net80211_channel *channelp) |
| static void | rtl8225_rf_conf_erp (struct net80211_device *dev) |
Variables | |
| static const u16 | rtl8225bcd_rxgain [] |
| static const u8 | rtl8225_agc [] |
| static const u8 | rtl8225_gain [] |
| static const u8 | rtl8225_threshold [] |
| static const u8 | rtl8225_tx_gain_cck_ofdm [] |
| static const u8 | rtl8225_tx_power_cck [] |
| static const u8 | rtl8225_tx_power_cck_ch14 [] |
| static const u8 | rtl8225_tx_power_ofdm [] |
| static const u32 | rtl8225_chan [] |
| static const u8 | rtl8225z2_tx_power_cck_ch14 [] |
| static const u8 | rtl8225z2_tx_power_cck_B [] |
| static const u8 | rtl8225z2_tx_power_cck_A [] |
| static const u8 | rtl8225z2_tx_power_cck [] |
| static const u16 | rtl8225z2_rxgain [] |
| struct rtl818x_rf_ops rtl8225_ops | __rtl818x_rf_driver |
| #define RTL8225_ANAPARAM_ON 0xa0000b59 |
Definition at line 27 of file rtl8185_rtl8225.c.
Referenced by rtl8225_rf_init(), and rtl8225z2_rf_init().
| #define RTL8225_ANAPARAM2_ON 0x860dec11 |
| #define RTL8225_ANAPARAM_OFF 0xa00beb59 |
| #define RTL8225_ANAPARAM2_OFF 0x840dec11 |
| #define min | ( | a, | |||
| b | ) | (((a)<(b))?(a):(b)) |
Definition at line 32 of file rtl8185_rtl8225.c.
| #define ARRAY_SIZE | ( | a | ) | (int)(sizeof(a)/sizeof((a)[0])) |
Definition at line 33 of file rtl8185_rtl8225.c.
| FILE_LICENCE | ( | GPL2_ONLY | ) |
| static void rtl8225_write_phy_ofdm | ( | struct net80211_device * | dev, | |
| u8 | addr, | |||
| u8 | data | |||
| ) | [inline, static] |
Definition at line 35 of file rtl8185_rtl8225.c.
References rtl818x_write_phy().
Referenced by rtl8225_rf_init(), rtl8225_rf_set_tx_power(), rtl8225z2_rf_init(), and rtl8225z2_rf_set_tx_power().
00037 { 00038 rtl818x_write_phy(dev, addr, data); 00039 }
| static void rtl8225_write_phy_cck | ( | struct net80211_device * | dev, | |
| u8 | addr, | |||
| u8 | data | |||
| ) | [inline, static] |
Definition at line 41 of file rtl8185_rtl8225.c.
References rtl818x_write_phy().
Referenced by rtl8225_rf_init(), rtl8225_rf_set_tx_power(), rtl8225z2_rf_init(), and rtl8225z2_rf_set_tx_power().
00043 { 00044 rtl818x_write_phy(dev, addr, data | 0x10000); 00045 }
| static void rtl8225_write | ( | struct net80211_device * | dev, | |
| u8 | addr, | |||
| u16 | data | |||
| ) | [static] |
Definition at line 47 of file rtl8185_rtl8225.c.
References rtl818x_csr::EEPROM_CMD, rtl818x_priv::map, net80211_device::priv, priv, rtl818x_csr::RFPinsEnable, rtl818x_csr::RFPinsOutput, rtl818x_csr::RFPinsSelect, rtl818x_ioread16(), rtl818x_ioread8(), rtl818x_iowrite16(), u16, u32, and udelay().
Referenced by rtl8225_rf_init(), rtl8225_rf_set_channel(), rtl8225_rf_stop(), rtl8225x_rf_init(), and rtl8225z2_rf_init().
00048 { 00049 struct rtl818x_priv *priv = dev->priv; 00050 u16 reg80, reg84, reg82; 00051 u32 bangdata; 00052 int i; 00053 00054 bangdata = (data << 4) | (addr & 0xf); 00055 00056 reg80 = rtl818x_ioread16(priv, &priv->map->RFPinsOutput) & 0xfff3; 00057 reg82 = rtl818x_ioread16(priv, &priv->map->RFPinsEnable); 00058 00059 rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, reg82 | 0x7); 00060 00061 reg84 = rtl818x_ioread16(priv, &priv->map->RFPinsSelect); 00062 rtl818x_iowrite16(priv, &priv->map->RFPinsSelect, reg84 | 0x7 | 0x400); 00063 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00064 udelay(10); 00065 00066 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg80 | (1 << 2)); 00067 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00068 udelay(2); 00069 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg80); 00070 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00071 udelay(10); 00072 00073 for (i = 15; i >= 0; i--) { 00074 u16 reg = reg80 | !!(bangdata & (1 << i)); 00075 00076 if (i & 1) 00077 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg); 00078 00079 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg | (1 << 1)); 00080 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg | (1 << 1)); 00081 00082 if (!(i & 1)) 00083 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg); 00084 } 00085 00086 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg80 | (1 << 2)); 00087 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00088 udelay(10); 00089 00090 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg80 | (1 << 2)); 00091 rtl818x_iowrite16(priv, &priv->map->RFPinsSelect, reg84 | 0x400); 00092 rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF); 00093 }
| static u16 rtl8225_read | ( | struct net80211_device * | dev, | |
| u8 | addr | |||
| ) | [static] |
Definition at line 95 of file rtl8185_rtl8225.c.
References rtl818x_csr::EEPROM_CMD, rtl818x_priv::map, net80211_device::priv, priv, rtl818x_csr::RFPinsEnable, rtl818x_csr::RFPinsInput, rtl818x_csr::RFPinsOutput, rtl818x_csr::RFPinsSelect, rtl818x_ioread16(), rtl818x_ioread8(), rtl818x_iowrite16(), u16, and udelay().
Referenced by rtl8225x_rf_init(), and rtl8225z2_rf_init().
00096 { 00097 struct rtl818x_priv *priv = dev->priv; 00098 u16 reg80, reg82, reg84, out; 00099 int i; 00100 00101 reg80 = rtl818x_ioread16(priv, &priv->map->RFPinsOutput); 00102 reg82 = rtl818x_ioread16(priv, &priv->map->RFPinsEnable); 00103 reg84 = rtl818x_ioread16(priv, &priv->map->RFPinsSelect) | 0x400; 00104 00105 reg80 &= ~0xF; 00106 00107 rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, reg82 | 0x000F); 00108 rtl818x_iowrite16(priv, &priv->map->RFPinsSelect, reg84 | 0x000F); 00109 00110 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg80 | (1 << 2)); 00111 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00112 udelay(4); 00113 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg80); 00114 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00115 udelay(5); 00116 00117 for (i = 4; i >= 0; i--) { 00118 u16 reg = reg80 | ((addr >> i) & 1); 00119 00120 if (!(i & 1)) { 00121 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg); 00122 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00123 udelay(1); 00124 } 00125 00126 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 00127 reg | (1 << 1)); 00128 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00129 udelay(2); 00130 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 00131 reg | (1 << 1)); 00132 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00133 udelay(2); 00134 00135 if (i & 1) { 00136 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, reg); 00137 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00138 udelay(1); 00139 } 00140 } 00141 00142 rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x000E); 00143 rtl818x_iowrite16(priv, &priv->map->RFPinsSelect, 0x040E); 00144 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00145 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 00146 reg80 | (1 << 3) | (1 << 1)); 00147 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00148 udelay(2); 00149 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 00150 reg80 | (1 << 3)); 00151 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00152 udelay(2); 00153 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 00154 reg80 | (1 << 3)); 00155 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00156 udelay(2); 00157 00158 out = 0; 00159 for (i = 11; i >= 0; i--) { 00160 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 00161 reg80 | (1 << 3)); 00162 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00163 udelay(1); 00164 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 00165 reg80 | (1 << 3) | (1 << 1)); 00166 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00167 udelay(2); 00168 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 00169 reg80 | (1 << 3) | (1 << 1)); 00170 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00171 udelay(2); 00172 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 00173 reg80 | (1 << 3) | (1 << 1)); 00174 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00175 udelay(2); 00176 00177 if (rtl818x_ioread16(priv, &priv->map->RFPinsInput) & (1 << 1)) 00178 out |= 1 << i; 00179 00180 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 00181 reg80 | (1 << 3)); 00182 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00183 udelay(2); 00184 } 00185 00186 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 00187 reg80 | (1 << 3) | (1 << 2)); 00188 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00189 udelay(2); 00190 00191 rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, reg82); 00192 rtl818x_iowrite16(priv, &priv->map->RFPinsSelect, reg84); 00193 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 0x03A0); 00194 00195 return out; 00196 }
| static void rtl8225_rf_set_tx_power | ( | struct net80211_device * | dev, | |
| int | channel | |||
| ) | [static] |
Definition at line 277 of file rtl8185_rtl8225.c.
References rtl818x_csr::ANAPARAM2, rtl818x_csr::CONFIG3, rtl818x_csr::EEPROM_CMD, rtl818x_priv::map, mdelay(), min, net80211_device::priv, priv, RTL818X_CONFIG3_ANAPARAM_WRITE, RTL818X_EEPROM_CMD_CONFIG, RTL818X_EEPROM_CMD_NORMAL, rtl818x_ioread8(), rtl818x_iowrite32(), rtl818x_iowrite8(), RTL8225_ANAPARAM2_ON, rtl8225_tx_gain_cck_ofdm, rtl8225_tx_power_cck, rtl8225_tx_power_cck_ch14, rtl8225_tx_power_ofdm, rtl8225_write_phy_cck(), rtl8225_write_phy_ofdm(), rtl818x_csr::TX_GAIN_CCK, rtl818x_csr::TX_GAIN_OFDM, rtl818x_priv::txpower, u32, and u8.
Referenced by rtl8225_rf_init(), and rtl8225_rf_set_channel().
00278 { 00279 struct rtl818x_priv *priv = dev->priv; 00280 u8 cck_power, ofdm_power; 00281 const u8 *tmp; 00282 u32 reg; 00283 int i; 00284 00285 cck_power = priv->txpower[channel - 1] & 0xFF; 00286 ofdm_power = priv->txpower[channel - 1] >> 8; 00287 00288 cck_power = min(cck_power, (u8)35); 00289 ofdm_power = min(ofdm_power, (u8)35); 00290 00291 rtl818x_iowrite8(priv, &priv->map->TX_GAIN_CCK, 00292 rtl8225_tx_gain_cck_ofdm[cck_power / 6] >> 1); 00293 00294 if (channel == 14) 00295 tmp = &rtl8225_tx_power_cck_ch14[(cck_power % 6) * 8]; 00296 else 00297 tmp = &rtl8225_tx_power_cck[(cck_power % 6) * 8]; 00298 00299 for (i = 0; i < 8; i++) 00300 rtl8225_write_phy_cck(dev, 0x44 + i, *tmp++); 00301 00302 mdelay(1); /* FIXME: optional? */ 00303 00304 /* anaparam2 on */ 00305 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG); 00306 reg = rtl818x_ioread8(priv, &priv->map->CONFIG3); 00307 rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg | RTL818X_CONFIG3_ANAPARAM_WRITE); 00308 rtl818x_iowrite32(priv, &priv->map->ANAPARAM2, RTL8225_ANAPARAM2_ON); 00309 rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg & ~RTL818X_CONFIG3_ANAPARAM_WRITE); 00310 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); 00311 00312 rtl818x_iowrite8(priv, &priv->map->TX_GAIN_OFDM, 00313 rtl8225_tx_gain_cck_ofdm[ofdm_power/6] >> 1); 00314 00315 tmp = &rtl8225_tx_power_ofdm[ofdm_power % 6]; 00316 00317 rtl8225_write_phy_ofdm(dev, 5, *tmp); 00318 rtl8225_write_phy_ofdm(dev, 7, *tmp); 00319 00320 mdelay(1); 00321 }
| static void rtl8225_rf_init | ( | struct net80211_device * | dev | ) | [static] |
Definition at line 323 of file rtl8185_rtl8225.c.
References ARRAY_SIZE, rtl818x_csr::BRSR, rtl818x_csr::CONFIG3, rtl818x_csr::EEPROM_CMD, rtl818x_csr::GP_ENABLE, rtl818x_priv::map, mdelay(), net80211_device::priv, priv, rtl818x_csr::RF_PARA, rtl818x_csr::RF_TIMING, rtl818x_csr::RFPinsEnable, rtl818x_csr::RFPinsOutput, rtl818x_csr::RFPinsSelect, RTL818X_EEPROM_CMD_CONFIG, RTL818X_EEPROM_CMD_NORMAL, rtl818x_ioread16(), rtl818x_ioread8(), rtl818x_iowrite16(), rtl818x_iowrite32(), rtl818x_iowrite8(), rtl818x_set_anaparam(), rtl8225_agc, RTL8225_ANAPARAM_ON, rtl8225_chan, rtl8225_gain, rtl8225_rf_set_tx_power(), rtl8225_threshold, rtl8225_write(), rtl8225_write_phy_cck(), rtl8225_write_phy_ofdm(), rtl8225bcd_rxgain, rtl818x_csr::TESTR, rtl818x_csr::TX_ANTENNA, u32, and u8.
Referenced by rtl8225x_rf_init().
00324 { 00325 struct rtl818x_priv *priv = dev->priv; 00326 int i; 00327 00328 rtl818x_set_anaparam(priv, RTL8225_ANAPARAM_ON); 00329 00330 /* host_pci_init */ 00331 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 0x0480); 00332 rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF); 00333 rtl818x_iowrite16(priv, &priv->map->RFPinsSelect, 0x0488); 00334 rtl818x_iowrite8(priv, &priv->map->GP_ENABLE, 0); 00335 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00336 mdelay(200); /* FIXME: ehh?? */ 00337 rtl818x_iowrite8(priv, &priv->map->GP_ENABLE, 0xFF & ~(1 << 6)); 00338 00339 rtl818x_iowrite32(priv, &priv->map->RF_TIMING, 0x000a8008); 00340 00341 /* TODO: check if we need really to change BRSR to do RF config */ 00342 rtl818x_ioread16(priv, &priv->map->BRSR); 00343 rtl818x_iowrite16(priv, &priv->map->BRSR, 0xFFFF); 00344 rtl818x_iowrite32(priv, &priv->map->RF_PARA, 0x00100044); 00345 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG); 00346 rtl818x_iowrite8(priv, &priv->map->CONFIG3, 0x44); 00347 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); 00348 00349 rtl8225_write(dev, 0x0, 0x067); 00350 rtl8225_write(dev, 0x1, 0xFE0); 00351 rtl8225_write(dev, 0x2, 0x44D); 00352 rtl8225_write(dev, 0x3, 0x441); 00353 rtl8225_write(dev, 0x4, 0x8BE); 00354 rtl8225_write(dev, 0x5, 0xBF0); /* TODO: minipci */ 00355 rtl8225_write(dev, 0x6, 0xAE6); 00356 rtl8225_write(dev, 0x7, rtl8225_chan[0]); 00357 rtl8225_write(dev, 0x8, 0x01F); 00358 rtl8225_write(dev, 0x9, 0x334); 00359 rtl8225_write(dev, 0xA, 0xFD4); 00360 rtl8225_write(dev, 0xB, 0x391); 00361 rtl8225_write(dev, 0xC, 0x050); 00362 rtl8225_write(dev, 0xD, 0x6DB); 00363 rtl8225_write(dev, 0xE, 0x029); 00364 rtl8225_write(dev, 0xF, 0x914); mdelay(1); 00365 00366 rtl8225_write(dev, 0x2, 0xC4D); mdelay(100); 00367 00368 rtl8225_write(dev, 0x0, 0x127); 00369 00370 for (i = 0; i < ARRAY_SIZE(rtl8225bcd_rxgain); i++) { 00371 rtl8225_write(dev, 0x1, i + 1); 00372 rtl8225_write(dev, 0x2, rtl8225bcd_rxgain[i]); 00373 } 00374 00375 rtl8225_write(dev, 0x0, 0x027); 00376 rtl8225_write(dev, 0x0, 0x22F); 00377 rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF); 00378 00379 for (i = 0; i < ARRAY_SIZE(rtl8225_agc); i++) { 00380 rtl8225_write_phy_ofdm(dev, 0xB, rtl8225_agc[i]); 00381 mdelay(1); 00382 rtl8225_write_phy_ofdm(dev, 0xA, 0x80 + i); 00383 mdelay(1); 00384 } 00385 00386 mdelay(1); 00387 00388 rtl8225_write_phy_ofdm(dev, 0x00, 0x01); mdelay(1); 00389 rtl8225_write_phy_ofdm(dev, 0x01, 0x02); mdelay(1); 00390 rtl8225_write_phy_ofdm(dev, 0x02, 0x62); mdelay(1); 00391 rtl8225_write_phy_ofdm(dev, 0x03, 0x00); mdelay(1); 00392 rtl8225_write_phy_ofdm(dev, 0x04, 0x00); mdelay(1); 00393 rtl8225_write_phy_ofdm(dev, 0x05, 0x00); mdelay(1); 00394 rtl8225_write_phy_ofdm(dev, 0x06, 0x00); mdelay(1); 00395 rtl8225_write_phy_ofdm(dev, 0x07, 0x00); mdelay(1); 00396 rtl8225_write_phy_ofdm(dev, 0x08, 0x00); mdelay(1); 00397 rtl8225_write_phy_ofdm(dev, 0x09, 0xfe); mdelay(1); 00398 rtl8225_write_phy_ofdm(dev, 0x0a, 0x09); mdelay(1); 00399 rtl8225_write_phy_ofdm(dev, 0x0b, 0x80); mdelay(1); 00400 rtl8225_write_phy_ofdm(dev, 0x0c, 0x01); mdelay(1); 00401 rtl8225_write_phy_ofdm(dev, 0x0e, 0xd3); mdelay(1); 00402 rtl8225_write_phy_ofdm(dev, 0x0f, 0x38); mdelay(1); 00403 rtl8225_write_phy_ofdm(dev, 0x10, 0x84); mdelay(1); 00404 rtl8225_write_phy_ofdm(dev, 0x11, 0x03); mdelay(1); 00405 rtl8225_write_phy_ofdm(dev, 0x12, 0x20); mdelay(1); 00406 rtl8225_write_phy_ofdm(dev, 0x13, 0x20); mdelay(1); 00407 rtl8225_write_phy_ofdm(dev, 0x14, 0x00); mdelay(1); 00408 rtl8225_write_phy_ofdm(dev, 0x15, 0x40); mdelay(1); 00409 rtl8225_write_phy_ofdm(dev, 0x16, 0x00); mdelay(1); 00410 rtl8225_write_phy_ofdm(dev, 0x17, 0x40); mdelay(1); 00411 rtl8225_write_phy_ofdm(dev, 0x18, 0xef); mdelay(1); 00412 rtl8225_write_phy_ofdm(dev, 0x19, 0x19); mdelay(1); 00413 rtl8225_write_phy_ofdm(dev, 0x1a, 0x20); mdelay(1); 00414 rtl8225_write_phy_ofdm(dev, 0x1b, 0x76); mdelay(1); 00415 rtl8225_write_phy_ofdm(dev, 0x1c, 0x04); mdelay(1); 00416 rtl8225_write_phy_ofdm(dev, 0x1e, 0x95); mdelay(1); 00417 rtl8225_write_phy_ofdm(dev, 0x1f, 0x75); mdelay(1); 00418 rtl8225_write_phy_ofdm(dev, 0x20, 0x1f); mdelay(1); 00419 rtl8225_write_phy_ofdm(dev, 0x21, 0x27); mdelay(1); 00420 rtl8225_write_phy_ofdm(dev, 0x22, 0x16); mdelay(1); 00421 rtl8225_write_phy_ofdm(dev, 0x24, 0x46); mdelay(1); 00422 rtl8225_write_phy_ofdm(dev, 0x25, 0x20); mdelay(1); 00423 rtl8225_write_phy_ofdm(dev, 0x26, 0x90); mdelay(1); 00424 rtl8225_write_phy_ofdm(dev, 0x27, 0x88); mdelay(1); 00425 00426 rtl8225_write_phy_cck(dev, 0x00, 0x98); mdelay(1); 00427 rtl8225_write_phy_cck(dev, 0x03, 0x20); mdelay(1); 00428 rtl8225_write_phy_cck(dev, 0x04, 0x7e); mdelay(1); 00429 rtl8225_write_phy_cck(dev, 0x05, 0x12); mdelay(1); 00430 rtl8225_write_phy_cck(dev, 0x06, 0xfc); mdelay(1); 00431 rtl8225_write_phy_cck(dev, 0x07, 0x78); mdelay(1); 00432 rtl8225_write_phy_cck(dev, 0x08, 0x2e); mdelay(1); 00433 rtl8225_write_phy_cck(dev, 0x10, 0x93); mdelay(1); 00434 rtl8225_write_phy_cck(dev, 0x11, 0x88); mdelay(1); 00435 rtl8225_write_phy_cck(dev, 0x12, 0x47); mdelay(1); 00436 rtl8225_write_phy_cck(dev, 0x13, 0xd0); 00437 rtl8225_write_phy_cck(dev, 0x19, 0x00); 00438 rtl8225_write_phy_cck(dev, 0x1a, 0xa0); 00439 rtl8225_write_phy_cck(dev, 0x1b, 0x08); 00440 rtl8225_write_phy_cck(dev, 0x40, 0x86); 00441 rtl8225_write_phy_cck(dev, 0x41, 0x8d); mdelay(1); 00442 rtl8225_write_phy_cck(dev, 0x42, 0x15); mdelay(1); 00443 rtl8225_write_phy_cck(dev, 0x43, 0x18); mdelay(1); 00444 rtl8225_write_phy_cck(dev, 0x44, 0x1f); mdelay(1); 00445 rtl8225_write_phy_cck(dev, 0x45, 0x1e); mdelay(1); 00446 rtl8225_write_phy_cck(dev, 0x46, 0x1a); mdelay(1); 00447 rtl8225_write_phy_cck(dev, 0x47, 0x15); mdelay(1); 00448 rtl8225_write_phy_cck(dev, 0x48, 0x10); mdelay(1); 00449 rtl8225_write_phy_cck(dev, 0x49, 0x0a); mdelay(1); 00450 rtl8225_write_phy_cck(dev, 0x4a, 0x05); mdelay(1); 00451 rtl8225_write_phy_cck(dev, 0x4b, 0x02); mdelay(1); 00452 rtl8225_write_phy_cck(dev, 0x4c, 0x05); mdelay(1); 00453 00454 rtl818x_iowrite8(priv, &priv->map->TESTR, 0x0D); mdelay(1); 00455 00456 rtl8225_rf_set_tx_power(dev, 1); 00457 00458 /* RX antenna default to A */ 00459 rtl8225_write_phy_cck(dev, 0x10, 0x9b); mdelay(1); /* B: 0xDB */ 00460 rtl8225_write_phy_ofdm(dev, 0x26, 0x90); mdelay(1); /* B: 0x10 */ 00461 00462 rtl818x_iowrite8(priv, &priv->map->TX_ANTENNA, 0x03); /* B: 0x00 */ 00463 mdelay(1); 00464 rtl818x_iowrite32(priv, (u32 *)((u8 *)priv->map + 0x94), 0x15c00002); 00465 rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF); 00466 00467 rtl8225_write(dev, 0x0c, 0x50); 00468 /* set OFDM initial gain */ 00469 rtl8225_write_phy_ofdm(dev, 0x0d, rtl8225_gain[4 * 4]); 00470 rtl8225_write_phy_ofdm(dev, 0x23, rtl8225_gain[4 * 4 + 1]); 00471 rtl8225_write_phy_ofdm(dev, 0x1b, rtl8225_gain[4 * 4 + 2]); 00472 rtl8225_write_phy_ofdm(dev, 0x1d, rtl8225_gain[4 * 4 + 3]); 00473 /* set CCK threshold */ 00474 rtl8225_write_phy_cck(dev, 0x41, rtl8225_threshold[0]); 00475 }
| static void rtl8225z2_rf_set_tx_power | ( | struct net80211_device * | dev, | |
| int | channel | |||
| ) | [static] |
Definition at line 493 of file rtl8185_rtl8225.c.
References rtl818x_priv::map, mdelay(), min, net80211_device::priv, priv, rtl818x_ioread8(), rtl818x_iowrite8(), rtl8225_write_phy_cck(), rtl8225_write_phy_ofdm(), rtl8225z2_tx_power_cck, rtl8225z2_tx_power_cck_A, rtl8225z2_tx_power_cck_B, rtl8225z2_tx_power_cck_ch14, rtl818x_csr::TX_GAIN_CCK, rtl818x_csr::TX_GAIN_OFDM, rtl818x_priv::txpower, and u8.
Referenced by rtl8225_rf_set_channel(), and rtl8225z2_rf_init().
00494 { 00495 struct rtl818x_priv *priv = dev->priv; 00496 u8 cck_power, ofdm_power; 00497 const u8 *tmp; 00498 int i; 00499 00500 cck_power = priv->txpower[channel - 1] & 0xFF; 00501 ofdm_power = priv->txpower[channel - 1] >> 8; 00502 00503 if (channel == 14) 00504 tmp = rtl8225z2_tx_power_cck_ch14; 00505 else if (cck_power == 12) 00506 tmp = rtl8225z2_tx_power_cck_B; 00507 else if (cck_power == 13) 00508 tmp = rtl8225z2_tx_power_cck_A; 00509 else 00510 tmp = rtl8225z2_tx_power_cck; 00511 00512 for (i = 0; i < 8; i++) 00513 rtl8225_write_phy_cck(dev, 0x44 + i, *tmp++); 00514 00515 cck_power = min(cck_power, (u8)35); 00516 if (cck_power == 13 || cck_power == 14) 00517 cck_power = 12; 00518 if (cck_power >= 15) 00519 cck_power -= 2; 00520 00521 rtl818x_iowrite8(priv, &priv->map->TX_GAIN_CCK, cck_power); 00522 rtl818x_ioread8(priv, &priv->map->TX_GAIN_CCK); 00523 mdelay(1); 00524 00525 ofdm_power = min(ofdm_power, (u8)35); 00526 rtl818x_iowrite8(priv, &priv->map->TX_GAIN_OFDM, ofdm_power); 00527 00528 rtl8225_write_phy_ofdm(dev, 2, 0x62); 00529 rtl8225_write_phy_ofdm(dev, 5, 0x00); 00530 rtl8225_write_phy_ofdm(dev, 6, 0x40); 00531 rtl8225_write_phy_ofdm(dev, 7, 0x00); 00532 rtl8225_write_phy_ofdm(dev, 8, 0x40); 00533 00534 mdelay(1); 00535 }
| static void rtl8225z2_rf_init | ( | struct net80211_device * | dev | ) | [static] |
Definition at line 552 of file rtl8185_rtl8225.c.
References ARRAY_SIZE, rtl818x_csr::BRSR, rtl818x_csr::CONFIG3, rtl818x_csr::EEPROM_CMD, rtl818x_csr::GP_ENABLE, rtl818x_priv::map, mdelay(), net80211_device::priv, priv, rtl818x_csr::RF_PARA, rtl818x_csr::RF_TIMING, rtl818x_csr::RFPinsEnable, rtl818x_csr::RFPinsOutput, rtl818x_csr::RFPinsSelect, RTL818X_EEPROM_CMD_CONFIG, RTL818X_EEPROM_CMD_NORMAL, rtl818x_ioread16(), rtl818x_ioread8(), rtl818x_iowrite16(), rtl818x_iowrite32(), rtl818x_iowrite8(), rtl818x_set_anaparam(), rtl8225_agc, RTL8225_ANAPARAM_ON, rtl8225_read(), rtl8225_write(), rtl8225_write_phy_cck(), rtl8225_write_phy_ofdm(), rtl8225z2_rf_set_tx_power(), rtl8225z2_rxgain, rtl818x_csr::TX_ANTENNA, u32, and u8.
Referenced by rtl8225x_rf_init().
00553 { 00554 struct rtl818x_priv *priv = dev->priv; 00555 int i; 00556 00557 rtl818x_set_anaparam(priv, RTL8225_ANAPARAM_ON); 00558 00559 /* host_pci_init */ 00560 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 0x0480); 00561 rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF); 00562 rtl818x_iowrite16(priv, &priv->map->RFPinsSelect, 0x0488); 00563 rtl818x_iowrite8(priv, &priv->map->GP_ENABLE, 0); 00564 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00565 mdelay(200); /* FIXME: ehh?? */ 00566 rtl818x_iowrite8(priv, &priv->map->GP_ENABLE, 0xFF & ~(1 << 6)); 00567 00568 rtl818x_iowrite32(priv, &priv->map->RF_TIMING, 0x00088008); 00569 00570 /* TODO: check if we need really to change BRSR to do RF config */ 00571 rtl818x_ioread16(priv, &priv->map->BRSR); 00572 rtl818x_iowrite16(priv, &priv->map->BRSR, 0xFFFF); 00573 rtl818x_iowrite32(priv, &priv->map->RF_PARA, 0x00100044); 00574 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG); 00575 rtl818x_iowrite8(priv, &priv->map->CONFIG3, 0x44); 00576 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); 00577 00578 rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF); 00579 00580 rtl8225_write(dev, 0x0, 0x0B7); mdelay(1); 00581 rtl8225_write(dev, 0x1, 0xEE0); mdelay(1); 00582 rtl8225_write(dev, 0x2, 0x44D); mdelay(1); 00583 rtl8225_write(dev, 0x3, 0x441); mdelay(1); 00584 rtl8225_write(dev, 0x4, 0x8C3); mdelay(1); 00585 rtl8225_write(dev, 0x5, 0xC72); mdelay(1); 00586 rtl8225_write(dev, 0x6, 0x0E6); mdelay(1); 00587 rtl8225_write(dev, 0x7, 0x82A); mdelay(1); 00588 rtl8225_write(dev, 0x8, 0x03F); mdelay(1); 00589 rtl8225_write(dev, 0x9, 0x335); mdelay(1); 00590 rtl8225_write(dev, 0xa, 0x9D4); mdelay(1); 00591 rtl8225_write(dev, 0xb, 0x7BB); mdelay(1); 00592 rtl8225_write(dev, 0xc, 0x850); mdelay(1); 00593 rtl8225_write(dev, 0xd, 0xCDF); mdelay(1); 00594 rtl8225_write(dev, 0xe, 0x02B); mdelay(1); 00595 rtl8225_write(dev, 0xf, 0x114); mdelay(100); 00596 00597 if (!(rtl8225_read(dev, 6) & (1 << 7))) { 00598 rtl8225_write(dev, 0x02, 0x0C4D); 00599 mdelay(200); 00600 rtl8225_write(dev, 0x02, 0x044D); 00601 mdelay(100); 00602 /* TODO: readd calibration failure message when the calibration 00603 check works */ 00604 } 00605 00606 rtl8225_write(dev, 0x0, 0x1B7); 00607 rtl8225_write(dev, 0x3, 0x002); 00608 rtl8225_write(dev, 0x5, 0x004); 00609 00610 for (i = 0; i < ARRAY_SIZE(rtl8225z2_rxgain); i++) { 00611 rtl8225_write(dev, 0x1, i + 1); 00612 rtl8225_write(dev, 0x2, rtl8225z2_rxgain[i]); 00613 } 00614 00615 rtl8225_write(dev, 0x0, 0x0B7); mdelay(100); 00616 rtl8225_write(dev, 0x2, 0xC4D); 00617 00618 mdelay(200); 00619 rtl8225_write(dev, 0x2, 0x44D); 00620 mdelay(100); 00621 00622 rtl8225_write(dev, 0x00, 0x2BF); 00623 rtl8225_write(dev, 0xFF, 0xFFFF); 00624 00625 rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF); 00626 00627 for (i = 0; i < ARRAY_SIZE(rtl8225_agc); i++) { 00628 rtl8225_write_phy_ofdm(dev, 0xB, rtl8225_agc[i]); 00629 mdelay(1); 00630 rtl8225_write_phy_ofdm(dev, 0xA, 0x80 + i); 00631 mdelay(1); 00632 } 00633 00634 mdelay(1); 00635 00636 rtl8225_write_phy_ofdm(dev, 0x00, 0x01); mdelay(1); 00637 rtl8225_write_phy_ofdm(dev, 0x01, 0x02); mdelay(1); 00638 rtl8225_write_phy_ofdm(dev, 0x02, 0x62); mdelay(1); 00639 rtl8225_write_phy_ofdm(dev, 0x03, 0x00); mdelay(1); 00640 rtl8225_write_phy_ofdm(dev, 0x04, 0x00); mdelay(1); 00641 rtl8225_write_phy_ofdm(dev, 0x05, 0x00); mdelay(1); 00642 rtl8225_write_phy_ofdm(dev, 0x06, 0x40); mdelay(1); 00643 rtl8225_write_phy_ofdm(dev, 0x07, 0x00); mdelay(1); 00644 rtl8225_write_phy_ofdm(dev, 0x08, 0x40); mdelay(1); 00645 rtl8225_write_phy_ofdm(dev, 0x09, 0xfe); mdelay(1); 00646 rtl8225_write_phy_ofdm(dev, 0x0a, 0x09); mdelay(1); 00647 rtl8225_write_phy_ofdm(dev, 0x18, 0xef); mdelay(1); 00648 rtl8225_write_phy_ofdm(dev, 0x0b, 0x80); mdelay(1); 00649 rtl8225_write_phy_ofdm(dev, 0x0c, 0x01); mdelay(1); 00650 rtl8225_write_phy_ofdm(dev, 0x0d, 0x43); 00651 rtl8225_write_phy_ofdm(dev, 0x0e, 0xd3); mdelay(1); 00652 rtl8225_write_phy_ofdm(dev, 0x0f, 0x38); mdelay(1); 00653 rtl8225_write_phy_ofdm(dev, 0x10, 0x84); mdelay(1); 00654 rtl8225_write_phy_ofdm(dev, 0x11, 0x06); mdelay(1); 00655 rtl8225_write_phy_ofdm(dev, 0x12, 0x20); mdelay(1); 00656 rtl8225_write_phy_ofdm(dev, 0x13, 0x20); mdelay(1); 00657 rtl8225_write_phy_ofdm(dev, 0x14, 0x00); mdelay(1); 00658 rtl8225_write_phy_ofdm(dev, 0x15, 0x40); mdelay(1); 00659 rtl8225_write_phy_ofdm(dev, 0x16, 0x00); mdelay(1); 00660 rtl8225_write_phy_ofdm(dev, 0x17, 0x40); mdelay(1); 00661 rtl8225_write_phy_ofdm(dev, 0x18, 0xef); mdelay(1); 00662 rtl8225_write_phy_ofdm(dev, 0x19, 0x19); mdelay(1); 00663 rtl8225_write_phy_ofdm(dev, 0x1a, 0x20); mdelay(1); 00664 rtl8225_write_phy_ofdm(dev, 0x1b, 0x11); mdelay(1); 00665 rtl8225_write_phy_ofdm(dev, 0x1c, 0x04); mdelay(1); 00666 rtl8225_write_phy_ofdm(dev, 0x1d, 0xc5); mdelay(1); 00667 rtl8225_write_phy_ofdm(dev, 0x1e, 0xb3); mdelay(1); 00668 rtl8225_write_phy_ofdm(dev, 0x1f, 0x75); mdelay(1); 00669 rtl8225_write_phy_ofdm(dev, 0x20, 0x1f); mdelay(1); 00670 rtl8225_write_phy_ofdm(dev, 0x21, 0x27); mdelay(1); 00671 rtl8225_write_phy_ofdm(dev, 0x22, 0x16); mdelay(1); 00672 rtl8225_write_phy_ofdm(dev, 0x23, 0x80); mdelay(1); /* FIXME: not needed? */ 00673 rtl8225_write_phy_ofdm(dev, 0x24, 0x46); mdelay(1); 00674 rtl8225_write_phy_ofdm(dev, 0x25, 0x20); mdelay(1); 00675 rtl8225_write_phy_ofdm(dev, 0x26, 0x90); mdelay(1); 00676 rtl8225_write_phy_ofdm(dev, 0x27, 0x88); mdelay(1); 00677 00678 rtl8225_write_phy_cck(dev, 0x00, 0x98); mdelay(1); 00679 rtl8225_write_phy_cck(dev, 0x03, 0x20); mdelay(1); 00680 rtl8225_write_phy_cck(dev, 0x04, 0x7e); mdelay(1); 00681 rtl8225_write_phy_cck(dev, 0x05, 0x12); mdelay(1); 00682 rtl8225_write_phy_cck(dev, 0x06, 0xfc); mdelay(1); 00683 rtl8225_write_phy_cck(dev, 0x07, 0x78); mdelay(1); 00684 rtl8225_write_phy_cck(dev, 0x08, 0x2e); mdelay(1); 00685 rtl8225_write_phy_cck(dev, 0x10, 0x93); mdelay(1); 00686 rtl8225_write_phy_cck(dev, 0x11, 0x88); mdelay(1); 00687 rtl8225_write_phy_cck(dev, 0x12, 0x47); mdelay(1); 00688 rtl8225_write_phy_cck(dev, 0x13, 0xd0); 00689 rtl8225_write_phy_cck(dev, 0x19, 0x00); 00690 rtl8225_write_phy_cck(dev, 0x1a, 0xa0); 00691 rtl8225_write_phy_cck(dev, 0x1b, 0x08); 00692 rtl8225_write_phy_cck(dev, 0x40, 0x86); 00693 rtl8225_write_phy_cck(dev, 0x41, 0x8a); mdelay(1); 00694 rtl8225_write_phy_cck(dev, 0x42, 0x15); mdelay(1); 00695 rtl8225_write_phy_cck(dev, 0x43, 0x18); mdelay(1); 00696 rtl8225_write_phy_cck(dev, 0x44, 0x36); mdelay(1); 00697 rtl8225_write_phy_cck(dev, 0x45, 0x35); mdelay(1); 00698 rtl8225_write_phy_cck(dev, 0x46, 0x2e); mdelay(1); 00699 rtl8225_write_phy_cck(dev, 0x47, 0x25); mdelay(1); 00700 rtl8225_write_phy_cck(dev, 0x48, 0x1c); mdelay(1); 00701 rtl8225_write_phy_cck(dev, 0x49, 0x12); mdelay(1); 00702 rtl8225_write_phy_cck(dev, 0x4a, 0x09); mdelay(1); 00703 rtl8225_write_phy_cck(dev, 0x4b, 0x04); mdelay(1); 00704 rtl8225_write_phy_cck(dev, 0x4c, 0x05); mdelay(1); 00705 00706 rtl818x_iowrite8(priv, (u8 *)priv->map + 0x5B, 0x0D); mdelay(1); 00707 00708 rtl8225z2_rf_set_tx_power(dev, 1); 00709 00710 /* RX antenna default to A */ 00711 rtl8225_write_phy_cck(dev, 0x10, 0x9b); mdelay(1); /* B: 0xDB */ 00712 rtl8225_write_phy_ofdm(dev, 0x26, 0x90); mdelay(1); /* B: 0x10 */ 00713 00714 rtl818x_iowrite8(priv, &priv->map->TX_ANTENNA, 0x03); /* B: 0x00 */ 00715 mdelay(1); 00716 rtl818x_iowrite32(priv, (u32 *)((u8 *)priv->map + 0x94), 0x15c00002); 00717 rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF); 00718 }
| static void rtl8225x_rf_init | ( | struct net80211_device * | dev | ) | [static] |
Definition at line 720 of file rtl8185_rtl8225.c.
References rtl818x_csr::EEPROM_CMD, rtl818x_priv::map, mdelay(), net80211_device::priv, priv, rtl818x_priv::rf_flag, rtl818x_csr::RFPinsEnable, rtl818x_csr::RFPinsOutput, rtl818x_csr::RFPinsSelect, rtl818x_ioread8(), rtl818x_iowrite16(), rtl8225_read(), rtl8225_rf_init(), rtl8225_write(), rtl8225z2_rf_init(), and u16.
00721 { 00722 struct rtl818x_priv *priv = dev->priv; 00723 u16 reg8, reg9; 00724 00725 rtl818x_iowrite16(priv, &priv->map->RFPinsOutput, 0x0480); 00726 rtl818x_iowrite16(priv, &priv->map->RFPinsSelect, 0x0488); 00727 rtl818x_iowrite16(priv, &priv->map->RFPinsEnable, 0x1FFF); 00728 rtl818x_ioread8(priv, &priv->map->EEPROM_CMD); 00729 mdelay(100); 00730 00731 rtl8225_write(dev, 0, 0x1B7); 00732 00733 reg8 = rtl8225_read(dev, 8); 00734 reg9 = rtl8225_read(dev, 9); 00735 00736 rtl8225_write(dev, 0, 0x0B7); 00737 00738 if (reg8 != 0x588 || reg9 != 0x700) { 00739 priv->rf_flag = 0; 00740 rtl8225_rf_init(dev); 00741 } else { 00742 priv->rf_flag = 1; 00743 rtl8225z2_rf_init(dev); 00744 } 00745 }
| static void rtl8225_rf_stop | ( | struct net80211_device * | dev | ) | [static] |
Definition at line 747 of file rtl8185_rtl8225.c.
References rtl818x_csr::ANAPARAM, rtl818x_csr::ANAPARAM2, rtl818x_csr::CONFIG3, rtl818x_csr::EEPROM_CMD, rtl818x_priv::map, mdelay(), net80211_device::priv, priv, RTL818X_CONFIG3_ANAPARAM_WRITE, RTL818X_EEPROM_CMD_CONFIG, RTL818X_EEPROM_CMD_NORMAL, rtl818x_ioread8(), rtl818x_iowrite32(), rtl818x_iowrite8(), RTL8225_ANAPARAM2_OFF, RTL8225_ANAPARAM_OFF, rtl8225_write(), and u8.
00748 { 00749 struct rtl818x_priv *priv = dev->priv; 00750 u8 reg; 00751 00752 rtl8225_write(dev, 0x4, 0x1f); mdelay(1); 00753 00754 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_CONFIG); 00755 reg = rtl818x_ioread8(priv, &priv->map->CONFIG3); 00756 rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg | RTL818X_CONFIG3_ANAPARAM_WRITE); 00757 rtl818x_iowrite32(priv, &priv->map->ANAPARAM2, RTL8225_ANAPARAM2_OFF); 00758 rtl818x_iowrite32(priv, &priv->map->ANAPARAM, RTL8225_ANAPARAM_OFF); 00759 rtl818x_iowrite8(priv, &priv->map->CONFIG3, reg & ~RTL818X_CONFIG3_ANAPARAM_WRITE); 00760 rtl818x_iowrite8(priv, &priv->map->EEPROM_CMD, RTL818X_EEPROM_CMD_NORMAL); 00761 }
| static void rtl8225_rf_set_channel | ( | struct net80211_device * | dev, | |
| struct net80211_channel * | channelp | |||
| ) | [static] |
Definition at line 763 of file rtl8185_rtl8225.c.
References net80211_channel::channel_nr, mdelay(), net80211_device::priv, priv, rtl818x_priv::rf_flag, rtl8225_chan, rtl8225_rf_set_tx_power(), rtl8225_write(), and rtl8225z2_rf_set_tx_power().
00765 { 00766 struct rtl818x_priv *priv = dev->priv; 00767 int chan = channelp->channel_nr; 00768 00769 if (priv->rf_flag) 00770 rtl8225z2_rf_set_tx_power(dev, chan); 00771 else 00772 rtl8225_rf_set_tx_power(dev, chan); 00773 00774 rtl8225_write(dev, 0x7, rtl8225_chan[chan - 1]); 00775 mdelay(10); 00776 }
| static void rtl8225_rf_conf_erp | ( | struct net80211_device * | dev | ) | [static] |
Definition at line 778 of file rtl8185_rtl8225.c.
References rtl818x_csr::CW_VAL, rtl818x_csr::DIFS, rtl818x_csr::EIFS, rtl818x_priv::map, NET80211_PHY_USE_SHORT_SLOT, net80211_device::phy_flags, net80211_device::priv, priv, rtl818x_iowrite8(), rtl818x_csr::SIFS, and rtl818x_csr::SLOT.
00779 { 00780 struct rtl818x_priv *priv = dev->priv; 00781 00782 if (dev->phy_flags & NET80211_PHY_USE_SHORT_SLOT) { 00783 rtl818x_iowrite8(priv, &priv->map->SLOT, 0x9); 00784 rtl818x_iowrite8(priv, &priv->map->SIFS, 0x22); 00785 rtl818x_iowrite8(priv, &priv->map->DIFS, 0x14); 00786 rtl818x_iowrite8(priv, &priv->map->EIFS, 81); 00787 rtl818x_iowrite8(priv, &priv->map->CW_VAL, 0x73); 00788 } else { 00789 rtl818x_iowrite8(priv, &priv->map->SLOT, 0x14); 00790 rtl818x_iowrite8(priv, &priv->map->SIFS, 0x44); 00791 rtl818x_iowrite8(priv, &priv->map->DIFS, 0x24); 00792 rtl818x_iowrite8(priv, &priv->map->EIFS, 81); 00793 rtl818x_iowrite8(priv, &priv->map->CW_VAL, 0xa5); 00794 } 00795 }
const u16 rtl8225bcd_rxgain[] [static] |
Initial value:
{
0x0400, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0408, 0x0409,
0x040a, 0x040b, 0x0502, 0x0503, 0x0504, 0x0505, 0x0540, 0x0541,
0x0542, 0x0543, 0x0544, 0x0545, 0x0580, 0x0581, 0x0582, 0x0583,
0x0584, 0x0585, 0x0588, 0x0589, 0x058a, 0x058b, 0x0643, 0x0644,
0x0645, 0x0680, 0x0681, 0x0682, 0x0683, 0x0684, 0x0685, 0x0688,
0x0689, 0x068a, 0x068b, 0x068c, 0x0742, 0x0743, 0x0744, 0x0745,
0x0780, 0x0781, 0x0782, 0x0783, 0x0784, 0x0785, 0x0788, 0x0789,
0x078a, 0x078b, 0x078c, 0x078d, 0x0790, 0x0791, 0x0792, 0x0793,
0x0794, 0x0795, 0x0798, 0x0799, 0x079a, 0x079b, 0x079c, 0x079d,
0x07a0, 0x07a1, 0x07a2, 0x07a3, 0x07a4, 0x07a5, 0x07a8, 0x07a9,
0x07aa, 0x07ab, 0x07ac, 0x07ad, 0x07b0, 0x07b1, 0x07b2, 0x07b3,
0x07b4, 0x07b5, 0x07b8, 0x07b9, 0x07ba, 0x07bb, 0x07bb
}
Definition at line 198 of file rtl8185_rtl8225.c.
Referenced by rtl8225_rf_init().
const u8 rtl8225_agc[] [static] |
Initial value:
{
0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e, 0x9e,
0x9d, 0x9c, 0x9b, 0x9a, 0x99, 0x98, 0x97, 0x96,
0x95, 0x94, 0x93, 0x92, 0x91, 0x90, 0x8f, 0x8e,
0x8d, 0x8c, 0x8b, 0x8a, 0x89, 0x88, 0x87, 0x86,
0x85, 0x84, 0x83, 0x82, 0x81, 0x80, 0x3f, 0x3e,
0x3d, 0x3c, 0x3b, 0x3a, 0x39, 0x38, 0x37, 0x36,
0x35, 0x34, 0x33, 0x32, 0x31, 0x30, 0x2f, 0x2e,
0x2d, 0x2c, 0x2b, 0x2a, 0x29, 0x28, 0x27, 0x26,
0x25, 0x24, 0x23, 0x22, 0x21, 0x20, 0x1f, 0x1e,
0x1d, 0x1c, 0x1b, 0x1a, 0x19, 0x18, 0x17, 0x16,
0x15, 0x14, 0x13, 0x12, 0x11, 0x10, 0x0f, 0x0e,
0x0d, 0x0c, 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06,
0x05, 0x04, 0x03, 0x02, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
}
Definition at line 213 of file rtl8185_rtl8225.c.
Referenced by rtl8225_rf_init(), and rtl8225z2_rf_init().
const u8 rtl8225_gain[] [static] |
Initial value:
{
0x23, 0x88, 0x7c, 0xa5,
0x23, 0x88, 0x7c, 0xb5,
0x23, 0x88, 0x7c, 0xc5,
0x33, 0x80, 0x79, 0xc5,
0x43, 0x78, 0x76, 0xc5,
0x53, 0x60, 0x73, 0xc5,
0x63, 0x58, 0x70, 0xc5,
}
Definition at line 232 of file rtl8185_rtl8225.c.
Referenced by rtl8225_rf_init().
const u8 rtl8225_threshold[] [static] |
Initial value:
{
0x8d, 0x8d, 0x8d, 0x8d, 0x9d, 0xad, 0xbd
}
Definition at line 242 of file rtl8185_rtl8225.c.
Referenced by rtl8225_rf_init().
const u8 rtl8225_tx_gain_cck_ofdm[] [static] |
Initial value:
{
0x02, 0x06, 0x0e, 0x1e, 0x3e, 0x7e
}
Definition at line 246 of file rtl8185_rtl8225.c.
Referenced by rtl8225_rf_set_tx_power().
const u8 rtl8225_tx_power_cck[] [static] |
Initial value:
{
0x18, 0x17, 0x15, 0x11, 0x0c, 0x08, 0x04, 0x02,
0x1b, 0x1a, 0x17, 0x13, 0x0e, 0x09, 0x04, 0x02,
0x1f, 0x1e, 0x1a, 0x15, 0x10, 0x0a, 0x05, 0x02,
0x22, 0x21, 0x1d, 0x18, 0x11, 0x0b, 0x06, 0x02,
0x26, 0x25, 0x21, 0x1b, 0x14, 0x0d, 0x06, 0x03,
0x2b, 0x2a, 0x25, 0x1e, 0x16, 0x0e, 0x07, 0x03
}
Definition at line 250 of file rtl8185_rtl8225.c.
Referenced by rtl8225_rf_set_tx_power().
const u8 rtl8225_tx_power_cck_ch14[] [static] |
Initial value:
{
0x18, 0x17, 0x15, 0x0c, 0x00, 0x00, 0x00, 0x00,
0x1b, 0x1a, 0x17, 0x0e, 0x00, 0x00, 0x00, 0x00,
0x1f, 0x1e, 0x1a, 0x0f, 0x00, 0x00, 0x00, 0x00,
0x22, 0x21, 0x1d, 0x11, 0x00, 0x00, 0x00, 0x00,
0x26, 0x25, 0x21, 0x13, 0x00, 0x00, 0x00, 0x00,
0x2b, 0x2a, 0x25, 0x15, 0x00, 0x00, 0x00, 0x00
}
Definition at line 259 of file rtl8185_rtl8225.c.
Referenced by rtl8225_rf_set_tx_power().
const u8 rtl8225_tx_power_ofdm[] [static] |
Initial value:
{
0x80, 0x90, 0xa2, 0xb5, 0xcb, 0xe4
}
Definition at line 268 of file rtl8185_rtl8225.c.
Referenced by rtl8225_rf_set_tx_power().
const u32 rtl8225_chan[] [static] |
Initial value:
{
0x085c, 0x08dc, 0x095c, 0x09dc, 0x0a5c, 0x0adc, 0x0b5c,
0x0bdc, 0x0c5c, 0x0cdc, 0x0d5c, 0x0ddc, 0x0e5c, 0x0f72
}
Definition at line 272 of file rtl8185_rtl8225.c.
Referenced by rtl8225_rf_init(), and rtl8225_rf_set_channel().
const u8 rtl8225z2_tx_power_cck_ch14[] [static] |
Initial value:
{
0x36, 0x35, 0x2e, 0x1b, 0x00, 0x00, 0x00, 0x00
}
Definition at line 477 of file rtl8185_rtl8225.c.
Referenced by rtl8225z2_rf_set_tx_power().
const u8 rtl8225z2_tx_power_cck_B[] [static] |
Initial value:
{
0x30, 0x2f, 0x29, 0x21, 0x19, 0x10, 0x08, 0x04
}
Definition at line 481 of file rtl8185_rtl8225.c.
Referenced by rtl8225z2_rf_set_tx_power().
const u8 rtl8225z2_tx_power_cck_A[] [static] |
Initial value:
{
0x33, 0x32, 0x2b, 0x23, 0x1a, 0x11, 0x08, 0x04
}
Definition at line 485 of file rtl8185_rtl8225.c.
Referenced by rtl8225z2_rf_set_tx_power().
const u8 rtl8225z2_tx_power_cck[] [static] |
Initial value:
{
0x36, 0x35, 0x2e, 0x25, 0x1c, 0x12, 0x09, 0x04
}
Definition at line 489 of file rtl8185_rtl8225.c.
Referenced by rtl8225z2_rf_set_tx_power().
const u16 rtl8225z2_rxgain[] [static] |
Initial value:
{
0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0008, 0x0009,
0x000a, 0x000b, 0x0102, 0x0103, 0x0104, 0x0105, 0x0140, 0x0141,
0x0142, 0x0143, 0x0144, 0x0145, 0x0180, 0x0181, 0x0182, 0x0183,
0x0184, 0x0185, 0x0188, 0x0189, 0x018a, 0x018b, 0x0243, 0x0244,
0x0245, 0x0280, 0x0281, 0x0282, 0x0283, 0x0284, 0x0285, 0x0288,
0x0289, 0x028a, 0x028b, 0x028c, 0x0342, 0x0343, 0x0344, 0x0345,
0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x0388, 0x0389,
0x038a, 0x038b, 0x038c, 0x038d, 0x0390, 0x0391, 0x0392, 0x0393,
0x0394, 0x0395, 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d,
0x03a0, 0x03a1, 0x03a2, 0x03a3, 0x03a4, 0x03a5, 0x03a8, 0x03a9,
0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03b0, 0x03b1, 0x03b2, 0x03b3,
0x03b4, 0x03b5, 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bb
}
Definition at line 537 of file rtl8185_rtl8225.c.
Referenced by rtl8225z2_rf_init().
| struct rtl818x_rf_ops rtl8225_ops __rtl818x_rf_driver |
Initial value:
{
.name = "rtl8225",
.id = 9,
.init = rtl8225x_rf_init,
.stop = rtl8225_rf_stop,
.set_chan = rtl8225_rf_set_channel,
.conf_erp = rtl8225_rf_conf_erp,
}
Definition at line 797 of file rtl8185_rtl8225.c.
1.5.7.1