summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath9k/beacon.c
AgeCommit message (Collapse)AuthorFilesLines
2015-12-08ath9k: MCC, add NOA also in case of an APJanusz Dziedzic1-1/+2
In case of MCC and AP interface, add also NOA attr that will inform stations about absence of an AP. There is a chance that some stations will handle this NOA attr correctly and will know exactly when AP is present/absent. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-03-16ath9k: fix tracking of enabled AP beaconsFelix Fietkau1-8/+12
sc->nbcnvifs tracks assigned beacon slots, not enabled beacons. Therefore, it cannot be used to decide if cur_conf->enable_beacon (bool) should be updated, or if beacons have been enabled already. With the current code (depending on the order of calls), beacons often do not get enabled in an AP+STA setup. To fix tracking of enabled beacons, convert cur_conf->enable_beacon to a bitmask of enabled beacon slots. Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2014-11-25ath9k: add TPC capability to TX descriptor pathLorenzo Bianconi1-2/+3
Add TPC capability to TX descriptor path. Cap per-packet TX power according to TX power per-rate tables. 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-10-08ath9k: Fix sequence number assignmentSujith Manoharan1-10/+2
Currently, ath9k uses a global counter for all frames that need to be assigned a sequence number. QoS-data frames are handled properly since they have a per-tid counter. But, beacons and other management frames use the same counter even if multiple interfaces or contexts are present. Fix this issue by making the counter per-interface and using it when mac80211 sets IEEE80211_TX_CTL_ASSIGN_SEQ. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-09ath9k: Fix interface accountingSujith Manoharan1-1/+1
Currently, the interface count is maintained globally, but this causes problems in RX filter calculation. Make the interface count a per-channel-context variable to fix this. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-09-09ath9k: Fix beacon configuration for channel contextsSujith Manoharan1-0/+12
In channel context mode, when a new context is added, mac80211 issues a bss_info_changed() notfication when preparing the connection for the new interface/context. But, this is done prior to the mgd_prepare_tx() call which is where we switch to the new context. Since the current context will be different when the earlier bss_info_changed() is handled, the beacon information for the VIF is not updated, but discarded since the rules for the current context disallows it. In the subsequent association process for the new context/vif, this becomes a problem because the beacon parameters are invalid. This causes problems with the TSF timer, causing large jumps. To fix this, check if the beacon info is being updated for a different context and if so, allow it without any checks since we limit the max. interfaces to two anyway. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28ath9k: Move ath9k_beacon_add_noa to channel.cSujith Manoharan1-49/+0
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28ath9k: Add wrappers for beacon eventsSujith Manoharan1-3/+2
Using these wrappers allows us to move the 'sched' variable in ath_softc inside CONFIG_ATH9K_CHANNEL_CONTEXT. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-08-28ath9k: Fix channel context eventsSujith Manoharan1-4/+9
Check if channel context usage is enabled before calling ath_chanctx_event() from various parts of the driver. Also, make sure that ath_chanctx_event() is compiled only when CONFIG_ATH9K_CHANNEL_CONTEXT is enabled. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19ath9k: Add periodic NoA supportFelix Fietkau1-5/+20
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-06-19ath9k: Add p2p go NoA attributeFelix Fietkau1-0/+37
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-06-19ath9k: switch channel context for beaconingFelix Fietkau1-2/+9
Add a basic state machine for switch channel context for beacon transmission. 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-06-19ath9k: Summarize hw state per channel contextRajkumar Manoharan1-8/+20
Group and set hw state (opmode, primary_sta, beacon conf) per channel context instead of whole list of vifs. This would allow each channel context to run in different mode (STA/AP). 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-06-19ath9k: Move beacon config to channel contextRajkumar Manoharan1-5/+5
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-06-19ath9k: Add channel context worker threadFelix Fietkau1-1/+1
The channel context worker is used to switch to next requested channel context. 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-05-06ath9k: Prevent divide-by-zero upon bad beacon_interval.Ben Greear1-2/+3
A similar patch fixed crashes seen on an ath9k system when testing against a broken ath10k AP. This patch is slightly less protective, but probably will do the job and is less redundant. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-04-09ath9k: fix a scheduling while atomic bug in CSA handlingFelix Fietkau1-4/+3
Commit "ath9k: prepare for multi-interface CSA support" added a call to ieee80211_iterate_active_interfaces in atomic context (beacon tasklet), which is crashing. Use ieee80211_iterate_active_interfaces_atomic instead. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17ath9k: remove unused ath9k_get_next_tbttOleksij Rempel1-27/+0
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17ath9k: move ath9k_beacon_config_ap commonOleksij Rempel1-19/+2
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17ath9k: move ath9k_beacon_config_adhoc to commonOleksij Rempel1-19/+2
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17ath9k: move ath9k_beacon_config_sta to common-beaconOleksij Rempel1-77/+3
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-03-17ath9k: move sc_flags to ath_commonOleksij Rempel1-8/+10
we will need it for ath9k_htc, may be other drivers too Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-28ath9k: remove unused listen_interval and sleepduration.Oleksij Rempel1-14/+7
this variable never changed. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-28ath9k: move ath9k_init_channels_rates to common-initOleksij Rempel1-1/+1
and rename it to ath9k_cmn_init_channels_rates. sbands are move to ath_common as well. Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-02-13ath9k: prepare for multi-interface CSA supportMichal Kazior1-10/+19
Soon mac80211 will support multi-interface CSA so using sc->csa_vif is not an option. Instead just depend on vif->csa_active. Calling ieee80211_csa_finish() multiple number of times should not be an issue. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-04ath9k: Remove RX PollSujith Manoharan1-2/+8
This patch removes the convoluted and hacky method of monitoring for connectivity. We rely on mac80211's connection loss logic and doing it in the driver is not necessary. The HW check for MAC/BB hangs is also simplified, there is no need to have a separate work instance for it. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-19ath9k: fix TSF offset precision issueFelix Fietkau1-3/+4
Dividing the beacon interval by ATH_BCBUF (8) truncates the result for the default beacon interval of 100. Fix the calculation by moving the division after conversion from TU to microseconds. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-19ath9k: call ath9k_set_tsfadjust from ath9k_beacon_configFelix Fietkau1-3/+9
Make that function and ath9k_allow_beacon_config static Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-19ath9k: properly preserve TSF across resetFelix Fietkau1-45/+43
The beacon code previously reset TSF on every configuration call, as some of the code was not prepared to properly calculate nexttbtt based on current TSF. This patch adds a common function for calculating nexttbtt and moves the TSF reset to driver start. This should improve AP mode compatibility with various stations that expect the TSF to not randomly jump due to hardware resets. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-19ath9k_hw: clean up station beacon timer APIFelix Fietkau1-27/+11
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-09-26ath9k: Handle abnormal NAV in AP modeSujith Manoharan1-0/+2
Beacon transmission would get stuck if the NAV is an invalid value for some reason. Check and correct the NAV value in the HW when this happens. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-08-16ath9k: enable CSA functionality in ath9kSimon Wunderlich1-0/+21
CSA is only enabled for one interface, but the same limitation applies for mac80211 too. It checks whether the beacon has been sent (different approaches for non-EDMA-enabled and EDMA-enabled devices), and completes the channel switch after that. 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-06-12ath9k: limit multicast buffer hardware queue depthFelix Fietkau1-21/+2
The CAB (Content after Beacon) queue is used for beacon-triggered transmission of buffered multicast frames. If lots of multicast frames were buffered and this queue fills up, it drowns out all regular traffic. To limit the damage that buffered traffic can do, try to limit the queued data to becaon_interval / 8. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-05-22ath9k: use ap style beaconing for meshThomas Pedersen1-3/+5
Chun-Yeow and Javier Lopez contributed these changes to make mesh mode use the more similar AP beaconing mode and queue parameters. Should improve PS performance, interface concurrency (AP modes can coexist), and beacon interval stability. AR9271 (ath9k_htc) mesh interfaces also need to be in AP operating mode. Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-03-25mac80211: Use a cfg80211_chan_def in ieee80211_hw_conf_chanKarl Beldan1-1/+1
Drivers that don't use chanctxes cannot perform VHT association because they still use a "backward compatibility" pair of {ieee80211_channel, nl80211_channel_type} in ieee80211_conf and ieee80211_local. Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com> [fix kernel-doc] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-02-12ath9k: 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 ↵John W. Linville1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless Conflicts: drivers/net/wireless/ath/ath9k/main.c drivers/net/wireless/iwlwifi/dvm/tx.c
2013-01-23ath9k: 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-06ath9k: 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>