linux-2.6-microblaze.git
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>
8 years agomac80211: mesh: print MAC address instead of pointer
Johannes Berg [Fri, 6 Nov 2015 10:30:46 +0000 (11:30 +0100)]
mac80211: mesh: print MAC address instead of pointer

There's no point in printing the mpath pointer since it can't
be used for anything - print the MAC address instead (like in
the forwarding case.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: replace ieee80211_ie_split() with an inline
Johannes Berg [Fri, 23 Oct 2015 07:50:03 +0000 (09:50 +0200)]
cfg80211: replace ieee80211_ie_split() with an inline

The function is a very simple wrapper around another one,
just adds a few default parameters, so replace it with a
static inline instead of using EXPORT_SYMBOL, reducing
the module size slightly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: add complete data to station add/change tracing
Johannes Berg [Thu, 22 Oct 2015 19:27:47 +0000 (22:27 +0300)]
cfg80211: add complete data to station add/change tracing

Complete the tracepoint with the missing data - it's not printed
by default (a lot of it is dynamic arrays) but will be recorded
and be available during post-processing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agocfg80211: Add missing tracing to cfg80211
Ilan Peer [Thu, 22 Oct 2015 19:27:46 +0000 (22:27 +0300)]
cfg80211: Add missing tracing to cfg80211

Add missing tracing for:

1. start_radar_detection()
2. set_mcast_rates()
3. set_coalesce()

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 driver to prevent two stations w/ same address
Johannes Berg [Thu, 22 Oct 2015 15:35:19 +0000 (17:35 +0200)]
mac80211: allow driver to prevent two stations w/ same address

Some devices or drivers cannot deal with having the same station
address for different virtual interfaces, say as a client to two
virtual AP interfaces. Rather than requiring each driver with a
limitation like that to enforce it, add a hardware flag for it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoMerge remote-tracking branch 'mac80211/master' into HEAD
Johannes Berg [Fri, 4 Dec 2015 13:43:05 +0000 (14:43 +0100)]
Merge remote-tracking branch 'mac80211/master' into HEAD

I want to get the full off-channel bugfix since later code depends on
it, as well as the AP client state change so I can revert it correctly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: fix off-channel mgmt-tx uninitialized variable usage
Johannes Berg [Fri, 27 Nov 2015 20:59:41 +0000 (21:59 +0100)]
mac80211: fix off-channel mgmt-tx uninitialized variable usage

In the last change here, I neglected to update the cookie in one code
path: when a mgmt-tx has no real cookie sent to userspace as it doesn't
wait for a response, but is off-channel. The original code used the SKB
pointer as the cookie and always assigned the cookie to the TX SKB in
ieee80211_start_roc_work(), but my change turned this around and made
the code rely on a valid cookie being passed in.

Unfortunately, the off-channel no-wait TX path wasn't assigning one at
all, resulting in an uninitialized stack value being used. This wasn't
handed back to userspace as a cookie (since in the no-wait case there
isn't a cookie), but it was tested for non-zero to distinguish between
mgmt-tx and off-channel.

Fix this by assigning a dummy non-zero cookie unconditionally, and get
rid of a misleading comment and some dead code while at it. I'll clean
up the ACK SKB handling separately later.

Fixes: 3b79af973cf4 ("mac80211: stop using pointers as userspace cookies")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: do not actively scan DFS channels
Antonio Quartulli [Sat, 21 Nov 2015 10:13:40 +0000 (18:13 +0800)]
mac80211: do not actively scan DFS channels

DFS channels should not be actively scanned as we can't be sure
if we are allowed or not.

If the current channel is in the DFS band, active scan might be
performed after CSA, but we have no guarantee about other channels,
therefore it is safer to prevent active scanning at all.

Cc: stable@vger.kernel.org
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomac80211: don't teardown sdata on sdata stop
Eliad Peller [Tue, 17 Nov 2015 08:24:40 +0000 (10:24 +0200)]
mac80211: don't teardown sdata on sdata stop

Interfaces are being initialized (setup) on addition,
and torn down on removal.

However, p2p device is being torn down when stopped,
resulting in the next p2p start operation being done
on uninitialized interface.

Solve it by calling ieee80211_teardown_sdata() only
on interface removal (for the non-netdev case).

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
[squashed in fix to call teardown after unregister]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiwlwifi: remove IWL_DL_LED
Eliad Peller [Wed, 18 Nov 2015 14:10:57 +0000 (16:10 +0200)]
iwlwifi: remove IWL_DL_LED

no need to have a separate debug level for a single
debug print (which is pretty much useless anyway).
remove them both.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: ROC: Extend the ROC max delay duration & limit ROC duration
Matti Gottlieb [Sun, 22 Nov 2015 08:08:56 +0000 (10:08 +0200)]
iwlwifi: mvm: ROC: Extend the ROC max delay duration & limit ROC duration

When associated to an AP and a ROC event with a long duration is scheduled
the FW may have a hard time scheduling a consecutive time event, since it
has to remain on the connection channel to hear the AP's DTIM.
In addition, when associated and a ROC is requested with a duration
greater than the DTIM interval, the FW will not be able to schedule
the ROC event, since it needs to wake up for the DTIM.

Increasing the "max delay" duration to the DTIM period will allow the FW to
wait until after the DTIM and then schedule the ROC time event.
Limiting the ROC to be less than the DTIM interval will assure that the
time event will be scheduled for at least part of the time (instead of
automatically failing)

Extend the ROC max delay duration to min(dtim_interval * 3, 600TU),
and limit the duration to be less than the DTIM interval.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add 9000-series RX API
Johannes Berg [Wed, 2 Sep 2015 14:16:49 +0000 (16:16 +0200)]
iwlwifi: mvm: add 9000-series RX API

Define the RX API that's used by the 9000 series hardware.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: report wakeup for wowlan
Derek Basehore [Thu, 5 Nov 2015 01:37:52 +0000 (17:37 -0800)]
iwlwifi: mvm: report wakeup for wowlan

When the wifi wakes up the system, we need to report it via calling
pm_wakeup_event for lucid sleep. This is so userspace knowns that the
wifi woke up the system via the /sys/power/wakeup_type sysfs interface.

Signed-off-by: Derek Basehore <dbasehore@chromium.org>
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 warning message
Dan Carpenter [Sat, 21 Nov 2015 10:33:38 +0000 (13:33 +0300)]
iwlwifi: mvm: rs: fix a warning message

WARN_ON_ONCE() doesn't take a message, it only takes a condition.  I
have changed this to WARN(1, ...).

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: print index in api/capa flags parsing message
Johannes Berg [Sat, 21 Nov 2015 20:57:52 +0000 (21:57 +0100)]
iwlwifi: print index in api/capa flags parsing message

If the API or capabilities index is bigger than the driver expects,
an error message is printed. Make that message print the index and
distinguish between API and capabilities.

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 agoiwlwifi: mvm: Align bt-coex priority with requirements
Avri Altman [Mon, 2 Nov 2015 12:16:07 +0000 (14:16 +0200)]
iwlwifi: mvm: Align bt-coex priority with requirements

Fix the gaps between the system requirements and our code.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: Add PCI IDs for the new series 8165
Oren Givon [Sun, 1 Nov 2015 13:27:58 +0000 (15:27 +0200)]
iwlwifi: Add PCI IDs for the new series 8165

Add a new struct for the 8165 series and a few new
PCI ID entries.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: Add PCI IDs for the new 3168 series
Oren Givon [Sun, 1 Nov 2015 13:07:48 +0000 (15:07 +0200)]
iwlwifi: Add PCI IDs for the new 3168 series

Add a new struct for the 3168 series and a few new
PCI ID entries.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: Add new PCI IDs for 9260 and 5165 series
Dreyfuss, Haim [Mon, 1 Jun 2015 05:27:17 +0000 (08:27 +0300)]
iwlwifi: Add new PCI IDs for 9260 and 5165 series

Add 9000-family configuration to iwl_cfg struct
Add a new struct to define the 5165 series.
Rename the struct that defines the 9000 series to 9260.
Add some new sub-system IDs for the 9260 and 5165 series.
For 9260:
0x0A10, 0x0000, 0x0510, 0x0710, 0x0410, 0x0610.
For 5165:
0x2A10, 0x2010, 0x0310, 0x0210.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: refactor d3 key update functions
Eliad Peller [Thu, 12 Nov 2015 08:49:38 +0000 (10:49 +0200)]
iwlwifi: mvm: refactor d3 key update functions

We need to reuse the key update logic for d0i3
as well.

Add some parameters to deal with the constraints
implied by the d0i3 flow (specifically, support
non-SYNC commands, and don't take mutexes that
might deadlock).

Change some commands to be ASYNC, in order
to simplify locking a bit.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: use firmware station lookup, combine code
Johannes Berg [Thu, 24 Sep 2015 16:29:00 +0000 (18:29 +0200)]
iwlwifi: mvm: use firmware station lookup, combine code

In most cases, the firmware will already match the station that
we received a given frame from and tell us the station ID in the
RX status, so we can look up the station from that. This lets us
skip the (more expensive) hash table lookup in mac80211.

Also change the fallback case (no station info from the firmware)
to not attempt to look up a multicast source address.

While at it, also combine all the code using the station into a
single if block.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: fix incorrect fallthrough in iwl_mvm_check_running_scans()
Nicholas Krause [Wed, 23 Sep 2015 00:24:19 +0000 (20:24 -0400)]
iwlwifi: mvm: fix incorrect fallthrough in iwl_mvm_check_running_scans()

In the iwl_mvm_check_running_scans() we were mistakenly ignoring the
value returned by iwl_mvm_scan_stop() for scheduled scans and falling
thorugh to the next case, which caused us to always return zero.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: remove pointer from debug message
Johannes Berg [Fri, 6 Nov 2015 10:27:23 +0000 (11:27 +0100)]
iwlwifi: pcie: remove pointer from debug message

Since this pointer is not shown anywhere else, it's useless.
Remove it, just keeping the indexes.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: clean up transport debugfs handling
Johannes Berg [Wed, 11 Nov 2015 10:53:32 +0000 (11:53 +0100)]
iwlwifi: clean up transport debugfs handling

Transport code currently calls itself through the transport ops,
which is quite pointless. Clean up all of this. While at it,
remove the unnecessary dir argument and the redundant IDI code.

In slave transports, call both the common slave debugfs and the
transport's own. SDIO has no files, so remove it all there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: Support setting continuous recording debug mode
Golan Ben Ami [Mon, 27 Jul 2015 14:02:35 +0000 (17:02 +0300)]
iwlwifi: mvm: Support setting continuous recording debug mode

Add ability to set the continuous recording mode of the FW, while
the FW debug data is configured to be stored on the NIC.
This could be useful for storing large segments of FW usniffer
debug data on the host, while having small store space on the NIC.
The host receives the usniffer data through the regular RX path, and
the data can get extracted using trace-cmd.

Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: move fw-dbg code to separate file
Golan Ben-Ami [Tue, 27 Oct 2015 17:17:14 +0000 (19:17 +0200)]
iwlwifi: mvm: move fw-dbg code to separate file

The fw debug functionality is big enough to warrant
a separate file. Move existing related functions to the new file.

Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: remove unnecessary check in iwl_mvm_is_d0i3_supported()
Luca Coelho [Mon, 26 Oct 2015 11:43:12 +0000 (13:43 +0200)]
iwlwifi: mvm: remove unnecessary check in iwl_mvm_is_d0i3_supported()

The d0i3_mode element is never set to IWL_D0I3_OFF, so it's not
necessary to check it in iwl_mvm_is_d0i3_supported().

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: flush all used TX queues before suspending
Luca Coelho [Fri, 2 Oct 2015 15:13:10 +0000 (18:13 +0300)]
iwlwifi: mvm: flush all used TX queues before suspending

There is a potential race condition when entering suspend with d0i3 in
PCIe.  If there is a frame queued just before we suspend, it won't
complete and we will never clear the queue stuck timer.  To solve
this, call TX_PATH_FLUSH to flush all queues (except the command
queue) as part of the d0i3 entry process.  Add a new function that
returns all the flushable queues.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: dump prph registers in a common place for all transports
Golan Ben-Ami [Wed, 21 Oct 2015 13:15:38 +0000 (16:15 +0300)]
iwlwifi: dump prph registers in a common place for all transports

Currently the prph registers dump is in the transport layer,
and each bus needs an additional dump implementation.

Move the prph dump outside transport, and allow a common
implementation for all of the buses.
This is possible because prph base addresses are similar for
all buses.

Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: export the _no_grab version of PRPH IO functions
Golan Ben-Ami [Wed, 21 Oct 2015 12:16:58 +0000 (15:16 +0300)]
iwlwifi: export the _no_grab version of PRPH IO functions

Expose _no_grab prph i/o functions that allow performing i/o
outside the transport, without requiring grab and release NIC access
for each operation. In addition, rename the functions so they reflect
their non-grabbing behavior.

This can be very useful for consecutive prph i/o operation that occur
outside trans, such as fw dumps.

Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: drop low_latency_agg_frame_cnt_limit
Eyal Shapira [Thu, 22 Oct 2015 10:10:36 +0000 (13:10 +0300)]
iwlwifi: mvm: drop low_latency_agg_frame_cnt_limit

This was an old workaround for solving latency issues with
certain Miracast adapters like ActionTec. However this isn't
needed anymore and furthermore it hurts throughput in other
use cases.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: remove stray nd_config element
Luca Coelho [Sun, 25 Oct 2015 20:55:32 +0000 (22:55 +0200)]
iwlwifi: mvm: remove stray nd_config element

When the netdetect debugfs entry was removed, the nd_config element
was accidentally left in the iwl_mvm structure.  Remove it.

Fixes: dbb04b0d29f8 ("iwlwifi: mvm: remove netdetect debugfs entry")
Reported-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add bt rrc and ttc to debugfs
Moshe Harel [Mon, 26 Oct 2015 09:33:49 +0000 (11:33 +0200)]
iwlwifi: mvm: add bt rrc and ttc to debugfs

As part of the bt_notif file add fields that are currently
not represented

Signed-off-by: Moshe Harel <moshe.harel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add bt settings to debugfs
Moshe Harel [Tue, 27 Oct 2015 12:04:12 +0000 (14:04 +0200)]
iwlwifi: mvm: add bt settings to debugfs

Add mplut and sync2sco and corunning to debugfs.

Signed-off-by: Moshe Harel <moshe.harel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: remove redundant d0i3 flag from the config struct
Luca Coelho [Thu, 17 Sep 2015 18:55:24 +0000 (21:55 +0300)]
iwlwifi: mvm: remove redundant d0i3 flag from the config struct

The d0i3 flag in the device configuration structure is redundant,
because the same information can be determined by checking the
firmware capability flag.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add trigger for firmware dump upon TDLS events
Golan Ben-Ami [Sun, 23 Aug 2015 14:57:33 +0000 (17:57 +0300)]
iwlwifi: mvm: add trigger for firmware dump upon TDLS events

This will allow to catch different TDLS events and get the
firmware data when they occur.
Add empty TX_LATENCY trigger on the way to avoid mismatch
with trees in which this trigger is implemented.

Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: use build-time assertion for fw trigger ID
Johannes Berg [Tue, 22 Sep 2015 10:24:31 +0000 (12:24 +0200)]
iwlwifi: mvm: use build-time assertion for fw trigger ID

The firmware debug trigger ID is always a compile-time constant,
so we can use a build-time assertion to validate that it is in
fact a valid constant.

To make that really guaranteed to work, convert this and the
inline function iwl_fw_dbg_trigger_simple_stop() to macros.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: change name of iwl_mvm_d3_update_gtk
Emmanuel Grumbach [Sun, 1 Nov 2015 11:06:37 +0000 (13:06 +0200)]
iwlwifi: mvm: change name of iwl_mvm_d3_update_gtk

This function updates the pairwise keys as well.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: generalize d0i3_entry_timeout module parameter
Luca Coelho [Fri, 18 Sep 2015 11:37:46 +0000 (14:37 +0300)]
iwlwifi: generalize d0i3_entry_timeout module parameter

The PCIe transport will also need a d0i3_entry_timeout_ms parameter,
so move the existing one from the slave transports to iwlwifi, so it
can be reused.  While at it, rename the parameter to something
shorter, namely d0i3_entry_delay.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: pcie: remove ICT allocation message
Johannes Berg [Fri, 6 Nov 2015 10:26:26 +0000 (11:26 +0100)]
iwlwifi: pcie: remove ICT allocation message

This message isn't very useful and presents a security risk
due to the use of %p - remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>