GitHub/moto-9609/android_kernel_motorola_exynos9610.git
7 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git
Kalle Valo [Thu, 24 Aug 2017 11:29:12 +0000 (14:29 +0300)]
Merge git://git./linux/kernel/git/kvalo/wireless-drivers.git

Stephen Rothwell reported quite a few conflicts in iwlwifi between
wireless-drivers and wireless-drivers-next. To avoid any problems later in
other trees merge w-d to w-d-next to fix those conflicts early.

7 years agowireless: ipw2x00: make iw_handler_def const
Bhumika Goyal [Wed, 23 Aug 2017 12:36:42 +0000 (18:06 +0530)]
wireless: ipw2x00: make iw_handler_def const

Make these const as they are only stored in the const field of a
net_device structure.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agonet: rsi: mac80211: constify ieee80211_ops
Arvind Yadav [Wed, 23 Aug 2017 09:59:34 +0000 (15:29 +0530)]
net: rsi: mac80211: constify ieee80211_ops

ieee80211_ops are not supposed to change at runtime. All functions
working with ieee80211_ops provided by <net/mac80211.h> work with
const ieee80211_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agowireless: ipw2200: Replace PCI pool old API
Romain Perier [Wed, 23 Aug 2017 07:16:51 +0000 (09:16 +0200)]
wireless: ipw2200: Replace PCI pool old API

The PCI pool API is deprecated. This commit replaces the PCI pool old
API by the appropriate function with the DMA pool API.

Signed-off-by: Romain Perier <romain.perier@collabora.com>
Reviewed-by: Peter Senna Tschudin <peter.senna@collabora.com>
Acked-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: rtl8821ae: fix spelling mistake: "faill" -> "failed"
Colin Ian King [Tue, 22 Aug 2017 12:59:04 +0000 (13:59 +0100)]
rtlwifi: rtl8821ae: fix spelling mistake: "faill" -> "failed"

Trivial fix to spelling mistake in RT_TRACE message

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agomt7601u: check memory allocation failure
Christophe Jaillet [Mon, 21 Aug 2017 22:06:17 +0000 (00:06 +0200)]
mt7601u: check memory allocation failure

Check memory allocation failure and return -ENOMEM in such a case, as
already done a few lines below.

As 'dev->tx_q' can be NULL, we also need to check for that in
'mt7601u_free_tx()', and return early.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: make a couple arrays larger
Dan Carpenter [Fri, 18 Aug 2017 08:05:19 +0000 (11:05 +0300)]
rtlwifi: make a couple arrays larger

This is a static checker fix.  "cal_num" is 10.  We're declaring the
tx_dt[] and rx_td[] arrays as 3 element arrays.  The static checker
complains that we do:

tx_dt[cal] = (vdf_y[1]>>20)-(vdf_y[0]>>20);

"cal" is the iterator and it is in the 0-9 range so it looks like
we could corrupt memory.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: btcoex: 23b 1ant: fix duplicated code for different branches
Gustavo A. R. Silva [Fri, 18 Aug 2017 00:22:19 +0000 (19:22 -0500)]
rtlwifi: btcoex: 23b 1ant: fix duplicated code for different branches

Refactor code in order to avoid identical code for different branches.

This issue was detected with the help of Coccinelle.

Addresses-Coverity-ID: 1415177
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agowlcore: add missing nvs file name info for wilink8
Reizer, Eyal [Sun, 20 Aug 2017 12:28:18 +0000 (12:28 +0000)]
wlcore: add missing nvs file name info for wilink8

The following commits:
commit c815fdebef44 ("wlcore: spi: Populate config firmware data")
commit d776fc86b82f ("wlcore: sdio: Populate config firmware data")

Populated the nvs entry for wilink6 and wilink7 only while it is
still needed for wilink8 as well.
This broke user space backward compatibility when upgrading from older
kernels, as the alternate mac address would not be read from the nvs that
is present in the file system (lib/firmware/ti-connectivity/wl1271-nvs.bin)
causing mac address change of the wlan interface.

This patch fix this and update the structure field with the same default
nvs file name that has been used before.

In addition, some distros hold a default wl1271-nvs.bin in the file
system with a bogus mac address (deadbeef...) that overrides the mac
address that is stored inside the device.
Warn users about this bogus mac address and use the internal mac address

Fixes: c815fdebef44 ("wlcore: spi: Populate config firmware data")
Fixes: d776fc86b82f ("wlcore: sdio: Populate config firmware data")
Signed-off-by: Eyal Reizer <eyalr@ti.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoMerge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Kalle Valo [Thu, 24 Aug 2017 09:26:17 +0000 (12:26 +0300)]
Merge ath-next from git://git./linux/kernel/git/kvalo/ath.git

ath.git patches for 4.14. Major changes:

ath10k

* initial UBS bus support (no full support yet)

