platform/kernel/linux-starfive.git
9 years agoMerge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next
Emmanuel Grumbach [Tue, 25 Nov 2014 05:53:57 +0000 (07:53 +0200)]
Merge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Conflicts:
drivers/net/wireless/iwlwifi/iwl-fw.h

9 years agoiwlwifi: update the secure mem space and for the CPUs
Emmanuel Grumbach [Sun, 23 Nov 2014 19:39:50 +0000 (21:39 +0200)]
iwlwifi: update the secure mem space and for the CPUs

Also update the timeout for the data verification.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: sdio: new SDIO card id for 4165 series
Oren Givon [Tue, 14 Oct 2014 08:26:52 +0000 (11:26 +0300)]
iwlwifi: sdio: new SDIO card id for 4165 series

Add a new SDIO card id intended for the new 4165 series.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: declare d0i3 support for IWL_DEVICE_8000
Eliad Peller [Wed, 25 Jun 2014 15:09:58 +0000 (18:09 +0300)]
iwlwifi: declare d0i3 support for IWL_DEVICE_8000

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: disconnect TDLS peers before channel switch
Arik Nemtsov [Sun, 14 Sep 2014 16:13:54 +0000 (19:13 +0300)]
iwlwifi: mvm: disconnect TDLS peers before channel switch

In case of channel switch, we need to teardown the TDLS peers.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: declare support for VHT BF info in radiotap
Eyal Shapira [Tue, 18 Nov 2014 14:43:55 +0000 (16:43 +0200)]
iwlwifi: mvm: declare support for VHT BF info in radiotap

The driver knows whether an rx frame was beamformed and marks
it in the radiotap VHT flags. However it should also declare
that it knows to extract this info otherwise this gets discarded
by sniffers like Wireshark.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add support to MFUART loading notification
Chaya Rachel Ivgy [Sat, 15 Nov 2014 19:08:29 +0000 (21:08 +0200)]
iwlwifi: mvm: add support to MFUART loading notification

Add support to MFUART loading notification (print notification
data with IWL_DEBUG_INFO)

Signed-off-by: Chaya Rachel Ivgy <chaya.rachel.ivgi@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: call iwl_trans_suspend/resume
Eliad Peller [Tue, 30 Sep 2014 07:02:13 +0000 (10:02 +0300)]
iwlwifi: mvm: call iwl_trans_suspend/resume

call the appropriate iwl_trans_suspend/resume ops
on iwl_mvm_suspend/resume calls.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: trans: add suspend/resume ops
Eliad Peller [Wed, 1 Oct 2014 12:21:28 +0000 (15:21 +0300)]
iwlwifi: trans: add suspend/resume ops

Add suspend/resume trans ops that will be called from
mac80211's suspend/resume ops.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: treat netdetect wake up separately
Luciano Coelho [Thu, 20 Nov 2014 06:59:51 +0000 (08:59 +0200)]
iwlwifi: mvm: treat netdetect wake up separately

When the device wakes up due to netdetect, we need to query different
things from the firmware than when it wakes up with a normal WoWLAN.
To make this easier, separate the netdetect wake up handling from the
rest.  For now, we don't send netdetect as a wake up reason, treating
it as a non-wireless wake up.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: refactor iwl_mvm_query_wakeup_reasons()
Luciano Coelho [Thu, 20 Nov 2014 08:14:44 +0000 (10:14 +0200)]
iwlwifi: mvm: refactor iwl_mvm_query_wakeup_reasons()

Refactor the iwl_mvm_query_wakeup_reasons() function to split the part
that gets the firmware status from the part that sets up the WoWLAN
status.  This will allow netdetect to reuse the code.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: refactor wowlan and netdetect configuration when suspending
Luciano Coelho [Wed, 19 Nov 2014 20:35:37 +0000 (22:35 +0200)]
iwlwifi: mvm: refactor wowlan and netdetect configuration when suspending

We need to send a WOWLAN_CONFIGURATION command also for netdetect and
configure the rfkill release trigger if needed.  To do so, refactor
the code that configures wowlan and netdetect when suspending and send
the WOWLAN_CONFIGURATION command also for net_detect.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add support for net detect
Luciano Coelho [Fri, 24 Oct 2014 07:39:51 +0000 (10:39 +0300)]
iwlwifi: mvm: add support for net detect

Add the net detect WoWLAN flag to indicate support and use the
nd_config from the WoWLAN configuration to start net detect, if it is
set.  The WoWLAN configuration takes precedence over the debugfs
configuration.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: protect session during CSA
Luciano Coelho [Mon, 10 Nov 2014 09:10:21 +0000 (11:10 +0200)]
iwlwifi: mvm: protect session during CSA

When another vif is also running during a channel switch, we need to
use a session protection when we move to the new channel, so that we
don't miss the beacons.  Without this, sometimes the other vif
repeatedly gets time exactly when we should be hearing the beacons,
preventing channel switch from completing.  Adding a session
protection that lasts from the moment the channel changes until 2
TBTTs later, ensures that we will hear the beacons on the destination
channel.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
9 years agoiwlwifi: mvm: clear TE data if CSA time event fails to start
Luciano Coelho [Mon, 10 Nov 2014 09:10:20 +0000 (11:10 +0200)]
iwlwifi: mvm: clear TE data if CSA time event fails to start

