summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
AgeCommit message (Collapse)Author
2016-12-15ath9k: Add an eeprom_ops callback for retrieving the eepmisc valueMartin Blumenstingl
This allows deciding if we have to swap the EEPROM data (so it matches the system's native endianness) even if no byte-swapping (swab16, based on the first two bytes in the EEPROM) is needed. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-12-15ath9k: indicate that the AR9003 EEPROM template values are little endianMartin Blumenstingl
The eepMisc field was not set explicitly. The default value of 0 means that the values in the EEPROM (template) should be interpreted as little endian. However, this is not clear until comparing the AR9003 code with the other EEPROM formats. To make the code easier to understand we explicitly state that the values are little endian - there are no functional changes with this patch. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-12-15ath9k: Add a #define for the EEPROM "eepmisc" endianness bitMartin Blumenstingl
This replaces a magic number with a named #define. Additionally it removes two "eeprom format" specific #defines for the "big endianness" bit which are the same on all eeprom formats. Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-08-19ath9k: consider return code onEduardo Abinader
just to comply with current ath9k_hw_nvram_read to return value, hence behaving reacting accordingly. Signed-off-by: Eduardo Abinader <eduardo.abinader@riverbed.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-06-30ath9k: Fix programming of minCCA power thresholdSven Eckelmann
The function ar9003_hw_apply_minccapwr_thresh takes as second parameter not a pointer to the channel but a boolean value describing whether the channel is 2.4GHz or not. This broke (according to the origin commit) the ETSI regulatory compliance on 5GHz channels. Fixes: 3533bf6b15a0 ("ath9k: Fix regulatory compliance") Signed-off-by: Sven Eckelmann <sven@narfation.org> Cc: Simon Wunderlich <sw@simonwunderlich.de> Cc: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-05-28ath9k: Remove empty test conditionEduardo Abinader
Just some code cleanup to remove an empty if clause. Signed-off-by: Eduardo Abinader <eduardo.abinader@riverbed.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-05-09ath9k: reuse ar9003_hw_tx_power_regwrite for tx99 setupHelmut Schaa
The same functionality as ar9003_hw_tx_power_regwrite is hardcoded in ar9003_hw_tx99_set_txpower. Just reuse the existing ar9003_hw_tx_power_regwrite for TX99 setup too. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2016-04-07Merge ath-next from ath.gitKalle Valo
ath.git patches for 4.7. Major changes: ath10k * implement push-pull tx model using mac80211 software queuing support * enable scan in AP mode (NL80211_FEATURE_AP_SCAN) wil6210 * add basic PBSS (Personal Basic Service Set) support * add initial P2P support * add oob_mode module parameter
2016-04-07ath9k: Remove unnecessary ?: operatorIvan Safonov
"(thermometer < 0) ? 0 : (thermometer == X)" is equivalent to "thermometer == X" for X >= 0. Signed-off-by: Ivan Safonov <insafonov@gmail.com> [Updated commit message] Signed-off-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
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-01-26ath9k: fix inconsistent use of tab and space in indentationMiaoqing Pan
Minor changes for indenting. Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-01-15ath9k: Add QCA956x HW supportMiaoqing 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-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: Fix thermometer programmingSujith Manoharan
The registers that control the on-chip thermometer need to be programmed based on the chainmask that the solution supports, not the chainmask that is present in the eeprom. 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-06-25ath9k_hw: fix XPABIASLEVEL settings for AR9531Rajkumar Manoharan
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17ath9k: Fix temperature compensationSujith Manoharan
The registers for temperature compensation need to be programmed only for active chains. Use the TX chainmask to make sure that this is done properly for QCA953x. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-14ath9k: Convert uses of __constant_<foo> to <foo>Joe Perches
The use of __constant_<foo> has been unnecessary for quite awhile now. Make these uses consistent with the rest of the kernel. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-04ath9k: Fix TX power calculationSujith Manoharan
The commit, "ath9k_hw: Fix incorrect Tx control power in AR9003 template" fixed the incorrect values in the eeprom templates, but if boards have already been calibrated with incorrect values, they would still be using the wrong TX power. Fix this by assigning a default value in such cases. Cc: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03ath9k: Add hardware support for QCA9531Sujith Manoharan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18ath9k: Fix regulatory complianceSujith Manoharan
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. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18ath9k: Update BaseExtension_1 eeprom structureSujith Manoharan
* Add a new field "misc_enable" * Use int_8 for tempslopextension. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-18ath9k: Initialize "switchcomspdt" eeprom field explicitlySujith Manoharan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-09ath9k: Apply tuning caps for AR9330 and AR9485Sujith Manoharan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-09ath9k: Fix internal regulator for AR955xSujith Manoharan
The internal regulator needs to be programmed correctly for AR955x. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02ath9k: Fix XLNA bias strengthSujith Manoharan
The EEPROM parameter to determine whether the bias strength values for XLNA have to be applied is part of the miscConfiguration field and not featureEnable. Cc: stable@vger.kernel.org Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-02ath9k: Fix QuickDrop usageSujith Manoharan
Bit 5 in the miscConfiguration field of the base EEPROM header denotes whether QuickDrop is enabled or not. Fix the incorrect usage of BIT(1) and also make sure that this is done only for the required chips. Cc: stable@vger.kernel.org Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-09-26ath9k: replace snprintf() with scnprintf()Zefir Kurtisi
Whenever the return value of snprintf() is used to calculate remaining buffer-space, we wanted to use sncprintf() instead. Indentation is adapted where possible. Some lines exceed the line width limit, either they did it already before, or since they can not be broken reasonably well. Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-09-26ath9k: Fix antenna diversity init for AR9565Sujith Manoharan
Program the HW registers (AR_PHY_CCK_DETECT, AR_PHY_MC_GAIN_CTRL) with the correct values for AR9565 to allow LNA combining. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-09-26ath9k: Bypass EEPROM for diversity cap for AR9565Sujith Manoharan
Use a default antenna diversity value for AR9565 instead of relying on the EEPROM/OTP programmed value. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-28ath9k: ar9003_eeprom.c:3618 fix variable name typoJohn W. Linville
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c: In function 'ar9003_hw_ant_ctrl_apply': >> drivers/net/wireless/ath/ath9k/ar9003_eeprom.c:3618: warning: 'regval' is used uninitialized in this function It seems obvious that 'regval' should have been 'value'... Reported-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-22ath9k: Add antenna diversity tweak for CUS198Sujith Manoharan
This improves RX diversity and performance for AR9485. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-05ath9k: Fix antenna control init for AR9485Sujith Manoharan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-05ath9k: Support ANT diversity for WB225Sujith Manoharan
WB225 based cards like CUS198 and CUS230 support both fast antenna diversity and LNA combining. Add support for this and also program the SWCOM register with the correct "ant_ctrl_comm2g_switch_enable" value. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-05ath9k: Remove "shared_chain_lnadiv"Sujith Manoharan
This variable is redundant since we can use common->bt_ant_diversity to determine if diversity has to be enabled/disabled. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-07-24ath9k: Fix diversity combining for AR9285Sujith Manoharan
When antenna diversity combining is enabled in the EEPROM, the initial values for the MAIN/ALT config have to be programmed correctly. This patch adds it for AR9285. Since the diversity combining macros are common to all chip families, remove the redundant AR9285 macros and move the definitions to phy.h. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-06-24ath9k: Add support for AR9462 2.1Sujith Manoharan
Various parts of the HW code are applicable for both v2.0 and v2.1. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-06-18ath9k: Convert a couple of debug messagesSujith Manoharan
Use the REGULATORY debug level to print the target power details. EEPROM can be used for other purposes and this spams the log. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-06-17ath9k: Fix LNA gpio for AR9485Sujith Manoharan
The commit "ath9k: Add custom parameters for CUS198" didn't pass the correct gpio value to ath9k_hw_cfg_output(). Fix it. Reported-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-06-14ath9k: Add custom parameters for CUS198Sujith Manoharan
CUS198 is a card based on AR9485. There are differences between the base reference design HB125 and CUS198. Identify such cards based on the PCI subsystem IDs and set HW parameters appropriately. Addresses this bug - https://bugzilla.kernel.org/show_bug.cgi?id=49201 Cc: jkp@iki.fi Cc: gfmichaud@gmail.com Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-06-12ath9k_hw: Assign default xlna config for AR9485Sujith Manoharan
For AR9485 boards with XLNA, the default gpio config is not set correctly, fix this. Cc: stable@vger.kernel.org Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-03-06ath9k_hw: Fix fixed antenna for AR9462Sujith Manoharan
When the RX chainmask is set to 0x2 for AR9462, certain values from chain1 have to be programmed for chain0 also. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-09ath9k_hw: Add TempCompensation feature for AR9550Sujith Manoharan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-12-10ath9k: use 'struct ath_hw *' as the first argument for 'ath9k_hw_nvram_read'Gabor Juhos
The 'ath9k_hw_nvram_read' function takes a 'struct ath_common *' as its first argument. Almost each of its caller has a 'struct ath_hw *' parameter in their argument list, and that is dereferenced in order to get the 'struct ath_common' pointer. Change the first argument of 'ath9k_hw_nvram_read' to be a 'struct ath_hw *', and remove the dereference calls from the callers. Also change the type of the first argument of the ar9300_eeprom_read_{byte,word} functions. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-12-10ath9k_hw: Calculate the correct training power for PAPRDSujith Manoharan
Assign the training power for PAPRD based on the chip. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-12-10ath9k_hw: Add HW cap for PAPRDSujith Manoharan
Add a HW capability to indicate whether PAPRD is enabled for the card, since PAPRD could be enabled in the EEPROM, but disabled in the driver. This makes things clearer. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-10-29ath9k_hw: Configure new switch table for AR9565 BTCOEXRajkumar Manoharan
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-10-29ath9k: adjust WLAN and BT concurrent transmissionRajkumar Manoharan
The simulataneous transmission of both WLAN and BT might cause increase in power levels. To avoid regulatory violation, WLAN tx power will be adjusted according to BT power index based on avaliability of BT scheduling messages. WLAN tx power reduction might affect its performance. So WLAN tx power is only be lowered when the signal strength is good enough. Otherwise concurrent tx will be disabled and WLAN uses it default power levels. Also concurrent tx is disabled whenever WLAN is moving to off-channel which might be used by BT. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-10-19ath/ath9k/ar9003_eeprom.c: Remove semicolon after ifPeter Senna Tschudin
This patch remove a semicolon after if(...) that is preventing the error check to work correctly. Removing this semicolon will change the code behavior, but this is intended. The semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r1@ position p; @@ if (...);@p @script:python@ p0 << r1.p; @@ // Emacs org-mode output cocci.print_main("", p0) cocci.print_secs("", p0) // </smpl> Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-30Merge branch 'for-davem' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next John W. Linville says: ==================== Here is another batch of updates intended for 3.7... Highlights include an hci_connect re-write in Bluetooth, HCI/LLC layer separation in NFC, removal of the raw pn544 NFC driver, NFC LLCP raw sockets support, improved IBSS auth frame handling in mac80211, full-MAC AP mode notification support in mac80211, a lot of attention paid to brcmfmac, and the usual level of updates to iwlwifi, ath9k, mwifiex, and rt2x00, and various other updates. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-28Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller
Conflicts: drivers/net/team/team.c drivers/net/usb/qmi_wwan.c net/batman-adv/bat_iv_ogm.c net/ipv4/fib_frontend.c net/ipv4/route.c net/l2tp/l2tp_netlink.c The team, fib_frontend, route, and l2tp_netlink conflicts were simply overlapping changes. qmi_wwan and bat_iv_ogm were of the "use HEAD" variety. With help from Antonio Quartulli. Signed-off-by: David S. Miller <davem@davemloft.net>