aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/xmit.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-02-11ath9k: Fix ATH9K_HW_CAP_HT usageSujith Manoharan1-3/+2
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-22ath9k: use ath_tx_process_buffer instead of open-coding similar codeFelix Fietkau1-37/+32
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-22ath9k: clean up processing of pending tx frames on resetFelix Fietkau1-33/+10
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-07ath9k: use the devres API for allocations/mappingsFelix Fietkau1-32/+5
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-11-30ath9k: Remove redundant NULL assignmentSujith Manoharan1-1/+0
'bf_next' is cleared using ATH_TXBUF_RESET() in both the callsites of ath_tx_get_buffer(). Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-30ath9k: Replace WME_NUM_TID with IEEE80211_NUM_TIDSSujith Manoharan1-4/+4
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-0/+2
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-5/+5
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-30ath9k: Test for TID only in BlockAcks while checking tx statusSven Eckelmann1-2/+6
The ath9k xmit functions for AMPDUs can send frames as non-aggregate in case only one frame is currently available. The client will then answer using a normal Ack instead of a BlockAck. This acknowledgement has no TID stored and therefore the hardware is not able to provide us the corresponding TID. The TID set by the hardware in the tx status descriptor has to be seen as undefined and not as a valid TID value for normal acknowledgements. Doing otherwise results in a massive amount of retransmissions and stalls of connections. Users may experience low bandwidth and complete connection stalls in environments with transfers using multiple TIDs. This regression was introduced in b11b160defc48e4daa283f785192ea3a23a51f8e ("ath9k: validate the TID in the tx status information"). Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Cc: stable@vger.kernel.org Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-10-29ath9k: fix stale pointers potentially causing access to free'd skbsFelix Fietkau1-0/+2
bf->bf_next is only while buffers are chained as part of an A-MPDU in the tx queue. When a tid queue is flushed (e.g. on tearing down an aggregation session), frames can be enqueued again as normal transmission, without bf_next being cleared. This can lead to the old pointer being dereferenced again later. This patch might fix crashes and "Failed to stop TX DMA!" messages. 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: use ieee80211_free_txskbFelix Fietkau1-24/+29
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-09-28ath9k: Fix chainmask selection for AR9462Sujith Manoharan1-0/+4
Force chain 1 to be used for CCK rates since the target power table stored in EEPROM is too high to transmit with both chains. This is needed to avoid regulatory violation. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-07Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirelessJohn W. Linville1-0/+3
2012-09-07ath9k: Fix TX filter usageSujith Manoharan1-1/+1
The TX filter bit for a station would be set by the HW when a frame is not acked. A frame would be completed with ATH9K_TXERR_FILT status only when the corresponding filter bit for the destination station is already set. Currently, un-acknowledged packets are added to the pending queue and retried, but the "clear_dest_mask" bit in the descriptor is set only when the TX status has been ATH9K_TXERR_FILT. This results in packet loss and the log shows: wlan0: dropped TX filtered frame, queue_len=0 PS=0 @4309746071 wlan0: dropped TX filtered frame, queue_len=0 PS=0 @4309746076 wlan0: dropped TX filtered frame, queue_len=0 PS=0 @4309746377 ... ... This issue can be resolved by making sure that the destination mask is cleared when the packet is being retried and the earlier TX status is ATH9K_TXERR_XRETRY. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-05ath9k: fix PA linearization calibration related crashFelix Fietkau1-0/+3
Before PAPRD training can run, the card needs to have sent a packet for thermal calibration. Sending a dummy packet with the PAPRD training flag set causes a crash under some circumstance. Fix the code by replacing the dummy tx with a delay that waits for a real packet tx to have occurred. 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-4/+5
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-7/+6
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 beacon queue configurationSujith Manoharan1-10/+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: fix aggregate size limit based on queue TXOP limitFelix Fietkau1-30/+43
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: make per-WMM-AC queue sizes configurable via debugfsFelix Fietkau1-2/+4
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-09Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirelessJohn W. Linville1-13/+18
Conflicts: net/mac80211/mlme.c
2012-06-26ath9k: raise aggregation limit to 64k for HT IBSSSven Eckelmann1-0/+12
mac80211 adds stations in HT IBSS as soon as a frame comes by, even if the HT capabilities are not known yet (they are often received later, e.g. in beacons). So far, ampdu factor/density are only calculated when the station is initially added. This patch changes this to update ampdu factor/density settings when starting a blockack session. Using this patch, we had performance boosts from 60 to 150 MBit/s between two 2x2 Atheros devices in 5 GHz HT IBSS mode. Signed-off-by: Sven Eckelmann <sven@narfation.org> Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-19ath9k: fix invalid pointer access in the tx pathFelix Fietkau1-12/+17
After setup_frame_info has been called, only info->control.rates is still valid, other control fields have been overwritten by the ath_frame_info data. Move the access to info->control.vif for checking short preamble to setup_frame_info before it gets overwritten. This regression was introduced in commit d47a61aa "ath9k: Fix multi-VIF BSS handling" Signed-off-by: Felix Fietkau <nbd@openwrt.org> Reported-by: Thomas Hühn <thomas@net.t-labs.tu-berlin.de> Acked-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Cc: stable@vger.kernel.org [3.4] Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-19ath9k: fix a tx rate duration calculation bugFelix Fietkau1-1/+1
The rate pointer variable for a rate series is used in a loop before it is initialized. This went unnoticed because it was used earlier for the RTS/CTS rate. This bug can lead to the wrong PHY type being passed to the duration calculation function. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-06ath9k: Fix powersave lockingSujith Manoharan1-0/+3
The 'ps_flags' is used/accessed in a variety of contexts and requires proper locking. Use 'sc_pm_lock' appropriately. 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-1/+1
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: Group link monitoring logicSujith Manoharan1-43/+3
Add link.c and move all the link/connection monitoring code to it. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-05-29ath9k: fix a use-after-free-bug when ath_tx_setup_buffer() failsFelix Fietkau1-6/+10
ath_tx_setup_buffer() can fail if there is no ath_buf left, or if mapping DMA failed. In this case it frees the skb passed to it. If ath_tx_setup_buffer is called from ath_tx_form_aggr, the skb is still linked into the tid buffer list and must be dequeued before being released. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@vger.kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-17ath9k: Fix TX fragmentationSujith Manoharan1-1/+9
Assigning sequence number for frames without taking care of the fragment field breaks transmission of fragmented frames. Fix this by assigning the fragment number properly. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-15ath9k_hw: remove ath9k_hw_gettxintrtxqsFelix Fietkau1-3/+2
The driver can just check the mask directly Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-15ath9k_hw: clean up tx completion interrupt handlingFelix Fietkau1-2/+1
TXQ_FLAG_TXOKINT_ENABLE and TXQ_FLAG_TXERRINT_ENABLE are always set and used together, and they share the same bitmask in enum ath9k_tx_queue_flags. Simplify the code that tests for these flags. 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-1/+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-15ath9k: Remove aggregation flagsSujith Manoharan1-12/+9
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-05ath9k: fix drv_tx_last_beacon on AR9003 by processing beacon tx statusFelix Fietkau1-2/+5
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-27ath9k: Calculate ampdu limit using a helperSujith Manoharan1-10/+9
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-01-05Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davemJohn W. Linville1-0/+3
Conflicts: drivers/net/wireless/b43legacy/dma.c
2012-01-04ath9k: fix tx queue sparse complaintLuis R. Rodriguez1-0/+3
This fixes this rant from sparse: CHECK drivers/net/wireless/ath/ath9k/xmit.c drivers/net/wireless/ath/ath9k/xmit.c:107:13: warning: context imbalance in 'ath_txq_lock' - wrong count at exit drivers/net/wireless/ath/ath9k/xmit.c:112:13: warning: context imbalance in 'ath_txq_unlock' - unexpected unlock drivers/net/wireless/ath/ath9k/xmit.c:123:30: warning: context imbalance in 'ath_txq_unlock_complete' - unexpected unlock CC [M] drivers/net/wireless/ath/ath9k/xmit. Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-01-03Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davemJohn W. Linville1-44/+74
Conflicts: drivers/net/wireless/b43/dma.c drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
2011-12-19net: fix assignment of 0/1 to bool variables.Rusty Russell1-2/+2
DaveM said: Please, this kind of stuff rots forever and not using bool properly drives me crazy. Joe Perches <joe@perches.com> gave me the spatch script: @@ bool b; @@ -b = 0 +b = false @@ bool b; @@ -b = 1 +b = true I merely installed coccinelle, read the documentation and took credit. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-12-19ath9k: fix tx locking issuesFelix Fietkau1-32/+64
The commit "ath9k: simplify tx locking" introduced a soft lockup triggered by mac80211 sending a BAR frame triggered by a driver call to ieee80211_tx_send_bar or ieee80211_tx_status. Fix these issues by queueing processed tx status skbs and submitting them to mac80211 outside of the lock. Signed-off-by: Felix Fietkau <nbd@openwrt.org> 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-12/+10
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-15ath9k: avoid retransmitting aggregation frames that a BAR was sent forFelix Fietkau1-3/+24
The receiver will discard them anyway. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-15ath9k: simplify tx lockingFelix Fietkau1-34/+5
Instead of releasing and taking back the lock over and over again in the tx path, hold the lock a bit longer, requiring much fewer lock/unlock pairs. This makes locking much easier to review and should not have any noticeable performance/latency impact. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-15ath9k: remove bogus sequence number incrementFelix Fietkau1-4/+0
tid->seq_next is initialized on A-MPDU start anyway, and the comment next to this chunk of code seems to be bogus as well. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-15ath9k: reduce indentation level in a few placesFelix Fietkau1-65/+60
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-15ath9k: reduce the number of unnecessary BAR tx packetsFelix Fietkau1-19/+31
When processing A-MPDU tx status, only send a BAR for the failed packet with the highest sequence number. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-15ath9k: change maximum software retransmission handlingFelix Fietkau1-3/+12
Instead of limiting a subframe to 10 A-MPDU software transmission attempts, count hardware retransmissions as well and raise the limit a bit. That way there will be fewer software retransmission attempts when traffic suffers from lots of hardware retransmissions. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-07ath9k: always issue a full hw reset after waking up from full-sleep modeFelix Fietkau1-1/+1
After waking up from full sleep, registers are accessible, but rx/tx typically fails. A fast channel change will not recover from this, so ensure that a full-sleep -> wake transition is always followed by a full reset. The reason why this hasn't created any serious problems yet is that it's hidden by the (wrong) behavior of enabling/disabling the radio when the wiphy idle state changes. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-28ath9k: improve ath_tx_aggr_stop to avoid TID stuck in cleanup stateNikolay Martynov1-7/+6
When tx agg is being stopped TID is flushed using ath_tx_flush_tid. It is possible that ath_tx_flush_tid completelly flushes TID (if all packets in this TID have already been retried). If this happened ath_tx_aggr_stop would leave TID in cleanup state permanently. Fix this by making ath_tx_flush_tid remove AGGR_ADDBA_COMPLETE and AGGR_CLEANUP flags from TID status if TID is empty. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-11-08ath9k: Add btcoex profile management support for AR9462Rajkumar Manoharan1-1/+4
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>