If setting the CSA time event fails, we must clear the TE data,
otherwise we'll try to remove it when, for instance, a disconnection
occurs, causing a SYSASSERT.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
9 years agoiwlwifi: mvm: disable beacon filtering during CSA
Luciano Coelho [Mon, 10 Nov 2014 09:10:18 +0000 (11:10 +0200)]
iwlwifi: mvm: disable beacon filtering during CSA

After a channel switch, transmission on the new channel is only
started once we see a beacon on it.  Thus, beacon filtering needs to
be disabled during channel switch so that mac80211 receives this
beacon and finishes the process.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
9 years agoiwlwifi: mvm: add a channel_switch op to bypass mac80211 timer
Luciano Coelho [Mon, 10 Nov 2014 09:10:17 +0000 (11:10 +0200)]
iwlwifi: mvm: add a channel_switch op to bypass mac80211 timer

We need to call ieee80211_chswitch_done() ourselves just when the
absence TE started, so we perform the actual context switch early
enough.  To do so, add a dummy channel_switch op, which will cause
mac80211 to skip the countdown timer and allow us to call
ieee80211_chswitch_done() to complete the operation.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
9 years agoiwlwifi: mvm: finalize on post_switch instead of unassign
Luciano Coelho [Mon, 10 Nov 2014 09:10:16 +0000 (11:10 +0200)]
iwlwifi: mvm: finalize on post_switch instead of unassign

Now that mac80211 waits for the first beacon on the new channel before
calling post_channel_switch, the reconfiguration of the firmware
should be done in the post_channel_switch operation instead of when
assigning the vif to the new context.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
9 years agoiwlwifi: mvm: schedule CSA time event a bit before beacon 1
Luciano Coelho [Mon, 10 Nov 2014 09:10:15 +0000 (11:10 +0200)]
iwlwifi: mvm: schedule CSA time event a bit before beacon 1

Instead of using a hardcoded number of TUs before beacon 0 as the time
to start the absence and actual channel switch, calculate it in
relation to the beacon interval.  We use 10 TUs + beacon interval
before beacon 0 to target a bit before beacon 1.  This gives us enough
time to switch to the new channel before the AP/GO switches.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
9 years agoiwlwifi: mvm: add CSA absent time event for clients
Luciano Coelho [Mon, 10 Nov 2014 09:10:14 +0000 (11:10 +0200)]
iwlwifi: mvm: add CSA absent time event for clients

Add an absent time event when pre_channel_switch is called and use the
time event started indication to set the disable_tx bit instead of
doing it in unassign_vif().  This is done so that the firmware queues
are stopped before the actual switch takes place to avoid losing
packets while the AP/GO is performing its actual switch.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
9 years agoiwlwifi: mvm: use switching_chanctx argument instead of csa_active
Luciano Coelho [Mon, 10 Nov 2014 09:10:13 +0000 (11:10 +0200)]
iwlwifi: mvm: use switching_chanctx argument instead of csa_active

Now that all CSA flows are using the switch_vif_chanctx op, we can
rely on the switching_chanctx boolean that is passed to the
__iwl_mvm_assign_vif_chanctx() and __iwl_mvm_unassign_vif_chanctx()
functions to decide whether the context switch flows need to be
executed.  In this way we make the chanctx switch flow more generic,
without having to rely on the csa_active flag being set.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
9 years agoiwlwifi: mvm: disable PS during channel switch
Luciano Coelho [Mon, 10 Nov 2014 09:10:12 +0000 (11:10 +0200)]
iwlwifi: mvm: disable PS during channel switch

Disable PS when pre_channel_switch is called and add the
post_channel_switch operation to re-enable PS when the channel switch
is completed.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
9 years agoiwlwifi: mvm: Handle failed beacon transmissions during CSA
Andrei Otcheretianski [Mon, 10 Nov 2014 09:10:11 +0000 (11:10 +0200)]
iwlwifi: mvm: Handle failed beacon transmissions during CSA

The spec requires to decrement the CSA counters based on TBTT,
regardless if the beacon was actually transmitted. Previously, the fw
would send beacon notifications only for successfully transmitted
beacons. This behavior resulted in inaccurate CSA countdown. In order
to address this issue, the fw was changed to send beacon
notifications also for not transmitted beacons. Such notifications
have TX_STATUS_INTERNAL_ABORT (0x92).
Don't start the CSA countdown before first successfully transmitted
beacon, in order to guarantee that the CSA is announced for a
required period.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
9 years agoiwlwifi: mvm: return the actual error code when switch_vif_chanctx fails
Luciano Coelho [Mon, 10 Nov 2014 09:10:10 +0000 (11:10 +0200)]
iwlwifi: mvm: return the actual error code when switch_vif_chanctx fails

We have code to recover and go back to the original channel context if
something fails in the middle of switch_vif_chanctx, but we return the
error code of the recover calls instead of the original code, so if
the recovery succeeds, we will return 0 (success).  Fix this by not
assigning the return value of the recovery calls to ret.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
9 years agoiwlwifi: mvm: add support for CHANCTX_SWMODE_REASSIGN_VIF
Luciano Coelho [Mon, 10 Nov 2014 09:10:09 +0000 (11:10 +0200)]
iwlwifi: mvm: add support for CHANCTX_SWMODE_REASSIGN_VIF

