]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
10 years agoiwlwifi: pcie: don't panic on host commands in iwldvm
Emmanuel Grumbach [Mon, 20 Jan 2014 07:50:29 +0000 (09:50 +0200)]
iwlwifi: pcie: don't panic on host commands in iwldvm

None of the devices supported by iwldvm have support for
shadow registers. This means that we wake the NIC
when we increment the write pointer on Tx ring.
This happened even before my bad commit mentionned below.
Since my commit below, we wake up the NIC when we put a
host command on the ring regardless of shadow register
support. This means that in iwldvm (when the NIC doesn't
support shadow register), we wake up the NIC twice:

pcie_enqueue_hcmd:
wake up the NIC
iwl_pcie_txq_inc_wr_ptr:
wake up the NIC - no shadow reg support

Since waking up the NIC means that we need to acquire a
spinlock, this obviously leads to a recursive spinlock
and hence a freeze.

Fixes: b9439491055a ("iwlwifi: pcie: keep the NIC awake when commands are in flight")
Reported-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: don't use highest rate in VHT MCS Set
Eyal Shapira [Sun, 5 Jan 2014 17:27:24 +0000 (19:27 +0200)]
iwlwifi: mvm: don't use highest rate in VHT MCS Set

Keeping this as 0 is ok according to spec section 9.7.11
as this means the limits are according to the Tx/Rx
supported MCS x NSS bitmap. Initially we've set these as
there were concerns of interop issues but these turned out
to be false.

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>
10 years agoiwlwifi: mvm: add REPLY_SF_CFG_CMD to cmd strings
David Spinadel [Thu, 9 Jan 2014 07:55:38 +0000 (09:55 +0200)]
iwlwifi: mvm: add REPLY_SF_CFG_CMD to cmd strings

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix theoretical uninitialized function return value
Eytan Lifshitz [Tue, 7 Jan 2014 10:50:45 +0000 (12:50 +0200)]
iwlwifi: mvm: fix theoretical uninitialized function return value

If we try to write NVM that do not exist, the function will return
uninitialized value. fixed.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: add inline helper for packet lengths
Johannes Berg [Wed, 8 Jan 2014 12:16:33 +0000 (13:16 +0100)]
iwlwifi: add inline helper for packet lengths

Add an inline helper function for getting an RX packet's
length or payload length and use it throughout the code
(most of which I did using an spatch.)

While at it, adjust some code, and remove a bogus comment
from the dvm calibration code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: change beamformee STS cap
Eyal Shapira [Mon, 6 Jan 2014 18:16:48 +0000 (20:16 +0200)]
iwlwifi: change beamformee STS cap

All beamformee supporting chips have the ability to support
VHT NDP in up to 4 STSs. So change the published beamformee
STS cap accordingly to 3 as it should be Nsts-1.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: reset Thermal Throttling's SMPS request upon disassociation
Emmanuel Grumbach [Mon, 6 Jan 2014 11:38:55 +0000 (13:38 +0200)]
iwlwifi: mvm: reset Thermal Throttling's SMPS request upon disassociation

The request of SMPS issued by the Thermal Throttling code
was not reset when we disassociated - fix that.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: remove unused flags from add station command
Emmanuel Grumbach [Wed, 1 Jan 2014 08:05:55 +0000 (10:05 +0200)]
iwlwifi: mvm: remove unused flags from add station command

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: use array indexing instead of treating it as a pointer
Johannes Berg [Mon, 6 Jan 2014 08:29:40 +0000 (09:29 +0100)]
iwlwifi: mvm: use array indexing instead of treating it as a pointer

It's a bit strange to treat an array as a pointer, so use proper
array indexing instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix SRAM dump debugfs handler
Emmanuel Grumbach [Mon, 6 Jan 2014 07:05:54 +0000 (09:05 +0200)]
iwlwifi: mvm: fix SRAM dump debugfs handler

If the length isn't set it means we want all the SRAM.
Also - this is perfectly valid to partially dump starting
at offset 0.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: fix a theoretical out of bounds access
Eyal Shapira [Sun, 5 Jan 2014 19:04:19 +0000 (21:04 +0200)]
iwlwifi: mvm: rs: fix a theoretical out of bounds access

Discovered by klocwork

Array 'iwl_rate_mcs' of size 15 may use index value(s) -1
  * rs.c:2562: index = iwl_hwrate_to_plcp_idx(rate)
    * rs.c:2562: Result of function call 'iwl_hwrate_to_plcp_idx(rate)' is '[-1,14]'
  * rs.c:2565: Array 'iwl_rate_mcs' size is 15.
  * rs.c:2565: Possible attempt to access element -1 of array 'iwl_rate_mcs'.

While at it stop using index = -1 and always use IWL_RATE_INVALID

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: send all the NVM sections to the NIC
Emmanuel Grumbach [Sun, 5 Jan 2014 13:09:44 +0000 (15:09 +0200)]
iwlwifi: mvm: send all the NVM sections to the NIC

Some NIC comes with more than the 4 NVM (non volative
memory) sections described in the nvm_to_read array.
These NICs usually get their NVM from an external file
fetched from userland during init.
We already parsed the file, but sent to the NIC only 4 NVM
sections whereas there could be more sections in the file.
Fix this.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix tx seq_ctrl debug print
Eliad Peller [Tue, 31 Dec 2013 16:54:06 +0000 (18:54 +0200)]
iwlwifi: mvm: fix tx seq_ctrl debug print

Since seq_number is incremented right after using
it, so printed seq_ctrl was actually the next
one to be used.

Fix it by incrementing the seq_number only later,
before saving it.