* add tdls support for 10.4 firmware

ath9k

* add Dell Wireless 1802

wil6210

* support FW RSSI reporting

7 years agoMerge tag 'iwlwifi-next-for-kalle-2017-08-18' of git://git.kernel.org/pub/scm/linux...
Kalle Valo [Wed, 23 Aug 2017 14:53:07 +0000 (17:53 +0300)]
Merge tag 'iwlwifi-next-for-kalle-2017-08-18' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

Third set of iwlwifi patches for 4.14

* Work for the upcoming A000 device family continues;
* Improvements in debugging;
* A couple of improvements in block-ack sessions;
* Some fixes for channel switch;
* A workaround for a HW data bug;
* Some FW API updates;
* General fixes and cleanups here and there.

7 years agoiwlwifi: use big-endian for the hw section of the nvm
Luca Coelho [Thu, 17 Aug 2017 15:51:56 +0000 (18:51 +0300)]
iwlwifi: use big-endian for the hw section of the nvm

Unlike the other sections of the NVM, the hw section is in big-endian.
To read a value from it, we had to cast it to __be16.  Fix that by
using __be16 * for the entire section.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: remove useless check for mvm->cfg in iwl_parse_nvm_section()
Luca Coelho [Tue, 15 Aug 2017 16:24:59 +0000 (19:24 +0300)]
iwlwifi: mvm: remove useless check for mvm->cfg in iwl_parse_nvm_section()

At this point we have already copied the cfg pointer to mvm and we
have been dereferencing this pointer many times before, so it will
never be NULL or we would have crashed.  Remove the useless check.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: remove useless argument in iwl_nvm_init()
Luca Coelho [Tue, 15 Aug 2017 15:46:44 +0000 (18:46 +0300)]
iwlwifi: mvm: remove useless argument in iwl_nvm_init()

We always call iwl_nvm_init() with read_nvm_from_nic == true, so this
argument is useless.  Remove it.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: fw: fix lar_enabled endian problem in iwl_fw_get_nvm
Luca Coelho [Tue, 15 Aug 2017 20:12:39 +0000 (23:12 +0300)]
iwlwifi: fw: fix lar_enabled endian problem in iwl_fw_get_nvm

We read the regulatory.lar_enabled field in iwl_fw_get_nvm() and store
it in nvm->lar_enabled, taking care of endianness.  But then later we
read it again to pass the value to iwl_init_sbands() without handling
endianness.  To solve this, simply reuse nvm->lar_enabled when calling
that function.

Fixes: e9e1ba3dbf00 ("iwlwifi: mvm: support getting nvm data from firmware")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: add workaround to disable wide channels in 5GHz
Luca Coelho [Tue, 15 Aug 2017 17:48:41 +0000 (20:48 +0300)]
iwlwifi: add workaround to disable wide channels in 5GHz

The OTP in some SKUs have erroneously allowed 40MHz and 80MHz channels
in the 5.2GHz band.  The firmware has been modified to not allow this
in those SKUs, so the driver needs to do the same otherwise the
firmware will assert when we try to use it.

Cc: stable@vger.kernel.org
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: change open and close criteria of a BA session
Gregory Greenman [Tue, 15 Aug 2017 09:27:01 +0000 (12:27 +0300)]
iwlwifi: mvm: change open and close criteria of a BA session

Tx BA session should be started according to the current throughput
without any dependence on the internal rate scaling state. The criteria
for opening a BA session will be 10 frames per second.

Sending frequent del BAs can cause inter-op issues with some APs. We'll
not close a BA session until we receive an explicit del BA from the
peer.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: update channel flags parser
Luca Coelho [Wed, 16 Aug 2017 07:46:52 +0000 (10:46 +0300)]
iwlwifi: update channel flags parser

There are some new flags in the channel flags that we don't know
about.  Also, the "WIDE" flag is very confusing, because it actually
means 20MHz bandwidth, which is not very wide.

Add the new flags and rename the confusing one.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pci: add new PCI ID for 7265D
Luca Coelho [Wed, 16 Aug 2017 05:47:38 +0000 (08:47 +0300)]
iwlwifi: pci: add new PCI ID for 7265D

We have a new PCI subsystem ID for 7265D.  Add it to the list.

Cc: stable@vger.kernel.org
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: distinguish different RF modules in A000 devices
Tzipi Peres [Tue, 25 Jul 2017 10:04:46 +0000 (13:04 +0300)]
iwlwifi: distinguish different RF modules in A000 devices

Newer versions of A000 devices come with two diffenent RF modules.
The PCI_ID, the subsystem ID and the RF ID are identical in these two cases,
so we need to differentiate them by using the CSR_HW_RF_ID register-
in order to load the appropriate firmware.