Add support to reassign vif in switch_vif_chanctx.  This is similar to
the existing CHANCTX_SWMODE_SWAP_CONTEXTS mode, but doesn't delete the
old context nor creates a new one, doing to switch between two
existing contexts.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
9 years agoiwlwifi: mvm: refactor iwl_mvm_switch_vif_chanctx to support other modes
Luciano Coelho [Mon, 10 Nov 2014 09:10:08 +0000 (11:10 +0200)]
iwlwifi: mvm: refactor iwl_mvm_switch_vif_chanctx to support other modes

Currently we only support the CHANCTX_SWMODE_SWAP_CONTEXTS mode, but
we need to support other modes as well.  Spin a new function off in
order to make it easier to support other modes.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
9 years agoiwlwifi: mvm: only save csa_vif in AP/GO mode
Luciano Coelho [Mon, 10 Nov 2014 09:10:07 +0000 (11:10 +0200)]
iwlwifi: mvm: only save csa_vif in AP/GO mode

We only need the csa_vif in AP/GO modes, and assigning for other
interfaces may cause problems, because csa_vif is never cleared.  To
prevent this, only assign the value if the iftype is
NL80211_IFTYPE_AP.  Use a switch to do this, even though, for now,
only the AP interface type is handled, because soon other interface
types will be added as well.

Additionally, convert the WARN() in the error case when a
channel-switch is already running to WARN_ONCE().

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
9 years agoiwlwifi: mvm: use new pre_channel_switch op instead of channel_switch_beacon
Luciano Coelho [Mon, 10 Nov 2014 09:10:06 +0000 (11:10 +0200)]
iwlwifi: mvm: use new pre_channel_switch op instead of channel_switch_beacon

A new callback has been added to prepare the device for a channel
switch.  Use the new callback instead of the old channel_switch_beacon
operation.

This makes it possible to remove the channel_switch_beacon operation
from mac80211.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
9 years agoiwlwifi: mvm: implement mac80211 TDLS channel-switch APIs
Arik Nemtsov [Thu, 23 Oct 2014 15:03:10 +0000 (18:03 +0300)]
iwlwifi: mvm: implement mac80211 TDLS channel-switch APIs

Maintain a TDLS channel-switch state and update it according to
notifications from FW and timeouts. Explicitly check all state
transitions are valid.
When switching is initiated by mac80211, use a delayed work to
periodically reschedule it from iwlwifi.
Give the FW mac80211 generated TDLS channel-switch request/response
templates. It will change appropriate values (switch timings) and Tx
them at appropriate times.

Enable the channel switch wiphy capability bit when the FW supports it.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: block TID when using TDLS
Liad Kaufman [Mon, 6 Oct 2014 17:08:56 +0000 (19:08 +0200)]
iwlwifi: mvm: block TID when using TDLS

Block TID 4 (VI) on a vif when using TDLS. This TID will be used by FW
for TDLS channel-switch requests and PTI requests.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: use private TFD queues for TDLS stations
Arik Nemtsov [Sun, 21 Sep 2014 16:10:04 +0000 (19:10 +0300)]
iwlwifi: mvm: use private TFD queues for TDLS stations

When adding a TDLS station, allocate 4 new queues for it. Configure them
to FW and enable them. On station removal, drain the queues if needed
and disable them when empty.

Make sure to flush all packets in the private queues of TDLS stations in
the mac80211 flush() callback.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: disconnect TDLS peers on reconfig
Arik Nemtsov [Sun, 14 Sep 2014 16:13:54 +0000 (19:13 +0300)]
iwlwifi: mvm: disconnect TDLS peers on reconfig

When TDLS peers are present the FW will send packets on a dedicated
TID vs. the peer when performing TDLS channel-switches. The driver
configures the TID on connection to the peer and the FW is responsible
for maintaining the state of QoS seqno and PN/IV for encryption.

If the FW asserts, the driver cannot correctly reconfigure the starting
seqno/PN to the reloaded FW, thus forcing us to reconnect the peer.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: allow private per-STA TFD queues
Arik Nemtsov [Sun, 21 Sep 2014 16:07:30 +0000 (19:07 +0300)]
iwlwifi: mvm: allow private per-STA TFD queues

TDLS stations will have private queues, so consider them as well when
allocating a new one. Consolidate the HW-queue iterating code into
a single exported function, to be used by the TDLS code in the future.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: configure TDLS peers to FW
Arik Nemtsov [Mon, 15 Sep 2014 15:48:59 +0000 (18:48 +0300)]
iwlwifi: mvm: configure TDLS peers to FW

Send a dedicated TDLS_CONFIG command when a TDLS peer joins/leaves. The
fields for the command are mostly place-holders, as most of the FW
functionality is not implemented. In the future the dedicated FW TID
will be used for channel-switching and buffer-sta functionality.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add TDLS channel switch FW APIs
Arik Nemtsov [Thu, 11 Sep 2014 10:10:08 +0000 (13:10 +0300)]
iwlwifi: mvm: add TDLS channel switch FW APIs

Add a channel-switch command and a switch-start notification. Also add a
FW TLV bit indicating TDLS channel switching support.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: declare TDLS support
Arik Nemtsov [Sun, 11 May 2014 15:13:04 +0000 (18:13 +0300)]
iwlwifi: mvm: declare TDLS support

The driver/FW combination now support TDLS.
Check the FW support with the TLV bit.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: pull SNAP header into skb->head
Johannes Berg [Thu, 13 Nov 2014 10:06:43 +0000 (11:06 +0100)]
iwlwifi: mvm: pull SNAP header into skb->head

