summaryrefslogtreecommitdiffstats
path: root/net/mac80211/rc80211_minstrel_ht.c
Commit message (Collapse)AuthorAgeFilesLines
* mac80211: stop modifying HT SMPS capabilityJohannes Berg2013-02-151-5/+1Star
| | | | | | | | | | Instead of modifying the HT SMPS capability field for stations, track the SMPS mode explicitly in a new field in the station struct and use it in the drivers that care about it. This simplifies the code using it. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: stop toggling IEEE80211_HT_CAP_SUP_WIDTH_20_40Johannes Berg2013-02-151-10/+9Star
| | | | | | | | | | | | | | | | | | | | | | | | | For VHT, many more bandwidth changes are possible. As a first step, stop toggling the IEEE80211_HT_CAP_SUP_WIDTH_20_40 flag in the HT capabilities and instead introduce a bandwidth field indicating the currently usable bandwidth to transmit to the station. Of course, make all drivers use it. To achieve this, make ieee80211_ht_cap_ie_to_sta_ht_cap() get the station as an argument, rather than the new capabilities, so it can set up the new bandwidth field. If the station is a VHT station and VHT bandwidth is in use, also set the bandwidth accordingly. Doing this allows us to get rid of the supports_40mhz flag as the HT capabilities now reflect the true capability instead of the current setting. While at it, also fix ieee80211_ht_cap_ie_to_sta_ht_cap() to not ignore HT cap overrides when MCS TX isn't supported (not that it really happens...) Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211/minstrel_ht: add support for using CCK ratesFelix Fietkau2013-02-131-17/+135
| | | | | | | | | | | | When MCS rates start to get bad in 2.4 GHz because of long range or strong interference, CCK rates can be a lot more robust. This patch adds a pseudo MCS group containing CCK rates (long preamble in the lower 4 slots, short preamble in the upper slots). Signed-off-by: Felix Fietkau <nbd@openwrt.org> [make minstrel_ht_get_stats static] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211/minstrel_ht: remove the sampling bypass check for the lowest rateFelix Fietkau2013-02-111-4/+0Star
| | | | | | | | It's more of an unnecessary micro-optimization and it prevents switching from long-GI to short-GI in HT20/single-stream for the lowest rate Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: simplify loop in minstrel_htJohannes Berg2012-11-301-5/+3Star
| | | | Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* Merge branch 'for-john' of ↵John W. Linville2012-07-121-2/+6
|\ | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Conflicts: drivers/net/wireless/iwmc3200wifi/cfg80211.c drivers/net/wireless/mwifiex/cfg80211.c
| * minstrel_ht: enable frame aggregation for fixed rateSylvain Roger Rieunier2012-07-121-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | When sample_idx is set to a value other than -1 it activates the IEEE80211_TX_CTL_RATE_CTRL_PROBE flag which disables frame aggregation. To allow frame aggregation during fixed rate it is necessary to set max_tp_rate, max_tp_rate2 and max_prob_rate instead of sample_idx. Signed-off-by: Sylvain Roger Rieunier <sylvain.roger.rieunier@gmail.com> [reword commit message a bit] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211: correct size the argument to kzalloc in minstrel_htThomas Huehn2012-07-091-1/+1
|/ | | | | | | | | | | | | msp has type struct minstrel_ht_sta_priv not struct minstrel_ht_sta. (This incorporates the fixup originally posted as "mac80211: fix kzalloc memory corruption introduced in minstrel_ht". -- JWL) Reported-by: Fengguang Wu <wfg@linux.intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de> Acked-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: remove hw.conf.channel usage where possibleMichal Kazior2012-04-131-3/+2Star
| | | | | | | | | | | | | | Removes hw.conf.channel usage from the following functions: * ieee80211_mandatory_rates * ieee80211_sta_get_rates * ieee80211_frame_duration * ieee80211_rts_duration * ieee80211_ctstoself_duration This is in preparation for multi-channel operation. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: remove channel type argument from rate_updateJohannes Berg2012-04-101-11/+4Star
| | | | | | | | | | | | | | | 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>
* mac80211: Don't sample max throughput rate in minstrel_htHelmut Schaa2012-03-151-0/+7
| | | | | | | | | | | The current max throughput rate is known to be good as otherwise it wouldn't be the max throughput rate. Since rate sampling can introduce some overhead (by adding RTS for example or due to not aggregating the frame) don't sample the max throughput rate. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Disable MCS > 7 in minstrel_ht when STA uses static SMPSHelmut Schaa2012-03-121-0/+9
| | | | | | | | | Disable multi stream rates (MCS > 7) when a STA is in static SMPS mode since it has only one active rx chain. Hence, it doesn't even make sense to sample multi stream rates. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* minstrel_ht: Remove unused function parametersPatrick Kelle2011-11-171-14/+12Star
| | | | | | | | | | | Remove unused function parameters in the following functions: minstrel_calc_rate_ewma() minstrel_ht_calc_tp() minstrel_aggr_check() minstrel_ht_set_rate() Signed-off-by: Patrick Kelle <patrick.kelle81@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Get rid of search loop for rate group indexHelmut Schaa2011-11-171-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | Finding the group index for a specific rate is done by looping through all groups and returning if the correct one is found. This code is called for each tx'ed frame and thus it makes sense to reduce its runtime. Do this by calculating the group index by this formula based on the SGI and HT40 flags as well as the stream number: idx = (HT40 * 2 * MINSTREL_MAX_STREAMS) + (SGI * MINSTREL_MAX_STREAMS) + (streams - 1) Hence, the groups are ordered by th HT40 flag first, then by the SGI flag and afterwards by the number of used streams. This should reduce the runtime of minstrel_ht_get_group_idx considerable. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Check rate->idx before rate->countHelmut Schaa2011-11-171-2/+2
| | | | | | | | | | The drivers are not required to fill in rate->count if rate->idx is set to -1. Hence, we should first check rate->idx before accessing rate->count. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: max_tp_rate2 management of minstrel_htLorenzo Bianconi2011-09-301-0/+2
| | | | | | | | | | I noticed a possible issue in the max_tp_rate2 management of minstrel_ht. In particular, if we look up just among max_tp_rate2 of each group it will be possible that the selected rate will not be the mcs with second maximum throughput. I wrote this simple patch. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* minstrel_ht: fix Open BA session request floodsChristian Lamparter2011-09-141-1/+2
| | | | | | | | | | | | | | | | | | Minstrel HT tries very hard to establish a BA session with each peer once there's some data on the way. However the stack does not inform minstrel if an aggregation session is already in place, so it keeps trying and wastes good cycles in the tx status path. [ 8149.946393] Open BA session requested for $AP tid 0 [ 8150.048765] Open BA session requested for $AP tid 0 [ 8150.174509] Open BA session requested for $AP tid 0 [ 8150.274376] Open BA session requested for $AP tid 0 ... Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Don't use EAPOL frames for rate samplingHelmut Schaa2011-08-091-1/+7
| | | | | | Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* minstrel_ht: fixed rate mode through debugfsZefir Kurtisi2011-06-011-0/+7
| | | | | | | | | Found several threads about fixed rate mode in minstrel_ht for test environments, but no patches for it. This patch provides such a mode through debugfs. Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2011-05-171-6/+21
|\ | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/iwlwifi/iwl-agn-tx.c net/mac80211/sta_info.h
| * mac80211: fix contention time computation in minstrel, minstrel_htDaniel Halperin2011-05-121-6/+21
| | | | | | | | | | | | | | | | | | | | When transmitting a frame, the transmitter waits a random number of slots between 0 and cw. Thus, the contention time is (cw / 2) * t_slot which we can represent instead as (cw * t_slot) >> 1. Also fix a few other accounting bugs around contention time, and add comments. Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | Merge branch 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6Linus Torvalds2011-04-071-1/+1
|\ \ | |/ |/| | | | | * 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6: Fix common misspellings
| * Fix common misspellingsLucas De Marchi2011-03-311-1/+1
| | | | | | | | | | | | Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
* | mac80211: fix a crash in minstrel_ht in HT mode with no supported MCS ratesFelix Fietkau2011-03-281-7/+18
|/ | | | | | | | | | | When a client connects in HT mode but does not provide any valid MCS rates, the function that finds the next sample rate gets stuck in an infinite loop. Fix this by falling back to legacy rates if no usable MCS rates are found. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Cc: stable@kernel.org Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Shortcut minstrel_ht rate setup for non-MRR capable devicesHelmut Schaa2011-03-141-7/+34
| | | | | | | | | | | | | Devices without multi rate retry support won't be able to use all rates as specified by mintrel_ht. Hence, we can simply skip setting up further rates as the devices will only use the first one. Also add a special case for devices with only two possible tx rates. We use sample_rate -> max_prob_rate for sampling and max_tp_rate -> max_prob_rate by default. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: update minstrel_ht sample rate when probe is setDaniel Halperin2011-03-091-10/+5Star
| | | | | | | | | Waiting until the status is received can cause the same rate to be probed multiple times consecutively. Cc: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Remove redundant preamble and RTS flag setup in minstrel_htHelmut Schaa2011-03-041-3/+1Star
| | | | | | | | | mac80211 does the same afterwards anyway. Hence, just drop this redundant code. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Add timeout to BA session start APISujith Manoharan2010-12-151-1/+1
| | | | | | | | | | | | | Allow drivers or rate control algorithms to specify BlockAck session timeout when initiating an ADDBA transaction. This is useful in cases where maintaining persistent BA sessions does not incur any overhead. The current timeout value of 5000 TUs is retained for all non ath9k/ath9k_htc drivers. Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: avoid aggregation for VO trafficLuis R. Rodriguez2010-11-241-0/+3
| | | | | | | | | | | This should help with latency issues which can happen when using aggregation. Cc: Felix Fietkau <nbd@openwrt.org> Cc: Matt Smith <matt.smith@atheros.com> Cc: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: minstrel_ht - reduce the overhead of rate samplingFelix Fietkau2010-11-151-6/+10
| | | | | | | | | | - reduce the number of retransmission attempts for sample rates - sample lower rates less often - do not use RTS/CTS for sampling frames - increase the time between sampling attempts Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: minstrel_ht A-MPDU fixBjörn Smedman2010-10-111-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | This patch fixes two problems with the minstrel_ht rate control algorithms handling of A-MPDU frames: 1. The ampdu_len field of the tx status is not always initialized for non-HT frames (and it would probably be unreasonable to require all drivers to do so). This could cause rate control statistics to be corrupted. We now trust the ampdu_len and ampdu_ack_len fields only when the frame is marked with the IEEE80211_TX_STAT_AMPDU flag. 2. Successful transmission attempts where only recognized when the A-MPDU subframe carrying the rate control status information was marked with the IEEE80211_TX_STAT_ACK flag. If this information happed to be carried on a frame that failed to be ACKed then the other subframes (which may have succeeded) where not correctly registered. We now update rate control statistics regardless of whether the subframe carrying the information was ACKed or not. Cc: <stable@kernel.org> Signed-off-by: Björn Smedman <bjorn.smedman@venatech.se> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: freeing the wrong variableDan Carpenter2010-07-261-1/+1
| | | | | | | | The intent was to free "msp->ratelist" here. "msp->sample_table" is always NULL at this point. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* minstrel_ht: remove unnecessary NULL check in minstrel_ht_update_capsJohn W. Linville2010-07-261-1/+1
| | | | | | | | If sta is NULL, we will have problems long before we get here... Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Cc: Felix Fietkau <nbd@openwrt.org>
* minstrel_ht: fix check for downgrading of top2 rateMing Lei2010-07-021-2/+2
| | | | | | | | | The check should be against current top2 rate, instead of current top rate. Signed-off-by: Ming Lei <tom.leiming@gmail.com> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* minstrel_ht: fix updating rate with best probabilityMing Lei2010-07-021-0/+2
| | | | | | | | | The throughput should be considered when updating rate with best probability. Signed-off-by: Ming Lei <tom.leiming@gmail.com> Acked-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* minstrel_ht: make *idx unsigned in minstrel_downgrade_rateJohn W. Linville2010-06-241-1/+2
| | | | | | | | | | | | net/mac80211/rc80211_minstrel_ht.c:440:46: warning: incorrect type in argument 2 (different signedness) net/mac80211/rc80211_minstrel_ht.c:440:46: expected int *idx net/mac80211/rc80211_minstrel_ht.c:440:46: got unsigned int *<noident> net/mac80211/rc80211_minstrel_ht.c:446:46: warning: incorrect type in argument 2 (different signedness) net/mac80211/rc80211_minstrel_ht.c:446:46: expected int *idx net/mac80211/rc80211_minstrel_ht.c:446:46: got unsigned int *<noident> Signed-off-by: John W. Linville <linville@tuxdriver.com> Acked-by: Felix Fietkau <nbd@openwrt.org>
* mac80211: use RCU for TX aggregationJohannes Berg2010-06-141-1/+1
| | | | | | | | | | | | | Currently we allocate some memory for each TX aggregation session and additionally keep a state bitmap indicating the state it is in. By using RCU to protect the pointer, moving the state into the structure and some locking trickery we can avoid locking when the TX agg session is fully operational. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: add the minstrel_ht rate control algorithmFelix Fietkau2010-06-021-0/+824
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>