summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/rc.c
AgeCommit message (Collapse)Author
2012-11-21ath9k: Fix rate control debuggingSujith Manoharan
Update the rate statistics only when debugfs has been enabled in ath9k and mac80211 and move the stat() functions under proper conditionals. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-21ath9k: Fill remove_sta_debugfs() callbackSujith Manoharan
Remove the rate control statistics debugfs file properly via remove_sta_debugfs(). Also, check for both MAC80211_DEBUGFS and ATH9K_DEBUGFS config options. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-24ath9k: Enable SGI correctlySujith Manoharan
Set the driver specific SGI flag based on the station's HT capabilities, otherwise rate control uses the wrong rate. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: tune rc_stats to display only valid ratesRajkumar Manoharan
This could make rc_stats more simpler and ease the debugging. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: Trim rate tableSujith Manoharan
Remove ctrl_rate, cw40index, sgi_index, ht_index and calculate the rate index for TX status from the valid_rate_index that is populated at initialization time. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: Remove MIMO-PS specific codeSujith Manoharan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: Cleanup TX status APISujith Manoharan
Calculate the final rate index inside ath_rc_tx_status(). Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: Bail out properly before calculating rate indexSujith Manoharan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: Fix RTS/CTS rate selectionSujith Manoharan
The current method of assigning the RTS/CTS rate is completely broken for HT mode and breaks P2P operation. Fix this by using the basic_rates provided to the driver by mac80211. For now, choose the lowest supported basic rate for HT frames. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: Do not set IEEE80211_TX_RC_USE_SHORT_PREAMBLESujith Manoharan
mac80211 does it for us. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: Unify valid rate calculation routinesSujith Manoharan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: Remove ath_rc_set_valid_rate_idxSujith Manoharan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: Change rateset calculationSujith Manoharan
Commit "ath9k: Change rate control to use legacy rate as last MRR" resulted in the mixing of HT/legacy rates in a single rateset, which is undesirable. Revert this behavior. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: Cleanup index retrieval routinesSujith Manoharan
Trim API and remove unused variables. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: Cleanup ath_rc_setvalid_htratesSujith Manoharan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: Cleanup ath_rc_setvalid_ratesSujith Manoharan
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: Cleanup RC init APISujith Manoharan
A reference to the rate table is stored inside the private structure, so there is no need to pass "rate_table" around. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-08-10ath9k: Simplify rate table initializationSujith Manoharan
Remove various local variables that duplicate information already stored in mac80211. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-06-13ath9k: choose legacy rate as last rate of MRR seriesRajkumar Manoharan
Choose legacy rate as the last rate of Multi Rate Retry series if and only if the last selected rate is MCS and having higher PER rate. The current code fills a legacy rate as last one even though the previous rates in the series are having good PER value. This could limit the aggregation that affects the uplink performance. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-12Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
2012-04-10mac80211: notify driver of rate control updatesJohannes Berg
Devices that have internal rate control need to be notified when the bandwidth or SMPS state changes just like external rate control algorithms get a notification now. Add this notification and clarify the change bits while at it, the HT_CHANGED bit really meant only bandwidth changed. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-10mac80211: remove channel type argument from rate_updateJohannes Berg
The channel type argument to the rate_update() callback isn't really the correct way to give the rate control algorithm about the desired RX bandwidth of the peer. Remove this argument, and instead update the STA capabilities with 20/40 appropriately. The SMPS update done by this callback works in the same way, so this makes the callback cleaner. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-04-05simple_open: automatically convert to simple_open()Stephen Boyd
Many users of debugfs copy the implementation of default_open() when they want to support a custom read/write function op. This leads to a proliferation of the default_open() implementation across the entire tree. Now that the common implementation has been consolidated into libfs we can replace all the users of this function with simple_open(). This replacement was done with the following semantic patch: <smpl> @ open @ identifier open_f != simple_open; identifier i, f; @@ -int open_f(struct inode *i, struct file *f) -{ ( -if (i->i_private) -f->private_data = i->i_private; | -f->private_data = i->i_private; ) -return 0; -} @ has_open depends on open @ identifier fops; identifier open.open_f; @@ struct file_operations fops = { ... -.open = open_f, +.open = simple_open, ... }; </smpl> [akpm@linux-foundation.org: checkpatch fixes] Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Julia Lawall <Julia.Lawall@lip6.fr> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-03-15ath9k: Fix multi-VIF BSS handlingSujith Manoharan
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 Manoharan
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: completely zero intialize valid_phy_rate_idxMohammed Shafi Shajakhan
its better to zero initialize the 'valid_phy_rate_idx' array completely Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-27ath9k: avoid useless cast from (struct ath_rateset *) to (u8 *) and backPavel Roskin
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-15ath9k: stop on rates with idx -1 in ath9k rate control's .tx_statusPavel Roskin
Rate control algorithms are supposed to stop processing when they encounter a rate with the index -1. Checking for rate->count not being zero is not enough. Allowing a rate with negative index leads to memory corruption in ath_debug_stat_rc(). One consequence of the bug is discussed at https://bugzilla.redhat.com/show_bug.cgi?id=768639 Signed-off-by: Pavel Roskin <proski@gnu.org> Cc: stable@vger.kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-02-03ath9k: use WARN_ON_ONCE in ath_rc_get_highest_rixJohn W. Linville
The device seems to survive the issue, so no need to flood the logs about it... Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-12-19ath: Convert ath_dbg(bar, ATH_DBG_<FOO>, to ath_dbg(bar, FOOJoe Perches
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-14Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless Conflicts: drivers/net/wireless/iwlwifi/iwl-agn.c
2011-12-12ath9k: fix max phy rate at rate control initRajkumar Manoharan
The stations always chooses 1Mbps for all trasmitting frames, whenever the AP is configured to lock the supported rates. As the max phy rate is always set with the 4th from highest phy rate, this assumption might be wrong if we have less than that. Fix that. Cc: stable@kernel.org Cc: Paul Stewart <pstew@google.com> Reported-by: Ajay Gummalla <agummalla@google.com> Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-10-31drivers/net: Add export.h to files using EXPORT_SYMBOL/THIS_MODULEPaul Gortmaker
These were getting the macros from an implicit module.h include via device.h, but we are planning to clean that up. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> drivers/net: Add export.h to wireless/brcm80211/brcmfmac/bcmsdh.c This relatively recently added file uses EXPORT_SYMBOL and hence needs export.h included so that it is compatible with the module.h split up work. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
2011-09-30ath9k: Remove unnecessary AMPDU check at tx statusRajkumar Manoharan
Fill the ampdu_[ack]_len for both aggregation and normal frames. So that we could avoid unnecesary conditional at tx status. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-24ath9k: Change rate control to use legacy rate as last MRRRajkumar Manoharan
In congested network, having all rate reties at MCS rates is failing to transmit the frame offenly. By the time reaching the success rate set, the application gets timed out. One such scenario is that authentication time out during 4-Way handshake. This patch uses a legacy rate as last retry sequnce for unaggregated frames or if the first selected rate's PER is ~80% of max limit. And also observed from the tx status that the frame was trasmitted successfully by using legacy rates. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-10ath9k: optimize rate control statisticsMohammed Shafi Shajakhan
for the ease of debugging, we display only the rate control statistics for currently operating mode and bandwidth Cc: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Cc: "Balasubramanian, senthilkumar" <senthilb@qca.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-11ath9k: remove an unnecessary function declarationMohammed Shafi Shajakhan
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-06-17ath9k: use standard max(), remove A_MAX macroPavel Roskin
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-27Merge ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
2011-05-26ath9k: set 40 Mhz rate only if hw is configured in ht40Rajkumar Manoharan
Whenever there is a channel width change from 40 Mhz to 20 Mhz, the hardware is reconfigured to ht20. Meantime before doing the rate control updation, the packets are being transmitted are selected rate with IEEE80211_TX_RC_40_MHZ_WIDTH. While transmitting ht40 rate packets in ht20 mode is causing baseband panic with AR9003 based chips. ==== BB update: BB status=0x02001109 ==== ath: ** BB state: wd=1 det=1 rdar=0 rOFDM=1 rCCK=1 tOFDM=0 tCCK=0 agc=2 src=0 ** ath: ** BB WD cntl: cntl1=0xffff0085 cntl2=0x00000004 ** ath: ** BB mode: BB_gen_controls=0x000033c0 ** ath: ** BB busy times: rx_clear=99%, rx_frame=0%, tx_frame=0% ** ath: ==== BB update: done ==== Cc: stable@kernel.org Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-24Merge ↵John W. Linville
ssh://master.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem
2011-05-19ath9k: Drag the driver to the year 2011Sujith Manoharan
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-05Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/libertas/if_cs.c drivers/net/wireless/rtlwifi/pci.c net/bluetooth/l2cap_sock.c
2011-04-25ath9k: Fix warnings from -Wunused-but-set-variableSujith Manoharan
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-04-25Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/iwlwifi/iwl-core.c drivers/net/wireless/rt2x00/rt2x00queue.c drivers/net/wireless/rt2x00/rt2x00queue.h
2011-04-12ath9k: index out of boundsroel
Check whether index is within bounds before testing the element Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-23ath9k: Fix kernel panic caused by invalid rate index access.Senthil Balasubramanian
With the recent tx status optimization in mac80211, we bail out as and and when invalid rate index is found. So the behavior of resetting rate idx to -1 and count to 0 has changed for the rate indexes that were not part of the driver's retry series. This has resulted in ath9k using incorrect rate table index which caused the system to panic. Ideally ath9k need to loop only for the indexes that were part of the retry series and so simply use hw->max_rates as the loop counter. Pasted the stack trace of the panic issue for reference. [ 754.093192] BUG: unable to handle kernel paging request at ffff88046a9025b0 [ 754.093256] IP: [<ffffffffa02eac49>] ath_tx_status+0x209/0x2f0 [ath9k] [ 754.094888] Call Trace: [ 754.094903] <IRQ> [ 754.094928] [<ffffffffa051f883>] ieee80211_tx_status+0x203/0x9e0 [mac80211] [ 754.094975] [<ffffffffa053e305>] ? __ieee80211_wake_queue+0x125/0x140 [mac80211] [ 754.095017] [<ffffffffa02e66c9>] ath_tx_complete_buf+0x1b9/0x370 [ath9k] [ 754.095054] [<ffffffffa02e6fcf>] ath_tx_complete_aggr+0x51f/0xb50 [ath9k] [ 754.095098] [<ffffffffa05382a3>] ? ieee80211_prepare_and_rx_handle+0x173/0xab0 [mac80211] [ 754.095148] [<ffffffff81350e62>] ? _raw_spin_unlock_irqrestore+0x32/0x40 [ 754.095186] [<ffffffffa02e9735>] ath_tx_tasklet+0x365/0x4b0 [ath9k] [ 754.095224] [<ffffffff8107a2a2>] ? clockevents_program_event+0x62/0xa0 [ 754.095261] [<ffffffffa02e2628>] ath9k_tasklet+0x168/0x1c0 [ath9k] [ 754.095298] [<ffffffff8105599b>] tasklet_action+0x6b/0xe0 [ 754.095331] [<ffffffff81056278>] __do_softirq+0x98/0x120 [ 754.095361] [<ffffffff8100cd5c>] call_softirq+0x1c/0x30 [ 754.095393] [<ffffffff8100efb5>] do_softirq+0x65/0xa0 [ 754.095423] [<ffffffff810563fd>] irq_exit+0x8d/0x90 [ 754.095453] [<ffffffff8100ebc1>] do_IRQ+0x61/0xe0 [ 754.095482] [<ffffffff81351413>] ret_from_intr+0x0/0x15 [ 754.095513] <EOI> [ 754.095531] [<ffffffff81014375>] ? native_sched_clock+0x15/0x70 [ 754.096475] [<ffffffffa02bcfa6>] ? acpi_idle_enter_bm+0x24d/0x285 [processor] [ 754.096475] [<ffffffffa02bcf9f>] ? acpi_idle_enter_bm+0x246/0x285 [processor] [ 754.096475] [<ffffffff8127fab2>] cpuidle_idle_call+0x82/0x100 [ 754.096475] [<ffffffff8100a236>] cpu_idle+0xa6/0xf0 [ 754.096475] [<ffffffff81339bc1>] rest_init+0x91/0xa0 [ 754.096475] [<ffffffff814efccd>] start_kernel+0x3fd/0x408 [ 754.096475] [<ffffffff814ef347>] x86_64_start_reservations+0x132/0x136 [ 754.096475] [<ffffffff814ef451>] x86_64_start_kernel+0x106/0x115 [ 754.096475] RIP [<ffffffffa02eac49>] ath_tx_status+0x209/0x2f0 [ath9k] Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-28ath9k: fold struct ath_wiphy into struct ath_softcFelix Fietkau
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-01-04ath9k : few rate control clean upsMohammed Shafi Shajakhan
Remove some obvious looking dead code and rename few functions Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>