Additionally, use the IEEE80211_SEQ_TO_SN macro
in order to print the actual sequence number.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: enable oscillator for L1 exit
Emmanuel Grumbach [Tue, 24 Dec 2013 12:15:41 +0000 (14:15 +0200)]
iwlwifi: pcie: enable oscillator for L1 exit

Enabling the oscillator consumes slightly more power (100uA)
but allows to make sure that we exit from L1 on time.

Not doing so might lead to a PCIe specification violation
since we might wake up from L1 at the wrong time.
This issue has been identified on 3160 and 7260 only.
On older NICs L1 off is not enabled, on newer NICs (7265),
the issue is fixed.

When the bug occurs the user sees that the NIC has
disappeared from the PCI bridge, any access to the device
returns 0xff.

This fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=64541

and has been extensively discussed here:
http://markmail.org/thread/mfmpzqt3r333n4bo

Cc: stable@vger.kernel.org [3.10+]
Fixes: 99cd47142399 ("iwlwifi: add 7000 series device configuration")
Reported-and-tested-by: wzyboy <wzyboy@wzyboy.org>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: don't set the drain bit when we flush the AP station
Emmanuel Grumbach [Thu, 2 Jan 2014 08:01:46 +0000 (10:01 +0200)]
iwlwifi: mvm: don't set the drain bit when we flush the AP station

When we disassociate in managed mode, we flush the queues
after mac80211 has already removed the station.
During that time, the pointer to ieee80211_sta to the
fw_id_to_mac_id map is -EINVAL. In that case we should not
set the station as being drained when the last Tx of this
station has exited the shared Tx queue since we are
flushing all the queues anyway.
The draining logic is meant to be used in GO / AP mode only.
In GO / AP mode, we set -EBUSY in the fw_id_to_mac_id map.

This is why testing the ieee80211_sta pointer in the
fw_id_to_mac_id map with IS_ERR isn't enough to set the
station as draining, we need to check that it is -EBUSY.

The only impact of the bug was a print:

Drained sta 1, but it is internal?

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: rs: fix handling of column switch error
Eyal Shapira [Tue, 7 Jan 2014 16:19:35 +0000 (18:19 +0200)]
iwlwifi: mvm: rs: fix handling of column switch error

If we can't switch to a column because no rates are supported
in that column this led to a state where the search cycle
got stuck and never ended. This in turn also led to aggregation
not being turned on. Fix this by marking a column as
visited if we can't switch to it.

Reported-and-tested-by: Karl Beldan <karl.beldan@gmail.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix missing cleanup in .start() error path
Eliad Peller [Sun, 5 Jan 2014 10:41:12 +0000 (12:41 +0200)]
iwlwifi: mvm: fix missing cleanup in .start() error path

Cleanup of iwl_mvm_leds was missing in case of error,
resulting in the following warning:

WARNING: at lib/kobject.c:196 kobject_add_internal+0x1f4/0x210()
kobject_add_internal failed for phy0-led with -EEXIST, don't try to register things with the same name in the same directory.

which prevents further reloads of the driver.

Cc: stable@vger.kernel.org [3.10+]
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: update power after binding in start_ap_ibss()
Ilan Peer [Tue, 31 Dec 2013 19:19:55 +0000 (21:19 +0200)]
iwlwifi: mvm: update power after binding in start_ap_ibss()

The power settings need to be updated after a binding flow is done
and before quota calculations. This was missing in the start_ap_ibss()
flow. Fix it.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: clear ap_ibss_active in case of failure
Ilan Peer [Tue, 31 Dec 2013 19:05:50 +0000 (21:05 +0200)]
iwlwifi: mvm: clear ap_ibss_active in case of failure

The state variable was not set to false in case of a failure to
complete the start_ap_ibss() flow.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix coccinelle warnings
Fengguang Wu [Tue, 31 Dec 2013 09:04:18 +0000 (11:04 +0200)]
iwlwifi: mvm: fix coccinelle warnings

drivers/net/wireless/iwlwifi/mvm/led.c:106:2-3: Unneeded semicolon

 Removes unneeded semicolon.

Generated by: coccinelle/misc/semicolon.cocci

CC: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: Update Copyright to 2014
Emmanuel Grumbach [Mon, 30 Dec 2013 11:15:54 +0000 (13:15 +0200)]
iwlwifi: Update Copyright to 2014

Happy new year!

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: fix a potential NULL deref
Eyal Shapira [Mon, 23 Dec 2013 14:26:41 +0000 (16:26 +0200)]
iwlwifi: mvm: rs: fix a potential NULL deref

Found by klocwork analysis.
mvm could be NULL which may cause a NULL dereference
in a theoretical call flow

rs_fill_lq_cmd(mvm = NULL, ...)
rs_build_rates_table
rs_fill_rates_for_column
ucode_rate_from_rs_rate
IWL_ERR(mvm,...)

No real reason for passing NULL to rs_fill_lq_cmd so fix that.

Reported-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: dynamically update tsf_id
Ilan Peer [Mon, 23 Dec 2013 20:18:02 +0000 (22:18 +0200)]
iwlwifi: mvm: dynamically update tsf_id

Currently, the MAC context tsf_id assignment and the master/slave
relations are determined only when a new vif is added, as part
of the MAC context resource allocation. However, at this stage, the
beacon interval is not known, and thus could not be taken into account
in the master-slave algorithm.

To fix this, recalculate the MAC context tsf_id assignment,
just before the MAC context is activated, i.e., just before
a station VMAC is configured to associated and before an AP
VMAC is started.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: change the parameters for calculating an AP TBTT
Ilan Peer [Tue, 24 Dec 2013 15:17:05 +0000 (17:17 +0200)]
iwlwifi: mvm: change the parameters for calculating an AP TBTT