When we pre-populate the skb->head for the stack, we only pull
in the 802.11 header including crypto (assuming the packet isn't
short enough to be in there completely.) This is fine, but in
ieee80211_data_to_8023() we later unconditionally pull 8 more
bytes for the SNAP header and ethertype field (except for mesh
or 4-addr, where it's even more, but we don't care as much about
them).

Avoid the additional later pull by pulling in those 8 bytes here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: IdoX Yariv <ido@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: pull crypto header into skb->head
Johannes Berg [Wed, 12 Nov 2014 16:12:05 +0000 (17:12 +0100)]
iwlwifi: mvm: pull crypto header into skb->head

When we pre-populate the skb->head for the stack, we only pull
in the 802.11 header (assuming the packet isn't short enough to
be in there completely.) This is fine, but in many cases we'll
pull in the crypto headers pretty much immediately afterwards,
so to avoid that pull in the crypto header early.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: IdoX Yariv <ido@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: build mac80211 rx_status in place
Johannes Berg [Wed, 12 Nov 2014 15:45:12 +0000 (16:45 +0100)]
iwlwifi: build mac80211 rx_status in place

Instead of building the rx_status on the stack and then
copying it to the skb, allocate the skb a bit earlier
and then build the rx_status in place.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: IdoX Yariv <ido@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add WEP RX hardware offload support
Johannes Berg [Wed, 12 Nov 2014 22:54:48 +0000 (23:54 +0100)]
iwlwifi: mvm: add WEP RX hardware offload support

In the original driver, we decided to not implement WEP RX hardware
offload because of a quirk with the firmware API - it allows setting
global WEP keys that then get used for all virtual interfaces, which
is clearly wrong if more than one exists, and it allows setting per-
station keys but then separates multicast and unicast keys.

In order to implement WEP RX hardware offload, work around these
limitations by uploading each WEP key twice, once as multicast and
once as unicast, but point them both to the same key slot (offset)
and use the same key material so the slot overwrite on the second
upload doesn't actually change anything. Upon removal, also remove
the key twice so the station no longer references it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: refactor key add/remove functions
Johannes Berg [Wed, 12 Nov 2014 22:39:56 +0000 (23:39 +0100)]
iwlwifi: mvm: refactor key add/remove functions

Refactor the key add/remove functions to be able to reuse parts
of them later for RX WEP keys, which need to be uploaded twice.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add remove flow for AUX ROC time events
Matti Gottlieb [Sun, 16 Nov 2014 08:25:12 +0000 (10:25 +0200)]
iwlwifi: mvm: add remove flow for AUX ROC time events

Add a flow that handles the requests to cancel the roc time event,
that has been triggered via the aux framework.

The roc for bss is different than the roc for p2p devices, and  is done
via the aux framework using the aux queue, thus requires a different flow
to cancel the time event.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: remove warning on unknown scan complete
David Spinadel [Mon, 10 Nov 2014 09:16:53 +0000 (11:16 +0200)]
iwlwifi: mvm: remove warning on unknown scan complete

Remove warning on scan complete with unknown ID, since this
scan could be already cleared in abort flow.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: use unsigned for ssid_bitmap
Johannes Berg [Mon, 17 Nov 2014 14:06:52 +0000 (15:06 +0100)]
iwlwifi: mvm: use unsigned for ssid_bitmap

The ssid_bitmap should be unsigned, though it doesn't matter
much as the high bits aren't used.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: pcie: support 7265-D devices
Johannes Berg [Tue, 18 Nov 2014 14:39:51 +0000 (15:39 +0100)]
iwlwifi: pcie: support 7265-D devices

Identify 7265-D devices using the hardware revision (they have the
same PCI IDs as 7265) and change the configuration for them taking
the differences (currently only the firmware image) into account.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: check TLV flag before trying to use hotspot firmware commands
Luciano Coelho [Tue, 21 Oct 2014 13:12:18 +0000 (16:12 +0300)]
iwlwifi: mvm: check TLV flag before trying to use hotspot firmware commands

Older firmwares do not provide support for the HOT_SPOT_CMD command.
Check for the appropriate TLV flag that declares hotspot support in
the firmware to prevent a firmware assertion failure that can be
triggered from the userspace,

Cc: stable@vger.kernel.org [3.17+]
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: pcie: support loading FW with extended mem range
Arik Nemtsov [Mon, 17 Nov 2014 13:46:37 +0000 (15:46 +0200)]
iwlwifi: pcie: support loading FW with extended mem range

Toggle the LMPM_CHICK register when writing chunks into the FW's extended
SRAM. This tells the FW to put the chunk into a different memory space.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: disable beacon filtering escape timer
Eliad Peller [Wed, 19 Nov 2014 11:57:52 +0000 (13:57 +0200)]
iwlwifi: mvm: disable beacon filtering escape timer

There is no reason to pass every 50th beacon if
nothing was changed.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: make nd_ies part of the mvm struct
Luciano Coelho [Mon, 10 Nov 2014 21:21:55 +0000 (23:21 +0200)]
iwlwifi: mvm: make nd_ies part of the mvm struct

Instead of allocating nd_ies separately, make it part of the iwl_mvm
structure so it's easier to handle its lifetime.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: pcie: properly reset the device
Emmanuel Grumbach [Fri, 14 Nov 2014 15:29:47 +0000 (07:29 -0800)]
iwlwifi: pcie: properly reset the device

