deliverable/linux.git
8 years agoiwlwifi: mvm: add RSS queues notification infrastructure
Sara Sharon [Wed, 16 Dec 2015 16:48:28 +0000 (18:48 +0200)] 
iwlwifi: mvm: add RSS queues notification infrastructure

In multi rx queue HW, without execessive locking, there is no sync
between the ctrl path (default queue) and the rest of the rx queues.
This might cause issues on certain situations. For example, in case
a delBA was processed on a default queue but out of order packets
still wait for processing on the other queue.

The solution is to introduce internal messaging between the CTRL path
and the other rx queues.
The driver will send a message to the firmware, which will echo it to
all the requested queues. The message will be in order inside the queue.
This way we can avoid CTRL path and RSS queues races.

Add support for this messaging mechanism. As the firmware is agnostic to
the data sent, add internal representation of the data as well.
Although currently only delBA flow will use it, the internal representation
will enable generic use of this infrastructure for future uses.
Next patch will utilize this messaging mechanism for the reorder buffer
delBA flow.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add duplicate packet detection per rx queue
Sara Sharon [Mon, 7 Dec 2015 10:50:58 +0000 (12:50 +0200)] 
iwlwifi: mvm: add duplicate packet detection per rx queue

Next hardware will direct TCP/UDP streams to different cores.
Packets belonging to the same stream will be directed to the same
core.
The result is that duplicates will be always directed to the same
rx queue were the first packet was received.
This enabled parallelizing the duplicate packet detection across
the different cores, without sharing data between the rx queues.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: prevent skbs shadowing in iwl_trans_pcie_reclaim
Emmanuel Grumbach [Tue, 23 Feb 2016 09:34:17 +0000 (11:34 +0200)] 
iwlwifi: pcie: prevent skbs shadowing in iwl_trans_pcie_reclaim

The patch below introduced a variable shadowing. Fix that.

Fixes: 3955525d5d17 ("iwlwifi: pcie: buffer packets to avoid overflowing Tx queues")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: add pm_prepare and pm_complete ops
Luca Coelho [Tue, 1 Dec 2015 18:39:57 +0000 (20:39 +0200)] 
iwlwifi: pcie: add pm_prepare and pm_complete ops

With these ops, we can know when we are about to enter system suspend.
This allows us to exit D0i3 state before entering suspend.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: configure more RFH settings
Sara Sharon [Mon, 15 Feb 2016 15:26:48 +0000 (17:26 +0200)] 
iwlwifi: pcie: configure more RFH settings

Fine tune RFH registers further:
* Set default queue explicitly
* Set RFH to drop frames exceeding RB size
* Set the maximum rx transfer size to DRAM to 128 instead of 64

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: support filtered frames notification
Sara Sharon [Wed, 22 Jul 2015 08:38:40 +0000 (11:38 +0300)] 
iwlwifi: mvm: support filtered frames notification

During d0i3 frames might be filtered by the FW and this may
cause reordering buffer a delay - as the frames will not be
received and reorder will time out.

Introduce an API function to receive notification of filtered
frames and pass the information to the mac80211.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: update rx_status with mactime flag
Sara Sharon [Sun, 10 Jan 2016 12:23:25 +0000 (14:23 +0200)] 
iwlwifi: mvm: update rx_status with mactime flag

When forming IBSS, mac80211 scans in order to find an already
existing cell to join.
In case the scan does not find any existing cell a new IBSS
cell is formed.
When receiving the beacons of another IBSS cell we should
merge if the other IBSS cell's TSF is higher than ours.
However, currently iwlmvm does not set any timestamp flag in
rx_status so there is no valid rx timestamp to compare the
beacon's TSF to.
The reason for that is that TSF as indicated by the firmware
is at INA time, but up till now mac80211 expected the TSF at
the beginning or end of the MPDU.
Set the flag to the newly added RX_FLAG_MACTIME_PLCP_START flag.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: support tracing wide commands
Sara Sharon [Mon, 28 Dec 2015 20:37:08 +0000 (22:37 +0200)] 
iwlwifi: support tracing wide commands

Current iwlwifi_trace_dev_rx prints only the cmd without the
group, which might be misleading. Change it to print the wide
id. While at it add the DATA_PATH group and sub commands to the
trace of the command names, sine it is missing due to patches
submitted in parallel.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: don't send an A-MSDU that is larger than the TXF
Emmanuel Grumbach [Wed, 11 Nov 2015 09:37:02 +0000 (11:37 +0200)] 
iwlwifi: mvm: don't send an A-MSDU that is larger than the TXF

The A-MSDU must be smaller than the Transmit FIFO in the
device. Since the size of the TXF can change depending
on the device / firmware compilation mode, take the size
of the FIFO dynamically from the what the firmware tells us.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: don't enable A-MSDU when the rates are too low
Emmanuel Grumbach [Wed, 28 Oct 2015 07:47:41 +0000 (09:47 +0200)] 
iwlwifi: mvm: don't enable A-MSDU when the rates are too low

Allow A-MSDU only when we are not downscaling and the
initial MCS is at least 5.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: allow to limit the A-MSDU from debugfs
Emmanuel Grumbach [Mon, 26 Oct 2015 14:14:06 +0000 (16:14 +0200)] 
iwlwifi: mvm: allow to limit the A-MSDU from debugfs

in order to be able to tune the size of the desired A-MSDU
based on link condition, add a knob to modify the length
of the A-MSDU.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add Tx A-MSDU inside A-MPDU
Emmanuel Grumbach [Mon, 26 Oct 2015 14:00:29 +0000 (16:00 +0200)] 
iwlwifi: mvm: add Tx A-MSDU inside A-MPDU

If the peer allows, we can have A-MSDU inside A-MDPU.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: send large SKBs to the transport
Emmanuel Grumbach [Wed, 14 Oct 2015 13:28:52 +0000 (16:28 +0300)] 
iwlwifi: mvm: send large SKBs to the transport

