]> git.karo-electronics.de Git - linux-beck.git/log
linux-beck.git
8 years agoiwlwifi: mvm: constify the parameters of a few functions in fw-dbg.c
Emmanuel Grumbach [Tue, 5 Jan 2016 07:14:08 +0000 (09:14 +0200)]
iwlwifi: mvm: constify the parameters of a few functions in fw-dbg.c

The debug functions of fw-dbg.c don't really need to modify
the trigger and the description they receive as a parameter.
Constify the pointers.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: check minimum temperature notification length
Johannes Berg [Tue, 5 Jan 2016 15:16:31 +0000 (16:16 +0100)]
iwlwifi: mvm: check minimum temperature notification length

This notification will be extended with extra data, so just
check that it has a minimum length, not the exact length;
we might later add handling for the extra fields added and
have more code to handle both versions.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: initialize gtkdata->mvm correctly
Eliad Peller [Thu, 31 Dec 2015 13:19:32 +0000 (15:19 +0200)]
iwlwifi: mvm: initialize gtkdata->mvm correctly

gtkdata->mvm wasn't set in iwl_mvm_d0i3_update_keys,
resulting in kernel panic in some flows (when mvm
is actually used...)

Fixes: a3f7ba5c8825 ("iwlwifi: update key params on d0i3 entrance/exit")
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: check PN for CCMP/GCMP in the driver
Johannes Berg [Sun, 6 Dec 2015 12:58:08 +0000 (14:58 +0200)]
iwlwifi: mvm: check PN for CCMP/GCMP in the driver

As we're working on multi-queue RX, we want to parallelise checking
the PN in order to avoid having to serialise the RX processing.

It may seem that doing parallel PN checking is insecure, but it turns
out to be OK because queue assignment is done based on the data in the
frame (IP/TCP) and thus cannot be manipulated by an attacker, since
the data is encrypted and must first have been decrypted successfully.

There are some corner cases, in particular when the peer starts using
fragmentation which redirects the packet to the default queue. However
this redirection is remembered (for the STA, per TID) and thus cannot
be exploited by an attacker either.

Leave checking on the default queue (queue 0) to mac80211, since we
get fragmented packets there and those are subject to stricter checks
during reassembly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: don't ask beacons when P2P GO vif and no assoc sta
Ayala Beker [Sun, 20 Dec 2015 07:27:50 +0000 (09:27 +0200)]
iwlwifi: mvm: don't ask beacons when P2P GO vif and no assoc sta

The commit below called iwl_mvm_mac_ctxt_changed() to handle
a case that the vif is a P2P GO.
However iwl_mvm_mac_ctxt_cmd_go() ignores the number of
associated stations and asks the FW to pass beacons anyways.

Fix this by checking ap_assoc_sta_count parameter, in iwl_mvm_mac_ctxt_cmd_go()
as well, and ask the FW to pass beacons only when there's
at least one associated station.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: prevent multiple stations with the same address
Johannes Berg [Thu, 24 Sep 2015 16:14:55 +0000 (18:14 +0200)]
iwlwifi: mvm: prevent multiple stations with the same address

As the device (and parts of the driver) cannot deal with having the
same MAC address for two stations (on two virtual interfaces), add
some explicit code to prevent this case.

Note that in practice this cannot happen since the device doesn't
support operating with two AP/GO interfaces at the same time either,
and other scenarios for this are, while not impossible, not going to
happen in practice.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: remove useless WARN_ON and rely on cfg80211's combination
Emmanuel Grumbach [Thu, 24 Dec 2015 06:48:46 +0000 (08:48 +0200)]
iwlwifi: mvm: remove useless WARN_ON and rely on cfg80211's combination

We advertise one STATION vif only, so this just can't
happen. Remove this useless WARN_ON.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: support A-MSDU in A-MPDU
Johannes Berg [Mon, 21 Sep 2015 12:09:17 +0000 (14:09 +0200)]
iwlwifi: mvm: support A-MSDU in A-MPDU

Since A-MPDU deaggregation is done in hardware, and A-MSDU deaggregation
is done in software, there's no reason not to support A-MSDU in A-MPDU;
set the flag to support it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add a non-trigger window to fw dbg triggers
Golan Ben-Ami [Wed, 25 Nov 2015 09:44:57 +0000 (11:44 +0200)]
iwlwifi: mvm: add a non-trigger window to fw dbg triggers

Allow the user to configure a non-trigger session - a window
between triggers in which the driver won't collect fw debug data.
This can be useful when the frequent collection of fw data
has an impact on the performance, such as debugging
tx flows.

Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: dump the radio registers when the firmware crashes
Emmanuel Grumbach [Mon, 28 Dec 2015 13:22:28 +0000 (15:22 +0200)]
iwlwifi: mvm: dump the radio registers when the firmware crashes

Dumping the content of the radio registers greatly helps
to debug PHY issues, which can lead to TFD queue hang.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: fix extended dwell time
David Spinadel [Sun, 3 Jan 2016 15:08:32 +0000 (17:08 +0200)]
iwlwifi: mvm: fix extended dwell time

FW adds 10 msec for every dwell time in low band, so we need
to set 10 msec less.
Don't use extended dwell time when fragmented scan is needed
because FW adds 3 msec per probe and it can easily exceed
max out of channel time.

Fixes: c3e230b167a9 ("iwlwifi: mvm: add extended dwell time")
Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: nvm: fix loading default NVM file
Oren Givon [Wed, 25 Nov 2015 09:17:41 +0000 (11:17 +0200)]
iwlwifi: nvm: fix loading default NVM file

Fix loading the default NVM file, in the case where the
requested NVM file isn't found in the file system.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: bump max API to 20
Emmanuel Grumbach [Tue, 5 Jan 2016 14:30:04 +0000 (16:30 +0200)]
iwlwifi: mvm: bump max API to 20