Signed-off-by: Tzipi Peres <tzipi.peres@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: Fix channel switch in case of count <= 1
Ilan Peer [Tue, 8 Aug 2017 11:56:58 +0000 (14:56 +0300)]
iwlwifi: mvm: Fix channel switch in case of count <= 1

The code did not consider the case that the channel switch counter
is <= 1, which would result with an inaccurate calculation of the
time event apply time.

As the specification states that in case of counter == 0 the switch
occurs at any time after the reception the frame, and for counter == 1
the switch would happens before the next TBTT, schedule the time
event immediately.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: Demote messages about fw flags size to info
João Paulo Rechi Vita [Thu, 3 Aug 2017 14:47:28 +0000 (07:47 -0700)]
iwlwifi: Demote messages about fw flags size to info

These messages are not reporting a real error, just the fact that the
firmware knows about more flags than the driver.

Currently these messages are presented to the user during boot if there
is no bootsplash covering the console, even when booting the kernel with
"quiet".

Demoting it to the warn level helps having a clean boot process.

Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: move BT_MBOX_PRINT macro to common header
Luca Coelho [Sun, 6 Aug 2017 08:06:44 +0000 (11:06 +0300)]
iwlwifi: move BT_MBOX_PRINT macro to common header

Move the BT_MBOX_PRINT() macro from mvm/debugfs.c to fw/api/coex.h so
it can be reused and remove duplicate definition of BT_MBOX_MSG(),
keeping only the one already in coex.h.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: don't send BAR on flushed frames
Emmanuel Grumbach [Sun, 6 Aug 2017 10:19:05 +0000 (13:19 +0300)]
iwlwifi: mvm: don't send BAR on flushed frames

When we flush a queue, the packets will have a 'failed'
status but we shouldn't send a BAR. This check was missing.
Because of that, when we got an ampdu_action with
IEEE80211_AMPDU_TX_STOP_FLUSH, we started the following
ping pong with the firmware:

1) Set the station as 'draining'
2) Get a failed Tx status (DRAINED)
3) Send a BAR because of the failed Tx status

(loop of 2 and 3)

This loop wasn't endless since the BAR isn't sent on a
queue that would trigger a "nested" BAR.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: remove session protection to allow channel switch
Avraham Stern [Wed, 2 Aug 2017 09:13:20 +0000 (12:13 +0300)]
iwlwifi: mvm: remove session protection to allow channel switch

If a time event is already scheduled when trying to schedule one for
channel switch, the code assumes the channel switch is already
scheduled and no further action is required.
However, it is possible that the scheduled time event is actually
for session protection (e.g. when the first beacon after association
contains the CSA IE). In this case the channel switch will not be
scheduled which will finally lead to disconnection.

Fix this by removing the old time event and schduling a new one for
the channel switch.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: update the firmware API in TX
Emmanuel Grumbach [Wed, 2 Aug 2017 06:29:33 +0000 (09:29 +0300)]
iwlwifi: mvm: update the firmware API in TX

The firmware team is now re-using a bit that hasn't been
used for a few generations. Re-use for TX_ON_AIR drop.
This bit will be set by the firmware to indicate that
a frame in an A-MPDU was dropped but not because of the
already mapped reasons.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: use mvmsta consistently in rs.c
Luca Coelho [Tue, 1 Aug 2017 06:01:34 +0000 (09:01 +0300)]
iwlwifi: mvm: use mvmsta consistently in rs.c

We use mvmsta for the sta->drv_priv in mvm, but in rs.c we have a
bunch of instances using sta_priv, which is probably due to it being
copied from dvm.  Change all occurrences to mvmsta for consistency
with the rest of the driver

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: group all dummy SAR function declarations together
Luca Coelho [Wed, 26 Jul 2017 12:20:18 +0000 (15:20 +0300)]
iwlwifi: mvm: group all dummy SAR function declarations together

We have some of the SAR dummy functions when ACPI is not set declared
in mvm.h and some declared in fw.c.  Group them all together in fw.c
for consistency and to avoid static/non-static issues.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: include more debug data when we get an unexpected baid
Emmanuel Grumbach [Thu, 27 Jul 2017 06:45:10 +0000 (09:45 +0300)]
iwlwifi: mvm: include more debug data when we get an unexpected baid

When we get a valid baid in a received frame, we need to
check that we are aware of this baid. If not, we check
that the OLD_SN bit set. If that's not the case, we issue
a WARNING. Print more data when that happens.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: add command name for FRAME_RELEASE
Emmanuel Grumbach [Thu, 27 Jul 2017 06:40:16 +0000 (09:40 +0300)]
iwlwifi: mvm: add command name for FRAME_RELEASE

This name was missing in the list.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: support short Tx queues for A000 device family
Emmanuel Grumbach [Sun, 16 Jul 2017 09:28:05 +0000 (12:28 +0300)]
iwlwifi: pcie: support short Tx queues for A000 device family