Now that PCIe knows how to create A-MSDUs, use this
capability and prepare SKBs that are large enough to
build an A-MSDU.
Advertise TSO support towards the network stack and
segment the packet with gso_size set to be the maximal
A-MSDU length (after having taken the headers to be added
into account) to make sure that the skb that is passed
down to the transport are not longer than the maximal
A-MSDU allowed.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: update firmware of VHT MU-MIMO groups status on restart
Sara Sharon [Sun, 15 Nov 2015 09:11:59 +0000 (11:11 +0200)] 
iwlwifi: mvm: update firmware of VHT MU-MIMO groups status on restart

The firmware handles the VHT MU-MIMO group data on its own.
However, on HW restart (and future sniffer mode) the driver
shall update the firmware on the VHT MU-MIMO group membership
status.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: enable VHT MU-MIMO for supported hardware
Sara Sharon [Wed, 27 Jan 2016 16:59:48 +0000 (18:59 +0200)] 
iwlwifi: mvm: enable VHT MU-MIMO for supported hardware

Incoming hardware will support VHT MU-MIMO. Declare this
capability for relevant hardware.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: fix identation in trans.c
Emmanuel Grumbach [Sun, 7 Feb 2016 08:28:13 +0000 (10:28 +0200)] 
iwlwifi: pcie: fix identation in trans.c

A curly brace was misplaced, fix this.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: Add new configuration to enable MSIX
Haim Dreyfuss [Thu, 17 Dec 2015 10:17:58 +0000 (12:17 +0200)] 
iwlwifi: pcie: Add new configuration to enable MSIX

Working with MSIX requires prior configuration.
This includes requesting interrupt vectors from the OS,
registering the vectors and mapping the optional causes to the
relevant interrupt. In addition add new interrupt handler
to handle MSIX interrupt.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: aggregate Flow Handler configuration writes
Emmanuel Grumbach [Sun, 31 Jan 2016 07:29:39 +0000 (09:29 +0200)] 
iwlwifi: pcie: aggregate Flow Handler configuration writes

Instead of waking up the device each time we write a
register, wake it up once, and writes the registers
at once.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: bump firmware API to 21
Emmanuel Grumbach [Tue, 23 Feb 2016 19:53:12 +0000 (21:53 +0200)] 
iwlwifi: mvm: bump firmware API to 21

The driver is now ready to handle this firmware.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: rs: fix a theoretical access to uninitialized array elements
Eyal Shapira [Mon, 1 Feb 2016 07:07:05 +0000 (09:07 +0200)] 
iwlwifi: mvm: rs: fix a theoretical access to uninitialized array elements

Klocwork is unhappy as ht_vht_rates might be accessed with
rate->index being set to values between 0 and 3 which will
lead to accessing uninitialized array elements. Effectively this
doesn't happen as in HT/VHT we're not using these rate indices.
Still fix this.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: handle pass all scan reporting
Luca Coelho [Tue, 2 Feb 2016 20:58:46 +0000 (22:58 +0200)] 
iwlwifi: mvm: handle pass all scan reporting

The firmware doesn't send match found notifications when no matchsets
are passed.  This makes sense because if there are no matchsets,
nothing can be matched.  But the nl80211 API should report when there
are results available, even if no matchsets were passed.

To handle this, we can use the firmware's ITERATION_COMPLETE
reporting, which will send us notifications every time it completed a
scheduled scan iteration.  Then we can set a flag when we received
beacons and use that to report that results are available.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoMerge tag 'iwlwifi-for-kalle-2016-02-15' into HEAD
Emmanuel Grumbach [Thu, 25 Feb 2016 08:59:41 +0000 (10:59 +0200)] 
Merge tag 'iwlwifi-for-kalle-2016-02-15' into HEAD

These are a few fixes for the current cycle.
3 out of the 5 patches fix a bugzilla.

* fix a race that users reported when we try to load the firmware
  and the hardware rfkill interrupt triggers at the same time.
* Luca fixes a very visible bug in scheduled scan: our firmware
  doesn't support scheduled scan with no profile configured and
  the supplicant sometimes requests such scheduled scans.
* build system fix
* firmware name update for 8265
* typo fix in return value

8 years agoiwlwifi: mvm: fix RSS key sizing
Sara Sharon [Sun, 7 Feb 2016 10:50:35 +0000 (12:50 +0200)] 
iwlwifi: mvm: fix RSS key sizing

The initialization and copying of the RSS secret key
should not use ARRAY_SIZE as we need to initialize a
dword array, and not a byte array.
Fix also the hook maximum write size to allow writing
a longer table - up to full indirection table size.

Fixes: 43413a975d06("iwlwifi: mvm: support rss queues configuration command")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: set the correct descriptor size for tracing
Sara Sharon [Sun, 7 Feb 2016 11:09:59 +0000 (13:09 +0200)] 
iwlwifi: mvm: set the correct descriptor size for tracing

The 9000 series uses a diffrent sized descriptor. Update the
relevant tracing field.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add registration to cooling device
Chaya Rachel Ivgi [Tue, 5 Jan 2016 08:34:47 +0000 (10:34 +0200)] 
iwlwifi: mvm: add registration to cooling device

Register cooling device in order to have the Thermal
Manager handle the device's power budget according to the sent
notifications.
The interface adds a new thermal cooling device to
/sys/class/thermal/ folder.

Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add registration to thermal zone
Chaya Rachel Ivgi [Tue, 29 Dec 2015 07:54:49 +0000 (09:54 +0200)] 
iwlwifi: mvm: add registration to thermal zone