Change the parameters for calculating an AP TBTT to 64/36 instead of
80/20, to increase the interval between a station vif and an AP
vif TBTT events.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: Fix CSR_RESET operation access type
Eran Harary [Wed, 11 Dec 2013 06:13:50 +0000 (08:13 +0200)]
iwlwifi: pcie: Fix CSR_RESET operation access type

The access to the CSR_RESET reg should be done as a complete
DWORD and not by setting a bit. This is the right way to reset
the device.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Add a missed beacons threshold
Ilan Peer [Tue, 24 Dec 2013 20:08:14 +0000 (22:08 +0200)]
iwlwifi: mvm: Add a missed beacons threshold

Instead of always calling ieee80211_beacon_loss() on every missed
beacons notification, call this function only if the number of
consecutive missed beacons from last rx is higher than a predefined
threshold.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: squash a spurious warning on chnctx change
Arik Nemtsov [Sun, 29 Dec 2013 15:57:53 +0000 (17:57 +0200)]
iwlwifi: mvm: squash a spurious warning on chnctx change

If the channel min-width changes, we can update the PHY ctx, even if
it has multiple references.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: dump to debugfs the SRAM as binary
Emmanuel Grumbach [Tue, 24 Dec 2013 12:58:29 +0000 (14:58 +0200)]
iwlwifi: mvm: dump to debugfs the SRAM as binary

This allows to format it at will using external tools.
Since different teams want it in different formats, dump
the raw data and everyone can play with the data the way
they want.

While at it - make this code slightly more robust by making
the required verification on the offsets / length in the
write handler.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - update channel inihibition for channel 14
Emmanuel Grumbach [Tue, 24 Dec 2013 08:55:24 +0000 (10:55 +0200)]
iwlwifi: mvm: BT Coex - update channel inihibition for channel 14

This channel inhibition for channel 14 was wrong. Fix it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix harmless smatch / coccinelle warnings
Emmanuel Grumbach [Sun, 22 Dec 2013 08:55:47 +0000 (10:55 +0200)]
iwlwifi: mvm: fix harmless smatch / coccinelle warnings

Don't check if mvm->fw->cs is NULL since it can't be.
cs is an array member of iwl_fw, it can't be NULL.

Use memset(ptr, 0, sizeof(*ptr)); instead of
memset(ptr, 0, sizeof(struct ptr_type));

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: disable the device as soon as RFKILL fires
Emmanuel Grumbach [Thu, 19 Dec 2013 20:20:58 +0000 (22:20 +0200)]
iwlwifi: mvm: disable the device as soon as RFKILL fires

The firmware needs to be stopped quickly (100ms) after the
RFKILL interrupt fired. Failing to do so would allow the
firmware to access the radio registers which would lead to
a hardware error.

Before this change, we would kill the firmware only when
mac80211 stops the device which can take a fair amount of
time. Take a shortcut by stopping the device right away
in the interrupt.

This is not relevant if the current firmware is INIT
firmware since that firmware can run while in RFKILL.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: allow the op_mode to call stop_device whenever it wants
Emmanuel Grumbach [Thu, 19 Dec 2013 20:19:17 +0000 (22:19 +0200)]
iwlwifi: pcie: allow the op_mode to call stop_device whenever it wants

Calling stop_device when start_fw wasn't called would issue:
Stopping tx queues that aren't allocated...

Also allow the op_mode to call stop_device and then to
disable the Tx queues - in that case just silently ignore
the disabling on the Tx queues, since the PRPH registers
aren't reachable any more.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: don't update the op_mode if rfkill hasn't changed
Emmanuel Grumbach [Sun, 22 Dec 2013 13:13:01 +0000 (15:13 +0200)]
iwlwifi: pcie: don't update the op_mode if rfkill hasn't changed

This is useless and introduces a dependency between rfkill
and stop_device - the op_mode can't call stop_device from
the rfkill notification since it would lead to an endless
recursion.
Next patches will need to do so.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: keep the NIC awake when commands are in flight
Emmanuel Grumbach [Sun, 22 Dec 2013 13:09:40 +0000 (15:09 +0200)]
iwlwifi: pcie: keep the NIC awake when commands are in flight

Under very specific circumstances, the firmware might
ignore a host command. This was debugged and we ended up
seeing that the power management hardware was faulty.
In order to workaround this issue, we keep the NIC awake
as long as we have host commands in flight. This will avoid
to put the hardware into buggy condition.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix possible memory leak
Eytan Lifshitz [Wed, 18 Dec 2013 21:05:06 +0000 (23:05 +0200)]
iwlwifi: mvm: fix possible memory leak

In case of invalid section_id, the function returns after
it aleready allocated memory. Fixed by change the order of actions.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix AC / FIFO mapping
Emmanuel Grumbach [Thu, 19 Dec 2013 14:50:49 +0000 (16:50 +0200)]
iwlwifi: mvm: fix AC / FIFO mapping

The AC / fifo mapping was wrong - BE packets landed in VO
FIFO. The iwl_mvm_tx_fifo enumeration isn't in the same
order as ieee80211_ac_numbers enumeration.
Since the firmware relies on fifo / ac mapping - this led
to wrong behavior. E.g. the firmware sends beacon with the
same QoS parameters as VO, and it actually took the
parameters of BK. There are probably more severe issues.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: use don't disable interrupt when rxq->lock is taken
Emmanuel Grumbach [Wed, 11 Dec 2013 08:22:28 +0000 (10:22 +0200)]
iwlwifi: pcie: use don't disable interrupt when rxq->lock is taken