This allows to modify TFD_TX_CMD_SLOTS to a power of 2
which is smaller than 256.
Note that we still need to set values to wrap at 256
into the scheduler's write pointer, but all the rest of
the code can use shorter transmit queues.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: support new Coex firmware API
Emmanuel Grumbach [Sun, 23 Jul 2017 10:59:47 +0000 (13:59 +0300)]
iwlwifi: mvm: support new Coex firmware API

The firmware now adds more information about time sharing
with the Bluetooth core.
Adapt the API structures and add the new fields in the
debugfs hooks.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: call iwl_remove_notification from iwl_wait_notification
Luca Coelho [Mon, 24 Jul 2017 13:04:47 +0000 (16:04 +0300)]
iwlwifi: call iwl_remove_notification from iwl_wait_notification

The iwl_wait_notification() function removes the wait entry from the
list.  To make it clearer that it's doing the same thing as
iwl_remove_notification(), call the latter instead of having duplicate
code.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: consider RFKILL during INIT as success
Luca Coelho [Mon, 24 Jul 2017 11:47:52 +0000 (14:47 +0300)]
iwlwifi: mvm: consider RFKILL during INIT as success

There's no need to differentiate an INIT that ended early because of
RFKILL from one that succeded.  Additionally, if INIT fails later,
during calibration, due to RFKILL, we can just return success and
continue as if we were already in RFKILL to start with.

Remove this unnecessary differentiation and do some other small
clean-ups while at it.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: remove the corunning support
Emmanuel Grumbach [Sun, 16 Jul 2017 13:22:08 +0000 (16:22 +0300)]
iwlwifi: mvm: remove the corunning support

The corunning block was supposed to help in coex scenarios.
It required the driver to configure the firmware based on
the coupling between the two antennas of the devices.
This was never in use and the configuration sent by the
driver has always been blank.
Remove all that code.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agorsi: security enhancements for AP mode
Prameela Rani Garnepudi [Wed, 16 Aug 2017 13:13:18 +0000 (18:43 +0530)]
rsi: security enhancements for AP mode

Station id should be set in load key frame configured to device.
For WEP mode, key is configured once from mac80211. This key is
saved and configured to device every time a station is connected.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: aggregation parameters frame for AP mode
Prameela Rani Garnepudi [Wed, 16 Aug 2017 13:13:17 +0000 (18:43 +0530)]
rsi: aggregation parameters frame for AP mode

TX command frame ampdu aggregation parameters is updated to
include sta_id for AP mode.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: update tx auto rate command frame for AP mode
Prameela Rani Garnepudi [Wed, 16 Aug 2017 13:13:16 +0000 (18:43 +0530)]
rsi: update tx auto rate command frame for AP mode

Auto rate frame is sent to firmware when a new station is
connected. Station id and station's ht capabilities are updated
in auto rate command frame.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: use common descriptor for auto rate frame
Prameela Rani Garnepudi [Wed, 16 Aug 2017 13:13:15 +0000 (18:43 +0530)]
rsi: use common descriptor for auto rate frame

TX command frame auto rate request is modified to use common
descriptor struture.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: data and managemet path changes for AP mode
Prameela Rani Garnepudi [Wed, 16 Aug 2017 13:13:14 +0000 (18:43 +0530)]
rsi: data and managemet path changes for AP mode

Station id needs to be get for data and management frames
to fill in the descruptor for AP mode. Few other changes
related to AP mode are covered here.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: handle station disconnection in AP mode
Prameela Rani Garnepudi [Wed, 16 Aug 2017 13:13:13 +0000 (18:43 +0530)]
rsi: handle station disconnection in AP mode

When sta_remove of mac80211 is called, driver iterates through
list of existing stations to get the station id. Then peer notify
is prepared and send to firmare.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: handle station connection in AP mode
Prameela Rani Garnepudi [Wed, 16 Aug 2017 13:13:12 +0000 (18:43 +0530)]
rsi: handle station connection in AP mode

Station structures are maintained in driver with required
fields. When mac80211 callback sta_add is called, driver
iterates through list of connected stations to check available
index and assigns station id which is important for further
communication to that station. Then peer notify frame is send
to firmware to inform the firmware about new station connection.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: add beacon changes for AP mode
Prameela Rani Garnepudi [Wed, 16 Aug 2017 13:13:11 +0000 (18:43 +0530)]
rsi: add beacon changes for AP mode

Mac80211 config parameter BEACON_ENABLE is handled. When VAP
capabilities frame with AP mode is configured to firmware, beacon
events start coming to host at each PreTBTT. At this time, beacon
is taken from mac80211, descriptor is prepared and send to firmware.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: remove interface changes for AP mode
Prameela Rani Garnepudi [Wed, 16 Aug 2017 13:13:10 +0000 (18:43 +0530)]
rsi: remove interface changes for AP mode

