summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/mvm/rs.c
AgeCommit message (Collapse)AuthorFilesLines
2015-11-18iwlwifi: move under intel vendor directoryKalle Valo1-3983/+0
Part of reorganising wireless drivers directory and Kconfig. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-10-25iwlwifi: rs: Remove workaround that disables MIMO on P2PAlexander Bondar1-6/+0
Remove an old workaround that's no longer needed and enable MIMO on P2P interfaces. Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-10-05iwlwifi: mvm: rs: dynamically switch between 80MHz and 20MHz in some scenariosEyal Shapira1-0/+47
This is a tweak which has been shown to improve performance when moving away from the AP while working in 80Mhz. When RS decides to go down to 80MHz SISO MCS0 instead switch to 20MHz MCS4. Go back to 80MHz MCS1 if RS can sustain 20MHz MCS5. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-10-05iwlwifi: mvm: rs: fix success ratio comparison in rs_get_best_rateEyal Shapira1-2/+2
success_ratio is actually 128 * SR in percentage while IWL_MVM_RS_SR_NO_DECREASE is 85%. Fix this by using RS_PERCENT(). This bug caused the if branch to be always executed. This in turn led to always selecting a rate, following a column switch, in which the expected throughput would exceed the best expected current throughput. In some scenarios where the success ratio isn't >85% such a rate could be too aggressive leading us to avoid the new column. This has the potential of causing sub optimal performance. Reported-by: Moshe Harel <moshe.harel@intel.com> Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-10-05iwlwifi: mvm: rs: minor indentation fixEyal Shapira1-2/+2
Indentation was off a bit. Fix it. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-10-05iwlwifi: mvm: rs: remove overflowing debug messageEyal Shapira1-1/+0
This message isn't very useful and creates clutter. Remove it. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-10-05iwlwifi: mvm: rs: improve rate debug messagesEyal Shapira1-9/+51
Pretty print the rate full details to ease debugging. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-08-18iwlwifi: rs: disable MIMO only if allowed in configurationAlexander Bondar1-1/+2
Fix bug where MIMO is disabled for low latency TX on P2P VIF regardless of configuration. Make it dependent on IWL_MVM_RS_DISABLE_P2P_MIMO compilation option. Change configuration so that MIMO will be disabled only in SDIO platforms. Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-06-26iwlwifi: mvm: rs: report last tx rate based on RSSI and capsEyal Shapira1-7/+150
In scenarios where we haven't converged yet to a specific modulation and rate it could be better to report to userspace the last tx rate based on the STA capabilities and RSSI. This is important as sometimes userspace displays the last tx rate as the link speed. This avoids being presented with low legacy rates when rs just begins its search or after an idle period in which it resets itself. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-06-03iwlwifi: prepare for higher API/CAPA bitsJohannes Berg1-5/+5
Currently, loading the firmware fails when it has higher API or CAPA bits than the driver supports. That's an issue with integration. At the same time, actually using api[0] and capa[0] will become confusing when we also have api[1] and capa[1], and it's almost certain that we'll mix up the bits and use the bits for api[1] with api[0] by accident. Avoid all this by translating the API/CAPA bits to the regular kernel test_bit() format, and also providing wrapper functions. Also use the __bitwise__ facility of sparse to check that we're testing the right one. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-06-03iwlwifi: mvm: rs: pass rate directly to column checksEyal Shapira1-7/+7
A minor refactoring for following patches. This enables the reuse of the checks functions. type=cleanup Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-05-26Merge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-nextEmmanuel Grumbach1-0/+3
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Conflicts: drivers/net/wireless/iwlwifi/Kconfig
2015-05-10iwlwifi: mvm: forbid MIMO on devices that don't support itEmmanuel Grumbach1-0/+3
There are devices that forbid MIMO by the mean of the NVM. Detect thoses devices and forbid MIMO otherwise the firmware would crash. STBC is still allowed on these devices. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-04-29iwlwifi: rs: remove unneeded check of average tpt in windowLiad Kaufman1-7/+0
Previously there was a check that compared window->average_tpt to some value, and if it was different - it set it to that value. However, this value was already calculated and set in _rs_collect_tx_data(), so the entire check is unneeded. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-04-29iwlwifi: rs: cleanup last_txrate_idxEyal Shapira1-7/+3
last_txrate_idx isn't used anymore and can be dropped as this info exists already somewhere else. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-04-29iwlwifi: rs: remove code duplication when filling lq cmdLiad Kaufman1-3/+0
Same code appear a few lines later while the position has no effect on the actual flow. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-04-07Merge tag 'iwlwifi-next-for-kalle-2015-04-02' of ↵Kalle Valo1-11/+8
https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next * some more work on LAR * fixes for UMAC scan * more work on debugging framework * more work for 8000 devices * cleanups and small bugfixes
2015-04-02Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-2/+22
Conflicts: drivers/net/usb/asix_common.c drivers/net/usb/sr9800.c drivers/net/usb/usbnet.c include/linux/usb/usbnet.h net/ipv4/tcp_ipv4.c net/ipv6/tcp_ipv6.c The TCP conflicts were overlapping changes. In 'net' we added a READ_ONCE() to the socket cached RX route read, whilst in 'net-next' Eric Dumazet touched the surrounding code dealing with how mini sockets are handled. With USB, it's a case of the same bug fix first going into net-next and then I cherry picked it back into net. Signed-off-by: David S. Miller <davem@davemloft.net>
2015-04-02iwlwifi: fix spelling errorsSara Sharon1-2/+2
Fix spelling error across the driver. Modified only comments and prints. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-04-02iwlwifi: mvm: rs: refactor rs_update_rate_tblEyal Shapira1-6/+5
Minor cleanup and refactoring. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-30iwlwifi: mvm: rs: fix comment indentationLiad Kaufman1-3/+1
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-19iwlwifi: mvm: protect rate scaling against non-mvm IBSS stationsJohannes Berg1-2/+22
When the driver callback returns that it's out of space for new stations, the mac80211 IBSS code still keeps the station so it doesn't try to add it over and over again. Since the rate scaling algorithm is separate in mac80211, it also invokes the rate scaling algorithm for such stations. It doesn't know that our rate scaling algorithm is tightly integrated with the MVM code and relies on those data structures, and it cannot as the abstraction doesn't allow for it. This leads to crashes when the rate scaling algorithm tries to use uninitialized data, notably the mvmsta->vif pointer. Protect against this in the rate scaling algorithm. We cannot get good rates with such peers anyway since the firmware cannot do anything with them. This should fix https://bugzilla.kernel.org/show_bug.cgi?id=93461 CC: <stable@vger.kernel.org> Reported-by: Richard Taylor <rjt-kernel@thegrindstone.me.uk> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-12iwlwifi: mvm: rs: update Tx statistics when using fixed rateEyal Shapira1-7/+63
The Tx statistics weren't updated when using fixed rate for debugging. Fix this as Tx statistics are useful in this use case. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-12iwlwifi: mvm: rs: improve ss_params debug printEyal Shapira1-4/+4
Make the print a bit more readable. Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-12iwlwifi: fix smatch warning: warn: inconsistent indentingEmmanuel Grumbach1-9/+9
While at it, fix a few checkpatch issues. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-01iwlwifi: mvm: rs: print single stream params via debugfsEyal Shapira1-0/+11
Add this to the info printed when reading rate_scale_table. Useful for debugging. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-01iwlwifi: mvm: rs: avoid ss_force from being reset after tx idleEyal Shapira1-9/+12
ss_force is a debugging option to force a certain single stream tx mode. It's not useful if it gets reset after tx idle. Fix that. While at it also make sure any code touching ss_force will only get compiled if debugfs support is configured. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-01iwlwifi: mvm: rs: disable MIMO for low latency P2PEyal Shapira1-0/+8
Due to issues with Miracast adapters MIMO reception disable use of MIMO when for low latency P2P traffic. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-01iwlwifi: mvm: rs: adapt rate matching to new STBC/BFEREyal Shapira1-9/+36
Once the FW supports autonomous decision between STBC/BFER/SISO we no longer set the STBC bit and ANT_AB in the rate table. However the FW rate in the tx response will have the STBC or BFER bit set and the antennas set to ANT_AB in case these were chosen by it. This will cause us to discard any such response as unmatching the current LQ table and thus break the rs search cycle completely. Fix this by relaxing the rate matching in case we're working with the new API and STBC/BFER are used. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-03-01iwlwifi: mvm: rs: fix BT Coex check to look at the correct antEyal Shapira1-7/+14
The check to avoid the shared antenna was passed the wrong antenna parameter. It should have checked whether the antenna of the next column we're considering is allowed and instead it was passed the current antenna. This could lead to a wrong choice of the next column in the rs algorithm and non optimal performance. Fixes: commit 219fb66b49fac64bb ("iwlwifi: mvm: rs - don't use the shared antenna when BT load is high") Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-02-23iwlwifi: mvm: rs: fix BT Coex check to look at the correct antEyal Shapira1-7/+14
The check to avoid the shared antenna was passed the wrong antenna parameter. It should have checked whether the antenna of the next column we're considering is allowed and instead it was passed the current antenna. This could lead to a wrong choice of the next column in the rs algorithm and non optimal performance. Fixes: commit 219fb66b49fac64bb ("iwlwifi: mvm: rs - don't use the shared antenna when BT load is high") CC: <stable@vger.kernel.org> [3.19] Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-02-23iwlwifi: mvm: rs: better match tx response rate to the LQ tableEyal Shapira1-76/+43
Currently rs uses the info in mac80211 tx status which is a translation of the actual rate coming up from the FW in the tx response. This is matched up against the LQ table first rate to make sure this tx frame used the current LQ table. Instead of using the translated mac80211 info it's easier and cleaner to just pass the actual tx response rate in the driver private data and use that for matching. This becomes even more important once the FW begins to decide on its own whether to use STBC/BFER/SISO. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-02-01iwlwifi: mvm: rs: enable forcing single stream Tx decisionEyal Shapira1-0/+84
In certain testing scenarios we'd like to force a decision between STBC/BFER/SISO. In the normal scenario this decision is done by the FW. Enable this option vis debugfs. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-02-01iwlwifi: mvm: add beamformer supportEyal Shapira1-17/+140
VHT Beamformer (BFER) will be used if the peer supports it and there's a benefit to use it vs. STBC or SISO. The driver now tells the FW whether BFER and/or STBC are allowed but the FW will make the decision to use either or stick to SISO on its own. BFER is limited to a single remote peer. The driver takes care of ensuring this to the FW and prioritizes with which peer BFER will be used. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22iwlwifi: mvm: rs: remove stats argument from functionsJohannes Berg1-22/+70
The stats argument is always only passed as &mvm->drv_rx_stats, so there's no point in passing it when the mvm pointer is passed. Remove the argument entirely. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Reviewed-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22iwlwifi: mvm: use a new API for enabling STBCEyal Shapira1-1/+13
The new API tells the FW that it's allowed to use STBC but the FW will decide on its own whether to use STBC or SISO (and in the future Beamformer). Keep support for the old API which sets STBC explicitly in the rates in the LQ table while we still support old FW revisions. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22iwlwifi: mvm: rs: refactor ht/vht initEyal Shapira1-38/+4
Prepare to add some more code there so refactor to separate functions. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22iwlwifi: mvm: rs: use STBC regardless of power save modeEyal Shapira1-8/+0
Tx STBC was used only when in CAM mode or if powersave is disabled. Effectively this meant we never used STBC as these modes aren't used on most platforms by default. Change that. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22iwlwifi: mvm: rs: cleanup unuseful and overflowing tracesEyal Shapira1-3/+1
These aren't useful and overflowing so drop them and also fix a minor typo. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22iwlwifi: mvm: rs: allow to disable MIMO for P2P onlyEmmanuel Grumbach1-1/+1
This is to work around interoperability bugs with devices that don't hanle MIMO properly. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2015-01-22iwlwifi: mvm: rs: repeat initial legacy rates in LQ tableEyal Shapira1-9/+10
Repeating the legacy rates avoids degrading quickly to lower rates due to collisions which is common when doing TCP Tx traffic in legacy. This slightly improves TCP Tx throughput while working in legacy in different scenarios. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28iwlwifi: mvm: rs: organize and cleanup constsEyal Shapira1-58/+51
Organize and cleanup the consts used by rs. This is part of making some of these configurable. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28iwlwifi: mvm: use iwl_mvm_sta_from_mac80211() consistentlyJohannes Berg1-8/+5
A number of places (still) use a direct operation, use iwl_mvm_sta_from_mac80211() consistently. In one place also move it into the variable initializer. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28iwlwifi: mvm: rs: fix max rate allowed if no rate is allowedEyal Shapira1-7/+18
In case the rate mask for one of the modulations was zero the max rate idx for that modulation was set to 32 (BITS_PER_LONG). This is bad as it would later lead to an out of bounds access to the expected tpt table. In most cases there was no real effect as the expected tpt was set to 0 and this led to avoiding the modulation effectively. Fix the out of bounds access and explicitly skip the modulation in case there's no rate allowed in it. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-12-28iwlwifi: mvm: support LnP 1x1 antenna configurationMoshe Harel1-11/+11
The antenna configuration has to be read also from OTP Currently read only from FW image Guideline: An antenna exists only if appears both in FW image & NVM Signed-off-by: Moshe Harel <moshe.harel@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-11-23iwlwifi: mvm: rs: consider a missing BA as a single tx failureEyal Shapira1-0/+7
The fw now indicates missing BA with ampdu_ack_len=0. This will make the whole aggregation being marked as failed, although it's most likely not the case (and only the BA itself was failed). Consider this case as a single tx failure. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Eliad Peller <eliadx.peller@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-11-11iwlwifi: mvm: rs - don't use the shared antenna when BT load is highEmmanuel Grumbach1-0/+16
When we need only one antenna, we should refrain from using the antenna that is shared with BT if BT load is high. Fix this. Reviewed-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-11-11iwlwifi: mvm: rs: fix getting stuck in a test windowEyal Shapira1-7/+6
When Tx STBC is being used and RS switches to a search column using the alternate antenna from the current one there is a problem with using rs_rate_match to figure out which table is the active and which one is the search one. The root cause is because in STBC the antenna mask in the ucode rate is set to ANT_AB and in this specific scenario it matches both the active and search table (e.g. SISO_ANT_A and SISO_ANT_B). This leads to tx stats being updated in the wrong table and later on to getting stuck in a test window and not moving on to other columns. If this happens during the initial search cycle we never end it and therefore never enable aggregation which leads naturally to severe througput degradation. Fix it by deducing which table is which by knowing whether we're in a search or not like it's being done in rs_rate_scale_perform Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-11-11iwlwifi: mvm: rs: fix a WARNING in case of STBC and VHTEyal Shapira1-1/+1
This was taken care of in case we're doing STBC with HT but not when working with VHT. Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
2014-11-11iwlwifi: mvm: rs: don't use shadowing variableJohannes Berg1-3/+4
The variable 'tid' is already defined in this function, so use just 't' for the new one. As we return from the function just overwriting 'tid' would be acceptable, but less obvious to the reader. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>