7265D and up are now able to handle -20.ucode.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: set max firmware version of 7265 to 17
Emmanuel Grumbach [Mon, 4 Jan 2016 08:19:17 +0000 (10:19 +0200)]
iwlwifi: set max firmware version of 7265 to 17

Just like 7260, 7265 will not have firmware releases newer
than iwlwifi-7265-17.ucode. 7265D is still supported in
latest firmware releases.

Fixes: 628a2918afe4 ("iwlwifi: separate firmware version for 7260 devices")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: reset mvm->scan_type when firmware is started
Emmanuel Grumbach [Sun, 3 Jan 2016 20:23:40 +0000 (22:23 +0200)]
iwlwifi: mvm: reset mvm->scan_type when firmware is started

If we don't reset the scan type when the firmware is
started, we will think the firmware is still configured
after the interface has been brought down. When we will
bring it up again, we will not configure the scan type
in firmware and it will crash with the following assert:

0x0000100A | ADVANCED_SYSASSERT

Fixes: 355346ba3050 ("iwlwifi: mvm: configure scheduled scan according to traffic conditions")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: change mcc update API
Matti Gottlieb [Mon, 4 Jan 2016 11:38:41 +0000 (13:38 +0200)]
iwlwifi: mvm: change mcc update API

New functionality for testing that is not relevant for
this driver has been added. This required an API change.

Add new cmd & response versions for the MCC update cmd & response.
Add new TLV indicating that the FW is using the new API.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: let the firmware choose the antenna for beacons
Emmanuel Grumbach [Sun, 13 Dec 2015 07:35:30 +0000 (09:35 +0200)]
iwlwifi: mvm: let the firmware choose the antenna for beacons

The firmware knows better what antenna to choose.
Old firmware still need the setting, so use a flag to know
if the driver should choose the antenna or if the firmware
can do it iself.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: update and fix 7265 series PCI IDs
Oren Givon [Thu, 17 Dec 2015 12:17:00 +0000 (14:17 +0200)]
iwlwifi: update and fix 7265 series PCI IDs

Update and fix some 7265 PCI IDs entries.

CC: <stable@vger.kernel.org> [3.13+]
Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: dvm: fix WoWLAN
Emmanuel Grumbach [Sun, 20 Dec 2015 06:45:40 +0000 (08:45 +0200)]
iwlwifi: dvm: fix WoWLAN

My commit below introduced a mutex in the transport to
prevent concurrent operations. To do so, it added a flag
(is_down) to make sure the transport is in the right state.
This uncoverred an bug that didn't cause any harm until
now: iwldvm calls stop_device and then starts the firmware
without calling start_hw in between. While this flow is
fine from the device configuration point of view (register,
etc...), it is now forbidden by the new is_down flag.
This led to this error to appear:
iwlwifi 0000:05:00.0: Can't start_fw since the HW hasn't been started
and the suspend would fail.

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

CC: <stable@vger.kernel.org> [4.3+]
Reported-by: Bogdan Bogush <bogdan.s.bogush@gmail.com>
Fixes=fa9f3281cbb1 ("iwlwifi: pcie: lock start_hw / start_fw / stop_device")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: bail out in case of bad trans state
Eliad Peller [Thu, 17 Dec 2015 11:02:56 +0000 (13:02 +0200)]
iwlwifi: bail out in case of bad trans state

In case of bad trans state (i.e. fw is not loaded) bail
out immediately instead of calling the trans, which might
not be fully initialized yet.

Also add WARN_ON_ONCE to help debugging where the errorneous
call is coming from.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: fix printf specifier
Emmanuel Grumbach [Thu, 17 Dec 2015 08:41:49 +0000 (10:41 +0200)]
iwlwifi: fix printf specifier

Smatch warned about a bad specifier being used. Fix that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: remove unused parameter from grab_nic_access
Emmanuel Grumbach [Thu, 17 Dec 2015 09:55:13 +0000 (11:55 +0200)]
iwlwifi: remove unused parameter from grab_nic_access

All the callers used silent = false.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: update key params on d0i3 entrance/exit
Eliad Peller [Wed, 11 Nov 2015 15:23:59 +0000 (17:23 +0200)]
iwlwifi: update key params on d0i3 entrance/exit

In order to let the fw do offloading properly, we need
to provide various key data (e.g. PN).

Configure the params on d0i3 entrance, and update them
back on d0i3 exit.

Since d3 code is now called in d0i3 which requires runtime
pm only, make d3.0 depend on CONFIG_PM (rather than
CONFIG_PM_SLEEP), and add required #ifdefs and wrappers
where needed, so both CONFIG_PM=n and CONFIG_PM_RUNTIME=n
configurations will build correctly.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: Change number of associated stations when station becomes associated
Ayala Beker [Tue, 15 Dec 2015 22:32:07 +0000 (00:32 +0200)]
iwlwifi: mvm: Change number of associated stations when station becomes associated

Currently, the number of associated stations gets updated when adding
a new station or removing it. This is incorrect as it's possible that
a station was inserted before it was associated
Fix this by increasing/decreasing ap_assoc_sta_count whenever
a station transitions in/out the associated state.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: Update PCI IDs for 8000 and 9000 series
Oren Givon [Thu, 17 Dec 2015 11:44:06 +0000 (13:44 +0200)]
iwlwifi: Update PCI IDs for 8000 and 9000 series

A new PCI IDs update to the 8000 and 9000 series.

type=feature

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: dump more registers upon error
Emmanuel Grumbach [Wed, 16 Dec 2015 11:42:17 +0000 (13:42 +0200)]
iwlwifi: mvm: dump more registers upon error

These registers can help to debug PHY issues. Since this
adds a significant amount of work to the debug collection
phase, dump the periphery registers only if the firmware
is stopped.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: infrastructure for frame-release message
Sara Sharon [Tue, 1 Dec 2015 11:48:18 +0000 (13:48 +0200)]
iwlwifi: mvm: infrastructure for frame-release message