We were toggling the wrong bit when we reset the device,
fix that. Moreover, since the reset can take time, we need
to wait before we set the rfkill interrupt. Not doing so
can be racy since the driver is enabling the rfkill
interrupt while the device is resetting which will clear
all the registers including the CSR_INT_MASK.
This can basically lead to a situation where we don't
enable the rfkill interrupt. If that happens, the user will
not be able to re-enable the device when de-asserting
rfkill.

This scenario happened to the submitter of:
https://bugzilla.kernel.org/show_bug.cgi?id=87191

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: support random MAC address for scanning
Johannes Berg [Tue, 18 Nov 2014 16:21:19 +0000 (17:21 +0100)]
iwlwifi: mvm: support random MAC address for scanning

For background and scheduled scan, using the new unified scan API,
support random MAC address scanning.

Unfortunately, the firmware right now doesn't support randomising
itself, so for now do it on the host - we'll change this once the
firmware supports randomising the address for each scan iteration
using the address/mask.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: go to umac scan even if lmac tlv bit is on
David Spinadel [Mon, 17 Nov 2014 10:30:05 +0000 (12:30 +0200)]
iwlwifi: mvm: go to umac scan even if lmac tlv bit is on

LMAC TLV bit may be on in FWs that support UMAC scan; so check
for UMAC TLV bit first.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: rs: consider a missing BA as a single tx failure
Eyal Shapira [Wed, 12 Nov 2014 11:30:20 +0000 (13:30 +0200)]
iwlwifi: mvm: rs: consider a missing BA as a single tx failure

The fw now indicates missing BA with ampdu_ack_len=0.

This will make the whole aggregation being marked
as failed, although it's most likely not the case (and
only the BA itself was failed).

Consider this case as a single tx failure.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: BT Coex - add support for TTC / RRC
Emmanuel Grumbach [Mon, 3 Nov 2014 09:43:15 +0000 (11:43 +0200)]
iwlwifi: mvm: BT Coex - add support for TTC / RRC

The TTC and RRC features are supported by the newer
firmwares. It allows to reach better overall WiFi and BT
performance. When the RRC is enabled, we don't need to force
the AP to send SISO frames, but it can keeps sending MIMO
frames.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: implement UMAC scan API
David Spinadel [Tue, 20 May 2014 09:46:37 +0000 (12:46 +0300)]
iwlwifi: mvm: implement UMAC scan API

This API uses second CPU scan commands, and can support multiple
simultaneous scans.

Adding the new API, and adding new mechanisms to deal with up to
8 simultaneous scans instead of the old scan status.

New scan API requires scan configuration for default scan parameters,
adding it in _up flow. Also updating scan configuration after updating
valid scan antennas via debugfs.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: Fix the keep_alive calculation
Avri Altman [Tue, 11 Nov 2014 05:29:59 +0000 (07:29 +0200)]
iwlwifi: mvm: Fix the keep_alive calculation

The driver must set the keep alive period regardless of power
management state. The keep alive period must be greater or equal to
both the NIC's maximum sleep period, and the listen interval.
However, we were confusing time units (TU) and msec, so fix that.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: New skip over dtim policy
Avri Altman [Thu, 2 Oct 2014 17:46:16 +0000 (19:46 +0200)]
iwlwifi: mvm: New skip over dtim policy

Our firmware scheduler suffers from false wake-up on 500 time units.
that is if the dtim interval exceeds 500 time units, the fw wakes up,
understands that the next wake-up event is still ahead, and if this event
is more than 10msec in the future - goes back to sleep, otherwise - stay
awake.  For example, say that the beacon interval is 101 and the dtim
period is 5, the dtim interval is 101 x 5 = 505, and we will stay awake
for those extra 5msec.
So on the one hand the dtim interval should be congruent to the beacon
interval times the dtim period, and on the other should minimize
the false wake-ups event.
This change applies only to D0/D3 power modes.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: move deferred d0i3 exit to resume_complete op
Eliad Peller [Mon, 20 Oct 2014 15:42:58 +0000 (18:42 +0300)]
iwlwifi: mvm: move deferred d0i3 exit to resume_complete op

The deferred d0i3 exit is currently implemented in the
resume op, which is called when mac80211 starts its
resume process.

However, mac80211 still doesn't handle frames at this stage,
which results in frames being dropped.

Move the deferred d0i3 handling to the reconfig_complete
callback, in order to make sure mac80211 is fully available
at this point.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add support for WMM Access Control
Emmanuel Grumbach [Tue, 7 Oct 2014 07:38:53 +0000 (10:38 +0300)]
iwlwifi: mvm: add support for WMM Access Control

After the corresponding mac80211 patch, we can now report the airtime
used for each transmitted packet and mac80211 will be able to implement
WMM-AC with that information.

To support WMM-AC in the driver then, report the airtime and advertise
support.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: change max HT and VHT A-MPDU exponent
Eran Harary [Tue, 30 Sep 2014 04:42:06 +0000 (06:42 +0200)]
iwlwifi: change max HT and VHT A-MPDU exponent

Add two new parameters to iwl_cfg:
max_ht_ampdu_exponent and max_vht_ampdu_exponent.
These parameters, if set, will set new values to the maximum of
HT and VHT A-MPDU exponent for the A-MPDU length exponent.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: Insert DS Parameter Set placeholder in probes
Andrei Otcheretianski [Tue, 2 Sep 2014 14:55:40 +0000 (17:55 +0300)]
iwlwifi: mvm: Insert DS Parameter Set placeholder in probes

