39 static inline int min(
int x,
int y)
41 return (
x <
y) ?
x :
y;
44 static inline int max(
int x,
int y)
46 return (
x >
y) ?
x :
y;
59 u32 mask,
data, last_bit, bits_shifted, first_bit;
65 rfb =
ah->ah_rf_banks;
67 for (i = 0; i <
ah->ah_rf_regs_count; i++) {
68 if (rf_regs[i].
index == reg_id) {
75 DBG(
"ath5k: RF register not found!\n");
92 if (!(col <= 3 && num_bits <= 32 && first_bit + num_bits <= 319)) {
93 DBG(
"ath5k: RF invalid values at offset %d\n",
offset);
97 entry = ((first_bit - 1) / 8) +
offset;
98 position = (first_bit - 1) % 8;
103 for (bits_shifted = 0, bits_left = num_bits; bits_left > 0;
104 position = 0, entry++) {
106 last_bit = (position + bits_left > 8) ? 8 :
107 position + bits_left;
109 mask = (((1 << last_bit) - 1) ^ ((1 << position) - 1)) <<
114 rfb[entry] |= ((
data << position) << (col * 8)) & mask;
115 data >>= (8 - position);
117 data |= (((rfb[entry] & mask) >> (col * 8)) >> position)
119 bits_shifted += last_bit - position;
122 bits_left -= 8 - position;
162 switch (
ah->ah_radio) {
165 ah->ah_gain.g_low = 20;
166 ah->ah_gain.g_high = 35;
171 ah->ah_gain.g_low = 20;
172 ah->ah_gain.g_high = 85;
231 g_step = &go->
go_step[
ah->ah_gain.g_step_idx];
233 if (
ah->ah_rf_banks ==
NULL)
236 ah->ah_gain.g_f_corr = 0;
250 ah->ah_gain.g_f_corr =
step * 2;
253 ah->ah_gain.g_f_corr = (
step - 5) * 2;
256 ah->ah_gain.g_f_corr =
step;
259 ah->ah_gain.g_f_corr = 0;
263 return ah->ah_gain.g_f_corr;
275 if (
ah->ah_rf_banks ==
NULL)
287 level[1] = (
step == 63) ? 50 :
step + 4;
288 level[2] = (
step != 63) ? 64 : level[0];
289 level[3] = level[2] + 50 ;
291 ah->ah_gain.g_high = level[3] -
293 ah->ah_gain.g_low = level[0] +
303 level[0] = level[2] = 0;
306 level[1] = level[3] = 83;
308 level[1] = level[3] = 107;
309 ah->ah_gain.g_high = 55;
313 return (
ah->ah_gain.g_current >= level[0] &&
314 ah->ah_gain.g_current <= level[1]) ||
315 (
ah->ah_gain.g_current >= level[2] &&
316 ah->ah_gain.g_current <= level[3]);
327 switch (
ah->ah_radio) {
338 g_step = &go->
go_step[
ah->ah_gain.g_step_idx];
340 if (
ah->ah_gain.g_current >=
ah->ah_gain.g_high) {
343 if (
ah->ah_gain.g_step_idx == 0)
346 for (
ah->ah_gain.g_target =
ah->ah_gain.g_current;
347 ah->ah_gain.g_target >=
ah->ah_gain.g_high &&
348 ah->ah_gain.g_step_idx > 0;
349 g_step = &go->
go_step[
ah->ah_gain.g_step_idx])
350 ah->ah_gain.g_target -= 2 *
358 if (
ah->ah_gain.g_current <=
ah->ah_gain.g_low) {
364 for (
ah->ah_gain.g_target =
ah->ah_gain.g_current;
365 ah->ah_gain.g_target <=
ah->ah_gain.g_low &&
367 g_step = &go->
go_step[
ah->ah_gain.g_step_idx])
368 ah->ah_gain.g_target -= 2 *
377 DBG2(
"ath5k RF adjust: ret %d, gain step %d, current gain %d, " 378 "target gain %d\n", ret,
ah->ah_gain.g_step_idx,
379 ah->ah_gain.g_current,
ah->ah_gain.g_target);
395 if (
ah->ah_rf_banks ==
NULL ||
417 ah->ah_gain.g_current +=
420 ah->ah_gain.g_current +=
428 ah->ah_gain.g_current =
429 ah->ah_gain.g_current >=
ah->ah_gain.g_f_corr ?
430 (
ah->ah_gain.g_current-
ah->ah_gain.g_f_corr) :
447 return ah->ah_gain.g_state;
456 unsigned int i,
size;
458 switch (
ah->ah_radio) {
496 for (i = 0; i <
size; i++) {
525 int obdb = -1, bank = -1;
528 switch (
ah->ah_radio) {
592 if (
ah->ah_rf_banks ==
NULL) {
593 ah->ah_rf_banks =
malloc(
sizeof(
u32) *
ah->ah_rf_banks_size);
594 if (
ah->ah_rf_banks ==
NULL) {
600 rfb =
ah->ah_rf_banks;
602 for (i = 0; i <
ah->ah_rf_banks_size; i++) {
604 DBG(
"ath5k: invalid RF register bank\n");
609 if (bank != ini_rfb[i].rfb_bank) {
611 ah->ah_offset[bank] = i;
651 obdb =
channel->center_freq >= 5725 ? 3 :
652 (
channel->center_freq >= 5500 ? 2 :
653 (
channel->center_freq >= 5260 ? 1 :
654 (
channel->center_freq > 4000 ? 0 : -1)));
666 g_step = &go->
go_step[
ah->ah_gain.g_step_idx];
815 for (i = 0; i <
ah->ah_rf_banks_size; i++) {
835 if ((freq >=
ah->ah_capabilities.cap_range.range_2ghz_min) &&
836 (freq <= ah->ah_capabilities.cap_range.range_2ghz_max))
839 if ((freq >=
ah->ah_capabilities.cap_range.range_5ghz_min) &&
840 (freq <= ah->ah_capabilities.cap_range.range_5ghz_max))
920 unsigned int ath5k_channel = ath5k_freq_to_channel(
channel->center_freq);
932 &ath5k_channel_2ghz);
936 ath5k_channel = ath5k_channel_2ghz.
a2_athchan;
941 if (ath5k_channel < 145 || !(ath5k_channel & 1)) {
944 (clock << 1) | (1 << 10) | 1;
948 << 2) | (clock << 1) | (1 << 10) | 1;
972 if (!((c - 2224) % 5)) {
973 data0 = ((2 * (c - 704)) - 3040) / 10;
975 }
else if (!((c - 2192) % 5)) {
976 data0 = ((2 * (c - 672)) - 3040) / 10;
982 }
else if ((c - (c % 5)) != 2 || c > 5435) {
983 if (!(c % 20) && c >= 5120) {
986 }
else if (!(c % 10)) {
989 }
else if (!(c % 5)) {
1023 }
else if ((c - (c % 5)) != 2 || c > 5435) {
1024 if (!(c % 20) && c < 5120)
1058 DBG(
"ath5k: channel frequency (%d MHz) out of supported " 1059 "range\n",
channel->center_freq);
1066 switch (
ah->ah_radio) {
1082 DBG(
"ath5k: setting channel failed: %s\n",
strerror(ret));
1087 if (
channel->center_freq == 2484) {
1144 DBG(
"ath5k: noise floor calibration timeout (%d MHz)\n", freq);
1149 for (i = 20; i > 0; i--) {
1161 DBG2(
"ath5k: noise floor %d\n", noise_floor);
1164 DBG(
"ath5k: noise floor calibration failed (%d MHz)\n", freq);
1168 ah->ah_noise_floor = noise_floor;
1181 u32 phy_sig, phy_agc, phy_sat, beacon;
1258 DBG(
"ath5k: calibration timeout (%d MHz)\n",
1282 s32 iq_corr, i_coff, i_coffd, q_coff, q_coffd;
1285 if (!
ah->ah_calibration ||
1290 for (i = 0; i <= 10; i++) {
1296 i_coffd = ((i_pwr >> 1) + (q_pwr >> 1)) >> 7;
1297 q_coffd = q_pwr >> 7;
1300 if (i_coffd == 0 || q_coffd == 0)
1303 i_coff = ((-iq_corr) / i_coffd) & 0x3f;
1311 q_coff = (((
s32)i_pwr / q_coffd) - 128) & 0x1f;
1398 for (i = 0; i < 8; i++)
1407 ((srev & 0x0f) << 4), 8);
1451 if ((x_left == x_right) || (y_left == y_right))
1460 ratio = ((100 * y_right - 100 * y_left)/(x_right - x_left));
1463 result = y_left + (ratio * (target - x_left) / 100);
1478 const s16 *pwrL,
const s16 *pwrR)
1481 s16 min_pwrL, min_pwrR;
1484 if (pwrL[0] == pwrL[1])
1492 stepL[0], stepL[1]);
1498 if (pwrR[0] == pwrR[1])
1506 stepR[0], stepR[1]);
1513 return max(min_pwrL, min_pwrR);
1530 const s16 *pwr,
const u8 *vpd,
1534 u8 idx[2] = { 0, 1 };
1553 for (i = 0; (i <= (
u16) (pmax - pmin)) &&
1559 if ((pwr_i > pwr[idx[1]]) && (idx[1] < num_points - 1)) {
1565 pwr[idx[0]], pwr[idx[1]],
1566 vpd[idx[0]], vpd[idx[1]]);
1610 if (target < pcinfo[0].
freq) {
1618 if (target > pcinfo[
max].
freq) {
1619 idx_l = idx_r =
max;
1627 for (i = 0; i <=
max; i++) {
1632 if (pcinfo[i].
freq == target) {
1640 if (target < pcinfo[i].
freq) {
1648 *pcinfo_l = &pcinfo[idx_l];
1649 *pcinfo_r = &pcinfo[idx_r];
1688 if (target < rpinfo[0].
freq) {
1693 if (target > rpinfo[
max].
freq) {
1694 idx_l = idx_r =
max;
1698 for (i = 0; i <=
max; i++) {
1700 if (rpinfo[i].
freq == target) {
1705 if (target < rpinfo[i].
freq) {
1714 rates->freq = target;
1716 rates->target_power_6to24 =
1722 rates->target_power_36 =
1728 rates->target_power_48 =
1734 rates->target_power_54 =
1755 s16 max_chan_pwr =
ah->ah_txpower.txp_max_pwr / 4;
1789 for (i = 0; i < ee->
ee_ctls; i++) {
1790 if (ctl_val[i] == ctl_mode) {
1798 if (ctl_idx == 0xFF)
1814 if (target <= rep[rep_idx].
freq)
1815 edge_pwr = (
s16) rep[rep_idx].
edge;
1819 ah->ah_txpower.txp_max_pwr = 4*
min(edge_pwr, max_chan_pwr);
1839 u8 *pcdac_out =
ah->ah_txpower.txp_pd_table;
1840 u8 *pcdac_tmp =
ah->ah_txpower.tmpL[0];
1841 u8 pcdac_0, pcdac_n, pcdac_i, pwr_idx, i;
1842 s16 min_pwr, max_pwr;
1845 min_pwr = table_min[0];
1846 pcdac_0 = pcdac_tmp[0];
1848 max_pwr = table_max[0];
1849 pcdac_n = pcdac_tmp[table_max[0] - table_min[0]];
1853 for (i = 0; i < min_pwr; i++)
1854 pcdac_out[pcdac_i++] = pcdac_0;
1858 for (i = 0 ; pwr_idx <= max_pwr &&
1860 pcdac_out[pcdac_i++] = pcdac_tmp[i];
1866 pcdac_out[pcdac_i++] = pcdac_n;
1883 s16 *table_max,
u8 pdcurves)
1885 u8 *pcdac_out =
ah->ah_txpower.txp_pd_table;
1892 s16 mid_pwr_idx = 0;
1907 pcdac_low_pwr =
ah->ah_txpower.tmpL[1];
1908 pcdac_high_pwr =
ah->ah_txpower.tmpL[0];
1909 mid_pwr_idx = table_max[1] - table_min[1] - 1;
1910 max_pwr_idx = (table_max[0] - table_min[0]) / 2;
1915 if (table_max[0] - table_min[1] > 126)
1916 min_pwr_idx = table_max[0] - 126;
1918 min_pwr_idx = table_min[1];
1922 pcdac_tmp = pcdac_high_pwr;
1926 pcdac_low_pwr =
ah->ah_txpower.tmpL[1];
1927 pcdac_high_pwr =
ah->ah_txpower.tmpL[0];
1928 min_pwr_idx = table_min[0];
1929 max_pwr_idx = (table_max[0] - table_min[0]) / 2;
1930 pcdac_tmp = pcdac_high_pwr;
1935 ah->ah_txpower.txp_min_idx = min_pwr_idx/2;
1939 for (i = 63; i >= 0; i--) {
1943 if (edge_flag == 0x40 &&
1944 (2*pwr <= (table_max[1] - table_min[0]) || pwr == 0)) {
1946 pcdac_tmp = pcdac_low_pwr;
1947 pwr = mid_pwr_idx/2;
1954 if (pcdac_tmp[pwr] < 1 && (edge_flag == 0x00)) {
1956 pcdac_out[i] = pcdac_out[i + 1];
1962 pcdac_out[i] = pcdac_tmp[pwr] | edge_flag;
1967 if (pcdac_out[i] > 126)
1979 u8 *pcdac_out =
ah->ah_txpower.txp_pd_table;
1987 (((pcdac_out[2*i + 0] << 8 | 0xff) & 0xffff) << 0) |
1988 (((pcdac_out[2*i + 1] << 8 | 0xff) & 0xffff) << 16),
2007 s16 *pwr_min,
s16 *pwr_max,
u8 pdcurves)
2010 u8 *pdadc_out =
ah->ah_txpower.txp_pd_table;
2013 u8 pdadc_i, pdadc_n, pwr_step, pdg, max_idx, table_size;
2023 for (pdg = 0, pdadc_i = 0; pdg < pdcurves; pdg++) {
2024 pdadc_tmp =
ah->ah_txpower.tmpL[pdg];
2026 if (pdg == pdcurves - 1)
2029 gain_boundaries[pdg] = pwr_max[pdg] + 4;
2033 gain_boundaries[pdg] =
2034 (pwr_max[pdg] + pwr_min[pdg + 1]) / 2;
2047 pdadc_0 = (gain_boundaries[pdg - 1] - pwr_min[pdg]) -
2051 if ((pdadc_tmp[1] - pdadc_tmp[0]) > 1)
2052 pwr_step = pdadc_tmp[1] - pdadc_tmp[0];
2058 while ((pdadc_0 < 0) && (pdadc_i < 128)) {
2059 s16 tmp = pdadc_tmp[0] + pdadc_0 * pwr_step;
2060 pdadc_out[pdadc_i++] = (
tmp < 0) ? 0 : (
u8)
tmp;
2065 pdadc_n = gain_boundaries[pdg] + pd_gain_overlap - pwr_min[pdg];
2067 table_size = pwr_max[pdg] - pwr_min[pdg];
2068 max_idx = (pdadc_n < table_size) ? pdadc_n : table_size;
2071 while (pdadc_0 < max_idx)
2072 pdadc_out[pdadc_i++] = pdadc_tmp[pdadc_0++];
2075 if (pdadc_n <= max_idx)
2079 if ((pdadc_tmp[table_size - 1] - pdadc_tmp[table_size - 2]) > 1)
2080 pwr_step = pdadc_tmp[table_size - 1] -
2081 pdadc_tmp[table_size - 2];
2086 while ((pdadc_0 < (
s16) pdadc_n) &&
2088 s16 tmp = pdadc_tmp[table_size - 1] +
2089 (pdadc_0 - max_idx) * pwr_step;
2090 pdadc_out[pdadc_i++] = (
tmp > 127) ? 127 : (
u8)
tmp;
2096 gain_boundaries[pdg] = gain_boundaries[pdg - 1];
2101 pdadc_out[pdadc_i] = pdadc_out[pdadc_i - 1];
2120 ah->ah_txpower.txp_min_idx = pwr_min[0];
2127 u8 pdcurves,
u8 *pdg_to_idx)
2129 u8 *pdadc_out =
ah->ah_txpower.txp_pd_table;
2170 ((pdadc_out[4*i + 0] & 0xff) << 0) |
2171 ((pdadc_out[4*i + 1] & 0xff) << 8) |
2172 ((pdadc_out[4*i + 2] & 0xff) << 16) |
2173 ((pdadc_out[4*i + 3] & 0xff) << 24),
2214 for (pdg = 0; pdg < ee->
ee_pd_gains[ee_mode]; pdg++) {
2220 u8 idx = pdg_curve_to_idx[pdg];
2227 tmpL =
ah->ah_txpower.tmpL[pdg];
2228 tmpR =
ah->ah_txpower.tmpR[pdg];
2261 if (!(ee->
ee_pd_gains[ee_mode] > 1 && pdg == 0)) {
2273 if (table_max[pdg] - table_min[pdg] > 126)
2274 table_min[pdg] = table_max[pdg] - 126;
2290 if (pcinfo_L == pcinfo_R)
2308 for (i = 0; (i < (
u16) (table_max[pdg] - table_min[pdg])) &&
2352 ah->ah_txpower.txp_offset = 64 - (table_max[0] / 2);
2363 ah->ah_txpower.txp_min_idx = 0;
2364 ah->ah_txpower.txp_offset = 0;
2380 ah->ah_txpower.txp_offset = table_min[0];
2423 max_pwr =
min(max_pwr, (
u16)
ah->ah_txpower.txp_max_pwr) / 2;
2426 rates =
ah->ah_txpower.txp_rates_power_table;
2429 for (i = 0; i < 5; i++)
2462 for (i = 8; i <= 15; i++)
2463 rates[i] -=
ah->ah_txpower.txp_cck_ofdm_gainf_delta;
2465 ah->ah_txpower.txp_min_pwr =
rates[7];
2466 ah->ah_txpower.txp_max_pwr =
rates[0];
2467 ah->ah_txpower.txp_ofdm =
rates[7];
2476 u8 ee_mode,
u8 txpower)
2483 DBG(
"ath5k: invalid tx power %d\n", txpower);
2490 memset(&
ah->ah_txpower, 0,
sizeof(
ah->ah_txpower));
2492 ah->ah_txpower.txp_min_pwr = 0;
2496 switch (
ah->ah_radio) {
2556 if (
ah->ah_txpower.txp_tpc) {
2577 DBG2(
"ath5k: changing txpower to %d\n", txpower);
#define AR5K_PHY_SHIFT_5GHZ
#define AR5K_PHY_IQRES_CAL_CORR
static const struct ath5k_rf_reg rf_regs_2413[]
#define AR5K_PHY_AGCCTL_NF
#define AR5K_PHY_PAPD_PROBE_GAINF_S
#define EINVAL
Invalid argument.
u8 ee_pd_gains[AR5K_EEPROM_N_MODES]
static const struct ath5k_rf_reg rf_regs_5112a[]
#define AR5K_PHY_TPC_RG1_PDGAIN_2
#define AR5K_PHY_FRAME_CTL
int ath5k_hw_rfregs_init(struct ath5k_hw *ah, struct net80211_channel *channel, unsigned int mode)
#define AR5K_PHY_TPC_RG5_PD_GAIN_BOUNDARY_4
#define AR5K_PHY_SIG_FIRPWR
static void ath5k_create_power_curve(s16 pmin, s16 pmax, const s16 *pwr, const u8 *vpd, u8 num_points, u8 *vpd_table, u8 type)
#define AR5K_PHY_TXPOWER_RATE_MAX
struct ath5k_pdgain_info * pd_curves
static unsigned int unsigned int reg
static const struct ath5k_rf_reg rf_regs_5112[]
#define AR5K_PHY_PAPD_PROBE_TXPOWER
#define AR5K_PHY_AGCCOARSE
#define AR5K_EEPROM_MODE_11G
struct option_descriptor set[0]
#define AR5K_REG_WAIT(_i)
static void ath5k_fill_pwr_to_pcdac_table(struct ath5k_hw *ah, s16 *table_min, s16 *table_max)
u8 ee_ctl[AR5K_EEPROM_MAX_CTLS]
#define AR5K_EEPROM_MODE_11A
#define AR5K_PHY_AGC_DISABLE
u8 ee_pdc_to_idx[AR5K_EEPROM_N_MODES][AR5K_EEPROM_N_PD_GAINS]
#define AR5K_BEACON_ENABLE
#define AR5K_PHY_PAPD_PROBE
#define AR5K_PHY_IQ_CORR_ENABLE
#define AR5K_PHY_PAPD_PROBE_TYPE
uint16_t mode
Acceleration mode.
static void ath5k_setup_pwr_to_pdadc_table(struct ath5k_hw *ah, u8 pdcurves, u8 *pdg_to_idx)
#define AR5K_TXPOWER_CCK(_r, _v)
#define AR5K_INI_RFGAIN_5GHZ
uint32_t type
Operating system type.
static u32 ath5k_hw_bitswap(u32 val, unsigned int bits)
static const struct ath5k_rf_reg rf_regs_2425[]
uint16_t size
Buffer size.
#define AR5K_PHY_SHIFT_2GHZ
#define AR5K_GAIN_CCK_PROBE_CORR
static void ath5k_combine_linear_pcdac_curves(struct ath5k_hw *ah, s16 *table_min, s16 *table_max, u8 pdcurves)
#define AR5K_PHY_PAPD_PROBE_TYPE_CCK
static const struct ath5k_ini_rfbuffer rfb_5413[]
#define AR5K_MAX_RF_BANKS
static int min(int x, int y)
static const struct ath5k_ini_rfbuffer rfb_2417[]
#define AR5K_PHY_AGCCTL_CAL
u8 ee_rate_target_pwr_num[AR5K_EEPROM_N_MODES]
u16 ee_x_gain[AR5K_EEPROM_N_MODES]
#define AR5K_REG_MS(_val, _flags)
static u32 ath5k_hw_rf_gainf_corr(struct ath5k_hw *ah)
#define AR5K_PHY_TPC_RG1_PDGAIN_3
#define AR5K_PHY_NF_ACTIVE
static int max(int x, int y)
#define AR5K_GAIN_CHECK_ADJUST(_g)
#define AR5K_PHY_TXPOWER_RATE1
static const struct ath5k_gain_opt rfgain_opt_5111
ath5k_hw_get_isr - Get interrupt status
const struct ath5k_gain_opt_step go_step[AR5K_GAIN_STEP_COUNT]
static int ath5k_hw_rf2425_channel(struct ath5k_hw *ah, struct net80211_channel *channel)
static const struct ath5k_ini_rfgain rfgain_2425[]
#define AR5K_PHY_NF_RVAL(_n)
u16 ee_db[AR5K_EEPROM_N_MODES][AR5K_EEPROM_N_OBDB]
#define AR5K_EEPROM_N_PD_GAINS
#define AR5K_TUNE_DEFAULT_TXPOWER
#define AR5K_EEPROM_POWER_TABLE_SIZE
static int ath5k_hw_rf5110_calibrate(struct ath5k_hw *ah, struct net80211_channel *channel)
static const struct ath5k_ini_rfgain rfgain_2316[]
static int ath5k_hw_rf_check_gainf_readback(struct ath5k_hw *ah)
struct ath5k_chan_pcal_info ee_pwr_cal_b[AR5K_EEPROM_N_2GHZ_CHAN_MAX]
#define ENOMEM
Not enough space.
#define AR5K_PHY_AGCCOARSE_LO
static const struct ath5k_rf_reg rf_regs_5413[]
struct ath5k_rfb_field field
#define AR5K_GAIN_DYN_ADJUST_HI_MARGIN
#define AR5K_PHY_TPC_RG1_PDGAIN_1
#define AR5K_PHY_PCDAC_TXPOWER(_n)
static unsigned int ath5k_hw_rfb_op(struct ath5k_hw *ah, const struct ath5k_rf_reg *rf_regs, u32 val, u8 reg_id, int set)
int ath5k_hw_phy_calibrate(struct ath5k_hw *ah, struct net80211_channel *channel)
#define AR5K_PHY_NF_AVAL(_n)
#define AR5K_PHY_PAPD_PROBE_TX_NEXT
void ath5k_hw_set_def_antenna(struct ath5k_hw *ah, unsigned int ant)
static s16 ath5k_get_interpolated_value(s16 target, s16 x_left, s16 x_right, s16 y_left, s16 y_right)
struct ath5k_chan_pcal_info ee_pwr_cal_g[AR5K_EEPROM_N_2GHZ_CHAN_MAX]
#define AR5K_REG_WRITE_BITS(ah, _reg, _flags, _val)
static s8 ath5k_hw_rf_gainf_adjust(struct ath5k_hw *ah)
u16 ath5k_hw_radio_revision(struct ath5k_hw *ah, unsigned int chan)
static int ath5k_hw_rf5112_channel(struct ath5k_hw *ah, struct net80211_channel *channel)
static const struct ath5k_ini_rfbuffer rfb_2316[]
static void ath5k_setup_rate_powertable(struct ath5k_hw *ah, u16 max_pwr, struct ath5k_rate_pcal_info *rate_info, u8 ee_mode)
static void ath5k_setup_pcdac_table(struct ath5k_hw *ah)
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
enum ath5k_rfgain ath5k_hw_gainf_calibrate(struct ath5k_hw *ah)
s8 gos_param[AR5K_GAIN_CRN_MAX_FIX_BITS]
#define AR5K_PHY_TPC_RG5_PD_GAIN_BOUNDARY_1
uint32_t channel
RNDIS channel.
int ath5k_hw_channel(struct ath5k_hw *ah, struct net80211_channel *channel)
#define AR5K_TXPOWER_OFDM(_r, _v)
static const struct ath5k_ini_rfbuffer rfb_5112[]
u8 ee_n_piers[AR5K_EEPROM_N_MODES]
#define AR5K_PHY_TXPOWER_RATE3
static const struct ath5k_ini_rfgain rfgain_5112[]
static int ath5k_setup_channel_powertable(struct ath5k_hw *ah, struct net80211_channel *channel, u8 ee_mode, u8 type)
static const struct ath5k_rf_reg rf_regs_2316[]
char * strerror(int errno)
Retrieve string representation of error number.
static int ath5k_hw_rf511x_calibrate(struct ath5k_hw *ah, struct net80211_channel *channel)
unsigned int ath5k_hw_get_def_antenna(struct ath5k_hw *ah)
static const struct ath5k_ini_rfgain rfgain_2413[]
#define AR5K_RF_BUFFER_CONTROL_5
static void ath5k_get_chan_pcal_surrounding_piers(struct ath5k_hw *ah, struct net80211_channel *channel, struct ath5k_chan_pcal_info **pcinfo_l, struct ath5k_chan_pcal_info **pcinfo_r)
static const struct ath5k_ini_rfbuffer rfb_2425[]
static void ath5k_combine_pwr_to_pdadc_curves(struct ath5k_hw *ah, s16 *pwr_min, s16 *pwr_max, u8 pdcurves)
#define AR5K_EEPROM_N_EDGES
#define AR5K_DEFAULT_ANTENNA
#define AR5K_PHY_RFSTG_DISABLE
#define AR5K_EEPROM_MODE_11B
int ath5k_hw_phy_disable(struct ath5k_hw *ah)
static const struct ath5k_gain_opt rfgain_opt_5112
static const struct ath5k_rf_reg rf_regs_5111[]
struct ath5k_rate_pcal_info ee_rate_tpwr_b[AR5K_EEPROM_N_2GHZ_CHAN_MAX]
u16 ee_i_gain[AR5K_EEPROM_N_MODES]
static void ath5k_hw_reg_write(struct ath5k_hw *ah, u32 val, u16 reg)
int ath5k_hw_rfgain_opt_init(struct ath5k_hw *ah)
static u32 ath5k_hw_rf5110_chan2athchan(struct net80211_channel *channel)
static const struct ath5k_ini_rfbuffer rfb_2413[]
#define AR5K_TUNE_TPC_TXPOWER
void * malloc(size_t size)
Allocate memory.
u8 rates[0]
Rates data, one rate per byte.
#define EAGAIN
Resource temporarily unavailable.
static int ath5k_hw_rf5110_channel(struct ath5k_hw *ah, struct net80211_channel *channel)
#define AR5K_PHY_ACT_DISABLE
#define AR5K_RF_BUFFER_CONTROL_3
int ath5k_hw_rfgain_init(struct ath5k_hw *ah, unsigned int freq)
static void ath5k_get_rate_pcal_data(struct ath5k_hw *ah, struct net80211_channel *channel, struct ath5k_rate_pcal_info *rates)
static s16 ath5k_get_linear_pcdac_min(const u8 *stepL, const u8 *stepR, const s16 *pwrL, const s16 *pwrR)
#define AR5K_TUNE_NOISE_FLOOR
struct ath5k_rate_pcal_info ee_rate_tpwr_a[AR5K_EEPROM_N_5GHZ_CHAN]
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
static void ath5k_hw_request_rfgain_probe(struct ath5k_hw *ah)
#define AR5K_REG_DISABLE_BITS(ah, _reg, _flags)
#define AR5K_GAIN_DYN_ADJUST_LO_MARGIN
u16 ee_xpd[AR5K_EEPROM_N_MODES]
#define AR5K_PHY_TPC_RG5_PD_GAIN_OVERLAP
#define AR5K_PHY_IQ_CAL_NUM_LOG_MAX
struct ath5k_chan_pcal_info ee_pwr_cal_a[AR5K_EEPROM_N_5GHZ_CHAN]
static const struct ath5k_ini_rfbuffer rfb_5112a[]
#define AR5K_SREV_RAD_5112A
#define AR5K_PHY_IQ_CORR_Q_I_COFF_S
#define AR5K_PHY_TPC_RG5_PD_GAIN_BOUNDARY_3
#define AR5K_DIAG_SW_5210
#define AR5K_INI_RFGAIN_2GHZ
static const struct ath5k_ini_rfgain rfgain_5111[]
void step(void)
Single-step a single process.
static unsigned int unsigned int y
struct ath5k_rate_pcal_info ee_rate_tpwr_g[AR5K_EEPROM_N_2GHZ_CHAN_MAX]
#define AR5K_PHY_IQRES_CAL_PWR_I
uint8_t data[48]
Additional event data.
int ath5k_channel_ok(struct ath5k_hw *ah, u16 freq, unsigned int flags)
int ath5k_hw_noise_floor_calibration(struct ath5k_hw *ah, short freq)
ath5k_hw_noise_floor_calibration - perform PHY noise floor calibration
#define AR5K_PHY_CCKTXCTL_WORLD
#define AR5K_SREV_PHY_5212A
#define AR5K_PHY_TXPOWER_RATE4
static int ath5k_hw_rf5111_channel(struct ath5k_hw *ah, struct net80211_channel *channel)
int ath5k_hw_set_txpower_limit(struct ath5k_hw *ah, u8 mode, u8 txpower)
u16 ee_ob[AR5K_EEPROM_N_MODES][AR5K_EEPROM_N_OBDB]
static u32 ath5k_hw_reg_read(struct ath5k_hw *ah, u16 reg)
#define AR5K_PHY_TPC_RG5_PD_GAIN_BOUNDARY_2
uint16_t offset
Offset to command line.
static const struct ath5k_ini_rfbuffer rfb_2317[]
struct ath5k_edge_power ee_ctl_pwr[AR5K_EEPROM_N_EDGES *AR5K_EEPROM_MAX_CTLS]
#define AR5K_DIAG_SW_DIS_TX
#define DBG(...)
Print a debugging message.
#define AR5K_PHY_TPC_RG1_NUM_PD_GAIN
#define AR5K_PHY_ADCSAT_THR
#define AR5K_PHY_AGCCOARSE_HI
static const struct ath5k_ini_rfgain rfgain_5413[]
#define AR5K_PHY_FRAME_CTL_TX_CLIP
static void ath5k_get_max_ctl_power(struct ath5k_hw *ah, struct net80211_channel *channel)
u16 ee_cck_ofdm_gain_delta
#define AR5K_PHY_PDADC_TXPOWER(_n)
#define AR5K_PHY_ADCSAT_ICNT
#define AR5K_PHY_CCKTXCTL
#define AR5K_PHY_TXPOWER_RATE_MAX_TPC_ENABLE
#define NULL
NULL pointer (VOID *)
int ath5k_hw_txpower(struct ath5k_hw *ah, struct net80211_channel *channel, u8 ee_mode, u8 txpower)
#define AR5K_PHY_IQRES_CAL_PWR_Q
#define AR5K_PHY_TXPOWER_RATE2
struct bofm_section_header done
#define AR5K_CTL_NO_REGDOMAIN
#define AR5K_PHY_ACT_ENABLE
static const struct ath5k_ini_rfbuffer rfb_5111[]
static int ath5k_hw_rf5111_chan2athchan(unsigned int ieee, struct ath5k_athchan_2ghz *athchan)
#define AR5K_TUNE_MAX_TXPOWER
#define AR5K_REG_ENABLE_BITS(ah, _reg, _flags)
void * memset(void *dest, int character, size_t len) __nonnull
#define AR5K_PHY_CCKTXCTL_JAPAN
#define AR5K_RF_BUFFER_CONTROL_0
#define AR5K_DIAG_SW_DIS_RX_5210
#define AR5K_REG_SM(_val, _flags)