Incoming hardware will send frame release notifications to
the reorder buffer in order to update with the BA session
status and up to date NSSN.
This patch enables the API.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add 9000 series RX processing
Johannes Berg [Thu, 3 Sep 2015 12:56:10 +0000 (14:56 +0200)]
iwlwifi: mvm: add 9000 series RX processing

Convert the convert the new infrastructure added by previous
patches to actually use the new RX descriptor layout.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: change iwl_mvm_get_key_sta_id() to return the station
Johannes Berg [Fri, 11 Dec 2015 08:36:10 +0000 (09:36 +0100)]
iwlwifi: mvm: change iwl_mvm_get_key_sta_id() to return the station

The code in iwl_mvm_update_tkip_key() is now pretty much duplicated
with the code in iwl_mvm_get_key_sta_id() doing the station ID lookup
again after it was already done. Change iwl_mvm_get_key_sta_id() to
iwl_mvm_get_key_sta(), returning the mvm_sta pointer, to allow that
duplicate code to be removed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: Add a station in monitor mode
Chaya Rachel Ivgi [Thu, 3 Dec 2015 13:51:46 +0000 (15:51 +0200)]
iwlwifi: mvm: Add a station in monitor mode

Currently when creating a new vif in monitor mode the driver doesn't
allocate a specific station. This causes that in the situation that
tx traffic is injected, the tx queues are not scheduled,
with the result of a TFD queue hang.
Fix that by allocating a station and ensuring its tx queues
are scheduled.

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

Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add extended dwell time
David Spinadel [Sun, 22 Nov 2015 14:37:36 +0000 (16:37 +0200)]
iwlwifi: mvm: add extended dwell time

When doing active scan on crowded channels we are likely to miss probe
responses due to collisions. To overcome this issue we use an extended
dwell time on channels 1, 6 and 11; this dwell time is set to 100.

In case of fragmented scan extended dwell time is the maximum out of
channel time - 44 msec. Fragmented active scan will be addressed later.

Extended dwell time isn't used in sched scan or p2p find.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: small update in the firmware API
Emmanuel Grumbach [Wed, 16 Dec 2015 09:26:09 +0000 (11:26 +0200)]
iwlwifi: mvm: small update in the firmware API

Small change in firmware API, no functional change.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: support description for user triggered fw dbg collection
Golan Ben-Ami [Mon, 30 Nov 2015 12:30:21 +0000 (14:30 +0200)]
iwlwifi: mvm: support description for user triggered fw dbg collection

Add to the user triggered fw debug collection support for describing
the reason of the trigger.
This could be useful for identifying a dump by a unique id, passed as
a description.

Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: enable L3 filtering
Sara Sharon [Thu, 19 Nov 2015 11:12:15 +0000 (13:12 +0200)]
iwlwifi: mvm: enable L3 filtering

Firmware will support filtering multicast L3 packets.
The L3 filtering is configured by the WOWLAN_CONFIG command.
All flags should be enabled by default.
Older firmware is not affected as it does not look into
this field.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: refactor the way fw_key_table is handled
Luca Coelho [Tue, 10 Nov 2015 23:06:17 +0000 (01:06 +0200)]
iwlwifi: mvm: refactor the way fw_key_table is handled

Instead of keeping the fw_key_table bits set when the keys are removed
(i.e. in D3 entry or HW_RESTART flows), clear them and set them again
only when the keys have been successfully re-added.  This makes the
bitmask more closely tied to the actual firmware programming.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: 9000: increase the number of queues
Emmanuel Grumbach [Wed, 16 Dec 2015 08:50:03 +0000 (10:50 +0200)]
iwlwifi: 9000: increase the number of queues

9000 family devices have 31 queues.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: build an A-MSDU using TSO core
Emmanuel Grumbach [Sun, 18 Oct 2015 06:31:24 +0000 (09:31 +0300)]
iwlwifi: pcie: build an A-MSDU using TSO core

When the op_mode sends an skb whose payload is bigger than
MSS, PCIe will create an A-MSDU out of it. PCIe assumes
that the skb that is coming from the op_mode can fit in one
A-MSDU. It is the op_mode's responsibility to make sure
that this guarantee holds.

Additional headers need to be built for the subframes.
The TSO core code takes care of the IP / TCP headers and
the driver takes care of the 802.11 subframe headers.

These headers are stored on a per-cpu page that is re-used
for all the packets handled on that same CPU. Each skb
holds a reference to that page and releases the page when
it is reclaimed. When the page gets full, it is released
and a new one is allocated.

Since any SKB that doesn't go through the fast-xmit path
of mac80211 will be segmented, we can assume here that the
packet is not WEP / TKIP and has a proper SNAP header.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: clear ieee80211_tx_info->driver_data in the op_mode
Emmanuel Grumbach [Mon, 26 Oct 2015 13:39:22 +0000 (15:39 +0200)]
iwlwifi: clear ieee80211_tx_info->driver_data in the op_mode

The transport will need to use the info->driver_data
pointers. Since the op_mode has this memory hot in cache,
clear it there.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: re-organize code towards TSO
Emmanuel Grumbach [Wed, 14 Oct 2015 19:10:50 +0000 (22:10 +0300)]
iwlwifi: pcie: re-organize code towards TSO

The code that handles the TBs that contain the WiFi payload
will be changed for TSO. Move the current code into a
separate function.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: prepare the code towards TSO implementation
Emmanuel Grumbach [Wed, 14 Oct 2015 11:16:35 +0000 (14:16 +0300)]
iwlwifi: mvm: prepare the code towards TSO implementation

Differentiate between the cases where the skb is a large
send and the other cases.
Advertise TSO even if, at this stage, skb_gso_segment will
be called and it will do all the work.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: allow to pretend to have Tx CSUM for debug
Emmanuel Grumbach [Wed, 21 Oct 2015 06:00:07 +0000 (09:00 +0300)]
iwlwifi: pcie: allow to pretend to have Tx CSUM for debug