Register to thermal_zone interface and implement the
thermal ops.
The thermal handles the device throttling, and sets the
the temperature thresholds the Thermal Manager would be
notified of crossing.
The thermal interface adds a new thermal zone device sensor
under /sys/class/thermal/ folder.

Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add CT-KILL notification
Chaya Rachel Ivgi [Wed, 16 Dec 2015 14:34:55 +0000 (16:34 +0200)] 
iwlwifi: mvm: add CT-KILL notification

Up to today the driver was notified of the temperature from the FW
and decided whether to enter CT-kill or not.
From now on, the FW will decide when to enter CT-kill and will notify
the driver.
Add support for this notification.

Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoMerge tag 'mac80211-next-for-davem-2016-02-26' into next2
Emmanuel Grumbach [Sat, 27 Feb 2016 19:59:03 +0000 (21:59 +0200)] 
Merge tag 'mac80211-next-for-davem-2016-02-26' into next2

Here's another round of updates for -next:
 * big A-MSDU RX performance improvement (avoid linearize of paged RX)
 * rfkill changes: cleanups, documentation, platform properties
 * basic PBSS support in cfg80211
 * MU-MIMO action frame processing support
 * BlockAck reordering & duplicate detection offload support
 * various cleanups & little fixes

8 years agorfkill: Add documentation about LED triggers
João Paulo Rechi Vita [Mon, 22 Feb 2016 16:36:37 +0000 (11:36 -0500)] 
rfkill: Add documentation about LED triggers

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agorfkill: Factor rfkill_global_states[].cur assignments
João Paulo Rechi Vita [Mon, 22 Feb 2016 16:36:36 +0000 (11:36 -0500)] 
rfkill: Factor rfkill_global_states[].cur assignments

Factor all assignments to rfkill_global_states[].cur into a single
function rfkill_update_global_state().

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agorfkill: Move "state" sysfs file back to stable
João Paulo Rechi Vita [Mon, 22 Feb 2016 16:36:35 +0000 (11:36 -0500)] 
rfkill: Move "state" sysfs file back to stable

There is still quite a bit of code using this interface, so we can't
just remove it. Hopefully it will be possible in the future, but since
its scheduled removal date is past 2 years already, we are better having
the documentation reflecting the current state of things.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agorfkill: Point to the correct deprecated doc location
João Paulo Rechi Vita [Mon, 22 Feb 2016 16:36:34 +0000 (11:36 -0500)] 
rfkill: Point to the correct deprecated doc location

The "claim" sysfs interface has been removed, so its documentation now
lives in the "removed" folder.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agorfkill: Remove extra blank line
João Paulo Rechi Vita [Mon, 22 Feb 2016 16:36:33 +0000 (11:36 -0500)] 
rfkill: Remove extra blank line

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agorfkill: Improve documentation language
João Paulo Rechi Vita [Mon, 22 Feb 2016 16:36:32 +0000 (11:36 -0500)] 
rfkill: Improve documentation language

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agonet: rfkill: gpio: remove rfkill_gpio_platform_data
Heikki Krogerus [Mon, 25 Jan 2016 09:03:49 +0000 (12:03 +0300)] 
net: rfkill: gpio: remove rfkill_gpio_platform_data

No more users for it.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoARM: tegra: use build-in device properties with rfkill_gpio
Heikki Krogerus [Mon, 25 Jan 2016 09:03:48 +0000 (12:03 +0300)] 
ARM: tegra: use build-in device properties with rfkill_gpio

Pass the rfkill name and type to the device with properties
instead of driver specific platform data.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
CC: Alexandre Courbot <gnurou@gmail.com>
CC: Thierry Reding <thierry.reding@gmail.com>
CC: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Tested-by: Marc Dietrich <marvin24@gmx.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agonet: rfkill: gpio: get the name and type from device property
Heikki Krogerus [Mon, 25 Jan 2016 09:03:47 +0000 (12:03 +0300)] 
net: rfkill: gpio: get the name and type from device property

This prepares the driver for removal of platform data.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agonet: rfkill: add rfkill_find_type function
Heikki Krogerus [Mon, 25 Jan 2016 09:03:46 +0000 (12:03 +0300)] 
net: rfkill: add rfkill_find_type function

Helper for finding the type based on name. Useful if the
type needs to be determined based on device property.

Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
[modify rfkill_types array and BUILD_BUG_ON to not cause errors]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: add radiotap VHT info to rtap_namespace_sizes
Lorenzo Bianconi [Fri, 19 Feb 2016 10:43:04 +0000 (11:43 +0100)] 
cfg80211: add radiotap VHT info to rtap_namespace_sizes

Add IEEE80211_RADIOTAP_VHT entry to rtap_namespace_sizes array in order to
define alignment and size of VHT info in tx radiotap

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: Add global RRM capability
Beni Lev [Wed, 17 Feb 2016 18:30:00 +0000 (20:30 +0200)] 
cfg80211: Add global RRM capability

Today, the supplicant will add the RRM capabilities
Information Element in the association request only if
Quiet period is supported (NL80211_FEATURE_QUIET).

Quiet is one of many RRM features, and there are other RRM
features that are not related to Quiet (e.g. neighbor
report). Therefore, requiring Quiet to enable RRM is too
restrictive.
Some of the features, like neighbor report, can be
supported by user space without any help from the kernel.
Hence adding the RRM capabilities IE to association request
should be the sole user space's decision.
Removing the RRM dependency on Quiet in the driver solves
this problem, but using an old driver with a user space
tool that would not require Quiet feature would be
problematic: the user space would add NL80211_ATTR_USE_RRM
in the association request even if the kernel doesn't
advertize NL80211_FEATURE_QUIET and the association would
be denied by the kernel.

This solution adds a global RRM capability, that tells user
space that it can request RRM capabilities IE publishment
without any specific feature support in the kernel.

Signed-off-by: Beni Lev <beni.lev@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: move MU_MIMO_OWNER flag to ieee80211_vif
Sara Sharon [Tue, 16 Feb 2016 10:48:18 +0000 (12:48 +0200)] 
mac80211: move MU_MIMO_OWNER flag to ieee80211_vif