This lock was never acquired in the primary interrupt
handler, but since it was acquired along with irq_lock
which had to disable interrupts, rxq->lock had to disable
interrupts too.
Now that trans_pcie->irq_lock isn't acquired in the primary
interrupt handler, rxq->lock can let interrupt enabled.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: use don't disable interrupt when irq_lock is taken
Emmanuel Grumbach [Wed, 11 Dec 2013 08:22:28 +0000 (10:22 +0200)]
iwlwifi: pcie: use don't disable interrupt when irq_lock is taken

Since we don't take this lock in the primary interrupt
handler, there is no pointin disabling the interrupt
in the critical section protected by trans_pcie->irq_lock.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: move interrupt prints to the common handler
Emmanuel Grumbach [Wed, 11 Dec 2013 07:39:30 +0000 (09:39 +0200)]
iwlwifi: pcie: move interrupt prints to the common handler

Handling interrupt with no cause and printing logs doesn't
need to be ICT / non-ICT specific move this to the common
code.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: no need to save inta in trans_pcie
Emmanuel Grumbach [Wed, 11 Dec 2013 07:24:39 +0000 (09:24 +0200)]
iwlwifi: pcie: no need to save inta in trans_pcie

This was useful when the handling was not in the same
context as the interrupt cause retrieval: we could have
several hard interrupts until the handler gets called.
Since we retrieve the interrupt cause in the handler itself,
there is no need to OR the interrupt causes.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: return inta from iwl_pcie_int_cause_{non_}ict
Emmanuel Grumbach [Wed, 11 Dec 2013 07:20:34 +0000 (09:20 +0200)]
iwlwifi: pcie: return inta from iwl_pcie_int_cause_{non_}ict

These functions are meant to return an interrupt cause and
not an irqreturn_t.
We still return IRQ_HANDLED if we had an error and IRQ_NONE
if our device hasn't fired any interrupt.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: determine the interrupt type in the handler
Emmanuel Grumbach [Wed, 11 Dec 2013 07:02:25 +0000 (09:02 +0200)]
iwlwifi: pcie: determine the interrupt type in the handler

Instead of having:
iwl_pcie_irq_handler
iwl_pcie_isr_ict
iwl_pcie_isr_non_ict

we now have:

iwl_pcie_irq_handler:
if (use_ict))
iwl_pcie_int_cause_ict;
else
iwl_pcie_int_cause_non_ict;

This is much clearer.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: read the interrupt cause from the handler
Emmanuel Grumbach [Wed, 11 Dec 2013 07:00:03 +0000 (09:00 +0200)]
iwlwifi: pcie: read the interrupt cause from the handler

We now disable the interrupts in the hardware from the
upper half and all the rest (including reading the interrupt
cause) is done in the handler.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: move the ICT / non-ICT handling functions
Emmanuel Grumbach [Mon, 9 Dec 2013 12:27:44 +0000 (14:27 +0200)]
iwlwifi: pcie: move the ICT / non-ICT handling functions

The purpose of this is to be able to call these functions
from the interrupt handler and not from the primary
interrupt handler.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: re-organize the PCIe ISR code
Emmanuel Grumbach [Mon, 9 Dec 2013 09:48:30 +0000 (11:48 +0200)]
iwlwifi: pcie: re-organize the PCIe ISR code

Separate the code that simply disables interrupt in the
hardware and the code that checks what interrupt fired.
This will be useful to move the second part in the threaded
handler which will be done in a future patch.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: track interrupt mask in SW
Emmanuel Grumbach [Mon, 9 Dec 2013 09:09:47 +0000 (11:09 +0200)]
iwlwifi: pcie: track interrupt mask in SW

Track the interrupt mask in software, making it exactly
what is configured in the interrupt mask register in the
hardware.
This allows not to access the register from the interrupt
handler. This was the case for ICT interrupt already, but
not for non-ICT interrupt.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: clean up ICT allocation code
Emmanuel Grumbach [Mon, 9 Dec 2013 07:47:46 +0000 (09:47 +0200)]
iwlwifi: pcie: clean up ICT allocation code

Since iwl_trans_pcie_alloc_ict is called in the PCIe
allocation code, we always set CSR_INT_BIT_RX_PERIODIC.
Move that bit to the default list of interrupts we enable
and simplify the code.
Also use dma_zalloc_ and avoid to memset the memory
afterwards.
trans_pcie->ict_index is 0 since trans_pcie has just been
kzalloced, remove the redundant assignment.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: fix variable shadowing
Johannes Berg [Tue, 17 Dec 2013 10:34:25 +0000 (11:34 +0100)]
iwlwifi: mvm: rs: fix variable shadowing

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: EyalX Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: fix RTS protection being set indefinitely
Eyal Shapira [Mon, 16 Dec 2013 23:08:50 +0000 (01:08 +0200)]
iwlwifi: mvm: rs: fix RTS protection being set indefinitely

RTS protection was turned on once aggregation was enabled but it
was never turned off. Remove turning on RTS protection in the LQ command
completely as TX_CMD_FLG_PROT_REQUIRE gets set in iwl_mvm_set_tx_cmd
for every Tx which is part of an aggregation. This would already cause
RTS protection to be used during aggregations.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: set highest rate in VHT MCS Set
Eyal Shapira [Thu, 12 Dec 2013 13:53:14 +0000 (15:53 +0200)]
iwlwifi: mvm: set highest rate in VHT MCS Set

Set the Tx/Rx highest long GI rates in the VHT Supported MCS Set
field according to the chip capabilties.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: disable MCS9 Tx workaround
Eyal Shapira [Wed, 11 Dec 2013 07:32:28 +0000 (09:32 +0200)]
iwlwifi: mvm: rs: disable MCS9 Tx workaround