Allow to configure the driver to pretend to have TX CSUM
offload support. This will be useful to test the TSO flows
that will come in further patches.
This configuration is disabled by default.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: change the Intel Wireless email address
Emmanuel Grumbach [Tue, 17 Nov 2015 13:39:56 +0000 (15:39 +0200)]
iwlwifi: change the Intel Wireless email address

ilw@linux.intel.com is not available anymore.
linuxwifi@intel.com should be used instead.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoMerge tag 'iwlwifi-for-kalle-2015-12-16' into next
Emmanuel Grumbach [Sun, 20 Dec 2015 12:48:08 +0000 (14:48 +0200)]
Merge tag 'iwlwifi-for-kalle-2015-12-16' into next

* don't load firmware that won't exist for 7260
* fix RCU splat

8 years agoiwlwifi: dvm: fix compare_const_fl.cocci warnings
Julia Lawall [Fri, 27 Nov 2015 16:10:58 +0000 (17:10 +0100)]
iwlwifi: dvm: fix compare_const_fl.cocci warnings

Move constants to the right of binary operators.

Generated by: scripts/coccinelle/misc/compare_const_fl.cocci

type=cleanup

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: change protocol offload flows
Sara Sharon [Thu, 19 Nov 2015 09:53:49 +0000 (11:53 +0200)]
iwlwifi: mvm: change protocol offload flows

RFC4862 states that "In all cases, a node MUST NOT respond to
a Neighbor Solicitation for a tentative address".
Currently the driver configures the NS offload and does not wait
for address to become permanent, thus violating the RFC.
Just removing the address from the address list is not good enough
for all cases, since the NS messages are needed for the duplicate
address detection and should not be discarded.

For d0i3 disable NS offload. Put tentative address in the address
list so the NS packet will not be filtered out by ucode.
For D3 the platform will not wake from NS packets - so enable
NS offload while removing the tentative address from the list.

Given that now NS offload might be disabled, and that the ucode
uses the IP data for other puroposes (L3 filtering) add two
independent flags indicating if IPv4\IPv6 data is valid.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: expose fw usniffer mode to more utilities
Golan Ben-Ami [Sun, 30 Aug 2015 14:41:36 +0000 (17:41 +0300)]
iwlwifi: expose fw usniffer mode to more utilities

Today, in order to configure fw in usniffer mode, the ucode
must have the corresponding tlv, which is revealed to the driver
while parsing the ucode.

Expose the mode of the usniffer to other utilities in the driver
(other than the ucode parser) by passing back a pointer to the value.
This can be very useful for allowing configuring the fw dbg data
using an external configuration file, because this configuration
depends on the fw usniffer mode.

Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: protect RCU dereference in iwl_mvm_get_key_sta_id
Johannes Berg [Fri, 11 Dec 2015 08:06:25 +0000 (09:06 +0100)]
iwlwifi: mvm: protect RCU dereference in iwl_mvm_get_key_sta_id

Properly protect the RCU dereference in iwl_mvm_get_key_sta_id() when
coming from iwl_mvm_update_tkip_key() which cannot hold the mvm->mutex
by moving the call into the RCU critical section.
Modify the check to use rcu_dereference_check() to permit this.

Fixes: 9513c5e18a0d ("iwlwifi: mvm: Avoid dereferencing sta if it was already flushed")
Reported-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: separate firmware version for 7260 devices
Johannes Berg [Thu, 3 Dec 2015 16:26:59 +0000 (17:26 +0100)]
iwlwifi: separate firmware version for 7260 devices

The 7260 devices aren't going to be updated for completely new
firmware versions any more (only bugfixes), and haven't been
since API version 17. Encode that in the data structures to
avoid trying to load FW images that will never exist.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: replace d0i3_mode and wowlan_d0i3 with more generic variables
Luca Coelho [Thu, 17 Sep 2015 20:44:14 +0000 (23:44 +0300)]
iwlwifi: replace d0i3_mode and wowlan_d0i3 with more generic variables

The d0i3_mode variable is used to distinguish between transports that
handle d0i3 entry during suspend by themselves (i.e. the slave
transports) and those which rely on the op_mode layer to do it.  The
reason why the former do it by themselves is that they need to
transition from d0i3 in runtime_suspend into d0i3 in system-wide
suspend and this transition needs to happen before the op_mode's
suspend flow is called.

The wowlan_d0i3 element is also a bit confusing, because it just
reflects the wowlan->any value for the trans to understand.  This is a
bit unclear in the code and not generic enough for future use.

To make it clearer and to generalize the platform power mode settings,
introduce two variables to indicate the platform power management
modes used by the transport.

Additionally, in order not to take too big a step in one patch, treat
this new variables semantically in the same way as the old d0i3_mode
element, introducing a iwl_mvm_enter_d0i3_on_suspend() function to
help with that.

This commit also adds the foundation for a new concept where the
firmware configuration state (i.e. D0, D3 or D0i3) is abstracted from
the platform PM mode we are in (i.e. runtime suspend or system-wide
suspend).

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: remove the vif parameter of iwl_mvm_configure_bcast_filter()
Eliad Peller [Thu, 3 Dec 2015 14:10:07 +0000 (16:10 +0200)]
iwlwifi: mvm: remove the vif parameter of iwl_mvm_configure_bcast_filter()

Remove the vif parameter of iwl_mvm_configure_bcast_filter()
as it's not being used.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: avoid d0i3 commands when no/init ucode is loaded
Eliad Peller [Thu, 10 Dec 2015 13:47:11 +0000 (15:47 +0200)]
iwlwifi: avoid d0i3 commands when no/init ucode is loaded