Drivers may need to track which vif is using VHT MU-MIMO.
Move the flag indicationg the ownership of MU_MIMO to
ieee80211_vif.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: provide interface to driver to set VHT MU-MIMO data
Sara Sharon [Tue, 16 Feb 2016 10:48:17 +0000 (12:48 +0200)] 
mac80211: provide interface to driver to set VHT MU-MIMO data

Provide an interface to the lower level driver to set the VHT
MU-MIMO data. This is needed for example when there is an update
of the group data during low power state, where the management
frame will not be passed to the host at all.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: remove ieee80211_get_key_tx_seq/ieee80211_set_key_tx_seq
Eliad Peller [Mon, 15 Feb 2016 10:34:10 +0000 (12:34 +0200)] 
mac80211: remove ieee80211_get_key_tx_seq/ieee80211_set_key_tx_seq

Since the PNs of all the tx keys are now tracked in the public
part of the key struct (with atomic counter), we no longer
need these functions.

dvm and vt665{5,6} are currently the only users of these functions,
so update them accordingly.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiwlwifi: mvm: move TX PN assignment for TKIP to the driver
Eliad Peller [Sun, 14 Feb 2016 11:56:36 +0000 (13:56 +0200)] 
iwlwifi: mvm: move TX PN assignment for TKIP to the driver

If protocol offloading is configured, the fw might generate some
frames (e.g. arp response) on its own during d3/d0i3.

On d3/d0i3 exit the driver queries the updated PN (if relevant),
and updates its keys (for the d0i3 case, this is done by
iwl_mvm_d0i3_exit_work(), which is scheduled on d0i3 exit)

While in d0i3, iwlmvm defers tx frames until d0i3 exit, and
then continues their processing.

This is problematic with TKIP, since the frame's PN has already
been set at this stage (in contrast to CCMP, where the PN is
being set only later on), so both the frame's PN and the upcoming
PN update (from d0i3 exit work) might be wrong.

Fix it by moving the TX PN assignment (for TKIP) to the driver,
similarly to CCMP.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: move TKIP TX IVs to public part of key struct
Eliad Peller [Sun, 14 Feb 2016 11:56:35 +0000 (13:56 +0200)] 
mac80211: move TKIP TX IVs to public part of key struct

Some drivers/devices might want to set the IVs by
themselves (and still let mac80211 generate MMIC).

Specifically, this is needed when the device does
offloading at certain times, and the driver has
to make sure that the IVs of new tx frames (from
the host) are synchronized with IVs that were
potentially used during the offloading.

Similarly to CCMP, move the TX IVs of TKIP keys to the
public part of the key struct, and export a function
to add the IV right into the crypto header.

The public tx_pn field is defined as atomic64, so define
TKIP_PN_TO_IV16/32 helper macros to convert it to iv16/32
when needed.

Since the iv32 used for the p1k cache is taken
directly from the frame, we can safely remove
iv16/32 from being protected by tkip.txlock.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: fix wiphy supported_band access
Lorenzo Bianconi [Fri, 19 Feb 2016 11:18:01 +0000 (12:18 +0100)] 
mac80211: fix wiphy supported_band access