MCS9 introduces some corner cases in the current rs
algorithm which may lead to non optimal throughput and
instability in the throughput. Until all the corner
cases are resolved disable MCS9 for Tx as a workaround
which yields better throughput results as MCS8 is much
more stable.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Do not allow AP MAC context update if not active
Ilan Peer [Wed, 4 Dec 2013 14:47:14 +0000 (16:47 +0200)]
iwlwifi: mvm: Do not allow AP MAC context update if not active

Fix a regression introduced in "iwlwifi: mvm: fix ht protection flags"
where an AP/IBSS MAC context could have been updated even before the
context was added to the FW. This fix avoids the following warning:

WARNING: ... at .../drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c:1132
    iwl_mvm_mac_ctxt_changed+0x75/0x90 [iwlmvm]()
Changing inactive MAC 0c:8b:fd:01:1a:30/3
Modules linked in: [...]
Call Trace:
[<c16041fd>] dump_stack+0x41/0x52
[<c1041074>] warn_slowpath_common+0x84/0xa0
[<f80d8f45>] ? iwl_mvm_mac_ctxt_changed+0x75/0x90 [iwlmvm]
[<f80d8f45>] ? iwl_mvm_mac_ctxt_changed+0x75/0x90 [iwlmvm]
[<c1041133>] warn_slowpath_fmt+0x33/0x40
[<f80d8f45>] iwl_mvm_mac_ctxt_changed+0x75/0x90 [iwlmvm]
[<f80d517a>] iwl_mvm_bss_info_changed+0x22a/0x4b0 [iwlmvm]
[<c160831d>] ? mutex_unlock+0xd/0x10
[<f80d4678>] ? iwl_mvm_configure_filter+0x58/0x70 [iwlmvm]
[<f80d4f50>] ? iwl_mvm_mac_tx+0xc0/0xc0 [iwlmvm]
[<f8132d83>] ieee80211_bss_info_change_notify+0xa3/0x1d0 [mac80211]
[<f8149247>] ? ieee80211_del_virtual_monitor+0x127/0x1f0 [mac80211]
[<f8149cac>] ieee80211_do_open+0x12c/0xeb0 [mac80211]
[<c106c6de>] ? __raw_notifier_call_chain+0x1e/0x30
[<c106c70f>] ? raw_notifier_call_chain+0x1f/0x30
[<f814aa8d>] ieee80211_open+0x5d/0x60 [mac80211]
[<c1500c7b>] __dev_open+0xab/0x140
[<c160b39a>] ? _raw_spin_unlock_bh+0x2a/0x30
[<c1500f41>] __dev_change_flags+0x81/0x160
[<c10ab6fc>] ? __lock_is_held+0x3c/0x60
[<c15010d1>] dev_change_flags+0x21/0x60

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reported-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fixup Makefile
Emmanuel Grumbach [Sun, 8 Dec 2013 08:48:13 +0000 (10:48 +0200)]
iwlwifi: mvm: fixup Makefile

debufs.o appeared twice in the Makefile. Fix that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: refactor rate scale action decision
Eyal Shapira [Tue, 10 Dec 2013 22:55:36 +0000 (00:55 +0200)]
iwlwifi: mvm: rs: refactor rate scale action decision

Extract the scale action decision to a different function
in preparation of modifying it. While at it also convert
the scale action values from hardcoded values to a clear enum.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: remove unnecessary debug logs
Eyal Shapira [Tue, 10 Dec 2013 10:20:37 +0000 (12:20 +0200)]
iwlwifi: mvm: rs: remove unnecessary debug logs

The logs are emitted in a flow in which there were retries
and the rates in the rate table entry didn't match the active
or search table. This doesn't indicate a problem and is
expected in most cases where there will be retries for some
reason. Remove the logs.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: improve rates table algo
Eyal Shapira [Mon, 9 Dec 2013 11:02:56 +0000 (13:02 +0200)]
iwlwifi: mvm: rs: improve rates table algo

The new logic will attempt more rates with less retries
per rate. Also when starting off with MIMO it will
fallback to SISO with the same MCS and only then to Legacy.
Previously we fell back directly to Legacy.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: avoid recalc of supported legacy rate mask
Eyal Shapira [Mon, 9 Dec 2013 09:14:11 +0000 (11:14 +0200)]
iwlwifi: mvm: rs: avoid recalc of supported legacy rate mask

The supported legacy rate mask is initialized when rs
is initialized based on the remote peer supported rates.
There's no need to re mask it repeatedly with the supported
remote peer rates.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: refactor building the LQ command
Eyal Shapira [Wed, 4 Dec 2013 00:15:46 +0000 (02:15 +0200)]
iwlwifi: mvm: rs: refactor building the LQ command

Simplify the code a bit more by extracting the rates table
building logic into a separate function and handle setting
a fixed rate for debug in a separate flow.
Also avoid using and saving ucode rate format in different
places. Instead use rs_rate struct and convert to ucode format
only when filling the rates table in the LQ command.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Add and examine TLV flag for P2P client uAPSD support
Alexander Bondar [Tue, 12 Nov 2013 12:47:59 +0000 (14:47 +0200)]
iwlwifi: mvm: Add and examine TLV flag for P2P client uAPSD support

Current firmware doesn't handle well uAPSD in P2P Client.
When it will be fixed, the firmware will set a TLV flag to notify
the driver that uAPSD is supported in P2P client mode.
Check this flag when sending power command for P2P client.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: trans: turn set_pmi into an optional callback
Arik Nemtsov [Thu, 5 Dec 2013 16:31:45 +0000 (18:31 +0200)]
iwlwifi: trans: turn set_pmi into an optional callback

It is not currently implemented for SDIO, and not required for other slave
buses as well.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: trans: clear FW_ERROR status in common code
Arik Nemtsov [Wed, 4 Dec 2013 15:08:47 +0000 (17:08 +0200)]
iwlwifi: trans: clear FW_ERROR status in common code