remove_interface callback of mac80211 is handled for AP mode.
Same is notified to firmware through vap_capabilities frame
with VAP status VAP_DELETE.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: add interface changes for ap mode
Prameela Rani Garnepudi [Wed, 16 Aug 2017 13:13:09 +0000 (18:43 +0530)]
rsi: add interface changes for ap mode

AP mode is handled in add_interface callback of mac80211.
Also for AP mode, sending rx filter frame to disallow beacons
to host is added. Station structures are initialized to NULL.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agorsi: advertise ap mode support
Prameela Rani Garnepudi [Wed, 16 Aug 2017 13:13:08 +0000 (18:43 +0530)]
rsi: advertise ap mode support

AP mode support is advertised to cfg80211. Necessary wiphy
parameters are initialized.

Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Signed-off-by: Amitkumar Karwar <amit.karwar@redpinesignals.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoqtnfmac: modify tx reclaim locking
Sergey Matyukevich [Tue, 15 Aug 2017 13:06:38 +0000 (16:06 +0300)]
qtnfmac: modify tx reclaim locking

Perform additional reclaim from qtnf_pcie_data_tx. Lock tx_lock serves only
reclaim synchronization purposes. Rename it accordingly and improve
granularity moving this lock to qtnf_pcie_data_tx_reclaim.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoqtnfmac: introduce counter for Rx underflow events
Sergey Matyukevich [Tue, 15 Aug 2017 13:06:37 +0000 (16:06 +0300)]
qtnfmac: introduce counter for Rx underflow events

Introduce counter for Rx underflow events. Export this counter via debugfs.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoqtnfmac: switch to kernel circ_buf implementation
Sergey Matyukevich [Tue, 15 Aug 2017 13:06:36 +0000 (16:06 +0300)]
qtnfmac: switch to kernel circ_buf implementation

Current code for both Rx and Tx queue management is a custom and incomplete
circular buffer implementation. It makes a lot of sense to switch to kernel
built-in circ_buf implementation.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoqtnfmac: decrease default Tx queue size
Sergey Matyukevich [Tue, 15 Aug 2017 13:06:35 +0000 (16:06 +0300)]
qtnfmac: decrease default Tx queue size

Avoid extra buffering in driver by default. Use max hardware Tx queue size.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoqtnfmac: skb2rbd_attach cleanup
Sergey Matyukevich [Tue, 15 Aug 2017 13:06:34 +0000 (16:06 +0300)]
qtnfmac: skb2rbd_attach cleanup

Update PCIE_HDP_TX_HOST_Q_WR_PTR register in skb2rbd_attach as a part of
procedure of passing new Rx buffer to hardware. Sync up all the the
qtnf_rx_bd descriptor updates before passing Rx buffer to hardware.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoqtnfmac: use __netdev_alloc_skb_ip_align
Sergey Matyukevich [Tue, 15 Aug 2017 13:06:33 +0000 (16:06 +0300)]
qtnfmac: use __netdev_alloc_skb_ip_align

Replace __dev_alloc_skb and explicit NET_IP_ALIGN alignment by built-in
__netdev_alloc_skb_ip_align function.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoqtnfmac: switch to napi_gro_receive
Sergey Matyukevich [Tue, 15 Aug 2017 13:06:32 +0000 (16:06 +0300)]
qtnfmac: switch to napi_gro_receive

Use napi_gro_receive() rather than netif_receive_skb() to improve
performance when GRO is enabled.

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoqtnfmac: remove unused qtnf_rx_frame declaration
Sergey Matyukevich [Tue, 15 Aug 2017 13:06:31 +0000 (16:06 +0300)]
qtnfmac: remove unused qtnf_rx_frame declaration

Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agomwifiex: check for NL80211_SCAN_FLAG_RANDOM_ADDR during hidden SSID scan
Ganapathi Bhat [Thu, 10 Aug 2017 12:41:26 +0000 (18:11 +0530)]
mwifiex: check for NL80211_SCAN_FLAG_RANDOM_ADDR during hidden SSID scan

At the end of user scan request, driver will perform an active
scan for hidden SSIDs in passive channels. While doing this,
driver unconditionally adding random_mac in scan command, which
is no expected. It should add random_mac only if scan_request
has NL80211_SCAN_FLAG_RANDOM_ADDR flag set.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agomwifiex: do not use random MAC for pre-association scanning
Ganapathi Bhat [Thu, 10 Aug 2017 12:41:25 +0000 (18:11 +0530)]
mwifiex: do not use random MAC for pre-association scanning

Driver should use random MAC address only if the scan is
requested by user(provided NL80211_SCAN_FLAG_RANDOM_ADDR
is set in scan request). It should not be used for a scan
performed before association.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agobrcmfmac: feature check for multi-scheduled scan fails on bcm4343x devices
Arend Van Spriel [Fri, 11 Aug 2017 10:07:36 +0000 (11:07 +0100)]
brcmfmac: feature check for multi-scheduled scan fails on bcm4343x devices