Since it's too complicated for the fw to insert a DS Parameter Set
element in the middle of the frame, it was decided that it should be
done by the host. The fw will only parse the frame and update the
current channel field.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoMerge remote-tracking branch 'wireless-next/master' into iwlwifi-next
Emmanuel Grumbach [Sun, 23 Nov 2014 17:56:35 +0000 (19:56 +0200)]
Merge remote-tracking branch 'wireless-next/master' into iwlwifi-next

9 years agomwifiex: Add USB8766 support
Kristian Evensen [Thu, 20 Nov 2014 15:52:58 +0000 (16:52 +0100)]
mwifiex: Add USB8766 support

Adds new VID/PID for the Marvell 88W8766. The kernel currently only supports
the device as PCI, but it is also available using USB. An example of a device
delivered with the 88W8766 as USB is the Globalscale Mirabox.

TX buffer size is set to driver default (2K), as we do not know the firmware
requirement.

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agonet: brcm80211: Deletion of unnecessary checks before two function calls
Markus Elfring [Thu, 20 Nov 2014 15:42:51 +0000 (16:42 +0100)]
net: brcm80211: Deletion of unnecessary checks before two function calls

The functions brcmu_pkt_buf_free_skb() and release_firmware() test whether
their argument is NULL and then return immediately. Thus the test around
the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoMerge tag 'mac80211-next-for-john-2014-11-20' of git://git.kernel.org/pub/scm/linux...
John W. Linville [Thu, 20 Nov 2014 21:09:30 +0000 (16:09 -0500)]
Merge tag 'mac80211-next-for-john-2014-11-20' of git://git./linux/kernel/git/jberg/mac80211-next

Johannes Berg <johannes@sipsolutions.net> says:

"It has been a while since my last pull request, so we accumulated
another relatively large set of changes:
 * TDLS off-channel support set from Arik/Liad, with some support
   patches I did
 * custom regulatory fixes from Arik
 * minstrel VHT fix (and a small optimisation) from Felix
 * add back radiotap vendor namespace support (myself)
 * random MAC address scanning for cfg80211/mac80211/hwsim (myself)
 * CSA improvements (Luca)
 * WoWLAN Net Detect (wake on network found) support (Luca)
 * and lots of other smaller changes from many people"

Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoath9k_common: make sure DEBUG_FS and RELAY enabled
Oleksij Rempel [Wed, 19 Nov 2014 11:30:28 +0000 (12:30 +0100)]
ath9k_common: make sure DEBUG_FS and RELAY enabled

currently ath9k_common depends on this components.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoMerge commit '4e6ce4dc7ce71d0886908d55129d5d6482a27ff9' of git://git.kernel.org/pub...
John W. Linville [Wed, 19 Nov 2014 20:38:48 +0000 (15:38 -0500)]
Merge commit '4e6ce4dc7ce71d0886908d55129d5d6482a27ff9' of git://git./linux/kernel/git/linville/wireless

9 years agomac80211: minstrel_ht: add a small optimization to minstrel_aggr_check
Felix Fietkau [Sat, 15 Nov 2014 23:27:55 +0000 (00:27 +0100)]
mac80211: minstrel_ht: add a small optimization to minstrel_aggr_check

Check the queue mapping earlier, skb->queue_mapping is more likely than
skb->data to still be in d-cache.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: notify drivers on sta rate table changes
Johannes Berg [Tue, 18 Nov 2014 23:10:42 +0000 (00:10 +0100)]
mac80211: notify drivers on sta rate table changes

This allows drivers with a firmware or chip-based rate lookup table to
use the most recent default rate selection without having to get it from
per-packet data or explicit ieee80211_get_tx_rate calls

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agonl80211: Broadcast CMD_NEW_INTERFACE and CMD_DEL_INTERFACE
Tomasz Bursztyka [Wed, 12 Nov 2014 14:26:45 +0000 (16:26 +0200)]
nl80211: Broadcast CMD_NEW_INTERFACE and CMD_DEL_INTERFACE

Let the other listeners being notified when a new or del interface
command has been issued, thus reducing later necessary request to be in
sync with current context.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211-hwsim: Add HWSIM_CMD_GET_RADIO command
Patrik Flykt [Wed, 12 Nov 2014 14:42:40 +0000 (16:42 +0200)]
mac80211-hwsim: Add HWSIM_CMD_GET_RADIO command

HWSIM_CMD_GET_RADIO returns information about a specific radio id or
all of them in response to a dump. Create the netlink skb or use the
one provided by the dump functionality. Use the existing attribute
appending function to fill in the same attributes when creating a
new hwsim radio.

Save alpha2 and struct ieee80211_regdomain in the hwsim data or else
they will be lost in the depths of regulatory infrastructure.

Signed-off-by: Patrik Flykt <patrik.flykt@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211-hwsim: Factor out netlink attribute appending
Patrik Flykt [Wed, 12 Nov 2014 14:42:39 +0000 (16:42 +0200)]
mac80211-hwsim: Factor out netlink attribute appending

Factor out netlink message attribute appending in order to reuse it
with later code. As a result move netlink skb allocation to the
calling function.

Signed-off-by: Patrik Flykt <patrik.flykt@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agonl80211: Replace interface socket owner attribute with more generic one
Jukka Rissanen [Thu, 13 Nov 2014 15:25:14 +0000 (17:25 +0200)]
nl80211: Replace interface socket owner attribute with more generic one

