aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hw.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.h')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h83
1 files changed, 45 insertions, 38 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index c79889036ec4..f389b3c93cf3 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -45,6 +45,8 @@
45#define AR9300_DEVID_PCIE 0x0030 45#define AR9300_DEVID_PCIE 0x0030
46#define AR9300_DEVID_AR9340 0x0031 46#define AR9300_DEVID_AR9340 0x0031
47#define AR9300_DEVID_AR9485_PCIE 0x0032 47#define AR9300_DEVID_AR9485_PCIE 0x0032
48#define AR9300_DEVID_AR9580 0x0033
49#define AR9300_DEVID_AR9462 0x0034
48#define AR9300_DEVID_AR9330 0x0035 50#define AR9300_DEVID_AR9330 0x0035
49 51
50#define AR5416_AR9100_DEVID 0x000b 52#define AR5416_AR9100_DEVID 0x000b
@@ -93,6 +95,12 @@
93 (_ah)->reg_ops.write_flush((_ah)); \ 95 (_ah)->reg_ops.write_flush((_ah)); \
94 } while (0) 96 } while (0)
95 97
98#define PR_EEP(_s, _val) \
99 do { \
100 len += snprintf(buf + len, size - len, "%20s : %10d\n", \
101 _s, (_val)); \
102 } while (0)
103
96#define SM(_v, _f) (((_v) << _f##_S) & _f) 104#define SM(_v, _f) (((_v) << _f##_S) & _f)
97#define MS(_v, _f) (((_v) & _f) >> _f##_S) 105#define MS(_v, _f) (((_v) & _f) >> _f##_S)
98#define REG_RMW_FIELD(_a, _r, _f, _v) \ 106#define REG_RMW_FIELD(_a, _r, _f, _v) \
@@ -194,6 +202,7 @@ enum ath9k_hw_caps {
194 ATH9K_HW_CAP_2GHZ = BIT(13), 202 ATH9K_HW_CAP_2GHZ = BIT(13),
195 ATH9K_HW_CAP_5GHZ = BIT(14), 203 ATH9K_HW_CAP_5GHZ = BIT(14),
196 ATH9K_HW_CAP_APM = BIT(15), 204 ATH9K_HW_CAP_APM = BIT(15),
205 ATH9K_HW_CAP_RTT = BIT(16),
197}; 206};
198 207
199struct ath9k_hw_capabilities { 208struct ath9k_hw_capabilities {
@@ -329,6 +338,16 @@ enum ath9k_int {
329 CHANNEL_HT40PLUS | \ 338 CHANNEL_HT40PLUS | \
330 CHANNEL_HT40MINUS) 339 CHANNEL_HT40MINUS)
331 340
341#define MAX_RTT_TABLE_ENTRY 6
342#define RTT_HIST_MAX 3
343struct ath9k_rtt_hist {
344 u32 table[AR9300_MAX_CHAINS][RTT_HIST_MAX][MAX_RTT_TABLE_ENTRY];
345 u8 num_readings;
346};
347
348#define MAX_IQCAL_MEASUREMENT 8
349#define MAX_CL_TAB_ENTRY 16
350
332struct ath9k_hw_cal_data { 351struct ath9k_hw_cal_data {
333 u16 channel; 352 u16 channel;
334 u32 channelFlags; 353 u32 channelFlags;
@@ -338,9 +357,15 @@ struct ath9k_hw_cal_data {
338 bool paprd_done; 357 bool paprd_done;
339 bool nfcal_pending; 358 bool nfcal_pending;
340 bool nfcal_interference; 359 bool nfcal_interference;
360 bool done_txiqcal_once;
361 bool done_txclcal_once;
341 u16 small_signal_gain[AR9300_MAX_CHAINS]; 362 u16 small_signal_gain[AR9300_MAX_CHAINS];
342 u32 pa_table[AR9300_MAX_CHAINS][PAPRD_TABLE_SZ]; 363 u32 pa_table[AR9300_MAX_CHAINS][PAPRD_TABLE_SZ];
364 u32 num_measures[AR9300_MAX_CHAINS];
365 int tx_corr_coeff[MAX_IQCAL_MEASUREMENT][AR9300_MAX_CHAINS];
366 u32 tx_clcal[AR9300_MAX_CHAINS][MAX_CL_TAB_ENTRY];
343 struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS]; 367 struct ath9k_nfcal_hist nfCalHist[NUM_NF_READINGS];
368 struct ath9k_rtt_hist rtt_hist;
344}; 369};
345 370
346struct ath9k_channel { 371struct ath9k_channel {
@@ -382,14 +407,6 @@ enum ath9k_power_mode {
382 ATH9K_PM_UNDEFINED 407 ATH9K_PM_UNDEFINED
383}; 408};
384 409
385enum ath9k_tp_scale {
386 ATH9K_TP_SCALE_MAX = 0,
387 ATH9K_TP_SCALE_50,
388 ATH9K_TP_SCALE_25,
389 ATH9K_TP_SCALE_12,
390 ATH9K_TP_SCALE_MIN
391};
392
393enum ser_reg_mode { 410enum ser_reg_mode {
394 SER_REG_MODE_OFF = 0, 411 SER_REG_MODE_OFF = 0,
395 SER_REG_MODE_ON = 1, 412 SER_REG_MODE_ON = 1,
@@ -438,7 +455,6 @@ struct ath9k_hw_version {
438 u16 phyRev; 455 u16 phyRev;
439 u16 analog5GhzRev; 456 u16 analog5GhzRev;
440 u16 analog2GhzRev; 457 u16 analog2GhzRev;
441 u16 subsysid;
442 enum ath_usb_dev usbdev; 458 enum ath_usb_dev usbdev;
443}; 459};
444 460
@@ -577,7 +593,6 @@ struct ath_hw_private_ops {
577 bool (*rfbus_req)(struct ath_hw *ah); 593 bool (*rfbus_req)(struct ath_hw *ah);
578 void (*rfbus_done)(struct ath_hw *ah); 594 void (*rfbus_done)(struct ath_hw *ah);
579 void (*restore_chainmask)(struct ath_hw *ah); 595 void (*restore_chainmask)(struct ath_hw *ah);
580 void (*set_diversity)(struct ath_hw *ah, bool value);
581 u32 (*compute_pll_control)(struct ath_hw *ah, 596 u32 (*compute_pll_control)(struct ath_hw *ah,
582 struct ath9k_channel *chan); 597 struct ath9k_channel *chan);
583 bool (*ani_control)(struct ath_hw *ah, enum ath9k_ani_cmd cmd, 598 bool (*ani_control)(struct ath_hw *ah, enum ath9k_ani_cmd cmd,
@@ -585,6 +600,8 @@ struct ath_hw_private_ops {
585 void (*do_getnf)(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS]); 600 void (*do_getnf)(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS]);
586 void (*set_radar_params)(struct ath_hw *ah, 601 void (*set_radar_params)(struct ath_hw *ah,
587 struct ath_hw_radar_conf *conf); 602 struct ath_hw_radar_conf *conf);
603 int (*fast_chan_change)(struct ath_hw *ah, struct ath9k_channel *chan,
604 u8 *ini_reloaded);
588 605
589 /* ANI */ 606 /* ANI */
590 void (*ani_cache_ini_regs)(struct ath_hw *ah); 607 void (*ani_cache_ini_regs)(struct ath_hw *ah);
@@ -601,8 +618,7 @@ struct ath_hw_private_ops {
601 */ 618 */
602struct ath_hw_ops { 619struct ath_hw_ops {
603 void (*config_pci_powersave)(struct ath_hw *ah, 620 void (*config_pci_powersave)(struct ath_hw *ah,
604 int restore, 621 bool power_off);
605 int power_off);
606 void (*rx_enable)(struct ath_hw *ah); 622 void (*rx_enable)(struct ath_hw *ah);
607 void (*set_desc_link)(void *ds, u32 link); 623 void (*set_desc_link)(void *ds, u32 link);
608 bool (*calibrate)(struct ath_hw *ah, 624 bool (*calibrate)(struct ath_hw *ah,
@@ -610,30 +626,10 @@ struct ath_hw_ops {
610 u8 rxchainmask, 626 u8 rxchainmask,
611 bool longcal); 627 bool longcal);
612 bool (*get_isr)(struct ath_hw *ah, enum ath9k_int *masked); 628 bool (*get_isr)(struct ath_hw *ah, enum ath9k_int *masked);
613 void (*fill_txdesc)(struct ath_hw *ah, void *ds, u32 seglen, 629 void (*set_txdesc)(struct ath_hw *ah, void *ds,
614 bool is_firstseg, bool is_is_lastseg, 630 struct ath_tx_info *i);
615 const void *ds0, dma_addr_t buf_addr,
616 unsigned int qcu);
617 int (*proc_txdesc)(struct ath_hw *ah, void *ds, 631 int (*proc_txdesc)(struct ath_hw *ah, void *ds,
618 struct ath_tx_status *ts); 632 struct ath_tx_status *ts);
619 void (*set11n_txdesc)(struct ath_hw *ah, void *ds,
620 u32 pktLen, enum ath9k_pkt_type type,
621 u32 txPower, u32 keyIx,
622 enum ath9k_key_type keyType,
623 u32 flags);
624 void (*set11n_ratescenario)(struct ath_hw *ah, void *ds,
625 void *lastds,
626 u32 durUpdateEn, u32 rtsctsRate,
627 u32 rtsctsDuration,
628 struct ath9k_11n_rate_series series[],
629 u32 nseries, u32 flags);
630 void (*set11n_aggr_first)(struct ath_hw *ah, void *ds,
631 u32 aggrLen);
632 void (*set11n_aggr_middle)(struct ath_hw *ah, void *ds,
633 u32 numDelims);
634 void (*set11n_aggr_last)(struct ath_hw *ah, void *ds);
635 void (*clr11n_aggr)(struct ath_hw *ah, void *ds);
636 void (*set_clrdmask)(struct ath_hw *ah, void *ds, bool val);
637 void (*antdiv_comb_conf_get)(struct ath_hw *ah, 633 void (*antdiv_comb_conf_get)(struct ath_hw *ah,
638 struct ath_hw_antcomb_conf *antconf); 634 struct ath_hw_antcomb_conf *antconf);
639 void (*antdiv_comb_conf_set)(struct ath_hw *ah, 635 void (*antdiv_comb_conf_set)(struct ath_hw *ah,
@@ -647,9 +643,16 @@ struct ath_nf_limits {
647 s16 nominal; 643 s16 nominal;
648}; 644};
649 645
646enum ath_cal_list {
647 TX_IQ_CAL = BIT(0),
648 TX_IQ_ON_AGC_CAL = BIT(1),
649 TX_CL_CAL = BIT(2),
650};
651
650/* ah_flags */ 652/* ah_flags */
651#define AH_USE_EEPROM 0x1 653#define AH_USE_EEPROM 0x1
652#define AH_UNPLUGGED 0x2 /* The card has been physically removed. */ 654#define AH_UNPLUGGED 0x2 /* The card has been physically removed. */
655#define AH_FASTCC 0x4
653 656
654struct ath_hw { 657struct ath_hw {
655 struct ath_ops reg_ops; 658 struct ath_ops reg_ops;
@@ -690,6 +693,7 @@ struct ath_hw {
690 enum nl80211_iftype opmode; 693 enum nl80211_iftype opmode;
691 enum ath9k_power_mode power_mode; 694 enum ath9k_power_mode power_mode;
692 695
696 s8 noise;
693 struct ath9k_hw_cal_data *caldata; 697 struct ath9k_hw_cal_data *caldata;
694 struct ath9k_pacal_info pacal_info; 698 struct ath9k_pacal_info pacal_info;
695 struct ar5416Stats stats; 699 struct ar5416Stats stats;
@@ -703,8 +707,10 @@ struct ath_hw {
703 u32 txdesc_interrupt_mask; 707 u32 txdesc_interrupt_mask;
704 u32 txeol_interrupt_mask; 708 u32 txeol_interrupt_mask;
705 u32 txurn_interrupt_mask; 709 u32 txurn_interrupt_mask;
710 atomic_t intr_ref_cnt;
706 bool chip_fullsleep; 711 bool chip_fullsleep;
707 u32 atim_window; 712 u32 atim_window;
713 u32 modes_index;
708 714
709 /* Calibration */ 715 /* Calibration */
710 u32 supp_cals; 716 u32 supp_cals;
@@ -743,6 +749,7 @@ struct ath_hw {
743 int32_t sign[AR5416_MAX_CHAINS]; 749 int32_t sign[AR5416_MAX_CHAINS];
744 } meas3; 750 } meas3;
745 u16 cal_samples; 751 u16 cal_samples;
752 u8 enabled_cals;
746 753
747 u32 sta_id1_defaults; 754 u32 sta_id1_defaults;
748 u32 misc_mode; 755 u32 misc_mode;
@@ -820,11 +827,14 @@ struct ath_hw {
820 struct ar5416IniArray iniModes_9271_1_0_only; 827 struct ar5416IniArray iniModes_9271_1_0_only;
821 struct ar5416IniArray iniCckfirNormal; 828 struct ar5416IniArray iniCckfirNormal;
822 struct ar5416IniArray iniCckfirJapan2484; 829 struct ar5416IniArray iniCckfirJapan2484;
830 struct ar5416IniArray ini_japan2484;
823 struct ar5416IniArray iniCommon_normal_cck_fir_coeff_9271; 831 struct ar5416IniArray iniCommon_normal_cck_fir_coeff_9271;
824 struct ar5416IniArray iniCommon_japan_2484_cck_fir_coeff_9271; 832 struct ar5416IniArray iniCommon_japan_2484_cck_fir_coeff_9271;
825 struct ar5416IniArray iniModes_9271_ANI_reg; 833 struct ar5416IniArray iniModes_9271_ANI_reg;
826 struct ar5416IniArray iniModes_high_power_tx_gain_9271; 834 struct ar5416IniArray iniModes_high_power_tx_gain_9271;
827 struct ar5416IniArray iniModes_normal_power_tx_gain_9271; 835 struct ar5416IniArray iniModes_normal_power_tx_gain_9271;
836 struct ar5416IniArray ini_radio_post_sys2ant;
837 struct ar5416IniArray ini_BTCOEX_MAX_TXPWR;
828 838
829 struct ar5416IniArray iniMac[ATH_INI_NUM_SPLIT]; 839 struct ar5416IniArray iniMac[ATH_INI_NUM_SPLIT];
830 struct ar5416IniArray iniBB[ATH_INI_NUM_SPLIT]; 840 struct ar5416IniArray iniBB[ATH_INI_NUM_SPLIT];
@@ -978,6 +988,7 @@ void ath9k_hw_htc_resetinit(struct ath_hw *ah);
978/* PHY */ 988/* PHY */
979void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled, 989void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled,
980 u32 *coef_mantissa, u32 *coef_exponent); 990 u32 *coef_mantissa, u32 *coef_exponent);
991void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan);
981 992
982/* 993/*
983 * Code Specific to AR5008, AR9001 or AR9002, 994 * Code Specific to AR5008, AR9001 or AR9002,
@@ -1030,10 +1041,6 @@ void ath9k_ani_reset(struct ath_hw *ah, bool is_scanning);
1030void ath9k_hw_proc_mib_event(struct ath_hw *ah); 1041void ath9k_hw_proc_mib_event(struct ath_hw *ah);
1031void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan); 1042void ath9k_hw_ani_monitor(struct ath_hw *ah, struct ath9k_channel *chan);
1032 1043
1033#define ATH_PCIE_CAP_LINK_CTRL 0x70
1034#define ATH_PCIE_CAP_LINK_L0S 1
1035#define ATH_PCIE_CAP_LINK_L1 2
1036
1037#define ATH9K_CLOCK_RATE_CCK 22 1044#define ATH9K_CLOCK_RATE_CCK 22
1038#define ATH9K_CLOCK_RATE_5GHZ_OFDM 40 1045#define ATH9K_CLOCK_RATE_5GHZ_OFDM 40
1039#define ATH9K_CLOCK_RATE_2GHZ_OFDM 44 1046#define ATH9K_CLOCK_RATE_2GHZ_OFDM 44