Clear the FW_ERROR status before the common start_fw transport code.
Remove the transport specific clears.

After these patches the FW_ERROR flag is only set and cleared by common
transport code.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: trans: prevent reprobe on repeated FW errors before restart
Arik Nemtsov [Sun, 1 Dec 2013 11:50:40 +0000 (13:50 +0200)]
iwlwifi: trans: prevent reprobe on repeated FW errors before restart

In case a sync command timeouts or Tx is stuck while a FW error
interrupt arrives, we might call iwl_op_mode_nic_error twice before
a restart has been initiated. This will cause a reprobe. Unify calls
to this function at the transport level and only call it on the first
FW error in a given by checking the transport FW error flag.

While at it, remove the privately defined iwl_nic_error from PCIE code
and use the common callback instead.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: check iwl_nvm_init return value
Eliad Peller [Mon, 9 Dec 2013 11:15:02 +0000 (13:15 +0200)]
iwlwifi: mvm: check iwl_nvm_init return value

iwl_nvm_init() return value wasn't checked in some
path, which resulted in the following panic (if
there was some issue with the nvm):

Unable to handle kernel NULL pointer dereference at virtual address 00000004
pgd = d0460000
[00000004] *pgd=00000000
Internal error: Oops: 5 [#1] PREEMPT SMP
Modules linked in: iwlmvm(+) iwlwifi mac80211 cfg80211 compat [last unloaded: compat]
PC is at iwl_mvm_mac_setup_register+0x12c/0x460 [iwlmvm]
LR is at 0x2710
pc : [<bf50dd4c>]    lr : [<00002710>]    psr: 20800013
sp : d00cfe18  ip : 0000081e  fp : d006b908
r10: d0711408  r9 : bf532e64  r8 : d006b5bc
r7 : d01af000  r6 : bf39cefc  r5 : d006ab00  r4 : d006b5a4
r3 : 00000001  r2 : 00000000  r1 : d006a120  r0 : d006b860

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: remove pointer to transport from op_mode
Emmanuel Grumbach [Sun, 8 Dec 2013 08:38:20 +0000 (10:38 +0200)]
iwlwifi: remove pointer to transport from op_mode

This pointer was not used anywhere.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: move rs_program_fix_rate to cleanup ifdefs
Eyal Shapira [Tue, 3 Dec 2013 16:34:52 +0000 (18:34 +0200)]
iwlwifi: mvm: rs: move rs_program_fix_rate to cleanup ifdefs

Move rs_program_fix_rate right before it's caller where we're
already in the context of an ifdef CPTCFG_MAC80211_DEBUGFS so
we can get rid of the extra ifdefs surrounding the original
location.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: trans: prevent tx and cmds during FW error
Arik Nemtsov [Sun, 1 Dec 2013 11:02:18 +0000 (13:02 +0200)]
iwlwifi: trans: prevent tx and cmds during FW error

Stop Tx and commands from arriving to the transport layer when a FW
error has occurred. A HW recovery should take place before. Remove
transport specific checks of the same nature (note that not all
transports were protected).

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: trans: use a unified transport status
Arik Nemtsov [Sun, 1 Dec 2013 10:30:38 +0000 (12:30 +0200)]
iwlwifi: trans: use a unified transport status

The same bits are employed in all transport layers. Put the status
field in the common transport layer. This allows us to employ them
in common transport code.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: trans: divide stop_hw into stop_device/op_mode_leave
Arik Nemtsov [Sun, 24 Nov 2013 17:10:46 +0000 (19:10 +0200)]
iwlwifi: trans: divide stop_hw into stop_device/op_mode_leave

The stop_hw trans callback is not well defined. It is missing in many
cleanup flows and the division of labor between stop_device/stop_hw
is cumbersome. Remove stop_hw and use stop_device to perform both.
Implement this for all current transports.

PCIE needs some extra configuration the op-mode is leaving to configure
RF kill. Expose this explicitly as a new op_mode_leave trans callback.
Take the call to stop_device outside iwl_run_mvm_init_ucode, this
makes more sense and WARN when we want to run the INIT firmware while
it has run already.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: clarify smps_requests documentation
Johannes Berg [Wed, 4 Dec 2013 10:56:58 +0000 (11:56 +0100)]
iwlwifi: mvm: clarify smps_requests documentation

The documentation for smps_requests is unclear, rewrite it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: configure phy_ctxt with min_def
Eliad Peller [Thu, 31 Oct 2013 12:31:25 +0000 (14:31 +0200)]
iwlwifi: mvm: configure phy_ctxt with min_def

Configure the phy context to the minimum required
bandwidth, given by ctx->min_def.

Tuning to a narrower bandwidth should reduce the
noise level and consume less power.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: add multicast filtering support
Eliad Peller [Thu, 28 Nov 2013 12:08:50 +0000 (14:08 +0200)]
iwlwifi: mvm: add multicast filtering support

Configure the fw to filter multicast according to
the addresses given by mac80211.

Note that bssid should be given even if we want
to pass all the multicast frames.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: move iwl_mvm_set_tx_power to PHY area
Emmanuel Grumbach [Wed, 4 Dec 2013 11:53:39 +0000 (13:53 +0200)]
iwlwifi: mvm: move iwl_mvm_set_tx_power to PHY area

This is more related to phy contexts than to mac context.
Move this function to there.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: add per-vif power debugfs hooks
Alexander Bondar [Wed, 4 Dec 2013 08:13:24 +0000 (10:13 +0200)]
iwlwifi: mvm: add per-vif power debugfs hooks

This allows to tweak the power parameters per vif.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Enable power save on a single P2P client interface
Alexander Bondar [Mon, 2 Sep 2013 14:10:14 +0000 (17:10 +0300)]
iwlwifi: mvm: Enable power save on a single P2P client interface

Enable power save on P2P client interface only if it is the
only bound interface.
Avoid using uAPSD if P2P client is associated to GO that uses
opportunistic power save. This is due to current FW limitation.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Disable power save for monitor interface
Alexander Bondar [Wed, 23 Oct 2013 09:50:34 +0000 (11:50 +0200)]
iwlwifi: mvm: Disable power save for monitor interface

When monitor interface is activated device power save needs
to be disabled.
Re-consider power management status on other active
interfaces when monitor interface is bound or unbound.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Change power management dependency on multi MAC
Alexander Bondar [Tue, 27 Aug 2013 17:31:48 +0000 (20:31 +0300)]
iwlwifi: mvm: Change power management dependency on multi MAC

FW still does not support power management on multiple MAC interfaces.
Currently the driver enforce this limitation by disabling PM if second
interface is added. Change this behavior to allow PM on a single interface
even if other interfaces exist but not bound to any specific PHY.
PM will be enabled if only one single interface is bound.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Add uAPSD misbehaving AP notification handling
Alexander Bondar [Sun, 14 Apr 2013 17:59:37 +0000 (20:59 +0300)]
iwlwifi: mvm: Add uAPSD misbehaving AP notification handling

FW implements protective algorithm to identify AP's improper uAPSD
behavior. FW sends misbehaving AP notification in this case.
Add this notification handling. Avoid using uAPSD in next association
to the exactly same AP. Refactor iwl_mvm_power_build_cmd() to move
uAPSD related code to a separate function.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: publish Tx STBC support in VHT
Eyal Shapira [Tue, 12 Nov 2013 20:40:40 +0000 (22:40 +0200)]
iwlwifi: publish Tx STBC support in VHT

If the device is MIMO and VHT capable it supports Tx STBC.
Unlike HT, any chip that supports VHT also support STBC so
no need for a config parameter.
Using num_of_ants multiple times warranted caching it.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: set VHT beamformee STS cap correctly
Eyal Shapira [Sun, 3 Nov 2013 08:04:08 +0000 (10:04 +0200)]
iwlwifi: set VHT beamformee STS cap correctly

It was set to zero which reflects support of a single STS.
Set according to the number of Rx antennas which correctly
reflects the number of STSs the STA can receive in a VHT NDP.
This improves beamforming and has been tested to improve Rx
throughput.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: publish STBC support in HT
Eyal Shapira [Tue, 12 Nov 2013 20:37:28 +0000 (22:37 +0200)]
iwlwifi: publish STBC support in HT

Not all chips support STBC so allow this to be
another config parameter per chip type. If STBC
is supported then publish it in the HT caps.

Since 7260/7265/3160 chips support it - set the stbc
support bit.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: add a generic cipher scheme support
Max Stepanov [Tue, 27 Aug 2013 16:56:13 +0000 (19:56 +0300)]
iwlwifi: mvm: add a generic cipher scheme support

This patch adds a cipher scheme support to extend a set of
the supported ciphers. The driver reads a cipher scheme list TLV
from FW image and passes it to mac80211 on hw registration.
After the cipher schemes are registered the driver handles key
installation and Tx/Rx calls related to the new ciphers.

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Add Smart FIFO support
Lilach Edelstein [Sun, 6 Oct 2013 11:03:32 +0000 (13:03 +0200)]
iwlwifi: mvm: Add Smart FIFO support

Send firmware a Smart FIFO Configuration host command to allow
interrupt coalescing. The smart FIFO is enabled when there is
only one bound interface (other than  p2p devices which are
ignored) and it is of type station, and activated while the
station is associated.

Smart Fifo allows aggragations of DMA transactions and by that
causes processor and memory controller to stay for a longer time
on lower c-states, thus saving platform power.
Firmware relies on driver to activate and disable it.

Signed-off-by: Lilach Edelstein <lilach.edelstein@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: don't send SMPS action frame with single RX antenna
Emmanuel Grumbach [Thu, 28 Nov 2013 13:25:21 +0000 (15:25 +0200)]
iwlwifi: mvm: don't send SMPS action frame with single RX antenna

Products that have only 1 antenna in Rx don't support MIMO
in RX. As a consequence, they will be in STATIC always.
Don't tell mac80211 to update SMPS in that case. mac80211
would send an action frame to the AP which is clearly
bogus.
As a matter of fact, we have seen that some APs send a
deauth when that happens.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: fix compilation without CONFIG_MAC80211_DEBUGFS
Emmanuel Grumbach [Tue, 3 Dec 2013 09:50:30 +0000 (11:50 +0200)]
iwlwifi: mvm: rs: fix compilation without CONFIG_MAC80211_DEBUGFS

This fixes compilation issues with CONFIG_MAC80211_DEBUGFS
not enabled.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - enable Sync to SCO
Emmanuel Grumbach [Thu, 28 Nov 2013 12:58:20 +0000 (14:58 +0200)]
iwlwifi: mvm: BT Coex - enable Sync to SCO

Sync to SCO is a feature that allows to synchronise the
wifi activity with the predictable BT activity in
SCO profile. This allows to reduce the collisions and
improve overall quality.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: overhaul search cycle state machine
Eyal Shapira [Sun, 24 Nov 2013 19:30:13 +0000 (21:30 +0200)]
iwlwifi: mvm: rs: overhaul search cycle state machine

Rewrite the search cycle state machine to use a more data
oriented approach where the different Tx columns (configs)
limitations and next columns to search are reprsented in
tables which are easy to change. This overhaul also includes
several major fixes:

1. Prevent going back to a specific Tx column in a search
cycle if it was already explored.

2. Avoid switching to a Tx column that doesn't have any chance
if it performs perfectly to beat the current throughput we're
getting.

These issues were degrading throughput as they were causing
switching to "bad" Tx columns.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: use the proper channel width define for legacy rate
Eyal Shapira [Thu, 28 Nov 2013 10:35:42 +0000 (12:35 +0200)]
iwlwifi: mvm: rs: use the proper channel width define for legacy rate

Use the 20Mhz channel width define instead of just the number
zero for legacy rates. Note that the define has the same value
so this is just a minor cleanup.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: fix mapping from HT/VHT rates to legacy
Eyal Shapira [Thu, 28 Nov 2013 10:27:03 +0000 (12:27 +0200)]
iwlwifi: mvm: rs: fix mapping from HT/VHT rates to legacy

The table rs_ht_to_legacy is used to get the next legacy rate
following the last HT or VHT rate in the LQ rates table.
The mapping wasn't correct as well as didn't include entries
for MCS8/9 which led to out of bounds access. This didn't
trigger a crash but led to legacy rate entries using 1Mbps
rate.
In 5Ghz this probably caused the Tx to fail completely given
that Tx attempt would have reached the legacy entries and 1Mbps
isn't valid.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: set dual_stream_ant_msk to ANT_AB always
Eyal Shapira [Thu, 28 Nov 2013 00:25:24 +0000 (02:25 +0200)]
iwlwifi: mvm: rs: set dual_stream_ant_msk to ANT_AB always

Drop code which was relevant when there were chips with
3 antennas. Setting to ANT_AB should be ok with all mvm
supported chips.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: remove unused parameter to rs_get_supported_rates
Eyal Shapira [Fri, 22 Nov 2013 23:30:44 +0000 (01:30 +0200)]
iwlwifi: mvm: rs: remove unused parameter to rs_get_supported_rates

No use of the ieee80211 header. Drop it.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: refactor to use rs_rate
Eyal Shapira [Fri, 22 Nov 2013 23:06:36 +0000 (01:06 +0200)]
iwlwifi: mvm: rs: refactor to use rs_rate

Introduce rs_rate which represents a rate. Use this structure
instead of iwl_scale_tbl_info where we're dealing with a single
rate.
This avoids allocating the big iwl_scale_tbl_info structure
on the stack in several cases like converting to ucode rate
format or from ucode rate format.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: remove unused timestamp field
Eyal Shapira [Fri, 22 Nov 2013 12:27:20 +0000 (14:27 +0200)]
iwlwifi: mvm: rs: remove unused timestamp field

Remove this as it's unused.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: increase stay in column timeout
Eyal Shapira [Fri, 22 Nov 2013 07:41:38 +0000 (09:41 +0200)]
iwlwifi: mvm: rs: increase stay in column timeout

Remain in the same Tx modulation (i.e. column) for a longer
time before starting a search cycle for a better modulation.
This has been shown to give better results.
Also change the name of the timeout define to better match its
description.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: rename thresholds defines
Eyal Shapira [Wed, 20 Nov 2013 23:18:47 +0000 (01:18 +0200)]
iwlwifi: mvm: rs: rename thresholds defines

Rename for clearer names.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: update expected TPT tables if aggregation changed
Eyal Shapira [Wed, 20 Nov 2013 23:12:11 +0000 (01:12 +0200)]
iwlwifi: mvm: rs: update expected TPT tables if aggregation changed

Expected TPT table was updated only when switching to a new
modulation. This is wrong as toggling aggregation changes
the expected TPT signficantly.
This leads to scenarios where turning aggregation on after
being in MIMO sends us back to SISO despite a perfect success
ratio.
This occurred because the TPT of the SISO mode was being
estimated based on aggregation while the MIMO one wasn't.

Also remove an error print which isn't an error anymore
since we might be updating the expected TPT table due
to aggregation changes.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: reduce min failures to end test window
Eyal Shapira [Wed, 20 Nov 2013 00:08:12 +0000 (02:08 +0200)]
iwlwifi: mvm: rs: reduce min failures to end test window

This terminates a test window of a new rate quicker in case
we've hit a bad rate and should recover better.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: improve debug prints
Eyal Shapira [Tue, 19 Nov 2013 23:45:38 +0000 (01:45 +0200)]
iwlwifi: mvm: rs: improve debug prints

Enable better tracking of different decisions made
by the rate scale algorithm.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: don't configure mimo rates if nss is limited to 1
Eyal Shapira [Sat, 9 Nov 2013 21:31:38 +0000 (23:31 +0200)]
iwlwifi: mvm: don't configure mimo rates if nss is limited to 1

Remote peer can publish a different number of supported nss via the
operating mode notification IE or action frame. If it limits to 1
then we don't want mimo rates configured in the rate table.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: don't enable VHT MCS9 in 20Mhz
Eyal Shapira [Sat, 9 Nov 2013 21:25:06 +0000 (23:25 +0200)]
iwlwifi: mvm: don't enable VHT MCS9 in 20Mhz

MCS9 in NSS=1 or NSS=2 isn't valid for 20Mhz so don't enable
it in case we're dealing with a 20Mhz sta. Trying to configure an
MCS9 rate with 20Mhz in the LQ rate table would lead to a FW assert.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: stop using MIMO in case BT doesn't allow it
Eyal Shapira [Wed, 13 Nov 2013 14:46:19 +0000 (16:46 +0200)]
iwlwifi: mvm: stop using MIMO in case BT doesn't allow it

Switch to using the new btcoex decision api regarding MIMO and stop
accessing the internal btcoex structs.
In case MIMO should be disabled it would detect this upon the next
Tx and force a search. The search will switch to SISO on a antenna A
which isn't used by BT.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>