The firmware feature check introduced for multi-scheduled scan turned out
to be failing for bcm4343{0,1,8} devices resulting in a firmware crash.
The reason for this crash has not yet been root cause so this patch avoids
the feature check for those device as a short-term fix.

Reported-by: Stefan Wahren <stefan.wahren@i2se.com>
Reported-by: Ian Molton <ian@mnementh.co.uk>
Fixes: 9fe929aaace6 ("brcmfmac: add firmware feature detection for gscan feature")
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoMerge tag 'iwlwifi-next-for-kalle-2017-08-11' of git://git.kernel.org/pub/scm/linux...
Kalle Valo [Fri, 11 Aug 2017 14:07:40 +0000 (17:07 +0300)]
Merge tag 'iwlwifi-next-for-kalle-2017-08-11' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

Sencond batch of iwlwifi patches for 4.14

* Some more code moved to a new directory;
* Fixes in LED handling;
* Some FW API updates;
* General fixes and cleanups here and there.

7 years agobrcm80211: constify usb_device_id
Arvind Yadav [Fri, 11 Aug 2017 05:23:50 +0000 (10:53 +0530)]
brcm80211: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agomwifiex: uap: enable 11d based on userspace configruation
Xinming Hu [Wed, 9 Aug 2017 02:31:43 +0000 (02:31 +0000)]
mwifiex: uap: enable 11d based on userspace configruation

This patch check whether userspace beacon data include country
ie, if so then download command to enable 11d setup in firmeare
accordingly.

Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agozd1211rw: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:31:42 +0000 (22:01 +0530)]
zd1211rw: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agozd1201: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:31:24 +0000 (22:01 +0530)]
zd1201: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortl8192cu: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:31:05 +0000 (22:01 +0530)]
rtl8192cu: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortl8xxxu: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:30:39 +0000 (22:00 +0530)]
rtl8xxxu: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortl8187: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:30:13 +0000 (22:00 +0530)]
rtl8187: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agort73usb: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:29:48 +0000 (21:59 +0530)]
rt73usb: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agort2800usb: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:29:15 +0000 (21:59 +0530)]
rt2800usb: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agort2500usb: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:29:14 +0000 (21:59 +0530)]
rt2500usb: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agomt7601u: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:28:24 +0000 (21:58 +0530)]
mt7601u: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agomwifiex: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:27:59 +0000 (21:57 +0530)]
mwifiex: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agolibertas_tf: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:27:29 +0000 (21:57 +0530)]
libertas_tf: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agolibertas: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:27:28 +0000 (21:57 +0530)]
libertas: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agop54: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:26:43 +0000 (21:56 +0530)]
p54: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoorinoco: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:26:28 +0000 (21:56 +0530)]
orinoco: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoat76c50x: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:25:03 +0000 (21:55 +0530)]
at76c50x: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agocarl9170: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:24:41 +0000 (21:54 +0530)]
carl9170: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoar5523: constify usb_device_id
Arvind Yadav [Wed, 9 Aug 2017 16:23:42 +0000 (21:53 +0530)]
ar5523: constify usb_device_id

usb_device_id are not supposed to change at runtime. All functions
working with usb_device_id provided by <linux/usb.h> work with
const usb_device_id. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoMerge tag 'iwlwifi-for-kalle-2018-08-09' of git://git.kernel.org/pub/scm/linux/kernel...
Kalle Valo [Wed, 9 Aug 2017 19:37:23 +0000 (22:37 +0300)]
Merge tag 'iwlwifi-for-kalle-2018-08-09' of git://git./linux/kernel/git/iwlwifi/iwlwifi-fixes

Some more fixes for 4.13

* Fix a memory leak in the SAR code;
* Fix a stuck queue case in AP mode;
* Convert a WARN to a simple debug in a legitimate race case (from
  which we can recover);
* Fix a severe throughput aggregation on 9000-family devices due to
  aggregation issues.

7 years agoiwlwifi: mvm: fix the coex firmware API
Emmanuel Grumbach [Sun, 23 Jul 2017 09:53:46 +0000 (12:53 +0300)]
iwlwifi: mvm: fix the coex firmware API

The firmware API defined in the header files didn't match
the structure that are actually passed by the firmware.
The impact could be a decision for MIMO in Tx or Rx in
coex scenarios.

Fixes: 430a3bbafdc7 ("iwlwifi: mvm: BT Coex - new API")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: free the TSO page when a Tx queue is unmapped on A000 devices
Emmanuel Grumbach [Sun, 16 Jul 2017 09:45:12 +0000 (12:45 +0300)]
iwlwifi: pcie: free the TSO page when a Tx queue is unmapped on A000 devices

