ath9k patches
v2 cover ath9k patches
From: Sujith Manoharan <[email protected]>
Various HW fixes and pending patches, rebased over current HEAD + Felix's patches.
There's one stable fix which was posted earlier:
https://patchwork.kernel.org/patch/3351331/
Sujith
Sujith Manoharan (10):
ath9k: Cleanup spectral scan code
ath9k: Cleanup ath9k.h
ath9k: Remove unneeded ref. count initialization
ath9k: Initialize "switchcomspdt" eeprom field explicitly
ath9k: Update BaseExtension_1 eeprom structure
ath9k: Fix regulatory compliance
ath9k: Remove ath9k_hw_gettsf32()
ath9k: Add a delay between RTC reset/clear for AR9003
ath9k: Fix RTC reset delay
ath9k: Use a subroutine for the AR9330 reset WAR
drivers/net/wireless/ath/ath9k/Makefile | 4 +- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 52 ++- drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | 14 +- drivers/net/wireless/ath/ath9k/ar9003_mci.c | 2 +- drivers/net/wireless/ath/ath9k/ar9003_phy.h | 4 +- drivers/net/wireless/ath/ath9k/ath9k.h | 358 ++++------------ drivers/net/wireless/ath/ath9k/debug.c | 311 +------------- drivers/net/wireless/ath/ath9k/debug.h | 2 - drivers/net/wireless/ath/ath9k/hw.c | 90 ++-- drivers/net/wireless/ath/ath9k/hw.h | 1 - drivers/net/wireless/ath/ath9k/init.c | 4 +- drivers/net/wireless/ath/ath9k/recv.c | 181 --------- drivers/net/wireless/ath/ath9k/spectral.c | 543 +++++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/spectral.h | 212 ++++++++++ 14 files changed, 948 insertions(+), 830 deletions(-) create mode 100644 drivers/net/wireless/ath/ath9k/spectral.c create mode 100644 drivers/net/wireless/ath/ath9k/spectral.h
Signature · 1 line
1.8.5.1
PATCH v2 1/10 ath9k: Cleanup spectral scan code
From: Sujith Manoharan <[email protected]>
* Move definitions to spectral.h
* Move processing/debug code to spectral.c
--- drivers/net/wireless/ath/ath9k/Makefile | 4 +- drivers/net/wireless/ath/ath9k/ath9k.h | 179 +--------- drivers/net/wireless/ath/ath9k/debug.c | 311 +---------------- drivers/net/wireless/ath/ath9k/debug.h | 2 - drivers/net/wireless/ath/ath9k/recv.c | 181 ---------- drivers/net/wireless/ath/ath9k/spectral.c | 543 ++++++++++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/spectral.h | 212 ++++++++++++ 7 files changed, 761 insertions(+), 671 deletions(-) create mode 100644 drivers/net/wireless/ath/ath9k/spectral.c create mode 100644 drivers/net/wireless/ath/ath9k/spectral.h
drivers/net/wireless/ath/ath9k/Makefile +3 -1
@@ -11,12 +11,14 @@ ath9k-$(CONFIG_ATH9K_BTCOEX_SUPPORT) += mci.o ath9k-$(CONFIG_ATH9K_LEGACY_RATE_CONTROL) += rc.o ath9k-$(CONFIG_ATH9K_PCI) += pci.o ath9k-$(CONFIG_ATH9K_AHB) += ahb.o -ath9k-$(CONFIG_ATH9K_DEBUGFS) += debug.o ath9k-$(CONFIG_ATH9K_DFS_DEBUGFS) += dfs_debug.o ath9k-$(CONFIG_ATH9K_DFS_CERTIFIED) += dfs.o ath9k-$(CONFIG_ATH9K_TX99) += tx99.o ath9k-$(CONFIG_ATH9K_WOW) += wow.o +ath9k-$(CONFIG_ATH9K_DEBUGFS) += debug.o \ + spectral.o + obj-$(CONFIG_ATH9K) += ath9k.o ath9k_hw-y:= \
drivers/net/wireless/ath/ath9k/ath9k.h +1 -178
203 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/debug.c +2 -309
341 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/debug.h +0 -2
@@ -292,8 +292,6 @@ void ath9k_sta_add_debugfs(struct ieee80211_hw *hw,struct ieee80211_vif *vif, struct ieee80211_sta *sta, struct dentry *dir); -void ath_debug_send_fft_sample (struct ath_softc *sc, -struct fft_sample_tlv *fft_sample);void ath9k_debug_stat_ant (struct ath_softc *sc,struct ath_hw_antcomb_conf *div_ant_conf,int main_rssi_avg,int alt_rssi_avg);
drivers/net/wireless/ath/ath9k/recv.c +0 -181
193 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/spectral.c new file +543 -0
543 lines not on this page · raw message
drivers/net/wireless/ath/ath9k/spectral.h new file +212 -0
212 lines not on this page · raw message
Signature · 1 line
1.8.5.1
PATCH v2 2/10 ath9k: Cleanup ath9k.h
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
* Remove unused macros.
* Move definitions to appropriate sections.
--- drivers/net/wireless/ath/ath9k/ath9k.h | 179 ++++++++++++++------------------- drivers/net/wireless/ath/ath9k/init.c | 2 +- 2 files changed, 79 insertions(+), 102 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +78 -101
@@ -29,39 +29,13 @@#include "dfs.h" #include "spectral.h" -/* -* Header for the ath9k.ko driver core *only* -- hw code nor any other driver -* should rely on this file or its contents. -*/ -struct ath_node ; +struct ath_rate_table ; -/* Macro to expand scalars to 64-bit objects */ - -#define ito64 (x) (sizeof(x) == 1) ? \ - (((unsigned long long int)(x)) & (0xff)) : \ - (sizeof(x) == 2) ? \ - (((unsigned long long int)(x)) & 0xffff) : \ - ((sizeof(x) == 4) ? \ - (((unsigned long long int)(x)) & 0xffffffff) : \ - (unsigned long long int)(x)) - -/* increment with wrap-around */ -#define INCR (_l, _sz) do { \ - (_l)++; \ - (_l) &= ((_sz) - 1); \ - } while (0) - -/* decrement with wrap-around */ -#define DECR (_l, _sz) do { \ - (_l)--; \ - (_l) &= ((_sz) - 1); \ - } while (0) - -#define TSF_TO_TU (_h,_l) \ - ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) - -#define ATH_TXQ_SETUP (sc, i) ((sc)->tx.txqsetup & (1<<i)) +extern struct ieee80211_ops ath9k_ops; +extern int ath9k_modparam_nohwcrypt; +extern int led_blink; +extern bool is_ath9k_unloaded;struct ath_config {u16 txpowlimit;
@@ -71,6 +45,17 @@ struct ath_config {/* Descriptor Management */ /*************************/ +#define ATH_TXSTATUS_RING_SIZE 512 + +/* Macro to expand scalars to 64-bit objects */ +#define ito64 (x) (sizeof(x) == 1) ? \ + (((unsigned long long int)(x)) & (0xff)) : \ + (sizeof(x) == 2) ? \ + (((unsigned long long int)(x)) & 0xffff) : \ + ((sizeof(x) == 4) ? \ + (((unsigned long long int)(x)) & 0xffffffff) : \ + (unsigned long long int)(x)) +#define ATH_TXBUF_RESET (_bf) do { \ (_bf)->bf_lastbf = NULL; \ (_bf)->bf_next = NULL; \
@@ -78,23 +63,6 @@ struct ath_config { sizeof(struct ath_buf_state)); \ } while (0) -/** -* enum buffer_type - Buffer type flags -* -* @BUF_AMPDU: This buffer is an ampdu, as part of an aggregate (during TX) -* @BUF_AGGR: Indicates whether the buffer can be aggregated -* (used in aggregation scheduling) -*/ -enum buffer_type { -BUF_AMPDU =BIT (0 ), - BUF_AGGR = BIT(1), -}; - -#define bf_isampdu (bf) (bf->bf_state.bf_type & BUF_AMPDU) -#define bf_isaggr (bf) (bf->bf_state.bf_type & BUF_AGGR) - -#define ATH_TXSTATUS_RING_SIZE 512 -#define DS2PHYS (_dd, _ds) \ ((_dd)->dd_desc_paddr + ((caddr_t)(_ds) - (caddr_t)(_dd)->dd_desc))#define ATH_DESC_4KB_BOUND_CHECK (_daddr) ((((_daddr) & 0xFFF) > 0xF7F) ? 1 : 0)
@@ -114,11 +82,20 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,/* RX / TX */ /***********/ +#define ATH_TXQ_SETUP (sc, i) ((sc)->tx.txqsetup & (1<<i)) + +/* increment with wrap-around */ +#define INCR (_l, _sz) do { \ + (_l)++; \ + (_l) &= ((_sz) - 1); \ + } while (0) +#define ATH_RXBUF 512#define ATH_TXBUF 512#define ATH_TXBUF_RESERVE 5#define ATH_MAX_QDEPTH (ATH_TXBUF / 4 - ATH_TXBUF_RESERVE)#define ATH_TXMAXTRY 13 +#define ATH_MAX_SW_RETRIES 30#define TID_TO_WME_AC (_tid) \ ((((_tid) == 0) || ((_tid) == 3)) ? IEEE80211_AC_BE : \
@@ -134,6 +111,9 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,#define ATH_AGGR_MIN_QDEPTH 2/* minimum h/w qdepth for non-aggregated traffic */ #define ATH_NON_AGGR_MIN_QDEPTH 8 +#define ATH_TX_COMPLETE_POLL_INT 1000 +#define ATH_TXFIFO_DEPTH 8 +#define ATH_TX_ERROR 0x01#define IEEE80211_SEQ_SEQ_SHIFT 4#define IEEE80211_SEQ_MAX 4096
@@ -168,9 +148,6 @@ int ath_descdma_setup(struct ath_softc *sc, struct ath_descdma *dd,#define IS_CCK_RATE (rate) ((rate >= 0x18) && (rate <= 0x1e)) -#define ATH_TX_COMPLETE_POLL_INT 1000 - -#define ATH_TXFIFO_DEPTH 8struct ath_txq {int mac80211_qnum;/* mac80211 queue number, -1 means not mac80211 Q */ u32 axq_qnum;/* ath9k hardware queue number */
@@ -215,6 +192,21 @@ struct ath_rxbuf {dma_addr_t bf_buf_addr; }; +/** +* enum buffer_type - Buffer type flags +* +* @BUF_AMPDU: This buffer is an ampdu, as part of an aggregate (during TX) +* @BUF_AGGR: Indicates whether the buffer can be aggregated +* (used in aggregation scheduling) +*/ +enum buffer_type { +BUF_AMPDU =BIT (0 ), +BUF_AGGR =BIT (1 ), +}; + +#define bf_isampdu (bf) (bf->bf_state.bf_type & BUF_AMPDU) +#define bf_isaggr (bf) (bf->bf_state.bf_type & BUF_AGGR) +struct ath_buf_state {u8 bf_type;u8 bfs_paprd;
@@ -279,7 +271,6 @@ struct ath_tx_control {struct ieee80211_sta *sta; }; -#define ATH_TX_ERROR 0x01/** * @txq_map: Index is mac80211 queue number. This is
@@ -373,6 +364,22 @@ struct ath_vif {struct ath_buf *av_bcbuf; }; +struct ath9k_vif_iter_data { +u8 hw_macaddr[ETH_ALEN ];/* address of the first vif */ +u8 mask[ETH_ALEN ];/* bssid mask */ +bool has_hw_macaddr; + +int naps;/* number of AP vifs */ +int nmeshes;/* number of mesh vifs */ +int nstations;/* number of station vifs */ +int nwds;/* number of WDS vifs */ +int nadhocs;/* number of adhoc vifs */ +}; + +void ath9k_calculate_iter_data (struct ieee80211_hw *hw, +struct ieee80211_vif *vif, +struct ath9k_vif_iter_data *iter_data); +/*******************/ /* Beacon Handling */ /*******************/
@@ -388,6 +395,9 @@ struct ath_vif {#define ATH_DEFAULT_BMISS_LIMIT 10#define IEEE80211_MS_TO_TU (x) (((x) * 1000) / 1024) +#define TSF_TO_TU (_h,_l) \ + ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10)) +struct ath_beacon_config {int beacon_interval;u16 listen_interval;
@@ -441,10 +451,9 @@ bool ath9k_csa_is_finished(struct ath_softc *sc);#define ATH_LONG_CALINTERVAL_INT 1000/* 1000 ms */ #define ATH_LONG_CALINTERVAL 30000/* 30 seconds */ #define ATH_RESTART_CALINTERVAL 1200000/* 20 minutes */ -#define ATH_ANI_MAX_SKIP_COUNT 10 - -#define ATH_PAPRD_TIMEOUT 100/* msecs */ -#define ATH_PLL_WORK_INTERVAL 100 +#define ATH_ANI_MAX_SKIP_COUNT 10 +#define ATH_PAPRD_TIMEOUT 100/* msecs */ +#define ATH_PLL_WORK_INTERVAL 100void ath_tx_complete_poll_work (struct work_struct *work);void ath_reset_work (struct work_struct *work);
@@ -538,12 +547,6 @@ static inline int ath9k_dump_btcoex(struct ath_softc *sc, u8 *buf, u32 size) }#endif /* CONFIG_ATH9K_BTCOEX_SUPPORT */ -struct ath9k_wow_pattern { -u8 pattern_bytes[MAX_PATTERN_SIZE ]; -u8 mask_bytes[MAX_PATTERN_SIZE ]; -u32 pattern_len; -}; -/********************/ /* LED Control */ /********************/
@@ -575,6 +578,12 @@ static inline void ath_fill_led_pin(struct ath_softc *sc)/* Wake on Wireless LAN */ /************************/ +struct ath9k_wow_pattern { +u8 pattern_bytes[MAX_PATTERN_SIZE ]; +u8 mask_bytes[MAX_PATTERN_SIZE ]; +u32 pattern_len; +}; +#ifdef CONFIG_ATH9K_WOW void ath9k_init_wow (struct ieee80211_hw *hw); int ath9k_suspend(struct ieee80211_hw *hw,
@@ -678,13 +687,8 @@ void ath_ant_comb_scan(struct ath_softc *sc, struct ath_rx_status *rs);* Used when PCI device not fully initialized by bootrom/BIOS */ #define DEFAULT_CACHELINE 32 -#define ATH_REGCLASSIDS_MAX 10#define ATH_CABQ_READY_TIME 80/* % of beacon interval */ -#define ATH_MAX_SW_RETRIES 30 -#define ATH_CHAN_MAX 255 -#define ATH_TXPOWER_MAX 100/* .5 dBm units */ -#define ATH_RATE_DUMMY_MARKER 0enum sc_op_flags {SC_OP_INVALID ,
@@ -703,20 +707,6 @@ enum sc_op_flags {#define PS_BEACON_SYNC BIT(4)#define PS_WAIT_FOR_ANI BIT(5) -struct ath_rate_table ; - -struct ath9k_vif_iter_data { -u8 hw_macaddr[ETH_ALEN ];/* address of the first vif */ -u8 mask[ETH_ALEN ];/* bssid mask */ -bool has_hw_macaddr; - -int naps;/* number of AP vifs */ -int nmeshes;/* number of mesh vifs */ -int nstations;/* number of station vifs */ -int nwds;/* number of WDS vifs */ -int nadhocs;/* number of adhoc vifs */ -}; -struct ath_softc {struct ieee80211_hw *hw;struct device *dev;
@@ -826,19 +816,13 @@ static inline int ath9k_tx99_send(struct ath_softc *sc, }#endif /* CONFIG_ATH9K_TX99 */ -void ath9k_tasklet (unsigned long data); -int ath_cabq_update (struct ath_softc *); -static inline void ath_read_cachesize (struct ath_common *common,int *csz) { common->bus_ops->read_cachesize (common, csz); } -extern struct ieee80211_ops ath9k_ops; -extern int ath9k_modparam_nohwcrypt; -extern int led_blink; -extern bool is_ath9k_unloaded; - +void ath9k_tasklet (unsigned long data); +int ath_cabq_update (struct ath_softc *);u8 ath9k_parse_mpdudensity (u8 mpdudensity);irqreturn_t ath_isr (int irq,void *dev);int ath_reset (struct ath_softc *sc);
@@ -847,8 +831,12 @@ void ath_restart_work(struct ath_softc *sc);int ath9k_init_device (u16 devid,struct ath_softc *sc,const struct ath_bus_ops *bus_ops);void ath9k_deinit_device (struct ath_softc *sc); -void ath9k_set_hw_capab (struct ath_softc *sc,struct ieee80211_hw *hw);void ath9k_reload_chainmask_settings (struct ath_softc *sc); +u8 ath_txchainmask_reduction (struct ath_softc *sc,u8 chainmask,u32 rate); +void ath_start_rfkill_poll (struct ath_softc *sc); +void ath9k_rfkill_poll_state (struct ieee80211_hw *hw); +void ath9k_ps_wakeup (struct ath_softc *sc); +void ath9k_ps_restore (struct ath_softc *sc);#ifdef CONFIG_ATH9K_PCI int ath_pci_init (void );
@@ -866,15 +854,4 @@ static inline int ath_ahb_init(void) { return 0; };static inline void ath_ahb_exit (void ) {};#endif -void ath9k_ps_wakeup (struct ath_softc *sc); -void ath9k_ps_restore (struct ath_softc *sc); - -u8 ath_txchainmask_reduction (struct ath_softc *sc,u8 chainmask,u32 rate); - -void ath_start_rfkill_poll (struct ath_softc *sc); -void ath9k_rfkill_poll_state (struct ieee80211_hw *hw); -void ath9k_calculate_iter_data (struct ieee80211_hw *hw, -struct ieee80211_vif *vif, -struct ath9k_vif_iter_data *iter_data); -#endif /* ATH9K_H */
drivers/net/wireless/ath/ath9k/init.c +1 -1
@@ -899,7 +899,7 @@ static const struct ieee80211_iface_combination if_comb[] = { } }; -void ath9k_set_hw_capab (struct ath_softc *sc,struct ieee80211_hw *hw) +static void ath9k_set_hw_capab (struct ath_softc *sc,struct ieee80211_hw *hw) {struct ath_hw *ah = sc->sc_ah;struct ath_common *common =ath9k_hw_common (ah);
Signature · 1 line
1.8.5.1
PATCH v2 3/10 ath9k: Remove unneeded ref. count initialization
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
The interrupt reference counter is always initialized in ath9k_start().
--- drivers/net/wireless/ath/ath9k/init.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/ath/ath9k/init.c +0 -1
@@ -705,7 +705,6 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, ah->reg_ops.read = ath9k_ioread32; ah->reg_ops.write = ath9k_iowrite32; ah->reg_ops.rmw = ath9k_reg_rmw; -atomic_set (&ah->intr_ref_cnt,-1 ); sc->sc_ah = ah; pCap = &ah->caps;
Signature · 1 line
1.8.5.1
PATCH v2 4/10 ath9k: Initialize "switchcomspdt" eeprom field explicitly
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +10 -0
@@ -131,6 +131,7 @@ static const struct ar9300_eeprom ar9300_default = { .thresh62 = 28, .papdRateMaskHt20 = LE32(0x0cf0e0e0), .papdRateMaskHt40 = LE32(0x6cf0e0e0), + .switchcomspdt = 0, .xlna_bias_strength = 0, .futureModal = { 0, 0, 0, 0, 0, 0, 0,
@@ -333,6 +334,7 @@ static const struct ar9300_eeprom ar9300_default = { .thresh62 = 28, .papdRateMaskHt20 = LE32(0x0c80c080), .papdRateMaskHt40 = LE32(0x0080c080), + .switchcomspdt = 0, .xlna_bias_strength = 0, .futureModal = { 0, 0, 0, 0, 0, 0, 0,
@@ -707,6 +709,7 @@ static const struct ar9300_eeprom ar9300_x113 = { .thresh62 = 28, .papdRateMaskHt20 = LE32(0x0c80c080), .papdRateMaskHt40 = LE32(0x0080c080), + .switchcomspdt = 0, .xlna_bias_strength = 0, .futureModal = { 0, 0, 0, 0, 0, 0, 0,
@@ -909,6 +912,7 @@ static const struct ar9300_eeprom ar9300_x113 = { .thresh62 = 28, .papdRateMaskHt20 = LE32(0x0cf0e0e0), .papdRateMaskHt40 = LE32(0x6cf0e0e0), + .switchcomspdt = 0, .xlna_bias_strength = 0, .futureModal = { 0, 0, 0, 0, 0, 0, 0,
@@ -1284,6 +1288,7 @@ static const struct ar9300_eeprom ar9300_h112 = { .thresh62 = 28, .papdRateMaskHt20 = LE32(0x0c80c080), .papdRateMaskHt40 = LE32(0x0080c080), + .switchcomspdt = 0, .xlna_bias_strength = 0, .futureModal = { 0, 0, 0, 0, 0, 0, 0,
@@ -1486,6 +1491,7 @@ static const struct ar9300_eeprom ar9300_h112 = { .thresh62 = 28, .papdRateMaskHt20 = LE32(0x0cf0e0e0), .papdRateMaskHt40 = LE32(0x6cf0e0e0), + .switchcomspdt = 0, .xlna_bias_strength = 0, .futureModal = { 0, 0, 0, 0, 0, 0, 0,
@@ -1861,6 +1867,7 @@ static const struct ar9300_eeprom ar9300_x112 = { .thresh62 = 28, .papdRateMaskHt20 = LE32(0x0c80c080), .papdRateMaskHt40 = LE32(0x0080c080), + .switchcomspdt = 0, .xlna_bias_strength = 0, .futureModal = { 0, 0, 0, 0, 0, 0, 0,
@@ -2063,6 +2070,7 @@ static const struct ar9300_eeprom ar9300_x112 = { .thresh62 = 28, .papdRateMaskHt20 = LE32(0x0cf0e0e0), .papdRateMaskHt40 = LE32(0x6cf0e0e0), + .switchcomspdt = 0, .xlna_bias_strength = 0, .futureModal = { 0, 0, 0, 0, 0, 0, 0,
@@ -2437,6 +2445,7 @@ static const struct ar9300_eeprom ar9300_h116 = { .thresh62 = 28, .papdRateMaskHt20 = LE32(0x0c80C080), .papdRateMaskHt40 = LE32(0x0080C080), + .switchcomspdt = 0, .xlna_bias_strength = 0, .futureModal = { 0, 0, 0, 0, 0, 0, 0,
@@ -2639,6 +2648,7 @@ static const struct ar9300_eeprom ar9300_h116 = { .thresh62 = 28, .papdRateMaskHt20 = LE32(0x0cf0e0e0), .papdRateMaskHt40 = LE32(0x6cf0e0e0), + .switchcomspdt = 0, .xlna_bias_strength = 0, .futureModal = { 0, 0, 0, 0, 0, 0, 0,
Signature · 1 line
1.8.5.1
PATCH v2 5/10 ath9k: Update BaseExtension_1 eeprom structure
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
* Add a new field "misc_enable"
* Use int_8 for tempslopextension.
--- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 10 +++++----- drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +5 -5
@@ -139,7 +139,7 @@ static const struct ar9300_eeprom ar9300_default = { }, .base_ext1 = { .ant_div_control = 0, - .future = {0, 0, 0}, + .future = {0, 0}, .tempslopextension = {0, 0, 0, 0, 0, 0, 0, 0} }, .calFreqPier2G = {
@@ -717,7 +717,7 @@ static const struct ar9300_eeprom ar9300_x113 = { }, .base_ext1 = { .ant_div_control = 0, - .future = {0, 0, 0}, + .future = {0, 0}, .tempslopextension = {0, 0, 0, 0, 0, 0, 0, 0} }, .calFreqPier2G = {
@@ -1296,7 +1296,7 @@ static const struct ar9300_eeprom ar9300_h112 = { }, .base_ext1 = { .ant_div_control = 0, - .future = {0, 0, 0}, + .future = {0, 0}, .tempslopextension = {0, 0, 0, 0, 0, 0, 0, 0} }, .calFreqPier2G = {
@@ -1875,7 +1875,7 @@ static const struct ar9300_eeprom ar9300_x112 = { }, .base_ext1 = { .ant_div_control = 0, - .future = {0, 0, 0}, + .future = {0, 0}, .tempslopextension = {0, 0, 0, 0, 0, 0, 0, 0} }, .calFreqPier2G = {
@@ -2453,7 +2453,7 @@ static const struct ar9300_eeprom ar9300_h116 = { }, .base_ext1 = { .ant_div_control = 0, - .future = {0, 0, 0}, + .future = {0, 0}, .tempslopextension = {0, 0, 0, 0, 0, 0, 0, 0} }, .calFreqPier2G = {
drivers/net/wireless/ath/ath9k/ar9003_eeprom.h +12 -2
@@ -270,10 +270,20 @@ struct cal_ctl_data_5g {u8 ctlEdges[AR9300_NUM_BAND_EDGES_5G ]; } __packed; +#define MAX_BASE_EXTENSION_FUTURE 2 +struct ar9300_BaseExtension_1 {u8 ant_div_control; -u8 future[3 ]; -u8 tempslopextension[8 ]; +u8 future[MAX_BASE_EXTENSION_FUTURE ]; +/* +* misc_enable: +* +* BIT 0 - TX Gain Cap enable. +* BIT 1 - Uncompressed Checksum enable. +* BIT 2/3 - MinCCApwr enable 2g/5g. +*/ +u8 misc_enable; +int8_t tempslopextension[8 ];int8_t quick_drop_low;int8_t quick_drop_high; } __packed;
Signature · 1 line
1.8.5.1
PATCH v2 6/10 ath9k: Fix regulatory compliance
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
To comply with ETSI regulations, make sure that the CCA registers are programmed with the threshold values from the EEPROM/Caldata. A new field is used to indicate if the card has been calibrated with the required threshold information.
--- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 32 ++++++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/ar9003_phy.h | 4 +++- 2 files changed, 35 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +32 -0
@@ -4121,6 +4121,37 @@ static void ar9003_hw_thermo_cal_apply(struct ath_hw *ah) } } +static void ar9003_hw_apply_minccapwr_thresh (struct ath_hw *ah, +bool is2ghz) +{ +struct ar9300_eeprom *eep = &ah->eeprom.ar9300_eep; +const u_int32_t cca_ctrl[AR9300_MAX_CHAINS ] = { +AR_PHY_CCA_CTRL_0 , +AR_PHY_CCA_CTRL_1 , +AR_PHY_CCA_CTRL_2 , + }; +int chain; +u32 val; + +if (is2ghz) { +if (!(eep->base_ext1.misc_enable &BIT (2 ))) +return ; + }else { +if (!(eep->base_ext1.misc_enable &BIT (3 ))) +return ; + } + +for (chain =0 ; chain <AR9300_MAX_CHAINS ; chain++) { +if (!(ah->caps.tx_chainmask &BIT (chain))) +continue ; + + val =ar9003_modal_header (ah, is2ghz)->noiseFloorThreshCh[chain]; +REG_RMW_FIELD (ah, cca_ctrl[chain], +AR_PHY_EXT_CCA0_THRESH62_1 , val); + } + +} +static void ath9k_hw_ar9300_set_board_values (struct ath_hw *ah,struct ath9k_channel *chan) {
@@ -4135,6 +4166,7 @@ static void ath9k_hw_ar9300_set_board_values(struct ath_hw *ah,if (!AR_SREV_9330 (ah) && !AR_SREV_9340 (ah))ar9003_hw_internal_regulator_apply (ah);ar9003_hw_apply_tuning_caps (ah); +ar9003_hw_apply_minccapwr_thresh (ah, chan);ar9003_hw_txend_to_xpa_off_apply (ah, is2ghz);ar9003_hw_thermometer_apply (ah);ar9003_hw_thermo_cal_apply (ah);
drivers/net/wireless/ath/ath9k/ar9003_phy.h +3 -1
@@ -270,7 +270,7 @@#define AR_PHY_AGC (AR_AGC_BASE + 0x14)#define AR_PHY_EXT_ATTEN_CTL_0 (AR_AGC_BASE + 0x18)#define AR_PHY_CCA_0 (AR_AGC_BASE + 0x1c) -#define AR_PHY_EXT_CCA0 (AR_AGC_BASE + 0x20) +#define AR_PHY_CCA_CTRL_0 (AR_AGC_BASE + 0x20)#define AR_PHY_RESTART (AR_AGC_BASE + 0x24)/*
@@ -398,6 +398,8 @@#define AR9280_PHY_CCA_THRESH62_S 12#define AR_PHY_EXT_CCA0_THRESH62 0x000000FF#define AR_PHY_EXT_CCA0_THRESH62_S 0 +#define AR_PHY_EXT_CCA0_THRESH62_1 0x000001FF +#define AR_PHY_EXT_CCA0_THRESH62_1_S 0#define AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK 0x0000003F#define AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK_S 0#define AR_PHY_CCK_DETECT_ANT_SWITCH_TIME 0x00001FC0
Signature · 1 line
1.8.5.1
PATCH v2 7/10 ath9k: Remove ath9k_hw_gettsf32()
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
It is unnecessary and the value is just a simple,
direct register read.
--- drivers/net/wireless/ath/ath9k/ar9003_mci.c | 2 +- drivers/net/wireless/ath/ath9k/hw.c | 10 ---------- drivers/net/wireless/ath/ath9k/hw.h | 1 - 3 files changed, 1 insertion(+), 12 deletions(-)
drivers/net/wireless/ath/ath9k/ar9003_mci.c +1 -1
@@ -1263,7 +1263,7 @@ u32 ar9003_mci_state(struct ath_hw *ah, u32 state_type)ar9003_mci_send_coex_bt_status_query (ah, true, query_type);break ;case MCI_STATE_RECOVER_RX : - tsf =ath9k_hw_gettsf32 (ah); + tsf =REG_READ (ah,AR_TSF_L32 );if ((tsf - mci->last_recovery) <=MCI_RECOVERY_DUR_TSF ) {ath_dbg (ath9k_hw_common (ah),MCI ,"(MCI) ignore Rx recovery\n" );
drivers/net/wireless/ath/ath9k/hw.c +0 -10
@@ -2973,12 +2973,6 @@ static const struct ath_gen_timer_configuration gen_tmr_configuration[] =/* HW generic timer primitives */ -u32 ath9k_hw_gettsf32 (struct ath_hw *ah) -{ -return REG_READ (ah,AR_TSF_L32 ); -} -EXPORT_SYMBOL (ath9k_hw_gettsf32); - struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah, void (*trigger)(void *), void (*overflow)(void *),
@@ -3137,10 +3131,6 @@ void ath_gen_timer_isr(struct ath_hw *ah) }EXPORT_SYMBOL (ath_gen_timer_isr); -/********/ -/* HTC */ -/********/ - static struct { u32 version; const char * name;
drivers/net/wireless/ath/ath9k/hw.h +0 -1
@@ -978,7 +978,6 @@ void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test);void ath9k_hw_setopmode (struct ath_hw *ah);void ath9k_hw_setmcastfilter (struct ath_hw *ah,u32 filter0,u32 filter1);void ath9k_hw_write_associd (struct ath_hw *ah); -u32 ath9k_hw_gettsf32 (struct ath_hw *ah);u64 ath9k_hw_gettsf64 (struct ath_hw *ah);void ath9k_hw_settsf64 (struct ath_hw *ah,u64 tsf64);void ath9k_hw_reset_tsf (struct ath_hw *ah);
Signature · 1 line
1.8.5.1
Re: [PATCH v2 07/10] ath9k: Remove ath9k_hw_gettsf32()
Quoted 6 lines · Sujith Manoharan
From: Sujith Manoharan <[email protected]>
It is unnecessary and the value is just a simple,
direct register read.Signed-off-by Sujith Manoharan <[email protected]>
I'm using this function in my work-in-progress patches for p2p multichannel.
Should I switch to using REG_READ in the driver or would you prefer to drop this patch instead?
- Felix
Re: [PATCH v2 07/10] ath9k: Remove ath9k_hw_gettsf32()
Quoted 4 lines · Felix Fietkau
I'm using this function in my work-in-progress patches for p2p multichannel.
Should I switch to usingREG_READin the driver or would you prefer to drop this patch instead?
We can drop this patch. I can send it after the p2p work is done.
Jphn, please drop this patch from the series.
Sujith
PATCH v2 8/10 ath9k: Add a delay between RTC reset/clear for AR9003
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
The small delay that is present between a RTC reset/clear operation is required for the chip to settle and this is needed for all chips, not just the AR9002 family.
--- drivers/net/wireless/ath/ath9k/hw.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +1 -2
@@ -1399,8 +1399,7 @@ static bool ath9k_hw_set_reset_power_on(struct ath_hw *ah)REGWRITE_BUFFER_FLUSH (ah); -if (!AR_SREV_9300_20_OR_LATER (ah)) -udelay (2 ); +udelay (2 );if (!AR_SREV_9100 (ah) && !AR_SREV_9300_20_OR_LATER (ah))REG_WRITE (ah,AR_RC ,0 );
Signature · 1 line
1.8.5.1
PATCH v2 9/10 ath9k: Fix RTC reset delay
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
The delay that is required after issuing a RTC reset varies for each chip. Handle this properly.
--- drivers/net/wireless/ath/ath9k/hw.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/hw.c +6 -1
@@ -1363,7 +1363,12 @@ static bool ath9k_hw_set_reset(struct ath_hw *ah, int type)REGWRITE_BUFFER_FLUSH (ah); -udelay (50 ); +if (AR_SREV_9300_20_OR_LATER (ah)) +udelay (50 ); +else if (AR_SREV_9100 (ah)) +udelay (10000 ); +else +udelay (100 );REG_WRITE (ah,AR_RTC_RC ,0 );if (!ath9k_hw_wait (ah,AR_RTC_RC ,AR_RTC_RC_M ,0 ,AH_WAIT_TIMEOUT )) {
Signature · 1 line
1.8.5.1
PATCH v2 10/10 ath9k: Use a subroutine for the AR9330 reset WAR
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/hw.c | 70 +++++++++++++++++++---------------- drivers/net/wireless/ath/ath9k/init.c | 1 - 2 files changed, 38 insertions(+), 33 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +38 -32
@@ -1272,6 +1272,42 @@ void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled, *coef_exponent = coef_exp -16 ; } +/* AR9330 WAR: +* call external reset function to reset WMAC if: +* - doing a cold reset +* - we have pending frames in the TX queues. +*/ +static bool ath9k_hw_ar9330_reset_war (struct ath_hw *ah,int type) +{ +int i, npend =0 ; + +for (i =0 ; i <AR_NUM_QCU ; i++) { + npend =ath9k_hw_numtxpending (ah, i); +if (npend) +break ; + } + +if (ah->external_reset && + (npend || type ==ATH9K_RESET_COLD )) { +int reset_err =0 ; + +ath_dbg (ath9k_hw_common (ah),RESET , +"reset MAC via external reset\n" ); + + reset_err = ah->external_reset (); +if (reset_err) { +ath_err (ath9k_hw_common (ah), +"External reset failed, err=%d\n" , + reset_err); +return false; + } + +REG_WRITE (ah,AR_RTC_RESET ,1 ); + } + +return true; +} +static bool ath9k_hw_set_reset (struct ath_hw *ah,int type) {u32 rst_flags;
@@ -1322,38 +1358,8 @@ static bool ath9k_hw_set_reset(struct ath_hw *ah, int type) }if (AR_SREV_9330 (ah)) { -int npend =0 ; -int i; - -/* AR9330 WAR: -* call external reset function to reset WMAC if: -* - doing a cold reset -* - we have pending frames in the TX queues -*/ - -for (i =0 ; i <AR_NUM_QCU ; i++) { - npend =ath9k_hw_numtxpending (ah, i); -if (npend) -break ; - } - -if (ah->external_reset && - (npend || type ==ATH9K_RESET_COLD )) { -int reset_err =0 ; - -ath_dbg (ath9k_hw_common (ah),RESET , -"reset MAC via external reset\n" ); - - reset_err = ah->external_reset (); -if (reset_err) { -ath_err (ath9k_hw_common (ah), -"External reset failed, err=%d\n" , - reset_err); -return false; - } - -REG_WRITE (ah,AR_RTC_RESET ,1 ); - } +if (!ath9k_hw_ar9330_reset_war (ah, type)) +return false; }if (ath9k_hw_mci_is_enabled (ah))
drivers/net/wireless/ath/ath9k/init.c +0 -1
@@ -470,7 +470,6 @@ static int ath9k_init_queues(struct ath_softc *sc) sc->beacon.beaconq =ath9k_hw_beaconq_setup (sc->sc_ah); sc->beacon.cabq =ath_txq_setup (sc,ATH9K_TX_QUEUE_CAB ,0 ); -ath_cabq_update (sc); sc->tx.uapsdq =ath_txq_setup (sc,ATH9K_TX_QUEUE_UAPSD ,0 );
Signature · 1 line
1.8.5.1