summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath9k/hw.h
AgeCommit message (Collapse)Author
2016-10-13Revert "ath9k_hw: implement temperature compensation support for AR9003+"Felix Fietkau
This reverts commit 171f6402e4aa ("ath9k_hw: implement temperature compensation support for AR9003+"). Some users report that this commit causes a regression in performance under some conditions. Fixes: 171f6402e4aa ("ath9k_hw: implement temperature compensation support for AR9003+") Cc: <stable@vger.kernel.org> # 4.8 Signed-off-by: Felix Fietkau <nbd@nbd.name> [kvalo@qca.qualcomm.com: improve commit log] Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-07-19ath9k_hw: implement temperature compensation support for AR9003+Felix Fietkau
Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-03-11ath9k: make GPIO API to support both of WMAC and SOCMiaoqing Pan
commit 61b559dea40e ("ath9k: add extra GPIO led support") added ath9k to support access SOC's GPIOs, but implemented in a separated API: ath9k_hw_request_gpio(). So this patch make the APIs more common, to support both of WMAC and SOC GPIOs. The new APIs as below, void ath9k_hw_gpio_request_in(); void ath9k_hw_gpio_request_out(); void ath9k_hw_gpio_free(); NOTE, the BSP of the SOC chips(AR9340, AR9531, AR9550, AR9561) should set the corresponding MUX registers correctly. Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-03-11ath9k: define correct GPIO numbers and bits maskMiaoqing Pan
Define correct GPIO numbers and MASK bits to indicate the WMAC GPIO resource. Allow SOC chips(AR9340, AR9531, AR9550, AR9561) to access all GPIOs which rely on gpiolib framework. But restrict SOC AR9330 only to access WMAC GPIO which has the same design with the old chips. Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-11-05Merge tag 'driver-core-4.4-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core Pull driver core updates from Greg KH: "Here's the "big" driver core updates for 4.4-rc1. Primarily a bunch of debugfs updates, with a smattering of minor driver core fixes and updates as well. All have been in linux-next for a long time" * tag 'driver-core-4.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: debugfs: Add debugfs_create_ulong() of: to support binding numa node to specified device in devicetree debugfs: Add read-only/write-only bool file ops debugfs: Add read-only/write-only size_t file ops debugfs: Add read-only/write-only x64 file ops debugfs: Consolidate file mode checks in debugfs_create_*() Revert "mm: Check if section present during memory block (un)registering" driver-core: platform: Provide helpers for multi-driver modules mm: Check if section present during memory block (un)registering devres: fix a for loop bounds check CMA: fix CONFIG_CMA_SIZE_MBYTES overflow in 64bit base/platform: assert that dev_pm_domain callbacks are called unconditionally sysfs: correctly handle short reads on PREALLOC attrs. base: soc: siplify ida usage kobject: move EXPORT_SYMBOL() macros next to corresponding definitions kobject: explain what kobject's sd field is debugfs: document that debugfs_remove*() accepts NULL and error values debugfs: Pass bool pointer to debugfs_create_bool() ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'
2015-10-14ath9k: rename ini_modes_rxgain_5g_xlna to ini_modes_rxgain_xlnaMiaoqing Pan
rename the variable as preparation for using the array with 2.4 GHz band, etc. Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-10-04debugfs: Pass bool pointer to debugfs_create_bool()Viresh Kumar
Its a bit odd that debugfs_create_bool() takes 'u32 *' as an argument, when all it needs is a boolean pointer. It would be better to update this API to make it accept 'bool *' instead, as that will make it more consistent and often more convenient. Over that bool takes just a byte. That required updates to all user sites as well, in the same commit updating the API. regmap core was also using debugfs_{read|write}_file_bool(), directly and variable types were updated for that to be bool as well. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Mark Brown <broonie@kernel.org> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-26ath9k: split ar5008_hw_spur_mitigate and reuse common code in ↵Oleksij Rempel
ar9002_hw_spur_mitigate. [ar5008 and ar9002]_hw_spur_mitigate have big portion of identical code. This patch will move common part of ar5008_hw_spur_mitigate to ar5008_hw_cmn_spur_mitigate and reuse it in ar9002_hw_spur_mitigate. As noticed by Joe Perches I reuse ar9002_hw_spur_mitigate (const) version of declarations for pilot_mask_reg and chan_mask_reg. There should be no other difference with original code. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-04-07ath9k: add extra GPIO led supportMiaoqing Pan
ar9550 or later chips, the AR_GPIO_IN_OUT register only can control GPIO[0:3]. For the extra GPIO, use standard GPIO calls instead of WMAC internal registers. Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-03-30ath9k: add new function ath9k_hw_read_arrayOleksij Rempel
REG_READ generate most overhead on usb bus. It send and read micro packages and reduce usb bandwidth. To reduce this overhead we should read in batches. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-03-30ath9k_htc: add new WMI_REG_RMW_CMDID commandOleksij Rempel
Since usb bus add extra delay on each request, a command with read + write requests is too expensive. We can dramtically reduce usb load by moving this command to firmware. In my tests, this patch will reduce channel scan time for about 5-10 seconds. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-03-21ath9k: Fix AIC compilation errorSujith Manoharan
AIC needs to be registered only when BTCOEX is enabled. This fixes the error reported by kbuild: >> ERROR: "ar9003_hw_attach_aic_ops" [drivers/net/wireless/ath/ath9k/ath9k_hw.ko] undefined! Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-03-20ath9k: Register private AIC opsSujith Manoharan
AIC can be disabled or enabled on a per-card basis using MCI configuration, so register a function to check its status. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-03-13ath9k: Initialize pll_pwrsave for AR9462/AR9565Sujith Manoharan
Cards based on AR9462/AR9565 support more PCIE power save mechanisms, so register them correctly. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-03-13ath9k: Fix PLL powersave for AR9485Sujith Manoharan
Use the value in ah->config.pll_pwrsave to determine which array needs to be loaded. Also, initialize pll_pwrsave to 1 by default. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-03-13ath9k: Add PCIE powersave macrosSujith Manoharan
These will be used to handle chip-specific power save configuration. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-03-03ath9k: Move MCI registers to reg_mci.hSujith Manoharan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-02-06ath9k: Fix issues with WoW enableSujith Manoharan
This patch addresses several issues with the ath9k_hw_wow_enable() routine: * The usage of set/clr variables is removed. Writing the required values to registers is cleaner. * The shift value of 28 for the contention window field in AR_WOW_PATTERN is incorrect, change it to 27. * Disabling Keep Alive needs to be done based on the LINK_CHANGE option. This is done unconditionally now, fix this. * The workaround for the D1/D3 issue is required only for AR9462. * The bitfield for enabling pattern matching for packets less than 256 bytes has expanded for new chips, handle this accordingly. * General cleanup. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-02-06ath9k: Add support for more WOW patternsSujith Manoharan
Newer chips like WB222, WB335 support more than 8 user-configurable patterns. This patch adds support for it by setting up the correct HW registers. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-02-03ath9k: Fix max pattern checkSujith Manoharan
Since the maximum number of configurable patterns is chip-specific, use the HW capability instead of a fixed value for checking if a free pattern slot is available. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-02-03ath9k: Register max WOW patternsSujith Manoharan
Since the number of patterns that can be configured in the HW is higher for newer chips, store the chip-specific value in ath9k_hw_wow. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-02-03ath9k: Add a HW structure for WOWSujith Manoharan
This can be used to hold the WOW state in ath9k_hw. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-02-03ath9k: Remove ath9k_hw_wow_event_to_stringSujith Manoharan
Printing the value of the wakeup status is sufficient. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-02-03ath9k: Remove ATH9K_HW_WOW_DEVICE_CAPABLESujith Manoharan
Enabling WOW based on the chip is incorrect since it needs to be done for specific sub-devices which have proper platform support. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15ath9k: add power per-rate tables for AR9002 chipsLorenzo Bianconi
Add TX power per-rate tables for MIMO/legacy modes for AR9002 based chips in order to cap the maximum TX power value per-rate in the TX descriptor path. Add TX power adjustments for HT40 mode, open loop CCK rates and eeprom power bias for AR9280 and later chips Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-01-15ath9k: Add HW IDs for QCA956xMiaoqing Pan
Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-12-01ath9k: fix BE/BK queue orderFelix Fietkau
Hardware queues are ordered by priority. Use queue index 0 for BK, which has lower priority than BE. Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-25ath9k: add TX power per-rate tablesLorenzo Bianconi
Add TX power per-rate tables for different MIMO modes (e.g STBC) in order to cap the maximum TX power value per-rate in the TX descriptor path. Cap TX power for self generated frames (ACK, RTS/CTS). Currently TPC is supported just by AR9003 based chips Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-17ath9k: Store the chip chainmask in HW capabilitiesSujith Manoharan
Cc: Miaoqing Pan <miaoqing@qca.qualcomm.com> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-17ath9k: Enable TSF2 for generic HW timersSujith Manoharan
The base TSF is used for HW timers 0..7, but chips in the AR9003 family and above can support more generic timers. To use them, however, a second HW TSF needs to be enabled. This patch allows usage of the extra timers by starting the second TSF properly. The extra set of HW timers is apparently also present in AR9287, but we enable it only for the AR9003 family. Cc: Kobi Cohen-Arazi <kobic@qti.qualcomm.com> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-17ath9k: Fix LED configurationSujith Manoharan
On some x86 platforms, the LED gpio is active high instead of active low. Identify such cards and modify the GPIO usage to make sure LED works properly. Cc: Russell Hu <rhu@qca.qualcomm.com> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-11-17ath9k|ath9k_htc: Seperate the software crypto flag for Tx and RxChun-Yeow Yeoh
Use the sw_mgmt_crypto_tx flag to trigger the CCMP encryption for transmitted management frames to be done in software while the sw_mgmt_crypto_rx flag is used to trigger the CCMP decryption for received management frames to be done in software. Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27ath9k: allow disabling bands via platform dataFelix Fietkau
Some devices have multiple bands enables in the EEPROM data, even though they are only calibrated for one. Allow platform data to disable unsupported bands. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27ath9k: add support for endian swap of eeprom from platform dataFelix Fietkau
On some devices (especially little-endian ones), the flash EEPROM data has a different endian, which needs to be detected. Add a flag to the platform data to allow overriding that behavior Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27ath9k: restart hardware after noise floor calibration failureFelix Fietkau
When NF calibration fails, the radio often becomes deaf. The usual hardware hang checks do not detect this, so it's better to issue a reset when that happens. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-10-27ath9k_hw: make support for PC-OEM cards optionalFelix Fietkau
The initvals use up quite a bit of space, and PC-OEM support is typically not needed on embedded systems Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-30ath9k: fix getting tx duration for dynackFelix Fietkau
On AR9003, tx control and tx status are in separate descriptor rings. Tx duration is extracted from the tx control descriptor data, which ar9003_hw_proc_txdesc cannot access. Fix getting the duration by adding a separate callback for it. Acked-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-16ath9k: add dynamic ACK timeout estimationLorenzo Bianconi
Add dynamic ACK timeout estimation algorithm based on ACK frame RX timestamp, TX frame timestamp and frame duration. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Tested-by: Philippe Duchein <wireless-dev@duchein.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-16ath9k: export methods related to ACK timeout estimationLorenzo Bianconi
Remove static keyword and export ath9k_hw_setslottime(), ath9k_hw_set_ack_timeout() and ath9k_hw_set_cts_timeout() in hw.h. These methods will be used in ACK timeout estimation algorithm (dynack) Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19ath9k: save tsf in channel contextFelix Fietkau
Save TSF in channel context for multiple operating channels. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-23ath9k: Fix RX interrupt mitigationSujith Manoharan
The threshold values for RX interrupt mitigation are different for AR9003 and AR9002 families. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03ath9k: Assign macVersion for QCA9531Sujith Manoharan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03ath9k: Remove unused config option ack_6mbSujith Manoharan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03ath9k: Identify baseband watchdog signaturesSujith Manoharan
A full HW reset is not required for all baseband watchdog signatures. Some BB watchdog updates are benign and can be discarded, some require re-programming of certain registers and others require a chip reset. This patch adds a routine to identify such signatures. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03ath9k: Add HW callbacks for MAC/BB hang checksSujith Manoharan
This is required for adding separate hang check routines for AR9002 and AR9003. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03ath9k: Register supported HW hang checksSujith Manoharan
HW hang checks have to be done on a per-chip basis. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-19ath9k: move ath9k_debug_sync_cause out of ath9k_hwFelix Fietkau
ath9k_hw should not depend on any ath9k data structures like ath_softc Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18ath9k_hw: clean up station beacon timer APIFelix Fietkau
Remove unused fields, pass timer info in usec instead of TU. Preparation for fixing nexttbtt calculation Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18ath9k_hw: remove spur related unused definesFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18ath9k_hw: remove additional_swba_backoffFelix Fietkau
It is unused Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>