When we unmap a non-empty Tx queue, we need to free the
pages that we allocated for the headers in TSO flows.
This code existed for the 9000 device family, but somehow
it got left out when the new Tx path for the A000 devices
was written.

Fixes: 2b0c5946d9ed ("iwlwifi: pcie: introduce a000 TX queues management")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: remove references to unsupported HW
Luca Coelho [Mon, 17 Jul 2017 06:15:34 +0000 (09:15 +0300)]
iwlwifi: remove references to unsupported HW

There are still some references to 3945 and 4965 HW, which were never
supported in iwlwifi.  These references were inherited from a previous
project and are irrelevant here.  Additionally, remove some irrelevant
references to 5100 HW.  Remove all these.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: fix nmi triggering from host
Golan Ben-Ami [Wed, 28 Jun 2017 10:03:58 +0000 (13:03 +0300)]
iwlwifi: fix nmi triggering from host

Although nmi was triggered fine till now, it appears
that the driver didn't write the exact correct values
to the correct addresses for each HW.
Fix the nmi triggering by setting the correct addresses
and values.

Fixes: 4c9706dc2f29 ("iwlwifi: update nmi register")
Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: don't init a Tx queue with an SSN > size of the queue
Emmanuel Grumbach [Thu, 13 Jul 2017 06:49:32 +0000 (09:49 +0300)]
iwlwifi: pcie: don't init a Tx queue with an SSN > size of the queue

The TVQM tells us the initial write pointer for a queue,
but that write pointer is in WiFi sequence number unit
and not in TFD index unit. Which means that the write
pointer in the TVQM's response can be bigger than the
Tx queue ring size.

Fix that by modulo'ing the write pointer from the TVQM
with the Tx queue size.

Fixes: 66128fa08806 ("iwlwifi: move to TVQM mode")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: add station before allocating a queue
Shaul Triebitz [Mon, 10 Jul 2017 16:58:10 +0000 (19:58 +0300)]
iwlwifi: mvm: add station before allocating a queue

One of the queue config params is the associated station id.
Hence the FW must know about the station prior to the queue allocation.
In a000 devices, allocating a queue without a valid station
results with assert 0x2B00.
In FW restart flow the queues are allocated before
adding the station so first add the station.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: don't send CTDP commands via debugfs if not supported
Matt Chen [Fri, 23 Jun 2017 09:50:18 +0000 (17:50 +0800)]
iwlwifi: mvm: don't send CTDP commands via debugfs if not supported

Fix this issue if it is not supported by the firmware.

Fixes: 00f481bd895a ("iwlwifi: mvm: add ctdp operations to debugfs")
Signed-off-by: Matt Chen <matt.chen@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: support new beacon template command
Haim Dreyfuss [Mon, 12 Jun 2017 11:59:02 +0000 (14:59 +0300)]
iwlwifi: mvm: support new beacon template command

Support a new version of the beacon template command. This replaces v8
of the command, which was missing the rate code.  Also, export rate
decision logic to a separate function.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: send delba upon rx ba session timeout
Naftali Goldstein [Tue, 11 Jul 2017 07:07:32 +0000 (10:07 +0300)]
iwlwifi: mvm: send delba upon rx ba session timeout

When an RX block-ack session times out, the firmware, which offloads
RX reordering but not the BA session negotiation, stops the session
but doesn't send a DELBA.  This causes the the session to remain
active in the remote device, so no more BA sessions will be
established, causing a severe throughput degradation due to the lack
of aggregation.

Use the new ieee80211_rx_ba_timer_expired API when the ba session timer
expires, since this will tear down the ba session and also send a delba.

The previous API used is intended for drivers that offload the
addba/delba negotiation, but not the rx reordering, while our driver
does the opposite.

This patch depends on "mac80211: add api to start ba session timer
expired flow".

Signed-off-by: Naftali Goldstein <naftali.goldstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agomac80211: add api to start ba session timer expired flow
Naftali Goldstein [Tue, 11 Jul 2017 07:07:25 +0000 (10:07 +0300)]
mac80211: add api to start ba session timer expired flow

Some drivers handle rx buffer reordering internally (and by extension
handle also the rx ba session timer internally), but do not ofload the
addba/delba negotiation.
Add an api for these drivers to properly tear-down the ba session,
including sending a delba.

Signed-off-by: Naftali Goldstein <naftali.goldstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: set the default cTDP budget
Chaya Rachel Ivgi [Sun, 9 Jul 2017 13:35:14 +0000 (16:35 +0300)]
iwlwifi: mvm: set the default cTDP budget

In case there is no value received from BIOS
for cTDP budget, the default should be 2000 mWatt.

Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: move a000 device NVM retrieval to a common place
Shaul Triebitz [Thu, 22 Jun 2017 14:09:08 +0000 (17:09 +0300)]
iwlwifi: mvm: move a000 device NVM retrieval to a common place

