Lines Matching refs:rf
1506 .rf = {
2348 if (libconf->rf.channel <= 14) { in rt2800_config_lna_gain()
2351 } else if (libconf->rf.channel <= 64) { in rt2800_config_lna_gain()
2354 } else if (libconf->rf.channel <= 128) { in rt2800_config_lna_gain()
2425 struct rf_channel *rf, in rt2800_config_channel_rf2xxx() argument
2428 rt2x00_set_field32(&rf->rf4, RF4_FREQ_OFFSET, rt2x00dev->freq_offset); in rt2800_config_channel_rf2xxx()
2431 rt2x00_set_field32(&rf->rf2, RF2_ANTENNA_TX1, 1); in rt2800_config_channel_rf2xxx()
2434 rt2x00_set_field32(&rf->rf2, RF2_ANTENNA_RX1, 1); in rt2800_config_channel_rf2xxx()
2435 rt2x00_set_field32(&rf->rf2, RF2_ANTENNA_RX2, 1); in rt2800_config_channel_rf2xxx()
2437 rt2x00_set_field32(&rf->rf2, RF2_ANTENNA_RX2, 1); in rt2800_config_channel_rf2xxx()
2439 if (rf->channel > 14) { in rt2800_config_channel_rf2xxx()
2446 rt2x00_set_field32(&rf->rf3, RF3_TXPOWER_A_7DBM_BOOST, in rt2800_config_channel_rf2xxx()
2452 rt2x00_set_field32(&rf->rf3, RF3_TXPOWER_A, info->default_power1); in rt2800_config_channel_rf2xxx()
2454 rt2x00_set_field32(&rf->rf4, RF4_TXPOWER_A_7DBM_BOOST, in rt2800_config_channel_rf2xxx()
2460 rt2x00_set_field32(&rf->rf4, RF4_TXPOWER_A, info->default_power2); in rt2800_config_channel_rf2xxx()
2462 rt2x00_set_field32(&rf->rf3, RF3_TXPOWER_G, info->default_power1); in rt2800_config_channel_rf2xxx()
2463 rt2x00_set_field32(&rf->rf4, RF4_TXPOWER_G, info->default_power2); in rt2800_config_channel_rf2xxx()
2466 rt2x00_set_field32(&rf->rf4, RF4_HT40, conf_is_ht40(conf)); in rt2800_config_channel_rf2xxx()
2468 rt2800_rf_write(rt2x00dev, 1, rf->rf1); in rt2800_config_channel_rf2xxx()
2469 rt2800_rf_write(rt2x00dev, 2, rf->rf2); in rt2800_config_channel_rf2xxx()
2470 rt2800_rf_write(rt2x00dev, 3, rf->rf3 & ~0x00000004); in rt2800_config_channel_rf2xxx()
2471 rt2800_rf_write(rt2x00dev, 4, rf->rf4); in rt2800_config_channel_rf2xxx()
2475 rt2800_rf_write(rt2x00dev, 1, rf->rf1); in rt2800_config_channel_rf2xxx()
2476 rt2800_rf_write(rt2x00dev, 2, rf->rf2); in rt2800_config_channel_rf2xxx()
2477 rt2800_rf_write(rt2x00dev, 3, rf->rf3 | 0x00000004); in rt2800_config_channel_rf2xxx()
2478 rt2800_rf_write(rt2x00dev, 4, rf->rf4); in rt2800_config_channel_rf2xxx()
2482 rt2800_rf_write(rt2x00dev, 1, rf->rf1); in rt2800_config_channel_rf2xxx()
2483 rt2800_rf_write(rt2x00dev, 2, rf->rf2); in rt2800_config_channel_rf2xxx()
2484 rt2800_rf_write(rt2x00dev, 3, rf->rf3 & ~0x00000004); in rt2800_config_channel_rf2xxx()
2485 rt2800_rf_write(rt2x00dev, 4, rf->rf4); in rt2800_config_channel_rf2xxx()
2490 struct rf_channel *rf, in rt2800_config_channel_rf3xxx() argument
2496 rt2800_rfcsr_write(rt2x00dev, 2, rf->rf1); in rt2800_config_channel_rf3xxx()
2499 rt2x00_set_field8(&rfcsr, RFCSR3_K, rf->rf3); in rt2800_config_channel_rf3xxx()
2503 rt2x00_set_field8(&rfcsr, RFCSR6_R1, rf->rf2); in rt2800_config_channel_rf3xxx()
2568 struct rf_channel *rf, in rt2800_config_channel_rf3052() argument
2575 if (rf->channel <= 14) { in rt2800_config_channel_rf3052()
2583 rt2800_rfcsr_write(rt2x00dev, 2, rf->rf1); in rt2800_config_channel_rf3052()
2584 rt2800_rfcsr_write(rt2x00dev, 3, rf->rf3); in rt2800_config_channel_rf3052()
2587 rt2x00_set_field8(&rfcsr, RFCSR6_R1, rf->rf2); in rt2800_config_channel_rf3052()
2588 if (rf->channel <= 14) in rt2800_config_channel_rf3052()
2595 if (rf->channel <= 14) in rt2800_config_channel_rf3052()
2602 if (rf->channel <= 14) { in rt2800_config_channel_rf3052()
2615 if (rf->channel <= 14) { in rt2800_config_channel_rf3052()
2635 if (rf->channel <= 14) { in rt2800_config_channel_rf3052()
2674 if (rf->channel <= 14) { in rt2800_config_channel_rf3052()
2707 if (rf->channel <= 64) { in rt2800_config_channel_rf3052()
2711 } else if (rf->channel <= 128) { in rt2800_config_channel_rf3052()
2727 if (rf->channel <= 14) in rt2800_config_channel_rf3052()
2740 struct rf_channel *rf, in rt2800_config_channel_rf3053() argument
2760 if (rf->channel <= 14) { in rt2800_config_channel_rf3053()
2773 rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1); in rt2800_config_channel_rf3053()
2774 rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3 & 0xf); in rt2800_config_channel_rf3053()
2777 rt2x00_set_field8(&rfcsr, RFCSR11_R, (rf->rf2 & 0x3)); in rt2800_config_channel_rf3053()
2782 if (rf->channel <= 14) in rt2800_config_channel_rf3053()
2789 if (rf->channel <= 14) { in rt2800_config_channel_rf3053()
2804 if (rf->channel <= 14) { in rt2800_config_channel_rf3053()
2819 if (rf->channel <= 14) { in rt2800_config_channel_rf3053()
2888 if (rf->channel <= 14) in rt2800_config_channel_rf3053()
2901 if (rf->channel <= 14) in rt2800_config_channel_rf3053()
2908 if (rf->channel <= 14) in rt2800_config_channel_rf3053()
2915 if (rf->channel <= 14) in rt2800_config_channel_rf3053()
2922 if (rf->channel >= 1 && rf->channel <= 14) in rt2800_config_channel_rf3053()
2924 else if (rf->channel >= 36 && rf->channel <= 64) in rt2800_config_channel_rf3053()
2926 else if (rf->channel >= 100 && rf->channel <= 128) in rt2800_config_channel_rf3053()
2938 if (rf->channel <= 14) { in rt2800_config_channel_rf3053()
2951 if (rf->channel <= 14) { in rt2800_config_channel_rf3053()
2961 if (rf->channel <= 14) in rt2800_config_channel_rf3053()
2976 if (rf->channel <= 14) in rt2800_config_channel_rf3053()
2982 if (rf->channel <= 14) { in rt2800_config_channel_rf3053()
2992 if (rf->channel <= 14) { in rt2800_config_channel_rf3053()
3004 if (rf->channel >= 1 && rf->channel <= 14) { in rt2800_config_channel_rf3053()
3011 } else if (rf->channel >= 36 && rf->channel <= 64) { in rt2800_config_channel_rf3053()
3018 } else if (rf->channel >= 100 && rf->channel <= 128) { in rt2800_config_channel_rf3053()
3037 struct rf_channel *rf, in rt2800_config_channel_rf3853() argument
3048 if (rf->channel <= 14) in rt2800_config_channel_rf3853()
3050 else if (rf->channel < 132) in rt2800_config_channel_rf3853()
3055 rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1); in rt2800_config_channel_rf3853()
3056 rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3); in rt2800_config_channel_rf3853()
3058 if (rf->channel <= 14) in rt2800_config_channel_rf3853()
3063 if (rf->channel <= 14) in rt2800_config_channel_rf3853()
3114 if (rf->channel <= 14) in rt2800_config_channel_rf3853()
3124 if (rf->channel <= 14) in rt2800_config_channel_rf3853()
3131 if (rf->channel <= 14) in rt2800_config_channel_rf3853()
3137 if (rf->channel <= 14) in rt2800_config_channel_rf3853()
3139 else if (rf->channel < 100) in rt2800_config_channel_rf3853()
3141 else if (rf->channel < 132) in rt2800_config_channel_rf3853()
3151 if (rf->channel <= 14) in rt2800_config_channel_rf3853()
3156 if (rf->channel <= 14) in rt2800_config_channel_rf3853()
3158 else if (rf->channel < 100) in rt2800_config_channel_rf3853()
3160 else if (rf->channel < 132) in rt2800_config_channel_rf3853()
3166 if (rf->channel <= 14) in rt2800_config_channel_rf3853()
3179 if (rf->channel <= 14) in rt2800_config_channel_rf3853()
3185 if (rf->channel <= 14) in rt2800_config_channel_rf3853()
3190 if (rf->channel <= 14) { in rt2800_config_channel_rf3853()
3208 rf->channel, pwr1, pwr2, pwr3); in rt2800_config_channel_rf3853()
3220 if (rf->channel <= 14) in rt2800_config_channel_rf3853()
3245 struct rf_channel *rf, in rt2800_config_channel_rf3290() argument
3250 rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1); in rt2800_config_channel_rf3290()
3251 rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3); in rt2800_config_channel_rf3290()
3253 rt2x00_set_field8(&rfcsr, RFCSR11_R, rf->rf2); in rt2800_config_channel_rf3290()
3265 if (rf->channel <= 14) { in rt2800_config_channel_rf3290()
3266 if (rf->channel == 6) in rt2800_config_channel_rf3290()
3271 if (rf->channel >= 1 && rf->channel <= 6) in rt2800_config_channel_rf3290()
3273 else if (rf->channel >= 7 && rf->channel <= 11) in rt2800_config_channel_rf3290()
3275 else if (rf->channel >= 12 && rf->channel <= 14) in rt2800_config_channel_rf3290()
3282 struct rf_channel *rf, in rt2800_config_channel_rf3322() argument
3287 rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1); in rt2800_config_channel_rf3322()
3288 rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3); in rt2800_config_channel_rf3322()
3330 struct rf_channel *rf, in rt2800_config_channel_rf53xx() argument
3334 int idx = rf->channel-1; in rt2800_config_channel_rf53xx()
3336 rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1); in rt2800_config_channel_rf53xx()
3337 rt2800_rfcsr_write(rt2x00dev, 9, rf->rf3); in rt2800_config_channel_rf53xx()
3339 rt2x00_set_field8(&rfcsr, RFCSR11_R, rf->rf2); in rt2800_config_channel_rf53xx()
3428 struct rf_channel *rf, in rt2800_config_channel_rf55xx() argument
3441 (rf->channel > 14 || conf_is_ht40(conf)) ? 5 : 0); in rt2800_config_channel_rf55xx()
3445 rt2800_rfcsr_write(rt2x00dev, 8, rf->rf1 & 0xff); in rt2800_config_channel_rf55xx()
3448 rt2x00_set_field8(&rfcsr, RFCSR9_K, rf->rf2 & 0xf); in rt2800_config_channel_rf55xx()
3449 rt2x00_set_field8(&rfcsr, RFCSR9_N, (rf->rf1 & 0x100) >> 8); in rt2800_config_channel_rf55xx()
3450 rt2x00_set_field8(&rfcsr, RFCSR9_MOD, ((rf->rf3 - 8) & 0x4) >> 2); in rt2800_config_channel_rf55xx()
3454 rt2x00_set_field8(&rfcsr, RFCSR11_R, rf->rf4 - 1); in rt2800_config_channel_rf55xx()
3455 rt2x00_set_field8(&rfcsr, RFCSR11_MOD, (rf->rf3 - 8) & 0x3); in rt2800_config_channel_rf55xx()
3458 if (rf->channel <= 14) { in rt2800_config_channel_rf55xx()
3492 rfcsr = rf->channel <= 10 ? 0x07 : 0x06; in rt2800_config_channel_rf55xx()
3534 if (rf->channel >= 36 && rf->channel <= 64) { in rt2800_config_channel_rf55xx()
3540 if (rf->channel <= 50) in rt2800_config_channel_rf55xx()
3542 else if (rf->channel >= 52) in rt2800_config_channel_rf55xx()
3551 if (rf->channel <= 50) { in rt2800_config_channel_rf55xx()
3554 } else if (rf->channel >= 52) { in rt2800_config_channel_rf55xx()
3563 } else if (rf->channel >= 100 && rf->channel <= 165) { in rt2800_config_channel_rf55xx()
3568 if (rf->channel <= 153) { in rt2800_config_channel_rf55xx()
3571 } else if (rf->channel >= 155) { in rt2800_config_channel_rf55xx()
3575 if (rf->channel <= 138) { in rt2800_config_channel_rf55xx()
3580 } else if (rf->channel >= 140) { in rt2800_config_channel_rf55xx()
3586 if (rf->channel <= 124) in rt2800_config_channel_rf55xx()
3588 else if (rf->channel >= 126) in rt2800_config_channel_rf55xx()
3590 if (rf->channel <= 138) in rt2800_config_channel_rf55xx()
3592 else if (rf->channel >= 140) in rt2800_config_channel_rf55xx()
3595 if (rf->channel <= 138) in rt2800_config_channel_rf55xx()
3597 else if (rf->channel >= 140) in rt2800_config_channel_rf55xx()
3599 if (rf->channel <= 128) in rt2800_config_channel_rf55xx()
3601 else if (rf->channel >= 130) in rt2800_config_channel_rf55xx()
3603 if (rf->channel <= 116) in rt2800_config_channel_rf55xx()
3605 else if (rf->channel >= 118) in rt2800_config_channel_rf55xx()
3607 if (rf->channel <= 138) in rt2800_config_channel_rf55xx()
3609 else if (rf->channel >= 140) in rt2800_config_channel_rf55xx()
3611 if (rf->channel <= 116) in rt2800_config_channel_rf55xx()
3613 else if (rf->channel >= 118) in rt2800_config_channel_rf55xx()
3681 rt2800_bbp_write(rt2x00dev, 79, (rf->channel <= 14) ? 0x1C : 0x18); in rt2800_config_channel_rf55xx()
3682 rt2800_bbp_write(rt2x00dev, 80, (rf->channel <= 14) ? 0x0E : 0x08); in rt2800_config_channel_rf55xx()
3683 rt2800_bbp_write(rt2x00dev, 81, (rf->channel <= 14) ? 0x3A : 0x38); in rt2800_config_channel_rf55xx()
3684 rt2800_bbp_write(rt2x00dev, 82, (rf->channel <= 14) ? 0x62 : 0x92); in rt2800_config_channel_rf55xx()
3688 rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0xE0 : 0xF0); in rt2800_config_channel_rf55xx()
3690 rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0x1F : 0x1E); in rt2800_config_channel_rf55xx()
3692 rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0x38 : 0x28); in rt2800_config_channel_rf55xx()
3694 rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0x32 : 0x20); in rt2800_config_channel_rf55xx()
3696 rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0x28 : 0x7F); in rt2800_config_channel_rf55xx()
3698 rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0x19 : 0x7F); in rt2800_config_channel_rf55xx()
3703 struct rf_channel *rf, in rt2800_config_channel_rf7620() argument
3724 rfcsr = (rf->rf1 & 0x00ff); in rt2800_config_channel_rf7620()
3751 rfcsr = rf->rf2; in rt2800_config_channel_rf7620()
3755 rfcsr = rf->rf3; in rt2800_config_channel_rf7620()
3759 rt2x00_set_field8(&rfcsr, RFCSR19_K, rf->rf4); in rt2800_config_channel_rf7620()
3813 conf_is_ht40(conf) && (rf->channel == 11)); in rt2800_config_channel_rf7620()
4058 struct rf_channel *rf) in rt3883_bbp_adjust() argument
4062 bbp = (rf->channel > 14) ? 0x48 : 0x38; in rt3883_bbp_adjust()
4067 if (rf->channel <= 14) { in rt3883_bbp_adjust()
4076 if (rf->channel > 14) { in rt3883_bbp_adjust()
4089 struct rf_channel *rf, in rt2800_config_channel() argument
4096 info->default_power1 = rt2800_txpower_to_dev(rt2x00dev, rf->channel, in rt2800_config_channel()
4098 info->default_power2 = rt2800_txpower_to_dev(rt2x00dev, rf->channel, in rt2800_config_channel()
4102 rt2800_txpower_to_dev(rt2x00dev, rf->channel, in rt2800_config_channel()
4107 rt3883_bbp_adjust(rt2x00dev, rf); in rt2800_config_channel()
4111 switch (rt2x00dev->chip.rf) { in rt2800_config_channel()
4117 rt2800_config_channel_rf3xxx(rt2x00dev, conf, rf, info); in rt2800_config_channel()
4120 rt2800_config_channel_rf3052(rt2x00dev, conf, rf, info); in rt2800_config_channel()
4123 rt2800_config_channel_rf3053(rt2x00dev, conf, rf, info); in rt2800_config_channel()
4126 rt2800_config_channel_rf3290(rt2x00dev, conf, rf, info); in rt2800_config_channel()
4129 rt2800_config_channel_rf3322(rt2x00dev, conf, rf, info); in rt2800_config_channel()
4132 rt2800_config_channel_rf3853(rt2x00dev, conf, rf, info); in rt2800_config_channel()
4142 rt2800_config_channel_rf53xx(rt2x00dev, conf, rf, info); in rt2800_config_channel()
4145 rt2800_config_channel_rf55xx(rt2x00dev, conf, rf, info); in rt2800_config_channel()
4148 rt2800_config_channel_rf7620(rt2x00dev, conf, rf, info); in rt2800_config_channel()
4151 rt2800_config_channel_rf2xxx(rt2x00dev, conf, rf, info); in rt2800_config_channel()
4199 if (rf->channel > 14) { in rt2800_config_channel()
4234 if (rf->channel <= 14) { in rt2800_config_channel()
4275 rt2x00_set_field32(®, TX_BAND_CFG_A, rf->channel > 14); in rt2800_config_channel()
4276 rt2x00_set_field32(®, TX_BAND_CFG_BG, rf->channel <= 14); in rt2800_config_channel()
4293 rf->channel > 14); in rt2800_config_channel()
4295 rf->channel <= 14); in rt2800_config_channel()
4300 rf->channel > 14); in rt2800_config_channel()
4302 rf->channel <= 14); in rt2800_config_channel()
4307 rf->channel > 14); in rt2800_config_channel()
4312 rf->channel <= 14); in rt2800_config_channel()
4343 if (rf->channel <= 14) in rt2800_config_channel()
4359 if (rf->channel <= 14) in rt2800_config_channel()
4384 if (rf->channel <= 14) in rt2800_config_channel()
4401 if (rf->channel <= 14) in rt2800_config_channel()
4429 reg = (rf->channel <= 14 ? 0x1c : 0x24) + 2*rt2x00dev->lna_gain; in rt2800_config_channel()
4433 rt2800_iq_calibrate(rt2x00dev, rf->channel); in rt2800_config_channel()
5506 switch (rt2x00dev->chip.rf) { in rt2800_vco_calibration()
5544 rt2x00dev->chip.rf); in rt2800_vco_calibration()
5678 &libconf->rf, &libconf->channel); in rt2800_config()
10997 u16 rf; in rt2800_init_eeprom() local
11013 rf = rt2800_eeprom_read(rt2x00dev, EEPROM_CHIP_ID); in rt2800_init_eeprom()
11015 rf = RF3322; in rt2800_init_eeprom()
11017 rf = RF3853; in rt2800_init_eeprom()
11019 rf = RF5350; in rt2800_init_eeprom()
11021 rf = RF5592; in rt2800_init_eeprom()
11023 rf = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE); in rt2800_init_eeprom()
11025 switch (rf) { in rt2800_init_eeprom()
11053 rf); in rt2800_init_eeprom()
11057 rt2x00_set_rf(rt2x00dev, rf); in rt2800_init_eeprom()
11615 switch (rt2x00dev->chip.rf) { in rt2800_probe_hw_mode()
11783 switch (rt2x00dev->chip.rf) { in rt2800_probe_hw_mode()