aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/init.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-02-01ath9k: Only remove spectral scan relay file when it was createdSven Eckelmann1-1/+1
The relay file depends on relayfs. Trying to close this file without having ATH9K_DEBUGFS (and therefore RELAY) activated causes build failures. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30ath9k: add debug parameters for spectral scanSimon Wunderlich1-0/+7
Export the various parameters to userspace. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-22Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-nextJohn W. Linville1-6/+3
2013-01-14wireless: make the reg_notifier() voidLuis R. Rodriguez1-6/+3
The reg_notifier()'s return value need not be checked as it is only supposed to do post regulatory work and that should never fail. Any behaviour to regulatory that needs to be considered before cfg80211 does work to a driver should be specified by using the already existing flags, the reg_notifier() just does post processing should it find it needs to. Also make lbs_reg_notifier static. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> [move lbs_reg_notifier to not break compile] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-09ath9k: add spectral scan featureSimon Wunderlich1-0/+6
Adds the spectral scan feature for ath9k. AR92xx and AR93xx chips are supported for now. The spectral scan is triggered by configuring a mode through a debugfs control file. Samples can be gathered via another relay debugfs file. Essentially, to try it out: echo chanscan > /sys/kernel/debug/ieee80211/phy0/ath9k/spectral_scan_ctl iw dev wlan0 scan cat /sys/kernel/debug/ieee80211/phy0/ath9k/spectral_scan0 > samples echo disable > /sys/kernel/debug/ieee80211/phy0/ath9k/spectral_scan_ctl This feature is still experimental. The special "chanscan" mode is used to perform spectral scan while mac80211 is scanning for channels. To allow this, sw_scan_start/complete() ops have been added. The patch contains code snippets and information from Zefir Kurtisi and information provided by Adrian Chadd and Felix Fietkau. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-07ath9k_hw: use the devres API for allocationsFelix Fietkau1-0/+1
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-07ath9k: use the devres API for allocations/mappingsFelix Fietkau1-70/+30
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-12-11ath9k: check pdata variable before dereferencing itGabor Juhos1-1/+1
Due to my recent commit (ath9k: allow to load EEPROM content via firmware API) smatch complains about that the 'pdata' variable in 'ath9k_hw_init' can be NULL and it is dereferenced before checking that. That is absolutely correct. Check the 'pdata' variable before using it to avoid a NULL pointer dereference. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-12-10ath9k: allow to load EEPROM content via firmware APIGabor Juhos1-1/+59
The calibration data for devices w/o a separate EEPROM chip can be specified via the 'eeprom_data' field of 'ath9k_platform_data'. The 'eeprom_data' is usually filled from board specific setup functions. It is easy if the EEPROM data is mapped to the memory, but it can be complicated if it is stored elsewhere. The patch adds support for loading of the EEPROM data via the firmware API to avoid this limitation. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-21ath9k: Remove 'stations' debugfs fileSujith Manoharan1-4/+0
The 'stations' debugfs file has multiple issues. It doesn't scale to an arbitrary number of associated stations and allocating 64K is not elegant either. Now that changes have been made in mac80211 to support dynamic creation/deletion of driver-specific debugfs files on station addition/removal, remove this file and make use of the mac80211 hooks (which will be done in a sebsequent patch). Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-21ath9k/ath9k_htc: Remove WME macrosSujith Manoharan1-1/+1
Use the macros provided by mac80211 and remove redundant declarations inside the drivers. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-10-29ath9k: Advertize beacon_int_infra_matchMohammed Shafi Shajakhan1-0/+1
Currently ath9k need to have beacon interval matched between STA mode and beaconing mode. Advertize this through interface combinations. Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-24ath9k: Add a module parameter to enable diversitySujith Manoharan1-0/+12
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-24ath9k: fill led_pin before drv_startRajkumar Manoharan1-0/+1
Ensure that led pin is filled and set to OFF before starting the driver. With recent changes, drv_start is being called even before led_init is being completed. This is causing led is always OFF on driver load when the interface is UP. This patch splits the led init and fills the led pin before register hw. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-11ath9k: Set correct max streams for AR9565Sujith Manoharan1-1/+1
Also, set the correct chainmask. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k: Cleanup the beacon taskletSujith Manoharan1-1/+1
Remove unused variables, use a helper function to choose the slot and reset beaconing status at one place. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k: make per-WMM-AC queue sizes configurable via debugfsFelix Fietkau1-0/+1
Prepare for using different queue size defaults for each AC. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-12ath9k: advertise supported WoW flags to upper layerMohammed Shafi Shajakhan1-0/+18
currently the code supports WoW triggers due to *magic packet *user defined patterns *deauth and disassoc patterns *disconnect - beacon miss, last beacon received timeout, no ack for keeep alive frames. Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com> Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Cc: vadivel@qca.qualcomm.com Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-06ath9k: Handle ASPM properlySujith Manoharan1-0/+3
ASPM has to be disabled when BTCOEX is in use, do this properly by calling the bus-specific ASPM init routine after the BTCOEX scheme has been determined. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-06ath9k: Prune ath9k_init_deviceSujith Manoharan1-8/+7
Instead of cluttering ath9k_init_device() with 'ath_softc' specific initialization code, use ath9k_init_softc() to setup driver-specific work routines, timers etc. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-23ath9k: add possible wiphy interface combinationsFelix Fietkau1-0/+21
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-11ath9k: add DFS pattern detector instance to ath_softcZefir Kurtisi1-0/+4
Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-10mac80211: don't always advertise remain-on-channelJohannes Berg1-0/+1
Not all devices are really capable of implementing remain-on-channel, even if it is implemented in SW, as they can't necessarily deal with channel changes while associated. Remove the WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL and add it only if either the driver has remain_on_channel implemented in the driver/device. Also add it to all drivers that advertise P2P right now since those definitely have to have it working. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-10ath: Add and use pr_fmt, convert printks to pr_<level>Joe Perches1-7/+6
Use a more current logging style. Make sure all output is prefixed appropriately. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-09ath9k: recover ar9380 chips from rare stuck stateRajkumar Manoharan1-0/+1
In the experiment with Azimuth ADEPT-n testbed where the APs transmit power was reduced to 25% and the signal strength was futher attenuated by 20dB and induced a path loss of ~7dB, the station was reporting beacon losses and the following issue were observed. * rx clear is stuck at low for more than 300ms * dcu chain and complete state is stuck at one of the hang signature This patch triggers the hang detection logic that recovers the chip from any of the above conditions. As the issue was originally reported in ChromeOs with AR9382 chips, this detection logic is enabled only for AR9380/2 chips. Cc: Paul Stewart <pstew@google.com> Reported-by: Gary Morain <gmorain@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-26ath9k: reduce listen time periodRajkumar Manoharan1-1/+1
When we have downlink traffic alone and the station is going thru bgscan, the client is out of operating channel for around 1000ms which is too long. The mac80211 decides when to switch back to oper channel based on tx queue, bad latency and listen time. As the station does not have tx traffic, the bgscan can easily affect downlink throughput. By reducing the listen time, it helps the associated AP to retain the downstream rate. Cc: Paul Stewart <pstew@google.com> Tested-by: Gary Morain <gmorain@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-15ath9k: optimize register access functionsFelix Fietkau1-3/+3
By checking for NR_CPUS, the compiler can optimize out register access serialization code on non-SMP kernels Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-15ath9k_hw: remove ath9k_hw_getdefantennaFelix Fietkau1-1/+0
The default antenna (as programmed by the INI file) is always 0 anyway. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-15ath9k: Remove aggregation flagsSujith Manoharan1-8/+1
SC_OP_TXAGGR and SC_OP_RXAGGR are not really needed. The HT capabilities of the station and HW can be used instead. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-07ath9k: make MAC sample statistics optionalFelix Fietkau1-1/+3
They're more expensive than some of the other debug options and only used in very rare situations, so it sometimes makes sense to disable them while leaving in debugfs support. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-27ath9k: Move BTCOEX init/deinit functions to gpio.cSujith Manoharan1-47/+1
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-27ath9k: Initialize MCI params using a helperSujith Manoharan1-21/+2
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-03ath9k: Fix kernel panic during driver initilizationMohammed Shafi Shajakhan1-4/+5
all works need to be initialized before ieee80211_register_hw to prevent mac80211 call backs such as drv_start, drv_config getting started. otherwise we would queue/cancel works before initializing them and it leads to kernel panic. this issue can be recreated with the following script in Chrome laptops with AR928X cards, with background scan running (or) Network manager is running while true do sudo modprobe -v ath9k sleep 3 sudo modprobe -r ath9k sleep 3 done EIP: [<81040a47>] __cancel_work_timer+0xb8/0xe1 SS:ESP 0068:f6be9d70 ---[ end trace 4f86d6139a9900ef ]--- Registered led device: ath9k-phy0 ieee80211 phy0: Atheros AR9280 Rev:2 mem=0xf88a0000, irq=16 Kernel panic - not syncing: Fatal exception Pid: 456, comm: wpa_supplicant Tainted: G D 3.0.13 #1 Call Trace: [<81379e21>] panic+0x53/0x14a [<81004a30>] oops_end+0x73/0x81 [<81004b53>] die+0x4c/0x55 [<81002710>] do_trap+0x7c/0x83 [<81002855>] ? do_bounds+0x58/0x58 [<810028cc>] do_invalid_op+0x77/0x81 [<81040a47>] ? __cancel_work_timer+0xb8/0xe1 [<810489ec>] ? sched_clock_cpu+0x81/0x11f [<8103f809>] ? wait_on_work+0xe2/0xf7 [<8137f807>] error_code+0x67/0x6c [<810300d8>] ? wait_consider_task+0x4ba/0x84c [<81040a47>] ? __cancel_work_timer+0xb8/0xe1 [<810380c9>] ? try_to_del_timer_sync+0x5f/0x67 [<81040a91>] cancel_work_sync+0xf/0x11 [<f88d7b7c>] ath_set_channel+0x62/0x25c [ath9k] [<f88d67d1>] ? ath9k_tx_last_beacon+0x26a/0x85c [ath9k] [<f88d8899>] ath_radio_disable+0x3f1/0x68e [ath9k] [<f90d0edb>] ieee80211_hw_config+0x111/0x116 [mac80211] [<f90dd95c>] __ieee80211_recalc_idle+0x919/0xa37 [mac80211] [<f90dda76>] __ieee80211_recalc_idle+0xa33/0xa37 [mac80211] [<812dbed8>] __dev_open+0x82/0xab Cc: <stable@vger.kernel.org> Cc: Gary Morain <gmorain@google.com> Cc: Paul Stewart <pstew@google.com> Cc: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Tested-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-19ath9k_hw: make bluetooth coexistence support optional at compile timeFelix Fietkau1-3/+3
Many systems (e.g. embedded systems) do not have wifi modules connected to bluetooth modules, so bluetooth coexistence is irrelevant there. With the addition of MCI support, ath9k picked up quite a bit of extra code that can be compiled out this way. This patch redefines ATH9K_HW_CAP_MCI and adds an inline wrapper for querying the bluetooth coexistence scheme, allowing the compiler to eliminate code that uses it, with only very little use of #ifdef. On MIPS this reduces the total size for the modules by about 20k. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-19ath: Convert ath_dbg(bar, ATH_DBG_<FOO>, to ath_dbg(bar, FOOJoe Perches1-4/+3
Add ATH_DBG_ to macros to shorten the uses and reduce the line count. Coalesce ath_dbg formats. Add missing spaces to coalesced formats. Add missing newline terminations to ath_dbg formats. Align ath_dbg arguments where appropriate. Standardize ath_dbg formats without periods. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-13ath9k: Reconfigure tx power on regulatory updateRajkumar Manoharan1-2/+15
Whenever the regulatory got updated by country IE for the world roaming cards, need to reconfigure the tx power immediately to increase the power level. Reviewed-by: Sam Leffler <sleffler@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-06ath9k: clarify max_streams for AR9462Mohammed Shafi Shajakhan1-0/+2
max_streams for AR9462 is '2'. it does not fixes anything, but improves the code readability Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-30ath9k: MCI state machine based on MCI interruptMohammed Shafi Shajakhan1-0/+11
Cc: Wilson Tsao <wtsao@qca.qualcomm.com> Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-30ath9k_hw: initialize MCI parametersMohammed Shafi Shajakhan1-0/+22
these parameter will be utilized and modified in the MCI hardware codes state machine Cc: Wilson Tsao <wtsao@qca.qualcomm.com> Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-22Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linuxJohn W. Linville1-0/+1
Conflicts: drivers/net/wireless/iwlegacy/iwl-debugfs.c drivers/net/wireless/iwlegacy/iwl-rx.c drivers/net/wireless/iwlegacy/iwl-scan.c drivers/net/wireless/iwlegacy/iwl-tx.c include/net/bluetooth/bluetooth.h
2011-11-09ath9k: Advertise support for TDLSJouni Malinen1-0/+1
Based on a quick test, TDLS seemed to be working fine with ath9k, so let's start advertising support for this in the driver. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-08ath9k: Add btcoex profile management support for AR9462Rajkumar Manoharan1-0/+2
AR9462 chips have the capabilities to provoide bluetooth profile information. For non-AR9462 btcoex chips, the BT priority traffic was identified by periodically polling the respective registers and updated dutycycle, stomptype, etc. As AR9462 chip offers the BT profile informations, let us make use of that to update aggregation limit, dutycycle, stomptype and wieghtages. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-10-31drivers/net: Add module.h to drivers who were implicitly using itPaul Gortmaker1-0/+1
The device.h header was including module.h, making it present for most of these drivers. But we want to clean that up. Call out the include of module.h in the modular network drivers. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-10-11ath9k_hw: clean up tx power handlingFelix Fietkau1-2/+0
The code for handling various restrictions concerning regulatory limits, antenna gain, etc. is very convoluted and duplicated across various EEPROM parsing implementations, making it hard to review. This patch partially cleans up the mess by unifying regulatory limit handling in one function and simplifying handling of antenna gain. It also removes unused transmit power scaling arrays from the EEPROM code, which belonged to an unimplemented API that isn't supposed to be in the driver anyway. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-19ath9k_hw: fix setting the hardware diversity flagFelix Fietkau1-1/+0
ath9k_hw_set_diversity is only called from init.c where it cannot affect the hardware setting because it's cleared on the next reset. Instead of using a PHY op for something that's supposed to be initialized statically, set the register value directly in the INI override function. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-14ath9k: implement .get_antenna and .set_antennaFelix Fietkau1-7/+25
On MIMO chips this can be used to enable/disable hardware chains, ensuring that the MCS information is updated accordingly. On non-MIMO chips with rx diversity (e.g. 9285), this configures the rx input antenna. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-14ath9k: always call ath_reset from workqueue contextFelix Fietkau1-0/+1
This makes it much easier to add further rework to avoid race conditions between reset and other work items. Move other functions to make ath_reset static. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-14ath9k: eliminate common->{rx,tx}_chainmaskFelix Fietkau1-7/+2
we already have ah->{rx,tx}chainmask for the same purpose Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-29ath9k: Add debugfs support for mac/baseband samplesRajkumar Manoharan1-0/+1
This patch keep track of number of samples that includes DMA debugs registers, PCU observe, CR, channel noise, cycle conters, noisefloor history buffer and last N number of tx and rx descriptor status. These samples are grouped in table manner which dumping in debgufs. Debugfs file location: <debugfs_mnt>/ieee80211/phy#/ath9k/samples Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-24ath9k: Move ath9k_init_crypto to commonRajkumar Manoharan1-26/+1
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>