Replace NL80211_ATTR_IFACE_SOCKET_OWNER attribute with more generic
NL80211_ATTR_SOCKET_OWNER that can be used with other commands
that interface creation.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211-hwsim: remove unnecessary hwname check
Johannes Berg [Wed, 19 Nov 2014 17:51:55 +0000 (18:51 +0100)]
mac80211-hwsim: remove unnecessary hwname check

The hwname will always be set if idx is negative (as it's
a u32 read into an s64 it can't overflow either) so we can
remove the unnecessary check for hwname being non-NULL.

This was reported by smatch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211-hwsim: hwname is always known so use the value from wiphy
Jukka Rissanen [Fri, 14 Nov 2014 11:16:34 +0000 (13:16 +0200)]
mac80211-hwsim: hwname is always known so use the value from wiphy

We can always know the hwname of the radio so use the value
from wiphy.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: protect fools returning NULL in add_virtual_intf
Rafał Miłecki [Fri, 14 Nov 2014 17:43:28 +0000 (18:43 +0100)]
cfg80211: protect fools returning NULL in add_virtual_intf

Callback add_virtual_intf is supposed to return ERR_PTR and trying to
return NULL results in some "Unable to handle kernel paging request",
etc. As it may be complicated to debug & trace, let's catch it (WARN).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: explicitly initialize some fields in custom reg path
Arik Nemtsov [Sun, 16 Nov 2014 14:37:47 +0000 (16:37 +0200)]
cfg80211: explicitly initialize some fields in custom reg path

Explicitly initialize the DFS state and beacon found state when handling
channels in the custom regulatory path.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Acked-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: update missing fields in custom regulatory path
Arik Nemtsov [Sun, 16 Nov 2014 14:37:46 +0000 (16:37 +0200)]
cfg80211: update missing fields in custom regulatory path

Some channels fields were not being updated in the custom regulatory
path. Update them according to the code in handle_channel().

Signed-off-by: Jonathan Doron <jonathanx.doron@intel.com>
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Acked-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: skip legacy rate mask handling for VHT rates
Felix Fietkau [Sat, 15 Nov 2014 02:48:54 +0000 (03:48 +0100)]
mac80211: skip legacy rate mask handling for VHT rates

The rate mask code currently assumes that a rate is legacy if
IEEE80211_TX_RC_MCS is not set. This might be the cause of bogus VHT
rates being reported with minstrel_ht.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: don't allow 40MHz tx rates in case of 20MHz chandef
Eliad Peller [Tue, 11 Nov 2014 16:11:22 +0000 (18:11 +0200)]
mac80211: don't allow 40MHz tx rates in case of 20MHz chandef

When 20MHz chandef is used, 40MHz rates shouldn't be
used (by the rate-control algorithm), even if the sta
ht capabilities indicate support for it.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Singed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211_hwsim: support scanning with random MAC address
Johannes Berg [Thu, 12 Jun 2014 20:41:00 +0000 (22:41 +0200)]
mac80211_hwsim: support scanning with random MAC address

This adds support for scanning with random MAC address for
both software and hardware scan.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: allow drivers to support NL80211_SCAN_FLAG_RANDOM_ADDR
Johannes Berg [Thu, 12 Jun 2014 20:24:31 +0000 (22:24 +0200)]
mac80211: allow drivers to support NL80211_SCAN_FLAG_RANDOM_ADDR

Allow drivers to support NL80211_SCAN_FLAG_RANDOM_ADDR with software
based scanning and generate a random MAC address for them for every
scan request with the flag.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: rcu-ify scan and scheduled scan request pointers
Johannes Berg [Wed, 19 Nov 2014 10:55:49 +0000 (11:55 +0100)]
mac80211: rcu-ify scan and scheduled scan request pointers

In order to use the scan and scheduled scan request pointers during
RX to check for randomisation, make them accessible using RCU.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: allow drivers to support random MAC addresses for scan
Johannes Berg [Thu, 12 Jun 2014 19:39:05 +0000 (21:39 +0200)]
cfg80211: allow drivers to support random MAC addresses for scan

Add the necessary feature flags and a scan flag to support using
random MAC addresses for scan while unassociated.

The configuration for this supports an arbitrary MAC address
value and mask, so that any kind of configuration (e.g. fixed
OUI or full 46-bit random) can be requested. Full 46-bit random
is the default when no other configuration is passed.

Also add a small helper function to use the addr/mask correctly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: remove redundant check
Eliad Peller [Wed, 12 Nov 2014 08:08:29 +0000 (10:08 +0200)]
mac80211: remove redundant check

local->scan_req was tested in the previous line, so it
can't be NULL.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: add wowlan net-detect support
Luciano Coelho [Wed, 17 Sep 2014 08:55:28 +0000 (11:55 +0300)]
cfg80211: add wowlan net-detect support

Add a new WoWLAN API to enable net-detect as a wake up trigger.
Net-detect allows the device to scan in the background while the
host is asleep to wake up the host system when a matching network
is found.

Reuse the scheduled scan attributes to specify how the scan is
performed while suspended and the matches that will trigger a
wake event.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: refactor nl80211_start_sched_scan so it can be reused
Luciano Coelho [Mon, 10 Nov 2014 14:13:46 +0000 (16:13 +0200)]
cfg80211: refactor nl80211_start_sched_scan so it can be reused

For net detect, we will need to reuse most of the scheduled scan
parsing function, but not all, so split out the attributes parsing
part out of the main start sched_scan function.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: synchronously reserve TID per station
Liad Kaufman [Wed, 19 Nov 2014 11:47:38 +0000 (13:47 +0200)]
mac80211: synchronously reserve TID per station

In TDLS (e.g., TDLS off-channel) there is a requirement for
some drivers to supply an unused TID between the AP and the
device to the FW, to allow sending PTI requests and to allow
the FW to aggregate on a specific TID for better throughput.

To ensure that the allocated TID is indeed unused, this patch
introduces an API for blocking the driver from TXing on that
TID.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add specific-queue flushing support
Liad Kaufman [Sun, 9 Nov 2014 16:50:21 +0000 (18:50 +0200)]
mac80211: add specific-queue flushing support

If the HW supports IEEE80211_HW_QUEUE_CONTROL, allow
flushing only specific queues rather than all of them.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add TDLS channel-switch Rx flow
Arik Nemtsov [Sun, 9 Nov 2014 16:50:20 +0000 (18:50 +0200)]
mac80211: add TDLS channel-switch Rx flow

When receiving a TDLS channel switch request or response, parse the frame
and call a new tdls_recv_channel_switch op in the low level driver with
the parsed data.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: introduce TDLS channel switch ops
Arik Nemtsov [Sun, 9 Nov 2014 16:50:19 +0000 (18:50 +0200)]
mac80211: introduce TDLS channel switch ops

Implement the cfg80211 TDLS channel switch ops and introduce new mac80211
ones for low-level drivers.
Verify low-level driver support for the new ops when using the relevant
wiphy feature bit. Also verify the peer supports channel switching before
passing the command down.

Add a new STA flag to track the off-channel state with the TDLS peer and
make sure to cancel the channel-switch if the peer STA is unexpectedly
removed.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add parsing of TDLS specific IEs
Arik Nemtsov [Sun, 9 Nov 2014 16:50:18 +0000 (18:50 +0200)]
mac80211: add parsing of TDLS specific IEs

These are used in TDLS channel switching code.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: introduce TDLS channel switch commands
Arik Nemtsov [Wed, 19 Nov 2014 10:54:26 +0000 (12:54 +0200)]
cfg80211: introduce TDLS channel switch commands

Introduce commands to initiate and cancel TDLS channel-switching. Once
TDLS channel-switching is started, the lower level driver is responsible
for continually initiating channel-switch operations and returning to
the base (AP) channel to listen for beacons from time to time.

Upon cancellation of the channel-switch all communication between the
relevant TDLS peers will continue on the base channel.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: prepare TDLS mgmt code for channel-switch templates
Arik Nemtsov [Sun, 9 Nov 2014 16:50:16 +0000 (18:50 +0200)]
mac80211: prepare TDLS mgmt code for channel-switch templates

Split the data-generating from the Tx-sending functionality, as we do
not want to send templates to the lower driver. Also add an optional
chandef argument to the data-generating portion. It will be used for
channel-switch templates.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: track AP and peer STA TDLS chan-switch support
Arik Nemtsov [Sun, 9 Nov 2014 16:50:15 +0000 (18:50 +0200)]
mac80211: track AP and peer STA TDLS chan-switch support

The AP or peer can prohibit TDLS channel switch via a bit in the
extended capabilities IE. Parse the IE and track this bit. Set an
appropriate STA flag if both the AP and peer STA support TDLS
channel-switching.

Add the new STA flag and the missing TDLS_INITIATOR to debugfs.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg/mac80211: define TDLS channel switch feature bit
Arik Nemtsov [Sun, 9 Nov 2014 16:50:14 +0000 (18:50 +0200)]
cfg/mac80211: define TDLS channel switch feature bit

Define some related TDLS protocol constants and advertise channel switch
support in the extended-capabilities IE when the feature bit is defined.

Actually supporting TDLS channel-switching also requires support for
some new nl80211 commands, to be introduced by future patches.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add BSS coex IE to TDLS setup frames
Arik Nemtsov [Sun, 9 Nov 2014 16:50:13 +0000 (18:50 +0200)]
mac80211: add BSS coex IE to TDLS setup frames

Add the BSS coex IE in case we support HT40 channels, as mandated by
section 8.5.13 in IEEE802.11 2012.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add supported channels IE during TDLS setup
Arik Nemtsov [Sun, 9 Nov 2014 16:50:12 +0000 (18:50 +0200)]
mac80211: add supported channels IE during TDLS setup

This information element is mandatory in case TDLS channel-switching is to
be supported. The channels given are ones supported and allowed to be
active in the current regulatory setting.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add function to create data frame template including key
Johannes Berg [Sun, 9 Nov 2014 16:50:11 +0000 (18:50 +0200)]
mac80211: add function to create data frame template including key

For some TDLS channel switch implementations data frames need to be
sent by the firmware based on a template. This template should be
created by mac80211, and thus needs to properly be built from an
802.3 frame into an 802.11 frame. In addition, the device will need
the key information so the select_key handler needs to be run.
However, the driver/device will be responsible for all of the crypto
encapsulation, as the sequence numbers etc. cannot be built by the
host anyway in this case since it's a template to be used multiple
times.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: factor out 802.11 header building code
Johannes Berg [Sun, 9 Nov 2014 16:50:10 +0000 (18:50 +0200)]
mac80211: factor out 802.11 header building code

Factor out the 802.11 header building code from the xmit function
to be able to use it separately in a later commit.

While at it, fix up some documentation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>