Getting the NVM data in a000 devices should be shared
across operation mode.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: dump smem configuration when firmware crashes
Golan Ben-Ami [Sun, 25 Jun 2017 14:23:23 +0000 (17:23 +0300)]
iwlwifi: dump smem configuration when firmware crashes

Add the smem configuration to the fw data dump, once
the firmware crashes. This is useful mainly for later
parsing of the smem.

Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: fix a000 RF_ID define
Liad Kaufman [Sun, 2 Jul 2017 07:32:34 +0000 (10:32 +0300)]
iwlwifi: fix a000 RF_ID define

One of the defines has a wrong value.

Fixes: 1afb0ae42174 ("iwlwifi: allow combining different phy images with mac images")
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: add support of FPGA fw
Tzipi Peres [Wed, 14 Jun 2017 07:02:47 +0000 (10:02 +0300)]
iwlwifi: add support of FPGA fw

Load FW according to NIC type,
taking into account simulation, if exists.
This is determined by a prph register.

Signed-off-by: Tzipi Peres <tzipi.peres@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: fix a few instances of misaligned kerneldoc parameters
Luca Coelho [Wed, 28 Jun 2017 11:08:53 +0000 (14:08 +0300)]
iwlwifi: fix a few instances of misaligned kerneldoc parameters

There are a few places where we don't have a space between the * and
the @ in the parameter description.  Also, in one case, the @ had
trailing space before the parameter name.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: change functions that can only return 0 to void
Sharon Dvir [Mon, 12 Jun 2017 08:28:21 +0000 (11:28 +0300)]
iwlwifi: change functions that can only return 0 to void

Change iwl_set_ucode_api_flags(), iwl_set_ucode_capabilities() to be void.
No need to check returned values.
Found by Klocwork.

Signed-off-by: Sharon Dvir <sharon.dvir@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: add debugfs to force CT-kill
Chaya Rachel Ivgi [Tue, 27 Jun 2017 11:13:02 +0000 (14:13 +0300)]
iwlwifi: mvm: add debugfs to force CT-kill

CT-kill is a thermal-based "RF-kill", which disables the NIC
completely if the temperature gets too high, in order to avoid damage.

Add a debugfs entry to simulate high temperatures, in order to test
CT-kill flows in the driver without having to physically heat the
device up.

Signed-off-by: Chaya Rachel Ivgi <chaya.rachel.ivgi@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: add const to thermal_cooling_device_ops structure
Bhumika Goyal [Wed, 21 Jun 2017 08:40:42 +0000 (14:10 +0530)]
iwlwifi: mvm: add const to thermal_cooling_device_ops structure

Declare thermal_cooling_device_ops structure as const as it is only passed
as an argument to the function thermal_cooling_device_register and this
argument is of type const. So, declare the structure as const.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: use firmware LED command where applicable
Johannes Berg [Wed, 28 Jun 2017 14:19:49 +0000 (16:19 +0200)]
iwlwifi: mvm: use firmware LED command where applicable

On devices starting from 8000 series, the host can no longer toggle
the LED through the CSR_LED_REG register, but must do it via the
firmware instead. Add support for this. Note that this means that
the LED cannot be turned on while the firmware is off, so using an
arbitrary LED trigger may not work as expected.

Fixes: 503ab8c56ca0 ("iwlwifi: Add 8000 HW family support")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: remove useless condition in LED code
Johannes Berg [Thu, 29 Jun 2017 07:14:45 +0000 (09:14 +0200)]
iwlwifi: mvm: remove useless condition in LED code

If the module parameter is set to disable the LED, we leave the
initialization routine before setting the LEDS_INIT_COMPLETE
status bit. Therefore, there's no need to check the parameter
again on exit, just the status check is sufficient.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: don't WARN when a legit race happens in A-MPDU
Emmanuel Grumbach [Thu, 27 Jul 2017 12:34:12 +0000 (15:34 +0300)]
iwlwifi: mvm: don't WARN when a legit race happens in A-MPDU

When we start an Rx A-MPDU session, we first get the AddBA
request, then we send an ADD_STA command to the firmware
that will reply with a BAID which is a hardware resource
that tracks the BA session.
This BAID will appear on each and every frame that we get
from the firwmare until the A-MPDU session is torn down.
In the Rx path, we look at this BAID to manage the
reordering buffer.

This flow is inherently racy since the hardware will start
to put the BAID in the frames it receives even if the
firmware hasn't sent the response to the ADD_STA command.
This basically means that the driver can get frames with
a valid BAID that it doesn't know yet.
When that happens, the driver used to WARN.
Fix this by simply not WARN in this case. When the driver
will know abou the BAID, it will initialise the relevant
states and the next frame with a valid BAID will refresh
them.

Fixes: b915c10174fb ("iwlwifi: mvm: add reorder buffer per queue")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>