Fix wiphy supported_band access in tx radiotap parsing introduced
in commit 5ec3aed9ba4c ("mac80211: Parse legacy and HT rate in
injected frames"). In particular, info->band is always set to 0
(IEEE80211_BAND_2GHZ) since it has not assigned yet.
This cause a kernel crash on 5GHz only devices.
Move ieee80211_parse_tx_radiotap() after info->band assignment

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: reuse existing page fragments in A-MSDU rx
Felix Fietkau [Mon, 8 Feb 2016 13:34:42 +0000 (14:34 +0100)] 
cfg80211: reuse existing page fragments in A-MSDU rx

This massively reduces data copying and thus improves rx performance

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: fix faulty variable initialization in ieee80211_amsdu_to_8023s
Felix Fietkau [Mon, 8 Feb 2016 13:25:26 +0000 (14:25 +0100)] 
cfg80211: fix faulty variable initialization in ieee80211_amsdu_to_8023s

reuse_skb is set to true if the code decides to use the last segment.
Fixes a memory leak

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: fix VHT MU-MIMO frame processing
Sara Sharon [Wed, 3 Feb 2016 19:52:23 +0000 (21:52 +0200)] 
mac80211: fix VHT MU-MIMO frame processing

The source and destintation addresses in the memcpy arguments
are flipped. Fix that.

Fixes: 23a1f8d44c0b("mac80211: process and save VHT MU-MIMO group frame")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: Unify mesh and mpp path removal function
Henning Rogge [Wed, 3 Feb 2016 12:58:38 +0000 (13:58 +0100)] 
mac80211: Unify mesh and mpp path removal function

mpp_path_del() and mesh_path_del() are mostly the same function.
Move common code into a new static function.

Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: let unused MPP table entries timeout
Henning Rogge [Wed, 3 Feb 2016 12:58:37 +0000 (13:58 +0100)] 
mac80211: let unused MPP table entries timeout

Remember the last time when a mpp table entry is used for
rx or tx and remove them after MESH_PATH_EXPIRE time.

Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: Remove MPP table entries with MPath
Henning Rogge [Wed, 3 Feb 2016 12:58:36 +0000 (13:58 +0100)] 
mac80211: Remove MPP table entries with MPath

Make the mesh_path_del() function remove all mpp table entries
that are proxied by the removed mesh path.

Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Henning Rogge <henning.rogge@fkie.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: basic support for PBSS network type
Lior David [Thu, 28 Jan 2016 08:58:25 +0000 (10:58 +0200)] 
cfg80211: basic support for PBSS network type

PBSS (Personal Basic Service Set) is a new BSS type for DMG
networks. It is similar to infrastructure BSS, having an AP-like
entity called PCP (PBSS Control Point), but it has few differences.
PBSS support is mandatory for 11ad devices.

Add support for PBSS by introducing a new PBSS flag attribute.
The PBSS flag is used in the START_AP command to request starting
a PCP instead of an AP, and in the CONNECT command to request
connecting to a PCP instead of an AP.

Signed-off-by: Lior David <liord@codeaurora.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: add support for non-linear skbs in ieee80211_amsdu_to_8023s
Felix Fietkau [Tue, 2 Feb 2016 13:39:10 +0000 (14:39 +0100)] 
cfg80211: add support for non-linear skbs in ieee80211_amsdu_to_8023s

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: add function for 802.3 conversion with separate output buffer
Felix Fietkau [Tue, 2 Feb 2016 13:39:09 +0000 (14:39 +0100)] 
cfg80211: add function for 802.3 conversion with separate output buffer

Use skb_copy_bits in preparation for allowing fragmented skbs

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: move A-MSDU skb_linearize call to ieee80211_amsdu_to_8023s
Felix Fietkau [Tue, 2 Feb 2016 13:39:08 +0000 (14:39 +0100)] 
mac80211: move A-MSDU skb_linearize call to ieee80211_amsdu_to_8023s

Prepararation for zero-copy A-MSDU support with page fragment SKBs

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: fix memory leak
Sudip Mukherjee [Tue, 2 Feb 2016 07:51:14 +0000 (13:21 +0530)] 
mac80211: fix memory leak

On error we jumped to the error label and returned the error code but we
missed releasing sinfo.

Fixes: 5fe74014172d ("mac80211: avoid excessive stack usage in sta_info")
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: Interoperability workaround for 80+80 and 160 MHz channels
Jouni Malinen [Mon, 1 Feb 2016 09:40:55 +0000 (11:40 +0200)] 
mac80211: Interoperability workaround for 80+80 and 160 MHz channels

Number of deployed 80 MHz capable VHT stations that do not support 80+80
and 160 MHz bandwidths seem to misbehave when trying to connect to an AP
that advertises 80+80 or 160 MHz channel bandwidth in the VHT Operation
element. To avoid such issues with deployed devices, modify the design
based on recently accepted IEEE 802.11 standard changes (*).

This allows poorly implemented VHT 80 MHz stations to connect with the
AP in 80 MHz mode. 80+80 and 160 MHz capable stations need to support
the new workaround mechanism to allow full bandwidth to be used.
However, there are more or less no impacted station with 80+80/160
capability deployed.

The rebased version of this patch is based on the updated version from
Johannes Berg to take the HT/VHT chandef refactoring into account.

(*) Changes in
https://mentor.ieee.org/802.11/dcn/15/11-15-1530-04-000m-vht160-operation-signaling-through-non-zero-ccfs1.docx
were accepted during the IEEE 802.11 January 2016 meeting.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: add API to allow filtering frames in BA sessions
Sara Sharon [Thu, 28 Jan 2016 14:19:25 +0000 (16:19 +0200)] 
mac80211: add API to allow filtering frames in BA sessions

If any frames are dropped that are part of a BA session, the reorder
buffer will "indefinitely" (until the timeout) wait for them to come
in (or a BAR moving the window) and won't release frames after them.
This means it isn't possible to filter frames within a BA session in
firmware.

Introduce an API function that allows such filtering. Calling this
function will move the BA window forward to the new SSN, and allows
marking frames after the SSN as having been filtered, so any future
reordering activity will release frames while skipping the holes.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: change ieee80211_rx_reorder_ready() arguments
Johannes Berg [Thu, 28 Jan 2016 14:19:24 +0000 (16:19 +0200)] 
mac80211: change ieee80211_rx_reorder_ready() arguments

Clean up ieee80211_rx_reorder_ready() callers by passing the RX
TID struct and the index, instead of the frames list. This will
make it more extensible as well.

While at it, move the inline to rx.c as it's only used there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: expose txq queue depth and size to drivers
Michal Kazior [Wed, 27 Jan 2016 14:26:12 +0000 (15:26 +0100)] 
mac80211: expose txq queue depth and size to drivers

This will allow drivers to make more educated
decisions whether to defer transmission or not.

Relying on wake_tx_queue() call count implicitly
was not possible because it could be called
without queued frame count actually changing on
software tx aggregation start/stop code paths.

It was also not possible to know how long
byte-wise queue was without dequeueing.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: Parse legacy and HT rate in injected frames
Sven Eckelmann [Tue, 26 Jan 2016 16:11:13 +0000 (17:11 +0100)] 
mac80211: Parse legacy and HT rate in injected frames

Drivers/devices without their own rate control algorithm can get the
information what rates they should use from either the radiotap header of
injected frames or from the rate control algorithm. But the parsing of the
legacy rate information from the radiotap header was removed in commit
e6a9854b05c1 ("mac80211/drivers: rewrite the rate control API").

The removal of this feature heavily reduced the usefulness of frame
injection when wanting to simulate specific transmission behavior. Having
rate parsing together with MCS rates and retry support allows a fine
grained selection of the tx behavior of injected frames for these kind of
tests.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: mesh: drop constant field mean_chain_len
Bob Copeland [Sat, 30 Jan 2016 18:17:03 +0000 (13:17 -0500)] 
mac80211: mesh: drop constant field mean_chain_len

The mean_chain_len field in struct mesh_table is copied whenever a
new mesh table is allocated, but only ever has the value 2 and is
never otherwise updated, so just remove it and use the related
define instead.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: avoid excessive stack usage in sta_info
Arnd Bergmann [Tue, 26 Jan 2016 22:05:31 +0000 (23:05 +0100)] 
mac80211: avoid excessive stack usage in sta_info

When CONFIG_OPTIMIZE_INLINING is set, the sta_info_insert_finish
function consumes more stack than normally, exceeding the
1024 byte limit on ARM:

net/mac80211/sta_info.c: In function 'sta_info_insert_finish':
net/mac80211/sta_info.c:561:1: error: the frame size of 1080 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

It turns out that there are two functions that put a 'struct station_info'
on the stack: __sta_info_destroy_part2 and sta_info_insert_finish, and
this structure alone requires up to 792 bytes.

Hoping that both are called rarely enough, this replaces the
on-stack structure with a dynamic allocation, which unfortunately
requires some suboptimal error handling for out-of-memory.

The __sta_info_destroy_part2 function is actually affected by the
stack usage twice because it calls cfg80211_del_sta_sinfo(), which
has another instance of struct station_info on its stack.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 98b6218388e3 ("mac80211/cfg80211: add station events")
Fixes: 6f7a8d26e266 ("mac80211: send statistics with delete station event")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: always print a message when disconnecting
Johannes Berg [Mon, 25 Jan 2016 13:46:36 +0000 (15:46 +0200)] 
mac80211: always print a message when disconnecting

Make sure there's at least a debug message whenever the
connection to the AP is terminated.

Also change one message from wiphy_debug() to the common
mlme_dbg().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: fix ibss scan parameters
Sara Sharon [Mon, 25 Jan 2016 13:46:35 +0000 (15:46 +0200)] 
mac80211: fix ibss scan parameters

When joining IBSS a full scan should be initiated in order to search
for existing cell, unless the fixed_channel parameter was set.
A default channel to create the IBSS on if no cell was found is
provided as well.
However - a scan is initiated only on the default channel provided
regardless of whether ifibss->fixed_channel is set or not, with the
obvious result of the cell not joining existing IBSS cell that is
on another channel.

Fixes: 76bed0f43b27 ("mac80211: IBSS fix scan request")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: add RX_FLAG_MACTIME_PLCP_START
Johannes Berg [Mon, 25 Jan 2016 13:46:34 +0000 (15:46 +0200)] 
mac80211: add RX_FLAG_MACTIME_PLCP_START

The timestamp given by iwlwifi is at the beginning of the
frame over the air, at (or during) the SYNC field. Allow
such timestamps to be given to mac80211, at least (for now)
for frames with non-HT/VHT preambles.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: fix unnecessary frame drops in mesh fwding
Michal Kazior [Mon, 25 Jan 2016 13:43:24 +0000 (14:43 +0100)] 
mac80211: fix unnecessary frame drops in mesh fwding

The ieee80211_queue_stopped() expects hw queue
number but it was given raw WMM AC number instead.

This could cause frame drops and problems with
traffic in some cases - most notably if driver
doesn't map AC numbers to queue numbers 1:1 and
uses ieee80211_stop_queues() and
ieee80211_wake_queue() only without ever calling
ieee80211_wake_queues().

On ath10k it was possible to hit this problem in
the following case:

  1. wlan0 uses queue 0
     (ath10k maps queues per vif)
  2. offchannel uses queue 15
  3. queues 1-14 are unused
  4. ieee80211_stop_queues()
  5. ieee80211_wake_queue(q=0)
  6. ieee80211_wake_queue(q=15)
     (other queues are not woken up because both
      driver and mac80211 know other queues are
      unused)
  7. ieee80211_rx_h_mesh_fwding()
  8. ieee80211_select_queue_80211() returns 2
  9. ieee80211_queue_stopped(q=2) returns true
 10. frame is dropped (oops!)

Fixes: d3c1597b8d1b ("mac80211: fix forwarded mesh frame queue mapping")
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: fix txq queue related crashes
Michal Kazior [Thu, 21 Jan 2016 13:23:07 +0000 (14:23 +0100)] 
mac80211: fix txq queue related crashes

The driver can access the queue simultanously
while mac80211 tears down the interface. Without
spinlock protection this could lead to corrupting
sk_buff_head and subsequently to an invalid
pointer dereference.

Fixes: ba8c3d6f16a1 ("mac80211: add an intermediate software queue implementation")
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: mesh_plink: remove redundant sta_info check
Sunil Shahu [Thu, 21 Jan 2016 05:36:25 +0000 (11:06 +0530)] 
mac80211: mesh_plink: remove redundant sta_info check

Remove unnecessory "if" statement and club it with previos "if" block.

Signed-off-by: Sunil Shahu <shshahu@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agorfkill: Update userspace API documentation
João Paulo Rechi Vita [Tue, 19 Jan 2016 15:42:42 +0000 (10:42 -0500)] 
rfkill: Update userspace API documentation

Add a note to userspace on the effect of RFKILL_OP_CHANGE_ALL also
updating the default state for hotplugged devices.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
[reword a bit]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agorfkill: Remove obsolete "claim" sysfs interface
João Paulo Rechi Vita [Tue, 19 Jan 2016 15:42:39 +0000 (10:42 -0500)] 
rfkill: Remove obsolete "claim" sysfs interface

This was scheduled to be removed in 2012 by:

 commit 69c86373c6ea1149aa559e6088362d58d8ec8835
 Author: florian@mickler.org <florian@mickler.org>
 Date:   Wed Feb 24 12:05:16 2010 +0100

     Document the rfkill sysfs ABI

     This moves sysfs ABI info from Documentation/rfkill.txt to the
     ABI subfolder and reformats it.

     This also schedules the deprecated sysfs parts to be removed in
     2012 (claim file) and 2014 (state file).

Signed-off-by: Florian Mickler <florian@mickler.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agorfkill: remove/inline __rfkill_set_hw_state
João Paulo Rechi Vita [Tue, 19 Jan 2016 15:42:38 +0000 (10:42 -0500)] 
rfkill: remove/inline __rfkill_set_hw_state

__rfkill_set_hw_state() is only one used in rfkill_set_hw_state(), and
none of them are long or complicated, so merging the two makes the code
easier to read.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agorfkill: use variable instead of duplicating the expression
João Paulo Rechi Vita [Tue, 19 Jan 2016 15:42:37 +0000 (10:42 -0500)] 
rfkill: use variable instead of duplicating the expression

RFKILL_BLOCK_SW value have just been saved to prev, no need to check it
again in the if expression. This makes code a little bit easier to read.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: Fix some linguistics in Kconfig
Ola Olsson [Sun, 10 Jan 2016 17:41:42 +0000 (18:41 +0100)] 
cfg80211: Fix some linguistics in Kconfig

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agorfkill: disentangle polling pause and suspend
Johannes Berg [Wed, 20 Jan 2016 09:39:23 +0000 (10:39 +0100)] 
rfkill: disentangle polling pause and suspend

When suspended while polling is paused, polling will erroneously
resume at resume time. Fix this by tracking pause and suspend in
separate state variable and adding the necessary checks.

Clarify the documentation on this as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211_hwsim: remove shadowing variable
Johannes Berg [Wed, 13 Jan 2016 13:21:01 +0000 (14:21 +0100)] 
mac80211_hwsim: remove shadowing variable

The function here already has a variable hdr that even
contains the right thing, so the inner scope's hdr variable
that's shadowing the outer one can just be removed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: Make addr const in SET_IEEE80211_PERM_ADDR()
Bjorn Andersson [Thu, 24 Dec 2015 08:33:26 +0000 (00:33 -0800)] 
mac80211: Make addr const in SET_IEEE80211_PERM_ADDR()

Make the addr parameter const in SET_IEEE80211_PERM_ADDR() to save
clients from having to cast away a const qualifier.

Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: refactor HT/VHT to chandef code
Johannes Berg [Fri, 18 Dec 2015 14:08:34 +0000 (15:08 +0100)] 
mac80211: refactor HT/VHT to chandef code

The station MLME and IBSS/mesh ones use entirely different
code for interpreting HT and VHT operation elements. Change
the code that interprets them a bit - it now modifies an
existing chandef - and use it also in the MLME code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: add more warnings for inconsistent ops
Ola Olsson [Wed, 16 Dec 2015 21:43:35 +0000 (22:43 +0100)] 
cfg80211: add more warnings for inconsistent ops

Print a warning whenever an expected callback function
lacks implementation.

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: limit the A-MSDU Tx based on peer's capabilities
Emmanuel Grumbach [Sun, 13 Dec 2015 13:41:05 +0000 (15:41 +0200)] 
mac80211: limit the A-MSDU Tx based on peer's capabilities

In VHT, the specification allows to limit the number of
MSDUs in an A-MSDU in the Extended Capabilities IE. There
is also a limitation on the byte size in the VHT IE.
In HT, the only limitation is on the byte size.
Parse the capabilities from the peer and make them
available to the driver.

In HT, there is another limitation when a BA agreement
is active: the byte size can't be greater than 4095.
This is not enforced here.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: Recalc min chandef when station is associated
Ilan Peer [Sun, 13 Dec 2015 11:41:43 +0000 (13:41 +0200)] 
mac80211: Recalc min chandef when station is associated

The minimum chandef bandwidth calculation was done only in case
a new station was inserted (or when an existing station was removed).
However, it is possible that stations are inserted before they are
associated, e.g., when FULL_AP_CLIENT_STATE is supported and user
space adds stations unassociated.

Fix this by calling ieee80211_recalc_min_chandef() whenever
a station transitions in/out the associated state, and only
consider station marked as associated.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: allow drivers to report (non-)monitor frames
Grzegorz Bajorski [Fri, 11 Dec 2015 13:39:46 +0000 (14:39 +0100)] 
mac80211: allow drivers to report (non-)monitor frames

Some drivers offload some frames internally (e.g.
AddBa). Reporting such frames to mac80211 would
only confuse MLME. However it would be useful to
be able to pass such frames to monitor interfaces
for sniffing purposes, e.g. when running AP +
monitor.

To do that allow drivers to tell mac80211 whether
a given frame should be:
 - processed but not delivered to any monitor vif
 - not processed but delievered to monitor vifs
   only

Signed-off-by: Grzegorz Bajorski <grzegorz.bajorski@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: support hw managing reorder logic
Sara Sharon [Tue, 8 Dec 2015 17:09:05 +0000 (19:09 +0200)] 
mac80211: support hw managing reorder logic

Enable driver to manage the reordering logic itself.
This is needed for example for the iwlwifi driver that
will support hardware assisted reordering.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiwlwifi: pcie: fix erroneous return value
Anton Protopopov [Thu, 11 Feb 2016 06:35:15 +0000 (08:35 +0200)] 
iwlwifi: pcie: fix erroneous return value

The iwl_trans_pcie_start_fw() function may return the positive value EIO
instead of -EIO in case of error.

Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: fix RF-Kill vs. firmware load race
Emmanuel Grumbach [Sun, 31 Jan 2016 13:02:30 +0000 (15:02 +0200)] 
iwlwifi: pcie: fix RF-Kill vs. firmware load race

When we load the firmware, we hold trans_pcie->mutex to
avoid nested flows. We also rely on the ISR to wake up the
thread when the DMA has finished copying a chunk. During
this flow, we enable the RF-Kill interrupt.

The problem is that the RF-Kill interrupt handler can take
the mutex and bring the device down. This means that if
we load the firmware while the RF-Kill switch is enabled
(which will happen when we load the INIT firmware to read
the device's capabilities and register to mac80211), we
may get an RF-Kill interrupt immediately and the ISR will
be waiting for the mutex held by the thread that is
currently loading the firmware. At this stage, the ISR
won't be able to service the DMA's interrupt needed to
wake up the thread that load the firmware. We are in a
deadlock situation which ends when the thread that loads
the firmware fails on timeout and releases the mutex.

To fix this, take the mutex later in the flow, disable
the interrupts and synchronize_irq() to give a chance to
the RF-Kill interrupt to run and complete.
After that, mask all the interrupts besides the DMA
interrupt and proceed with firmware load. Make sure to
check that there was no RF-Kill interrupt when the
interrupts were disabled.

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

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: don't allow sched scans without matches to be started
Luca Coelho [Tue, 2 Feb 2016 13:11:15 +0000 (15:11 +0200)] 
iwlwifi: mvm: don't allow sched scans without matches to be started

The firmware can perform a scheduled scan with not matchsets passed,
but it can't send notification that results were found.  Since the
userspace then cannot know when we got new results and the firmware
wouldn't trigger a wake in case we are sleeping, it's better not to
allow scans without matchsets.

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

Cc: <stable@vger.kernel.org> [3.17+]
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: dvm: remove a wrong dependency on m
Emmanuel Grumbach [Wed, 10 Feb 2016 16:13:30 +0000 (18:13 +0200)] 
iwlwifi: dvm: remove a wrong dependency on m

This was wronly added when the dependency on IWLWIFI was
removed.

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

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: allow to disable beacon filtering for AP/GO interface
Andrei Otcheretianski [Tue, 26 Jan 2016 16:12:28 +0000 (18:12 +0200)] 
iwlwifi: mvm: allow to disable beacon filtering for AP/GO interface

When in AP mode we need to filter in beacons from other APs to update HT
operation mode. As a power optimization the beacons are filtered out when
there are no associated stations. As a result, when there are no
associated stations, we will not update the HT operation mode until a
station connects.
Add a debugfs parameter that allows to disable this optimization.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: update iwl_mpdu_desc fields
Sara Sharon [Tue, 26 Jan 2016 10:35:13 +0000 (12:35 +0200)] 
iwlwifi: pcie: update iwl_mpdu_desc fields

Final API of iwl_mpdu_desc has a change in the order of
the fields and does not include energy from the third
antenna (which is perfectly fine, since we don't have one).
Update the structure accordingly.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: enable multi-queue rx path
Sara Sharon [Mon, 25 Jan 2016 16:14:49 +0000 (18:14 +0200)] 
iwlwifi: pcie: enable multi-queue rx path

Previous patches enabled new 9000 hardware DMA for one queue
only.
Enable the actual multi-queue path and configuration now.
This requires also per-queue NAPI struct.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: support rss queues configuration command
Sara Sharon [Thu, 31 Dec 2015 09:49:18 +0000 (11:49 +0200)] 
iwlwifi: mvm: support rss queues configuration command

9000 series supports multi-queue rx. The hardware needs
to be configured with the hash functions to perform and
indirection table that maps hash results to the relevant
CPUs\queues.
Support this configuration.
Add debugfs hook to configure the indirection table in
order to enable performance analysis. The configuration
is stateless, receives a partial or full pattern and sends
the command to the firmware.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: rs: fix TPC action decision algorithm
Gregory Greenman [Tue, 26 Jan 2016 22:10:15 +0000 (00:10 +0200)] 
iwlwifi: mvm: rs: fix TPC action decision algorithm

Decreasing Tx power is allowed only when success ratio is
above the threshold defined in the algorithm. Add this condition.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add new ADD_STA command version
Sara Sharon [Tue, 26 Jan 2016 11:17:47 +0000 (13:17 +0200)] 
iwlwifi: mvm: add new ADD_STA command version

The 9000 hardware introduces the frame releaser, which
keeps track of the aggregation window and notifies host
of the window status. This requires in turn updating
the hardware with the RX BA session window size.
Firmware API was changed to enable that, update the driver
accordingly.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: Remove iwl_mvm_update_beacon_abort
Avri Altman [Sun, 24 Jan 2016 13:56:11 +0000 (15:56 +0200)] 
iwlwifi: mvm: Remove iwl_mvm_update_beacon_abort

It is only called from iwl_mvm_power_set_ba() so simplify things
by removing it.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: Remove bf_vif from iwl_power_vifs
Avri Altman [Sun, 24 Jan 2016 13:18:59 +0000 (15:18 +0200)] 
iwlwifi: mvm: Remove bf_vif from iwl_power_vifs

This member is actually not needed as beacon abort
is only allowed for a bss station.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: treat iwl_parse_nvm_data() MAC addr as little endian
Johannes Berg [Sun, 24 Jan 2016 14:28:43 +0000 (15:28 +0100)] 
iwlwifi: treat iwl_parse_nvm_data() MAC addr as little endian

The MAC address parameters passed to iwl_parse_nvm_data() are passed on
to iwl_set_hw_address_family_8000() which treats them as little endian.
Annotate them as such, and add the missing byte-swapping in mvm.

While at it, add the MAC address to the error to make debugging issues
with it easier.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add tlv for multi queue rx support
Sara Sharon [Wed, 30 Dec 2015 21:58:29 +0000 (23:58 +0200)] 
iwlwifi: mvm: add tlv for multi queue rx support

Previous patches enabled the multi-queue rx path based on
iwl_mvm_has_new_rx_api() which returned false by default.
Change it to return the actual value based on the firmware
TLV which is now defined.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: change the check for ADD_STA status
Sara Sharon [Thu, 7 Jan 2016 14:50:45 +0000 (16:50 +0200)] 
iwlwifi: mvm: change the check for ADD_STA status

The firmware will return the baid for BA session in the
ADD_STA command response.
This requires masking the check of the status, which is
actually only 8 bits, and not the whole 32 bits.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add debug print if scan config is ignored
Max Stepanov [Mon, 4 Jan 2016 09:09:14 +0000 (11:09 +0200)] 
iwlwifi: mvm: add debug print if scan config is ignored

Print a debug message in iwl_mvm_config_scan() if a scan configuration
data is decided not to be sent to FW.

Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
This page took 0.064721 seconds and 5 git commands to generate.