ath9k: Remove unused functions
PATCH 1/7 ath9k: Remove unused functions
From: Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/hw.c | 12 ------------ 1 file changed, 12 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +0 -12
@@ -37,18 +37,6 @@ MODULE_DESCRIPTION("Support for Atheros 802.11n wireless LAN cards.");MODULE_SUPPORTED_DEVICE ("Atheros 802.11n WLAN cards" );MODULE_LICENSE ("Dual BSD/GPL" ); -static int __init ath9k_init (void ) -{ -return 0 ; -} -module_init (ath9k_init); - -static void __exit ath9k_exit(void) -{ -return ; -} -module_exit (ath9k_exit); -/* Private hardware callbacks */ static void ath9k_hw_init_cal_settings (struct ath_hw *ah)
Signature · 1 line
1.8.5.2
PATCH 2/7 ath9k: Move private HW callbacks to hw-ops.h
From: Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/hw-ops.h | 27 +++++++++++++++++++++++ drivers/net/wireless/ath/ath9k/hw.c | 39 --------------------------------- 2 files changed, 27 insertions(+), 39 deletions(-)
drivers/net/wireless/ath/ath9k/hw-ops.h +27 -0
@@ -247,4 +247,31 @@ static inline void ath9k_hw_set_radar_params(struct ath_hw *ah)ath9k_hw_private_ops (ah)->set_radar_params (ah, &ah->radar_conf); } +static inline void ath9k_hw_init_cal_settings (struct ath_hw *ah) +{ +ath9k_hw_private_ops (ah)->init_cal_settings (ah); +} + +static inline u32 ath9k_hw_compute_pll_control (struct ath_hw *ah, +struct ath9k_channel *chan) +{ +return ath9k_hw_private_ops (ah)->compute_pll_control (ah, chan); +} + +static inline void ath9k_hw_init_mode_gain_regs (struct ath_hw *ah) +{ +if (!ath9k_hw_private_ops (ah)->init_mode_gain_regs) +return ; + +ath9k_hw_private_ops (ah)->init_mode_gain_regs (ah); +} + +static inline void ath9k_hw_ani_cache_ini_regs (struct ath_hw *ah) +{ +if (!ath9k_hw_private_ops (ah)->ani_cache_ini_regs) +return ; + +ath9k_hw_private_ops (ah)->ani_cache_ini_regs (ah); +} +#endif /* ATH9K_HW_OPS_H */
drivers/net/wireless/ath/ath9k/hw.c +0 -39
@@ -37,45 +37,6 @@ MODULE_DESCRIPTION("Support for Atheros 802.11n wireless LAN cards.");MODULE_SUPPORTED_DEVICE ("Atheros 802.11n WLAN cards" );MODULE_LICENSE ("Dual BSD/GPL" ); -/* Private hardware callbacks */ - -static void ath9k_hw_init_cal_settings (struct ath_hw *ah) -{ -ath9k_hw_private_ops (ah)->init_cal_settings (ah); -} - -static u32 ath9k_hw_compute_pll_control (struct ath_hw *ah, -struct ath9k_channel *chan) -{ -return ath9k_hw_private_ops (ah)->compute_pll_control (ah, chan); -} - -static void ath9k_hw_init_mode_gain_regs (struct ath_hw *ah) -{ -if (!ath9k_hw_private_ops (ah)->init_mode_gain_regs) -return ; - -ath9k_hw_private_ops (ah)->init_mode_gain_regs (ah); -} - -static void ath9k_hw_ani_cache_ini_regs (struct ath_hw *ah) -{ -/* You will not have this callback if using the old ANI */ -if (!ath9k_hw_private_ops (ah)->ani_cache_ini_regs) -return ; - -ath9k_hw_private_ops (ah)->ani_cache_ini_regs (ah); -} - -/********************/ -/* Helper Functions */ -/********************/ - -#ifdef CONFIG_ATH9K_DEBUGFS - -#endif - -static void ath9k_hw_set_clockrate (struct ath_hw *ah) {struct ath_common *common =ath9k_hw_common (ah);
Signature · 1 line
1.8.5.2
PATCH 3/7 ath9k: Handle unsupported MAC versions early
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
There is no point in trying to bring up the chip when the MAC version is not present in the supported list.
--- drivers/net/wireless/ath/ath9k/hw.c | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +24 -24
@@ -474,6 +474,30 @@ static int __ath9k_hw_init(struct ath_hw *ah)ath9k_hw_read_revisions (ah); +switch (ah->hw_version.macVersion) { +case AR_SREV_VERSION_5416_PCI : +case AR_SREV_VERSION_5416_PCIE : +case AR_SREV_VERSION_9160 : +case AR_SREV_VERSION_9100 : +case AR_SREV_VERSION_9280 : +case AR_SREV_VERSION_9285 : +case AR_SREV_VERSION_9287 : +case AR_SREV_VERSION_9271 : +case AR_SREV_VERSION_9300 : +case AR_SREV_VERSION_9330 : +case AR_SREV_VERSION_9485 : +case AR_SREV_VERSION_9340 : +case AR_SREV_VERSION_9462 : +case AR_SREV_VERSION_9550 : +case AR_SREV_VERSION_9565 : +break ; +default : +ath_err (common, +"Mac Chip Rev 0x%02x.%x is not supported by this driver\n" , + ah->hw_version.macVersion, ah->hw_version.macRev); +return -EOPNOTSUPP ; + } +/* * Read back AR_WA into a permanent copy and set bits 14 and 17. * We need to do this to avoid RMW of this register. We cannot
@@ -527,30 +551,6 @@ static int __ath9k_hw_init(struct ath_hw *ah)else ah->config.max_txtrig_level =MAX_TX_FIFO_THRESHOLD ; -switch (ah->hw_version.macVersion) { -case AR_SREV_VERSION_5416_PCI : -case AR_SREV_VERSION_5416_PCIE : -case AR_SREV_VERSION_9160 : -case AR_SREV_VERSION_9100 : -case AR_SREV_VERSION_9280 : -case AR_SREV_VERSION_9285 : -case AR_SREV_VERSION_9287 : -case AR_SREV_VERSION_9271 : -case AR_SREV_VERSION_9300 : -case AR_SREV_VERSION_9330 : -case AR_SREV_VERSION_9485 : -case AR_SREV_VERSION_9340 : -case AR_SREV_VERSION_9462 : -case AR_SREV_VERSION_9550 : -case AR_SREV_VERSION_9565 : -break ; -default : -ath_err (common, -"Mac Chip Rev 0x%02x.%x is not supported by this driver\n" , - ah->hw_version.macVersion, ah->hw_version.macRev); -return -EOPNOTSUPP ; - } -if (AR_SREV_9271 (ah) ||AR_SREV_9100 (ah) ||AR_SREV_9340 (ah) ||AR_SREV_9330 (ah) ||AR_SREV_9550 (ah)) ah->is_pciexpress = false;
Signature · 1 line
1.8.5.2
PATCH 4/7 ath9k: Cleanup __ath9k_hw_init()
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
* Move initialization of config variables to
ath9k_hw_init_config().
* Move initialization of defaults to ath9k_hw_init_defaults().
--- drivers/net/wireless/ath/ath9k/hw.c | 64 ++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +32 -32
@@ -346,6 +346,8 @@ static bool ath9k_hw_chip_test(struct ath_hw *ah)static void ath9k_hw_init_config (struct ath_hw *ah) { +struct ath_common *common =ath9k_hw_common (ah); + ah->config.dma_beacon_response_time =1 ; ah->config.sw_beacon_response_time =6 ; ah->config.ack_6mb =0x0 ;
@@ -372,6 +374,24 @@ static void ath9k_hw_init_config(struct ath_hw *ah)*/ if (num_possible_cpus () >1 ) ah->config.serialize_regmode =SER_REG_MODE_AUTO ; + +if (NR_CPUS >1 && ah->config.serialize_regmode ==SER_REG_MODE_AUTO ) { +if (ah->hw_version.macVersion ==AR_SREV_VERSION_5416_PCI || + ((AR_SREV_9160 (ah) ||AR_SREV_9280 (ah) ||AR_SREV_9287 (ah)) && + !ah->is_pciexpress)) { + ah->config.serialize_regmode =SER_REG_MODE_ON ; + }else { + ah->config.serialize_regmode =SER_REG_MODE_OFF ; + } + } + +ath_dbg (common,RESET ,"serialize_regmode is %d\n" , + ah->config.serialize_regmode); + +if (AR_SREV_9285 (ah) ||AR_SREV_9271 (ah)) + ah->config.max_txtrig_level =MAX_TX_FIFO_THRESHOLD >>1 ; +else + ah->config.max_txtrig_level =MAX_TX_FIFO_THRESHOLD ; }static void ath9k_hw_init_defaults (struct ath_hw *ah)
@@ -384,15 +404,24 @@ static void ath9k_hw_init_defaults(struct ath_hw *ah) ah->hw_version.magic =AR5416_MAGIC ; ah->hw_version.subvendorid =0 ; - ah->sta_id1_defaults = -AR_STA_ID1_CRPT_MIC_ENABLE | -AR_STA_ID1_MCAST_KSRCH ; + ah->sta_id1_defaults =AR_STA_ID1_CRPT_MIC_ENABLE | +AR_STA_ID1_MCAST_KSRCH ;if (AR_SREV_9100 (ah)) ah->sta_id1_defaults |=AR_STA_ID1_AR9100_BA_FIX ; + ah->slottime =ATH9K_SLOT_TIME_9 ; ah->globaltxtimeout = (u32) -1 ; ah->power_mode =ATH9K_PM_UNDEFINED ; ah->htc_reset_init = true; + + ah->ani_function =ATH9K_ANI_ALL ; +if (!AR_SREV_9300_20_OR_LATER (ah)) + ah->ani_function &= ~ATH9K_ANI_MRC_CCK ; + +if (AR_SREV_9285 (ah) ||AR_SREV_9271 (ah)) + ah->tx_trig_level = (AR_FTRIG_256B >>AR_FTRIG_S ); +else + ah->tx_trig_level = (AR_FTRIG_512B >>AR_FTRIG_S ); }static int ath9k_hw_init_macaddr (struct ath_hw *ah)
@@ -531,26 +560,6 @@ static int __ath9k_hw_init(struct ath_hw *ah)return -EIO ; } -if (NR_CPUS >1 && ah->config.serialize_regmode ==SER_REG_MODE_AUTO ) { -if (ah->hw_version.macVersion ==AR_SREV_VERSION_5416_PCI || - ((AR_SREV_9160 (ah) ||AR_SREV_9280 (ah) ||AR_SREV_9287 (ah)) && - !ah->is_pciexpress)) { - ah->config.serialize_regmode = -SER_REG_MODE_ON ; - }else { - ah->config.serialize_regmode = -SER_REG_MODE_OFF ; - } - } - -ath_dbg (common,RESET ,"serialize_regmode is %d\n" , - ah->config.serialize_regmode); - -if (AR_SREV_9285 (ah) ||AR_SREV_9271 (ah)) - ah->config.max_txtrig_level =MAX_TX_FIFO_THRESHOLD >>1 ; -else - ah->config.max_txtrig_level =MAX_TX_FIFO_THRESHOLD ; -if (AR_SREV_9271 (ah) ||AR_SREV_9100 (ah) ||AR_SREV_9340 (ah) ||AR_SREV_9330 (ah) ||AR_SREV_9550 (ah)) ah->is_pciexpress = false;
@@ -558,10 +567,6 @@ static int __ath9k_hw_init(struct ath_hw *ah) ah->hw_version.phyRev =REG_READ (ah,AR_PHY_CHIP_ID );ath9k_hw_init_cal_settings (ah); - ah->ani_function =ATH9K_ANI_ALL ; -if (!AR_SREV_9300_20_OR_LATER (ah)) - ah->ani_function &= ~ATH9K_ANI_MRC_CCK ; -if (!ah->is_pciexpress)ath9k_hw_disablepcie (ah);
@@ -580,11 +585,6 @@ static int __ath9k_hw_init(struct ath_hw *ah)return r; } -if (AR_SREV_9285 (ah) ||AR_SREV_9271 (ah)) - ah->tx_trig_level = (AR_FTRIG_256B >>AR_FTRIG_S ); -else - ah->tx_trig_level = (AR_FTRIG_512B >>AR_FTRIG_S ); -ath9k_hw_init_hang_checks (ah); common->state =ATH_HW_INITIALIZED ;
Signature · 1 line
1.8.5.2
PATCH 5/7 ath9k: Fix AR9100 chip power-on
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
AR9100 requires a larger delay after waking up
the RTC.
--- drivers/net/wireless/ath/ath9k/hw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/hw.c +5 -1
@@ -2012,7 +2012,11 @@ static bool ath9k_hw_set_power_awake(struct ath_hw *ah)REG_SET_BIT (ah,AR_RTC_FORCE_WAKE ,AR_RTC_FORCE_WAKE_EN ); -udelay (50 ); + +if (AR_SREV_9100 (ah)) +udelay (10000 ); +else +udelay (50 );for (i =POWER_UP_TIME /50 ; i >0 ; i--) { val =REG_READ (ah,AR_RTC_STATUS ) &AR_RTC_STATUS_M ;
Signature · 1 line
1.8.5.2
PATCH 6/7 ath9k: Remove unused config option ack_6mb
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
--- drivers/net/wireless/ath/ath9k/hw.c | 2 -- drivers/net/wireless/ath/ath9k/hw.h | 1 - 2 files changed, 3 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +0 -2
@@ -350,7 +350,6 @@ static void ath9k_hw_init_config(struct ath_hw *ah) ah->config.dma_beacon_response_time =1 ; ah->config.sw_beacon_response_time =6 ; - ah->config.ack_6mb =0x0 ; ah->config.cwm_ignore_extcca =0 ; ah->config.analog_shiftreg =1 ;
@@ -1552,7 +1551,6 @@ static void ath9k_hw_reset_opmode(struct ath_hw *ah,REG_RMW (ah,AR_STA_ID1 , macStaId1 |AR_STA_ID1_RTS_USE_DEF - | (ah->config.ack_6mb ?AR_STA_ID1_ACKCTS_6MB :0 ) | ah->sta_id1_defaults, ~AR_STA_ID1_SADH_MASK );ath_hw_setbssidmask (common);
drivers/net/wireless/ath/ath9k/hw.h +0 -1
@@ -295,7 +295,6 @@ enum ath9k_hw_hang_checks {struct ath9k_ops_config {int dma_beacon_response_time;int sw_beacon_response_time; -int ack_6mb;u32 cwm_ignore_extcca;u32 pcie_waen;u8 analog_shiftreg;
Signature · 1 line
1.8.5.2
PATCH 7/7 ath9k: Fix interrupt statistics
In reply to Sujith ManoharanFrom: Sujith Manoharan <[email protected]>
Initialize "sync_cause" to zero since commit "ath9k: move ath9k_debug_sync_cause out of ath9k_hw" fills it conditionally based on ISR status. Not doing this results in garbage values in debugfs.
--- drivers/net/wireless/ath/ath9k/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/main.c +1 -1
@@ -544,7 +544,7 @@ irqreturn_t ath_isr(int irq, void *dev)struct ath_hw *ah = sc->sc_ah;struct ath_common *common =ath9k_hw_common (ah);enum ath9k_int status; -u32 sync_cause; +u32 sync_cause =0 ;bool sched = false;/*
Signature · 1 line
1.8.5.2