Commit graph

20 commits

Author SHA1 Message Date
Arnd Bergmann 72569b7be4 ath9k: fix RX_STAT_INC() etc macros
A couple of macros that deal with statistics in ath9k rely on the
declaration of the 'sc' variable, which they dereference.

However, when the statistics are disabled, the new instance in
ath_cmn_process_fft() causes a warning for an unused variable:

drivers/net/wireless/ath/ath9k/common-spectral.c: In function 'ath_cmn_process_fft':
drivers/net/wireless/ath/ath9k/common-spectral.c:474:20: error: unused variable 'sc' [-Werror=unused-variable]

It's better if those macros only operate on their arguments instead of
known variable names, and adding a cast to (void) kills off that warning.

Fixes: 03224678c0 ("ath9k: add counters for good and errorneous FFT/spectral frames")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-10-13 20:27:35 +03:00
Felix Fietkau e45e91d881 ath9k: add support for reporting per-chain signal strength
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18 15:23:19 -05:00
Sujith Manoharan f96bd2ad22 ath9k: Add support for AR9565 v1.0.1 LNA diversity
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-09-26 15:13:28 -04:00
Sujith Manoharan 047dc3ac88 ath9k: Remove ath_ant_comb_update()
During a HW reset, the diversity config is programmed
in the set_board_values() eeprom callback, there is no
need to do it again by calling ath_ant_comb_update().

Fixed antenna support is not fully handled for 1-stream
cards, it can be done later.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-05 14:52:45 -04:00
Sujith Manoharan d8d7744b72 ath9k: Rename ath9k_hw_antctrl_shared_chain_lnadiv
Use "ath9k_hw_set_bt_ant_diversity" instead.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-05 14:52:42 -04:00
Sujith Manoharan 6308130542 ath9k: Cleanup WLAN/BT RX diversity
For single-chain WLAN+BT cards, the BT antenna can be used for
WLAN RX when the BT interface is disabled. Rename the modparam
"antenna_diversity" to "bt_ant_diversity" to clarify this.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-05 14:52:42 -04:00
Sujith Manoharan 3afa6b4f54 ath9k: Fix antenna diversity for CUS198
CUS198/CUS230 need a few tweaks in the antenna diversity
algorithm to accomodate RSSI variation. Add a couple
of knobs to control low RSSI threshold and fast antenna
diversity bias values.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-05 14:52:41 -04:00
Sujith Manoharan fd7f838731 ath9k: Add information about antenna diversity
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-05 14:52:40 -04:00
Sujith Manoharan e3d5291436 ath9k: Add statistics for antenna diversity
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-01 15:52:05 -04:00
Sujith Manoharan 37133002f5 ath9k: Use a subroutine to calculate ALT ratio
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-01 15:52:05 -04:00
Sujith Manoharan 9ddf030179 ath9k: Simplify checks in quick_scan
There is a function to do a ratio comparison for ALT,
so make use of it.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-01 15:52:05 -04:00
Sujith Manoharan 5f800ffbbb ath9k: Use a helper function for checking LNA options
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-01 15:52:05 -04:00
Sujith Manoharan ef999114ee ath9k: Use a subroutine to try LNA switch
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-01 15:52:04 -04:00
Sujith Manoharan 552bde40dd ath9k: Add ALT check for cards with GROUP-3 config
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-01 15:52:04 -04:00
Sujith Manoharan 9383be4204 ath9k: Use a subroutine to check for short scan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-01 15:52:04 -04:00
Sujith Manoharan 3fbaf4c55b ath9k: Do a quick scan only when scan_not_start is true
Right now, it is being done for all cases.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-01 15:52:04 -04:00
Sujith Manoharan e09f2dc73c ath9k: Add a module parameter to enable diversity
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-24 14:59:11 -04:00
Sujith Manoharan 5317c9c3e9 ath9k_hw: Add antenna diversity group for AR9565
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-24 14:59:11 -04:00
Sujith Manoharan d85ed4196e ath9k: Remove redundant variable assignment
Set main_gaintb and alt_gaintb once instead of zero'ing them
in every case.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-24 14:59:10 -04:00
Sujith Manoharan 8da07830e1 ath9k: Move LNA code to antenna.c
And use a helper function to setup antennae after a reset.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-06 15:20:31 -04:00