aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/beacon.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-02-11ath9k: Fix IBSS joiner modeSujith Manoharan1-26/+87
On joining an existing IBSS network, beaconing has to start only after a TSF sync has happened by receiving a beacon from the BSS. In creator mode, beaconing can start immediately after a HW reset has been done. Now that mac80211 notifies the driver of the mode type (creator/joiner) via ieee80211_bss_conf->ibss_creator, make use of it to properly setup the HW beacon timers. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> 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-1/+1
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-1/+1
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-11ath9k: remove the WARN_ON that triggers if generating a beacon failsFelix Fietkau1-1/+0
During teardown, mac80211 will not return a new beacon. This is normal and handled properly in the driver, so there's no need to spam the user with a kernel warning here. 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: fix double-free bug on beacon generate failureFelix Fietkau1-0/+1
When the next beacon is sent, the ath_buf from the previous run is reused. If getting a new beacon from mac80211 fails, bf->bf_mpdu is not reset, yet the skb is freed, leading to a double-free on the next beacon tx attempt, resulting in a system crash. Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau <nbd@openwrt.org> 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-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-07-17ath9k: Fix race in reset-work usageRajkumar Manoharan1-2/+3
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: Cleanup the beacon taskletSujith Manoharan1-65/+61
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: Set the TSF adjust value properlySujith Manoharan1-0/+17
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-7/+4
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-10/+5
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-139/+87
* 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-1/+1
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: Fix beacon setupSujith Manoharan1-108/+33
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-06-06ath9k: Use atomic operationsSujith Manoharan1-9/+9
The 'sc_flags' variable is being used in a number of places with no locking whatsoever. This patch converts the usage of sc_flags to atomic ops. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-06ath9k: Ensure a fair beacon distribution in IBSS modeVivek Natarajan1-1/+4
Configure CWmin based on slot time for IBSS mode. This helps in increasing the beacon distribution of ath9k to accepted levels in 11a mode. Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-23ath9k: simplify beacon configuration for beaconing vifsRajkumar Manoharan1-1/+3
As of now beacon configuration is being called multiple times in bss info change notification. This patch avoids multiple configuration and make it simpler. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-16ath9k: fix beacon descriptorRajkumar Manoharan1-1/+1
The tx interrupt for beacon queue is configured only for edma chips. As the edma chip does not support per descriptor interrupt, no need to set INTREQ for every beacon descriptor. And also clear ps filter for beacon frame. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-16ath9k: skip beaconing when reset work is pendingRajkumar Manoharan1-0/+6
Whenever the reset work is queued up, do not generate beacon. And also clear the beacon miss count once the beacon stuck was observed. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-16ath9k: fix ibss beacon next tbttRajkumar Manoharan1-0/+2
Sync-up ibss beacon timer with the beacon frame's timestamp. When the node acts as joiner, it has to sync with the received beacon timestamp instead of reading tsf from hw. As the hw tsf wont wont be update till bssid is configured. This patch programs hw tsf with the received beacon timestamp if beacon timers are yet to be configured. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-16ath9k: optimize the hardware hang checkFelix Fietkau1-0/+3
Since it's only called when beacons are stuck, move it to the SWBA handler tasklet, to avoid doing redundant checks on every single interrupt. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-15ath9k: Fix multi-VIF BSS handlingSujith Manoharan1-3/+3
mac80211 provides short preamble information and ERP protection information on a per-BSS basis, which can be used. Remove flags stored in the driver, which was incorrect since they were being used in a global manner. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-05ath9k: fix drv_tx_last_beacon on AR9003 by processing beacon tx statusFelix Fietkau1-1/+1
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-05Revert "ath9k_hw: Fix false tx hung detection in AR9003 chips"Felix Fietkau1-6/+0
The approach of this change is flawed, as it triggers tx status processing from more callsites, yet the chips only have one global tx status queue. Subsequent patches will properly fix the issue that this one tried to address. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-01-04ath9k: tx queue enable is read only for EDMA chipsetsMohammed Shafi Shajakhan1-2/+5
for EDMA chip AR_Q_TXE (tx enable for each queue) is read only Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> 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-22/+17
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-10-11ath9k_hw: make ath9k_hw_set_interrupts use ah->imask by defaultFelix Fietkau1-5/+5
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-16ath9k: use the new API for setting tx descriptorsFelix Fietkau1-29/+23
With the new API, tx descriptors can be written in one single pass instead of having to re-read and rewrite fields from multiple places. This makes the code easier to read and also slightly improves performance on embedded MIPS hardware. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-16ath9k: call ath9k_hw_set_desc_link for beacon descriptorsFelix Fietkau1-0/+1
This ensures that only ath9k_hw_set_desc_link needs to recalculate the tx descriptor checksum on AR9380+ Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-09-16ath9k: make beacon timer initialization more reliableFelix Fietkau1-0/+1
When starting the AP beacon timer, it assumes that the TSF has recently been cleared. Set the SC_OP_TSF_RESET flag to ensure that this is always the case. 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-3/+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-1/+1
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-09ath9k: Use atomic reference count for interrupt opsRajkumar Manoharan1-16/+5
Let us enable/disable interrupts based on reference count. By doing this we can ensure that interrupts are never be enabled in the middle of tasklet processing. Instead of addressing corner cases like "ath9k: avoid enabling interrupts while processing rx", this approach handles it in generic manner. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-09ath9k: do not enable interrupt on set interrupt maskRajkumar Manoharan1-2/+7
At preset set_interrupt also enables interrupt after changing mask. This is not necessary in all cases and also sometime it breaks the assumption that interrupt was disabled. So let us enable the interrupt explicity if it was disabled earlier. This could also avoid unnecessary register ops and also helps the follow up patch to have global ref count for interrupts ops. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-30Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davemJohn W. Linville1-0/+8
2011-06-27ath9k: Fix locking issue during tx completionRajkumar Manoharan1-0/+2
The received tx status of aggregated frame without BlockAck may cause deaf state in AR5416 cards. So the driver does a reset to recover. When this happens, we release the pcu_lock before doing a reset as ath_rest acquires pcu_lock. This is ugly and also not atomic. Fixing this addresses the TX DMA failure also. ath_tx_complete_aggr can be called from different paths which takes different variants of spin_lock. This patch also addresses the following warning. WARNING: at kernel/timer.c:1011 del_timer_sync+0x4e/0x50() Call Trace: <IRQ> [<ffffffff8104be3a>] warn_slowpath_common+0x7a/0xb0 [<ffffffff8104be85>] warn_slowpath_null+0x15/0x20 [<ffffffff8105915e>] del_timer_sync+0x4e/0x50 [<ffffffffa03726be>] ath_reset+0x3e/0x210 [ath9k] [<ffffffff8135cdaf>] ? _raw_spin_unlock_bh+0x1f/0x30 [<ffffffffa037760a>] ath_tx_complete_aggr.isra.26+0x54a/0xa40 [ath9k] Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-27ath9k_hw: Fix false tx hung detection in AR9003 chipsRajkumar Manoharan1-0/+6
The edma based (AR9003 family) chips update tx status descriptors in a common ring buffer for all transmitted frames. Whenever tx interrupt is raised, the descriptors are processed and tx status index is moved. The complete tx stauts ring are updated with beacons tx status when there are no data frames to be sent for a period of time. In this state, transmitting data frames causes the driver to wait for the tx status on an incorrect tx status index though the status was updated by hw properly. The driver detects this condition as a h/w hang and does unnecessary chip resets. This issue was orginally reported in adhoc mode while sending frames after an idle time. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-21net: remove mm.h inclusion from netdevice.hAlexey Dobriyan1-0/+1
Remove linux/mm.h inclusion from netdevice.h -- it's unused (I've checked manually). To prevent mm.h inclusion via other channels also extract "enum dma_data_direction" definition into separate header. This tiny piece is what gluing netdevice.h with mm.h via "netdevice.h => dmaengine.h => dma-mapping.h => scatterlist.h => mm.h". Removal of mm.h from scatterlist.h was tried and was found not feasible on most archs, so the link was cutoff earlier. Hope people are OK with tiny include file. Note, that mm_types.h is still dragged in, but it is a separate story. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-06-01ath9k: Further fix for mesh beaconingFabrice Deyber1-12/+3
This fix ensure the timers to be set at beacon interval boundaries. Without this change timers can be set improperly resulting in the absence of beacons. Signed-off-by: Fabrice Deyber <fabricedeyber@agilemesh.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-01ath9k: Remove ATH9K_BEACON_PERIOD maskRajkumar Manoharan1-3/+3
Earlier beacon_interval is used to hold interval value and some flags (ATH9K_BEACON_ENA &ATH9K_BEACON_PERIOD). So to extract interval ATH9K_BEACON_PERIOD is used. Those flags were completely removed. So masking beacon_interval is not required. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-19ath9k: implement .tx_last_beacon()Felix Fietkau1-0/+12
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-19ath9k: fix ad-hoc nexttbtt calculationFelix Fietkau1-1/+1
rounding up the delta between last-beacon-tsf and tsf to intval is wrong and can lead to misconfigured timers which breaks beacon transmission. Fix this by adding intval and subtracting the offset of the tsf within the current slot. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-19ath9k: Drag the driver to the year 2011Sujith Manoharan1-1/+1
The Times They Are a-Changin'. Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-19ath9k: fix ad-hoc mode beacon selectionFelix Fietkau1-12/+20
In ad-hoc mode, beacon timers are configured differently compared to AP mode, and (depending on the scenario) can vary enough to make the beacon tasklet not detect slot 0 based on the TSF. Since staggered beacons are not (and cannot be) used in ad-hoc mode, it makes more sense to just hardcode slot 0 here, avoiding unnecessary TSF reads and calculations. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Reported-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-10ath9k: avoid enabling interrupts while processing rxRajkumar Manoharan1-2/+13
The assumsion is that while processing ath9k tasklet, interrupts were already disabled and it will be enabled at the completion of ath9k tasklet. But whenever TSFOOR is raised, the driver configures the beacon timers after having received a beacon frame from the AP which inturn enables the interrupts. Cc: stable@kernel.org Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-26ath9k: set beacon related ps flags on bss_info changeRajkumar Manoharan1-6/+0
Requesting beacon sync up to configure beacon timers properly in hw, has be done after doing beacon config with default values. Setting the flags in beacon config is causing the device to not enter into network sleep on idle state. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-19ath9k: Fix beacon generation on foreign channelRajkumar Manoharan1-14/+22
While leaving the oper channel, beacon generation is stopped by mac80211 and beacon slots are marked as inactive. During the scan, ath9k configures beacon timers based on IEEE80211_CONF_OFFCHANNEL which inturn generates beacon alert even though bslot is inactive. ath9k fails to disable beacon alert while moving to offchannel if none of the beacon slot is active. This is causing beacon transmission on foreign channel. This patch enables swba based on active bslots. This issue was reported with two vifs (AP+STA) and triggered scan in STA vif in unassociated state. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-14ath9k: Fix improper beacon slot selection in IBSSRajkumar Manoharan1-1/+6
Request a re-configuration of Beacon related timers on the receipt of the first Beacon frame has to be set only for station mode. Setting beacon sync for IBSS is causing wrong beacon slot selection on beacon generation. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-12ath9k: Fix kernel panic on module unloadRajkumar Manoharan1-0/+1
The commit "ath9k: configure beacons based on hw opmode" introduced a regression which leads to kernel panic. Failed to stop ani timer during the driver unload while any of the beaconing vif is running. Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>