aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-02-11ath9k: Fix ATH9K_HW_CAP_HT usageSujith Manoharan1-8/+5
There are a few places where the station's HT capabilities should be checked instead of ATH9K_HW_CAP_HT, which is a global feature for the driver. Fix this. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-30ath9k: add debug parameters for spectral scanSimon Wunderlich1-17/+6
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-28Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirelessJohn W. Linville1-13/+9
Conflicts: drivers/net/wireless/ath/ath9k/main.c drivers/net/wireless/iwlwifi/dvm/tx.c
2013-01-22ath9k: clean up processing of pending tx frames on resetFelix Fietkau1-22/+19
Dropping packets from aggregation sessions is usually not a good idea, as it might upset the synchronization of the BlockAck receive window of the remote node. The use of the retry_tx parameter to reset/tx-drain functions also seemed a bit arbitrary. This patch removes this parameter altogether and ensures that pending tx frames are not dropped for no good reason. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-22ath9k: stop rx after txFelix Fietkau1-2/+2
Completing frame transmission can fail if the rx engine is stopped prematurely, as the hw might be waiting for an ACK from the other side. Shutting down tx before rx might make the DMA shutdown more reliable. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-22ath9k: allow setting arbitrary antenna masks on AR9003+Felix Fietkau1-0/+3
Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-14ath9k: disable the tasklet before taking the PCU lockFelix Fietkau1-4/+3
Fixes a reported CPU soft lockup where the tasklet tries to acquire the lock and blocks while ath_prepare_reset (holding the lock) waits for it to complete. Cc: stable@vger.kernel.org Reported-by: Robert Shade <robert.shade@gmail.com> Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-11ath9k: fix rx flush handlingFelix Fietkau1-13/+3
Right now the rx flush is not doing anything useful on AR9003+, as it only works if the buffers in the rx FIFO have not been purged yet, as is done by ath_stoprecv. To fix this, always call ath_flushrecv from within ath_stoprecv before the FIFO is emptied, but still after the hw receive path has been stopped. This ensures that frames received (and ACKed by the hardware) shortly before a reset will be seen by the software, which should improve A-MPDU session stability. Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-11ath9k: add a better fix for the rx tasklet vs rx flush raceFelix Fietkau1-0/+4
Ensure that the rx tasklet is no longer running when entering the reset path. Also remove the distinction between flush and no-flush frame processing. If a frame has been received and ACKed by the hardware, the stack needs to see it, so that the BA receive window does not go out of sync. Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-09ath9k: add spectral scan featureSimon Wunderlich1-0/+100
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-03mac80211: split TX aggregation stop actionJohannes Berg1-1/+3
When TX aggregation is stopped, there are a few different cases: - connection with the peer was dropped - session stop was requested locally - session stop was requested by the peer - connection was dropped while a session is stopping The behaviour in these cases should be different, if the connection is dropped then the driver should drop all frames, otherwise the frames may continue to be transmitted, aggregated in the case of a locally requested session stop or unaggregated in the case of the peer requesting session stop. Split these different cases so that the driver can act accordingly; however, treat local and remote stop the same way and ask the driver to not send frames as aggregated packets any more. In the case of connection drop, the stop callback the driver is otherwise supposed to call is no longer required. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-11-30ath9k: Implement sta_add_debugfs/sta_remove_debugfsSujith Manoharan1-2/+8
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-30ath9k: Move ethtool functions to debug.cSujith Manoharan1-127/+0
The ethtool statistics are available only when CONFIG_ATH9K_DEBUGFS is enabled, move these functions to debug.c Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-21ath9k: Remove 'stations' debugfs fileSujith Manoharan1-12/+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: Fix the 'xmit' debugfs fileSujith Manoharan1-1/+0
The 'xmit' debugfs file has become big and unwieldy, fix multiple issues with its usage: * Store TX counters/statistics only for the 4 Access Categories. Use IEEE80211_NUM_ACS instead of ATH9K_NUM_TX_QUEUES. * Move various utility macros to debug.h, they can be reused elsewhere. * Remove tx_complete_poll_work_seen. * Remove code that accesses various internal queue-specific variables without any locking whatsoever. HW/SW queue details will be handled in a subsequent patch. * Do not print internal values like txq_headidx and txq_headidx. They were mostly unused anyway, considering code like: PRX("txq_tailidx: ", txq_headidx); * Handle 'txprocdesc' for EDMA too. 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-13/+13
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-11-21ath9k: Process FATAL interrupts at firstRajkumar Manoharan1-12/+9
FATAL and WATCHDOG interrupts should be processed first followed by others. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-16ath9k: Remove unused workaroundSujith Manoharan1-3/+0
The workaround for ASPM/L0s is needed only for AR9485 1.0, which was never sold and is not supported by ath9k. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-09mac80211: clarify interface iteration and make it configurableJohannes Berg1-6/+9
During hardware restart, all interfaces are iterated even though they haven't been re-added to the driver, document this behaviour. The same also happens during resume, which is even more confusing since all of the interfaces were previously removed from the driver. Make this optional so drivers relying on the current behaviour can still use it, but to let drivers that don't want this behaviour disable it. Also convert all API users, keeping the old semantics except in hwsim, where the new normal ones are desired. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-10-29ath9k: adjust WLAN and BT concurrent transmissionRajkumar Manoharan1-0/+4
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-29ath9k: Send WLAN channel info to BTRajkumar Manoharan1-0/+5
WLAN updates channel bitmap when associated and disassociated. Channel bitmap will reflect whare are the channels used or affected by WLAN and BT should avoid using those. Not doing so, could affect BT traffic as both WLAN and BT is operating on same channel. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-10-19ath9k: perform ANI cycle in idle stateRajkumar Manoharan1-1/+2
As of now the ANI cycle is executed only when the chip is awake. On idle state case, the station wakes up from network sleep for beacon reception. Since most of the time, ANI cycle is not syncing with beacon wakeup, ANI cycle is ignored. Approx 5 mins once, the calibration is performed. This could affect the connection stability when the station is idle for long. Even though the OFDM and CCK phy error rates are too high, ANI is unable to tune its immunity level as quick enough due to rare execution. Here the experiment shows that OFDM and CCK levels are at default even on higher phy error rate. listenTime=44 OFDM:3 errs=121977/s CCK:2 errs=440818/s ofdm_turn=1 This change ensures that ANI calibration will be exectued atleast once for every 10 seconds. The below result shows improvements and immunity levels are adopted quick enough. listenTime=557 OFDM:4 errs=752/s CCK:4 errs=125/s ofdm_turn=0 Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-10-05ath9k: use ieee80211_free_txskbFelix Fietkau1-1/+1
Using ieee80211_free_txskb for tx frames is required, since mac80211 clones skbs for which socket tx status is requested. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@vger.kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-10-05ath9k: improve suspend/resume reliabilityFelix Fietkau1-9/+4
Ensure that drv_start() always returns true, as a failing hw start usually eventually leads to crashes when there's still a station entry present. Call a power-on reset after a resume and after a hw reset failure to bring the hardware back to life again. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-24Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-nextJohn W. Linville1-1/+1
2012-09-11ath9k: Cleanup add/change_interface callbacksMohammed Shafi Shajakhan1-47/+10
*Remove all the checks that will be handled by cfg80211 based on the interface combination advertised. For instance, driver supports at the maximum 8 beaconing interface, while we advertise maximum 8 beaconing interface in the interface combination support. *cfg80211 will take care of not allowing us to add an interface that is not supported by the driver, further if the change_interface changes the old interface to a beaconing interface while we had reached the max limit of 8 beaconing interface, again cfg80211 takes care of this stuff! So remove all these checks. *Beautify placing PS wrappers in the appropriate position. Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-11ath9k: Make use of ath_stop_ani wrapperMohammed Shafi Shajakhan1-1/+1
Additionally it has a neat debug message informing us that we are stopping the ANI algorithm. Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-10mac80211: add key flag for management keysJohannes Berg1-1/+1
Mark keys that might be used to receive management frames so drivers can fall back on software crypto for them if they don't support hardware offload. As the new flag is only set correctly for RX keys and the existing IEEE80211_KEY_FLAG_SW_MGMT flag can only affect TX, also rename the latter to IEEE80211_KEY_FLAG_SW_MGMT_TX. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-09-07Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirelessJohn W. Linville1-1/+3
2012-08-10ath9k: fix interrupt storms on queued hardware resetFelix Fietkau1-1/+3
commit b74713d04effbacd3d126ce94cec18742187b6ce "ath9k: Handle fatal interrupts properly" introduced a race condition, where IRQs are being left enabled, however the irq handler returns IRQ_HANDLED while the reset is still queued without addressing the IRQ cause. This leads to an IRQ storm that prevents the system from even getting to the reset code. Fix this by disabling IRQs in the handler without touching intr_ref_cnt. Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Cc: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-31mac80211: move TX station pointer and restructure TXThomas Huehn1-1/+4
Remove the control.sta pointer from ieee80211_tx_info to free up sufficient space in the TX skb control buffer for the upcoming Transmit Power Control (TPC). Instead, the pointer is now on the stack in a new control struct that is passed as a function parameter to the drivers' tx method. Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de> Signed-off-by: Alina Friedrichsen <x-alina@gmx.net> Signed-off-by: Felix Fietkau <nbd@openwrt.org> [reworded commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-07-17ath9k: Fix race in reset-work usageRajkumar Manoharan1-6/+11
Using work_pending() to defer certain operations when a HW-reset work has been queued is racy since the check would return false when the work item is actually in execution. Use SC_OP_HW_RESET instead to fix this race. Also, unify the reset debug statistics maintenance. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k: Reconfigure VIF state properlySujith Manoharan1-0/+27
When an interface in AP or P2P-GO mode is removed, check whether a station interface is already present and reconfigure the beacon timers etc. properly if it's associated. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k: Fix ANI managementSujith Manoharan1-17/+12
Currently, there are problems with how ANI is handled in multi-VIF scenarios. This patch addresses them by unifying the start/stop logic. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k: Set the TSF adjust value properlySujith Manoharan1-0/+3
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k: Cleanup beacon queue configurationSujith Manoharan1-4/+0
Setup the beacon queue parameters after disabling interrupts. Also, remove the redundant call in conf_tx() for IBSS mode since the queue would be configured with the appropriate cwmin/cwmax values when beaconing is enabled. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k: Remove is_bslot_activeSujith Manoharan1-2/+3
In the tx_last_beacon() callback, mac80211's beaconing status can be used instead. The beacon tasklet doesn't require it because it is disabled when removing a slot. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k: Cleanup beacon logicSujith Manoharan1-19/+5
* The beaconing status routine is not required, since in multi-VIF cases the HW beacon parameters should not be re-configured. * Remove SC_OP_TSF_RESET - when a beaconing interface comes up the first time, the TSF has to be reset. * Simplify ath9k_allow_beacon_config(). * Handle setting/clearing the SWBA interrupt properly. * Remove the TSF mangling in IBSS mode, it is not required. * General code cleanup. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k: Simplify ASSOC handlingSujith Manoharan1-70/+48
Cleanup the messy logic dealing with station association and disassociation. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k: Cleanup interface handlingSujith Manoharan1-15/+2
* Do not set/clear TSF when adding/deleting an interface. This should be done when the BSS is set up and should also take into account the existence of other interfaces. * Set opmode explicitly. * ANI setup needs to be decided based on multiple interfaces. This can be done via the bss_info_changed() callback. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k_hw: Cleanup ath9k_hw_set_tsfadjustSujith Manoharan1-8/+2
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k: Fix beacon setupSujith Manoharan1-36/+12
This patch revamps interface addition and deletion and simplifies slot allocation. There is no need to setup the beacon buffer in add/remove interface, remove this and use simple APIs for assigning/deleting slots. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k: fix aggregate size limit based on queue TXOP limitFelix Fietkau1-0/+1
If the aggregate size exceeds the TXOP limit, it leads to lots of unnecessary hardware and software retries. The previous 4ms frame limit table was completely undocumented, the commit that updated it only vaguely referenced and equation from the standard, but I've been unable to replicate its results. Fix this by using a formula based on the code in ath_pkt_duration, which is more likely to be correct for this case. Reported-by: Dave Täht <dave.taht@gmail.com> Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k/ath9k_htc: fix txop limit handlingFelix Fietkau1-1/+1
In all those years apparently nobody noticed that the txop limit programmed into the chip was off by a factor of 32 (!), probably because the VI and VO queues aren't used that much aside from mgmt frames on VO. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-17ath9k: validate rx antenna settingsFelix Fietkau1-1/+18
Many chips are not able to deal with non-consecutive rx antenna selections and respond with calibration errors, reset errors, etc. When an antenna is selected as a tx antenna, also flag it for rx to avoid chip issues. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-12ath9k: Add WoW related mac80211 callbacksMohammed Shafi Shajakhan1-0/+373
add suspend/resume/set_wakeup callbacks to the driver *suspend - bail out only if all the conditions for configuring WoW. is fine, currently multivif case is not handled - check for associated state. - map wow triggers from user space data. - add deauth/disassoc pattern and user defined pattern, for the later a list is maintained. - store the interrupt mask before suspend, enabled beacon miss interrupt for WoW. - configure WoW in the hardware by calling ath9k_hw_wow_enable. *resume - restore the interrupts based on the interrupt mask stored before suspend. - call ath9k_hw_wow_wakeup to configure/restore the hardware. - after wow wakeup clear away WoW events and query the WoW wakeup reason from the status register *set_wakeup - to call 'device_set_wakeup_enable' from cfg80211/mac80211 when wow is configured and as per Rafael/Johannnes the right way to do so rather in the driver suspend/resume call back Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com> Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Cc: vadivel@qca.qualcomm.com Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09ath9k: enable PLL workaround for AR9550Gabor Juhos1-1/+2
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Acked-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09ath9k: fix power consumption on network sleep when BTCOEX is enabledRajkumar Manoharan1-0/+2
The chip is waken up for every 45ms in btcoex timer cycle to for sharing the radio between BT and WLAN. Whenever the wlan interface is in network sleep mode, do not schedule hw timers. This could reduce power consumption on idle associated state. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-09ath9k: fix fullsleep power consumption when BTCOEX is enabledRajkumar Manoharan1-6/+5
As soon as the interface brought up, btcoex timer starts running eventhough the interface is in idle state and WLAN chip is moved to full sleep mode. There is no point in running btcoex timer when the wlan interface is in sleep mode and also it might consumes more power on WLAN idle unassociated state. So lets stop the btcoex when wlan is idle state. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-27ath9k: Fix compilation breakageSujith Manoharan1-0/+2
Wrap the MCI-work canceling with CONFIG_ATH9K_BTCOEX_SUPPORT. Reported-by: Emmanuel Benisty <benisty.e@gmail.com> Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>