d0i3 commands are not supported in the init image, so take
a reference to ensure we don't enter d0i3 during init image,
and additional checks to prevent d0i3 commands when no
fw image is loaded.

Add a few WARN_ON_ONCE to the d0i3 enter/exit commands
to ensure we send d0i3 commands only when the normal
ucode is loaded.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: close the SP if we send fewer frames than expected in SP
Emmanuel Grumbach [Thu, 5 Nov 2015 08:32:31 +0000 (10:32 +0200)]
iwlwifi: mvm: close the SP if we send fewer frames than expected in SP

When we have holes in the BA window, there might be frames
that have been ACKed between the read and the right
pointers. This means that these frames won't be scheduled
again by the SCD and the firwmare won't see them.
This invalidates the number of frames we tell the firmware
to send. When we detect this case, tell mac80211 to close
the SP and to send an EOSP so that the firmware can be in
sync.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoMerge tag 'mac80211-next-for-davem-2015-12-07' into next
Emmanuel Grumbach [Sun, 13 Dec 2015 07:41:59 +0000 (09:41 +0200)]
Merge tag 'mac80211-next-for-davem-2015-12-07' into next

This pull request got a bit bigger than I wanted, due to
needing to reshuffle and fix some bugs. I merged mac80211
to get the right base for some of these changes.

 * new mac80211 API for upcoming driver changes: EOSP handling,
   key iteration
 * scan abort changes allowing to cancel an ongoing scan
 * VHT IBSS 80+80 MHz support
 * re-enable full AP client state tracking after fixes
 * various small fixes (that weren't relevant for mac80211)
 * various cleanups

8 years agoiwlwifi: update host command messages to new format
Sharon Dvir [Thu, 15 Oct 2015 15:18:09 +0000 (18:18 +0300)]
iwlwifi: update host command messages to new format

Host commands now have a group id, express this in printed messages.

Signed-off-by: Sharon Dvir <sharon.dvir@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: uninline iwl_trans_send_cmd
Emmanuel Grumbach [Tue, 1 Dec 2015 11:45:37 +0000 (13:45 +0200)]
iwlwifi: uninline iwl_trans_send_cmd

This function got too big to be inlined. Uninline it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: block the queues when we send ADD_STA for uAPSD
Emmanuel Grumbach [Tue, 24 Nov 2015 12:55:18 +0000 (14:55 +0200)]
iwlwifi: block the queues when we send ADD_STA for uAPSD

We send an ADD_STA to instruct the firmware to release
frames despite the peer being in PS.
Since the ADD_STA command and the Tx frame that comes
immediately afterwards can be reordered by the DMA engine,
we need to block the Tx queues until the firmware replies
with the ADD_STA response.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: trans: support a callback for ASYNC commands
Emmanuel Grumbach [Tue, 24 Nov 2015 13:17:37 +0000 (15:17 +0200)]
iwlwifi: trans: support a callback for ASYNC commands

This allows the op_mode to request from the transport to
call a callback when an ASYNC commands is completed by
the firmware. The same callback will be called for all the
commands. Pass the command whose response triggers the
callback as a parameter to the callback itself.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: allow the op_mode to block the tx queues
Emmanuel Grumbach [Tue, 24 Nov 2015 11:24:24 +0000 (13:24 +0200)]
iwlwifi: pcie: allow the op_mode to block the tx queues

In certain flows (see next patches), the op_mode may need to
block the Tx queues for a short period. Provide an API for
that. The transport is in charge of counting the number of
times the queues are blocked since the op_mode may block the
queues several times in a row before unblocking them.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: check iwl_mvm_wowlan_config_key_params() return value
Eliad Peller [Sun, 15 Nov 2015 13:44:17 +0000 (15:44 +0200)]
iwlwifi: mvm: check iwl_mvm_wowlan_config_key_params() return value

commit 9a4c830007817e ("iwlwifi: mvm: refactor d3 key
update functions") refactored some code into
iwl_mvm_wowlan_config_key_params() function, but the
return value was never checked, and not all the function
flows returned valid values. fix it.

Fixes: ac8ef0ce38de ("iwlwifi: mvm: refactor d3 key update functions")
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: cleanup roc te on restart cleanup
Eliad Peller [Wed, 9 Dec 2015 14:33:20 +0000 (16:33 +0200)]
iwlwifi: mvm: cleanup roc te on restart cleanup

iwl_mvm_restart_cleanup() calls ieee80211_remain_on_channel_expired()
on cleanup, but it doesn't clean the actual roc time
events, resulting in failure of further ROC attempts.

Refactor iwl_mvm_stop_roc() a bit, and add a new function
to only cleanup the roc time events (without sending further
commands).

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: remove an extra tab
Dan Carpenter [Wed, 9 Dec 2015 10:26:08 +0000 (13:26 +0300)]
iwlwifi: mvm: remove an extra tab

Smatch prints a static checker warning here:

    drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c:386 iwl_dump_prph()
    warn: curly braces intended?

Curly braces are NOT intended, the extra tab was added by mistake in
commit 1a616dd2f171 ('iwlwifi: dump prph registers in a common place
for all transports').

type=cleanup

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: dvm: advertise NETIF_F_SG
Johannes Berg [Fri, 17 Apr 2015 14:39:12 +0000 (16:39 +0200)]
iwlwifi: dvm: advertise NETIF_F_SG

If the transport supports it, advertise NETIF_F_SG to mac80211 to
be able to use frag SKBs. This will already improve performance by
allowing software GSO to be used.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: advertise NETIF_F_SG
Johannes Berg [Fri, 17 Apr 2015 14:39:12 +0000 (16:39 +0200)]
iwlwifi: mvm: advertise NETIF_F_SG

If the transport supports it, advertise NETIF_F_SG to mac80211 to
be able to use frag SKBs. This will already improve performance by
allowing software GSO to be used.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: rs: fix a potential out of bounds access
Eyal Shapira [Thu, 19 Nov 2015 16:37:31 +0000 (18:37 +0200)]
iwlwifi: mvm: rs: fix a potential out of bounds access

Klocwork pointed these out. There is a theoretical possibility
that rate->index might be set to IWL_RATE_INVALID (15).
This could trigger an out of bounds access on ht_vht_rates or
legacy_rates arrays. Fix it by adding some checks.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: configure scheduled scan according to traffic conditions
Avraham Stern [Thu, 26 Nov 2015 09:22:33 +0000 (11:22 +0200)]
iwlwifi: mvm: configure scheduled scan according to traffic conditions

Change scan configuration (dwell time, suspend time etc.) according
to traffic conditions. This is useful for scans that are managed by
the FW (e.g. scheduled scan).

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: set default new STA as non-aggregated
Liad Kaufman [Thu, 24 Sep 2015 08:44:12 +0000 (10:44 +0200)]
iwlwifi: mvm: set default new STA as non-aggregated

When sending the first ADD_STA HCMD for a STA, the %add_modify
field indicates an addition of a STA and not a modification
of one. In such a case, all fields of the HCMD are used to
initialize the corresponding fields in the FW, regardless of
what bits are set in %modify_mask.

Set the %tid_disable_tx field to mvm_sta->tid_disable_agg in
iwl_mvm_sta_send_to_fw(). If the STA is only updated this will
have no effect, but if it is added - it will make sure the
STA starts with the correct queues - if any - configured as
non-aggregated by default (until told otherwise).

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add an option to start rs from HT/VHT rates
Gregory Greenman [Tue, 24 Nov 2015 17:13:27 +0000 (19:13 +0200)]
iwlwifi: mvm: add an option to start rs from HT/VHT rates

Extend the configurable option of setting initial rate to RSSI based.
Make the initial rate to be set to VHT/HT SISO or legacy depending on
the AP capabilities.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agomac80211: handle HW ROC expired properly
Ilan Peer [Sun, 6 Dec 2015 19:19:15 +0000 (21:19 +0200)]
mac80211: handle HW ROC expired properly

In case of HW ROC, when the driver reports that the ROC expired,
it is not sufficient to purge the ROCs based on the remaining
time, as it possible that the device finished the ROC session
before the actual requested duration.

To handle such cases, in case of ROC expired notification from
the driver, complete all the ROCs which are marked with hw_begun,
regardless of the remaining duration.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiwlwifi: mvm: don't keep an mvm ref when the interface is down
Luca Coelho [Wed, 25 Nov 2015 20:15:32 +0000 (22:15 +0200)]
iwlwifi: mvm: don't keep an mvm ref when the interface is down

There is no reason to keep a reference when the interface is down,
since we are not really doing anything.  The reference is only needed
when the mac80211 start op (or a hw restart) is running, to prevent
going into runtime or system supend in the meantime.  This will allow
us to support runtime PM when the interface is down (in another
patch).

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agomac80211_hwsim: check ATTR_FREQ for wmediumd (netlink) packets
Adam Welle [Tue, 1 Dec 2015 22:13:52 +0000 (17:13 -0500)]
mac80211_hwsim: check ATTR_FREQ for wmediumd (netlink) packets

If a packet is received from netlink with the frequency value set it is
checked against the current radio's frequency and discarded if different.
The frequency is also checked against data2->tmp_chan to support the "hw"
off-channel/scan case.

Signed-off-by: Adam Welle <arwelle@cert.org>
[allow both simultaneously, add locking]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211_hwsim: check txrate for NULL
Amit Khatri [Mon, 30 Nov 2015 07:16:52 +0000 (12:46 +0530)]
mac80211_hwsim: check txrate for NULL

If the rate control algorithm messed up then the txrate pointer
here could be NULL - WARN and drop the packet from monitoring.

Signed-off-by: Amit Khatri <amit.khatri@samsung.com>
Signed-off-by: Rahul Jain <rahul.jain@samsung.com>
[rewrite commit message, add warning]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: reject zero cookie in mgmt-tx/roc cancel
Johannes Berg [Tue, 1 Dec 2015 22:15:26 +0000 (23:15 +0100)]
mac80211: reject zero cookie in mgmt-tx/roc cancel

When cancelling, you can cancel "any" (first in list) mgmt-tx
or remain-on-channel operation by using the value 0 for the
cookie along with the *opposite* operation, i.e.
 * cancel the first mgmt-tx by cancelling roc with 0 cookie
 * cancel the first roc by cancelling mgmt-tx with 0 cookie

This isn't really that bad since userspace should only pass
cookies that we gave it, but could lead to hard-to-debug
issues so better prevent it and reject zero values since we
never hand those out.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211_hwsim: stop using pointers as cookies
Johannes Berg [Fri, 6 Nov 2015 10:57:23 +0000 (11:57 +0100)]
mac80211_hwsim: stop using pointers as cookies

Instead of using pointers, use sequentially assigned cookies.
This is easier to understand while debugging and also avoids
problems when the pointer is reused for the next allocation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211_hwsim: Advertise support for VHT IBSS
Jouni Malinen [Thu, 26 Nov 2015 18:51:04 +0000 (20:51 +0200)]
mac80211_hwsim: Advertise support for VHT IBSS

VHT can be used with IBSS without needing any additional changes in
mac80211_hwsim, so start claiming support for this to increase test
coverage.

Signed-off-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211_hwsim: Update timestamp in Probe Response frames
Jouni Malinen [Thu, 26 Nov 2015 18:50:12 +0000 (20:50 +0200)]
mac80211_hwsim: Update timestamp in Probe Response frames

Previously, this was done only for Beacon frames, but similar timestamp
update is needed for Probe Response frames to make these more accurately
match the real IEEE 802.11 behavior. Previously, all zeros timestamp was
sent in Probe Response frames.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: Allow a STA to join an IBSS with 80+80 MHz channel
Jouni Malinen [Thu, 26 Nov 2015 18:49:38 +0000 (20:49 +0200)]
mac80211: Allow a STA to join an IBSS with 80+80 MHz channel

While it was possible to create an IBSS with 80+80 MHz channel, joining
such an IBSS resulted in falling back to 20 MHz channel with VHT
disabled due to a missing switch case for 80+80.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: reg: Refactor calculation of bandwidth flags
Michal Sojka [Mon, 23 Nov 2015 18:27:16 +0000 (19:27 +0100)]
cfg80211: reg: Refactor calculation of bandwidth flags

The same piece of code appears at two places. Make a function from it.

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: rewrite remain-on-channel logic
Johannes Berg [Mon, 23 Nov 2015 22:53:51 +0000 (23:53 +0100)]
mac80211: rewrite remain-on-channel logic

Jouni found a bug in the remain-on-channel logic: when a short item
is queued, a long item is combined with it extending the original
one, and then the long item is deleted, the timeout doesn't go back
to the short one, and the short item ends up taking a long time. In
this case, this showed as blocking scan when running two test cases
back to back - the scan from the second was delayed even though all
the remain-on-channel items should long have been gone.

Fixing this with the current data structures turns out to be a bit
complicated, we just remove the long item from the dependents list
right now and don't recalculate the timeouts.

There's a somewhat similar bug where we delete the short item and
all the dependents go with it; to fix this we'd have to move them
from the dependents to the real list.

Instead of trying to do that, rewrite the code to not have all this
complexity in the data structures: use a single list and allow more
than one entry in it being marked as started. This makes the code a
bit more complex, the worker needs to understand that it might need
to just remove one of the started items, while keeping the device
off-channel, but that's not more complicated than the nested data
structures.

This then fixes both issues described, and makes it easier to also
limit the overall off-channel time when combining.

TODO: as before, with hardware remain-on-channel, deleting an item
after combining results in cancelling them all - we can keep track
of the time elapsed and only cancel after that to fix this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211_hwsim: delay hardware remain-on-channel start
Johannes Berg [Tue, 24 Nov 2015 17:29:45 +0000 (18:29 +0100)]
mac80211_hwsim: delay hardware remain-on-channel start

Typically drivers that implement hardware remain-on-channel will
have to wait for scheduling constraints, so make hwsim also wait
a little bit (only 20ms) before actually starting the operation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: simplify ack_skb handling
Johannes Berg [Tue, 24 Nov 2015 13:25:49 +0000 (14:25 +0100)]
mac80211: simplify ack_skb handling

Since the cookie is assigned inside ieee80211_make_ack_skb()
now, we no longer need to return the ack_skb as the cookie
and can simplify the function's return and the callers. Also
rename it to ieee80211_attach_ack_skb() to more accurately
reflect its purpose.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: move off-channel/mgmt-tx code to offchannel.c
Johannes Berg [Mon, 23 Nov 2015 16:18:35 +0000 (17:18 +0100)]
mac80211: move off-channel/mgmt-tx code to offchannel.c

This is quite a bit of code that logically depends here since
it has to deal with all the remain-on-channel logic.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: fix mgmt-tx abort cookie and leak
Johannes Berg [Tue, 24 Nov 2015 19:28:27 +0000 (20:28 +0100)]
mac80211: fix mgmt-tx abort cookie and leak

If a mgmt-tx operation is aborted before it runs, the wrong
cookie is reported back to userspace, and the ack_skb gets
leaked since the frame is freed directly instead of freeing
it using ieee80211_free_txskb(). Fix that.

Fixes: 3b79af973cf4 ("mac80211: stop using pointers as userspace cookies")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: catch queue stop underflow
Johannes Berg [Tue, 24 Nov 2015 14:29:53 +0000 (15:29 +0100)]
mac80211: catch queue stop underflow

If some code stops the queues more times than having started
(for when refcounting is used), warn on and reset the counter
to 0 to avoid blocking forever.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: properly free TX skbs when monitor TX fails
Johannes Berg [Tue, 24 Nov 2015 14:41:50 +0000 (15:41 +0100)]
mac80211: properly free TX skbs when monitor TX fails

We need to free all skbs here, not just the one we peeked
from the list.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: properly free skb when r-o-c for TX fails
Johannes Berg [Tue, 24 Nov 2015 14:38:43 +0000 (15:38 +0100)]
mac80211: properly free skb when r-o-c for TX fails

When freeing the TX skb for an off-channel TX, use the correct
API to also free the ACK skb that might have been allocated.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoRevert "mac80211: don't advertise NL80211_FEATURE_FULL_AP_CLIENT_STATE"
Johannes Berg [Thu, 26 Nov 2015 15:26:14 +0000 (16:26 +0100)]
Revert "mac80211: don't advertise NL80211_FEATURE_FULL_AP_CLIENT_STATE"

This reverts commit 45bb780a2147b9995f3d288c44ecb87ca8a330e2,
the previous two patches fixed the functionality.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: handle add_station auth/assoc flag quirks
Johannes Berg [Thu, 26 Nov 2015 15:26:13 +0000 (16:26 +0100)]
cfg80211: handle add_station auth/assoc flag quirks

When a new station is added to AP/GO interfaces the default behaviour
is for it to be added authenticated and associated, due to backwards
compatibility. To prevent that, the driver must be able to do that
(setting the NL80211_FEATURE_FULL_AP_CLIENT_STATE feature flag) and
userspace must set the flag mask to auth|assoc and clear the set.

Handle this quirk in the API entirely in nl80211, and always push the
full flags to the drivers. NL80211_FEATURE_FULL_AP_CLIENT_STATE is
still required for userspace to be allowed to set the mask including
those bits, but after checking that add both flags to the mask and
set in case userspace didn't set them otherwise.

This obsoletes the mac80211 code handling this difference, no other
driver is currently using these flags.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: use NL80211_ATTR_STA_AID in nl82011_set_station
Ayala Beker [Thu, 26 Nov 2015 15:26:12 +0000 (16:26 +0100)]
cfg80211: use NL80211_ATTR_STA_AID in nl82011_set_station

Fix nl80211_set_station() to use the value of NL80211_ATTR_STA_AID
attribute instead of NL80211_ATTR_PEER_AID attribute.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: Add support for aborting an ongoing scan
Vidyullatha Kanchanapally [Fri, 30 Oct 2015 13:44:50 +0000 (19:14 +0530)]
mac80211: Add support for aborting an ongoing scan

This commit adds implementation for abort scan in mac80211.

Reviewed-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Vidyullatha Kanchanapally <vkanchan@qti.qualcomm.com>
Signed-off-by: Sunil Dutt <usdutt@qti.qualcomm.com>
[adjust to wdev change in previous patch and clean up code a bit]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: Add support for aborting an ongoing scan
Vidyullatha Kanchanapally [Fri, 30 Oct 2015 13:44:49 +0000 (19:14 +0530)]
cfg80211: Add support for aborting an ongoing scan

Implement new functionality for aborting an ongoing scan.

Add NL80211_CMD_ABORT_SCAN to the nl80211 interface. After
aborting the scan, driver shall provide the scan status by
calling cfg80211_scan_done().

Reviewed-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Vidyullatha Kanchanapally <vkanchan@qti.qualcomm.com>
Signed-off-by: Sunil Dutt <usdutt@qti.qualcomm.com>
[change command to take wdev instead of netdev so that it
 can be used on p2p-device scans]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: add new IEEE80211_VIF_GET_NOA_UPDATE flag
Janusz.Dziedzic@tieto.com [Tue, 27 Oct 2015 07:38:40 +0000 (08:38 +0100)]
mac80211: add new IEEE80211_VIF_GET_NOA_UPDATE flag

Add new VIF flag, that will allow get NOA update
notification when driver will request this, even
this is not pure P2P vif (eg. STA vif).

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211_hwsim: do not actively scan DFS channels
Johannes Berg [Thu, 26 Nov 2015 16:59:27 +0000 (17:59 +0100)]
mac80211_hwsim: do not actively scan DFS channels

We had another change to fix this in mac80211, but the hwsim
"hardware" scan should also be fixed. Obviously this one isn't
important since it's not real hardware, but we'd better be
consistent.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: Remove unused cfg80211_can_use_iftype_chan()
Michal Sojka [Mon, 23 Nov 2015 18:27:15 +0000 (19:27 +0100)]
cfg80211: Remove unused cfg80211_can_use_iftype_chan()

Last caller of this function was removed in 3.17 in commit
97dc94f1d933c9df2c0b327066ea130c0e92083f.

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: reg: Remove unused function parameter
Michal Sojka [Mon, 23 Nov 2015 18:27:14 +0000 (19:27 +0100)]
cfg80211: reg: Remove unused function parameter

Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: add atomic uploaded keys iterator
Eliad Peller [Tue, 17 Nov 2015 08:24:37 +0000 (10:24 +0200)]
mac80211: add atomic uploaded keys iterator

add ieee80211_iter_keys_rcu() to iterate over uploaded
keys in atomic context (when rcu is locked)

The station removal code removes the keys only after
calling synchronize_net(), so it's not safe to iterate
the keys at this point (and postponing the actual key
deletion with call_rcu() might result in some
badly-ordered ops calls).

Add a flag to indicate a station is being removed,
and skip the configured keys if it's set.

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: allow the driver to send EOSP when needed
Emmanuel Grumbach [Tue, 17 Nov 2015 08:24:36 +0000 (10:24 +0200)]
mac80211: allow the driver to send EOSP when needed

This can happen when the driver needs to send less frames
than expected and then needs to close the SP.
Mac80211 still needs to set the more_data properly based
on its buffer state (ps_tx_buffer and buffered frames on
other TIDs).
To that end, refactor the code that delivers frames upon
uAPSD trigger frames to be able to get only the more_data
bit without actually delivering those frames in case the
driver is just asking to set a NDP with EOSP and MORE_DATA
bit properly set.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: ocb: Fix null pointer deref if join_ocb is unimplemented
Ola Olsson [Mon, 9 Nov 2015 21:02:09 +0000 (22:02 +0100)]
cfg80211: ocb: Fix null pointer deref if join_ocb is unimplemented

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agonl80211: clarify NL80211_ATTR_SCHED_SCAN_DELAY usage with net-detect
Luca Coelho [Mon, 9 Nov 2015 10:17:37 +0000 (12:17 +0200)]
nl80211: clarify NL80211_ATTR_SCHED_SCAN_DELAY usage with net-detect

In this attribute's documentation, it was not clear whether the delay
started counting when WoWLAN net-detect was enabled or when the system
was suspended.  The correct answer is that it starts when the system
suspends (which is when, in practice, the scan is scheduled).  Clarify
that in the nl80211.h documentation.

Suggested-by: Samuel Tan <samueltan@google.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: remove string from unaligned packet warning
Johannes Berg [Fri, 6 Nov 2015 11:34:24 +0000 (12:34 +0100)]
mac80211: remove string from unaligned packet warning

This really should never happen except very early in the process
of bringing up a new driver, at which point you'll have to add
more debugging in the driver and this string isn't useful. Remove
it and save some size (when it's even compiled in.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agolib80211: ratelimit key index mismatch
Johannes Berg [Fri, 6 Nov 2015 11:02:31 +0000 (12:02 +0100)]
lib80211: ratelimit key index mismatch

This indicates a driver key selection issue, but even then there's
no point in printing it all the time, so ratelimit it. Also remove
the priv pointer from it -- people debugging will only have a single
device anyway and it's useless as anything but a cookie.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>