Commit Graph

437 Commits

Author SHA1 Message Date
Peer, Ilan a904a08b5f iwlwifi: mvm: Advertise support for AP channel width change
The iwlmvm driver supports channel width change in AP mode.  Add the
proper flag.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-08-29 22:29:06 +03:00
Emmanuel Grumbach ff6e58e648 iwlwifi: mvm: don't use ret when not initialised
fw-dbg code return ret but that variable was either 0
or not initialised. Return 0 always.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Fixes: 6a95126763 ("iwlwifi: mvm: send dbg config hcmds to fw if set in tlv")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-08-29 22:29:05 +03:00
Sharon Dvir bdc98b1371 iwlwifi: mvm: check if vif is NULL before using it
wdev_to_ieee80211_vif() might return NULL.
Check that vif != NULL before dereferencing it.

Signed-off-by: Sharon Dvir <sharon.dvir@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-08-29 22:29:04 +03:00
Emmanuel Grumbach 3606479593 iwlwifi: mvm: consider P2p device type for firmware dump triggers
When the user really wanted a dump on P2P Client, he
coudln't get it because we checked vif->type but didn't
take vif->p2p into account. Fix that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-08-29 22:29:04 +03:00
Kalle Valo 643d09f461 * bump firmware version to load newer firmwares
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXg4EOAAoJEKFHnKIaPMX6VwEP/RgV91NszkXILE1MYzflpOEL
 6ebXRUN6vBfgIQvoNWKPOEr3zHnmqmL+GTFQufPusOdPJrj+16PrC7jHMZZyXdf7
 Eymk1Ts/IrvNUPT1G/l+hCtuoIf5J1YZE2khZTsZ4gODdseGKA4Kf91fU/zbai/R
 Nkqb3uUecRu6oRxLbC9lXVAig8zW9PWKDw/yd7L4qZjZKcjlq+6GrpvCv8zdEWt4
 p8cmes0ef8NmqJItnp5zDm/Prgq2VS8MHJcFDZkcVYwx3Vc89JHAhea7VcTzNw5l
 jJh8IkdfICRlbZpCCDOSX3I1oRG9Ubj0cdjyfYGP+bZzh3jnVPgZtgVmZhOcxRyE
 +OQbqDnE74Y40WSIXR4seC3qMgfpiyTFVeV24W2qbr8XxVLn2bXDvj6tVAAHAsL+
 6R6A/IQMLzvEtIgsKes3q/vtbHi4yEYy3BDB73JTLI3FTUgs2D8NbdhJhptoCYP1
 fQTyopMzq8f8VlfTU60YmnPAmsyBv9zoYCAb4BVMEOJd5usqtuwodZt49aOnOmxF
 kkRMNBQvwfbb9EgD0249rQHAZnfMjuhQYEbByLXyLNzo0IsXq+DSaVvlQyBHz5MZ
 0jIM3Tnd6F2g7uH4x4xTlq60+482MU8MeEYzki7Y7r7aMxjAY9yUvcyLSuKjtpVi
 39nfXoSBnocvbGiNx/MC
 =k7fO
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-next-for-kalle-2016-07-11' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

* bump firmware version to load newer firmwares
2016-07-18 22:46:28 +03:00
David S. Miller 88b3ec5274 wireless-drivers-next patches for 4.8
Major changes:
 
 iwlwifi
 
 * more work on the RX path for the 9000 device series
 * some more dynamic queue allocation work
 * SAR BIOS implementation
 * some work on debugging capabilities
 * added support for GCMP encryption
 * data path rework in preparation for new HW
 * some cleanup to remove transport dependency on mac80211
 * support for MSIx in preparation for new HW
 * lots of work in preparation for HW support (9000 and a000 series)
 
 mwifiex
 
 * implement get_tx_power and get_antenna cfg80211 operation callbacks
 
 wl18xx
 
 * add support for 64bit clock
 
 rtl8xxxu
 
 * aggregation support (optional for now)
 
 Also wireless-drivers is merged to fix some conflicts.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQEcBAABAgAGBQJXhmR1AAoJEG4XJFUm622bn+gH/Ar5l/oU76nmXKh0xNiV6bUE
 2FuRV9X7ynAOLbFJfqZvN8eL1kTyztXOpxVOt9xLZvNcrJP2mdOH+YdUpSPk/XRw
 mpFC7RCln/Y1bbX02la7V8iRJlKK1/VmdMABJXsalDcxSPMhhBQtr4/ZC7NcgmeJ
 zKCZDGr/x4qpmAkYGsf3msJsBotHtt9xuHp4fFswp9Gpm+VeqtdqGEeMxowoILRK
 QBj6nZIuLI4PMnJhfCJn94t9D/AVUIVJTeuWNDS5Up4gZVFo9SlpnkR520P0IY4Q
 1238g5sAdKqONsPO0lyUacUlY2cTafDr4kD6UKnjf659KDd49MDJArpfbvMeweY=
 =PTV+
 -----END PGP SIGNATURE-----

Merge tag 'wireless-drivers-next-for-davem-2016-07-13' of git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next

Kalle Valo says:

====================
wireless-drivers-next patches for 4.8

Major changes:

iwlwifi

* more work on the RX path for the 9000 device series
* some more dynamic queue allocation work
* SAR BIOS implementation
* some work on debugging capabilities
* added support for GCMP encryption
* data path rework in preparation for new HW
* some cleanup to remove transport dependency on mac80211
* support for MSIx in preparation for new HW
* lots of work in preparation for HW support (9000 and a000 series)

mwifiex

* implement get_tx_power and get_antenna cfg80211 operation callbacks

wl18xx

* add support for 64bit clock

rtl8xxxu

* aggregation support (optional for now)

Also wireless-drivers is merged to fix some conflicts.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2016-07-14 16:32:27 -07:00
Arnd Bergmann 25f700ef06 iwlwifi: add missing type declaration
The iwl-debug.h header relies in implicit inclusion of linux/device.h and
we get a lot of warnings without that:

drivers/net/wireless/intel/iwlwifi/iwl-debug.h:44:23: error: 'struct device' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
 void __iwl_err(struct device *dev, bool rfkill_prefix, bool only_trace,
                       ^~~~~~
In file included from drivers/net/wireless/intel/iwlwifi/iwl-eeprom-read.h:66:0,
                 from drivers/net/wireless/intel/iwlwifi/iwl-eeprom-read.c:68:
drivers/net/wireless/intel/iwlwifi/iwl-trans.h: In function 'iwl_trans_tx':
drivers/net/wireless/intel/iwlwifi/iwl-trans.h:1030:348: error: passing argument 1 of '__iwl_err' from incompatible pointer type [-Werror=incompatible-pointer-types]
   IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state);
                                                                                                                                                                                                                                                                                                                                                            ^
In file included from drivers/net/wireless/intel/iwlwifi/iwl-eeprom-read.c:67:0:
drivers/net/wireless/intel/iwlwifi/iwl-debug.h:44:6: note: expected 'struct device *' but argument is of type 'struct device *'
 void __iwl_err(struct device *dev, bool rfkill_prefix, bool only_trace,
      ^~~~~~~~~

The easiest workaround is to just declare 'struct device' before its first use,
rather than including the entire header file.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 21cb3222fe ("iwlwifi: decouple PCIe transport from mac80211")
Acked-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-07-12 14:51:57 +03:00
Luciano Coelho ad38844b8e iwlwifi: mvm: bump MAX firmware API for mvm devices
The driver is now ready to load the new firmware versions.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-11 14:15:38 +03:00
Kalle Valo 8a185006bc Merge git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git
This is to fix some conflicts in iwlwifi.

Conflicts:
	drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
	drivers/net/wireless/intel/iwlwifi/mvm/scan.c
2016-07-10 21:07:29 +03:00
Kalle Valo 26124f4b77 * work on DQA continued
* SAR BIOS implementation
 * some work on debugging capabilities
 * added support for GCMP encryption
 * data path rework in preparation for new HW
 * some cleanup to remove transport dependency on mac80211
 * support for MSIx in preparation for new HW
 * lots of work in preparation for HW support (9000 and a000 series)
 * general cleanups
 * general bugfixes
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJXfNsEAAoJEKFHnKIaPMX6Y4IQAKbpRnJybU8sEQug1y0wyFK7
 ou2JJwPj8wnufV6W08MgVxACT8IX2Lgac/LndCFrE2sRvyCm1mzwvpiF3Z7dJ6p1
 N6cziYEWh1IlTh5jXlNrE3sRJkA4+dspiwABZV7FoSiAUEJLWH1kaZQzwaOG/BCf
 jWH04VSnaYNBMAzQ0aLsq1J2/oagIdhcMdnz29XZBX5NxSbq7/TyXlDhQQoFUmH7
 /0TQ63zr6YuRedz5BvqMllShSeRDw+0TA/TawMHsPrnIHkS+28Dhn/WWy+cEBN8P
 5v4OODoAuRR3EWqlxj7/yHTJkB8EjdLB98QweBMhIaaHUwchfleq7b3lq1CIrmoh
 Hy7kHjRjVFS/FQGKXSunNP46DpNOHVPZ9ycoIMKEaA97TE95triKIY7Hh1Hn1a63
 TDuw2IFKnVaCwWgJ2CLPvGmLHOEls4euqXTcbyeqf2CmWOQc7ih/v1cSVJJPHQx8
 NbQCQk8V8eh9JgXICfiTvtH5ExwzFPlNsNfScv0UP/xaqKvTGXSWx0X+T44rjY4w
 tzcs7asVhT0CRNR9qR5wTIv5Uuq7jOham8mKaOKmyeyB/VCSuCpvml1oTfmoQetL
 c8DxZlAuUbfiJeM/KrdpKMOS7WbxaRftQgwPq4vBea5JqLC4tAUuCuN5dT1a1Q7z
 iP5lucMDEOTwWzVSlf6e
 =PpSg
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-next-for-kalle-2016-07-06' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

* work on DQA continued
* SAR BIOS implementation
* some work on debugging capabilities
* added support for GCMP encryption
* data path rework in preparation for new HW
* some cleanup to remove transport dependency on mac80211
* support for MSIx in preparation for new HW
* lots of work in preparation for HW support (9000 and a000 series)
* general cleanups
* general bugfixes
2016-07-08 12:20:30 +03:00
Avraham Stern 7947d3e075 mac80211: Add support for beacon report radio measurement
Add the following to support beacon report radio measurement
with the measurement mode field set to passive or active:
1. Propagate the required scan duration to the device
2. Report the scan start time (in terms of TSF)
3. Report each BSS's detection time (also in terms of TSF)

TSF times refer to the BSS that the interface that requested the
scan is connected to.

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
[changed ath9k/10k, at76c59x-usb, iwlegacy, wl1251 and wlcore to match
the new API]
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-07-06 14:53:19 +02:00
Sara Sharon 6f482e37b7 iwlwifi: move iwl_drv to be shared across transports
All transports has this structure. By moving it to be
shared, we can get rid of casting to the specific transport
in probe and remove.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:37:44 +03:00
Sara Sharon 38398efb74 iwlwifi: pcie: centralize SCD status logging
Centralize the logging of SCD status. The motivation is
that for a000 devices we will have new SCD HW, but this
code was duplicate anyway, so it is a proper cleanup.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:32:34 +03:00
Luca Coelho 55bfa4b9d4 iwlwifi: mvm: support v4 of the TX power command
Add support for the v4 version of the TX power command.  Just add a
new version and do the same sizing tricks that were done when support
for v3 was introduced.

This patch doesn't support the new functionality introduced, but makes
the driver work with the new size of the command.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:30:06 +03:00
Sara Sharon 564cdce735 iwlwifi: pcie: load FW chunk for a000 devices
Update the firmware load flow for TFH hardware.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:23:35 +03:00
Sara Sharon e22744af3b iwlwifi: pcie: initialize a000 device's TFD table
For a000 device the FH was replaced by the TFH.
This is the first patch in a series introducing the
changes stemming from this change.
This patch initializes the TFQ queue table with the new
64 bit register and the relevant TFH configuration
registers.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:23:02 +03:00
Sara Sharon 12a17458a2 iwlwifi: centralize 64 bit HW registers write
Move the write_prph_64 of pcie to be transport agnostic.
Add direct write as well, as it is needed for a000 HW.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:22:08 +03:00
Sara Sharon 8de437c71e iwlwifi: pcie: generalize and increase the size of scratchbuf
Currently the scratch buffer is set to 16 bytes and indicates
the size of the bi-directional DMA.
However, next HW generation will perform additional offloading,
and will write the result in the key location of the TX command,
so the size of the bi-directional consistent memory should grow
accordingly - increase it to 40.
Generalize the code to get rid of now irrelevant scratch references.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:21:29 +03:00
Sara Sharon b1753c62c7 iwlwifi: pcie: track rxb status
In MQ environment and new architecture in early stages
we may encounter DMA issues. Track RXB status and bail
out in case we receive index to an RXB that was not
mapped and handed over to HW.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:18:20 +03:00
Emmanuel Grumbach f16c3ebfa6 iwlwifi: pcie: fix a race in firmware loading flow
Upon firmware load interrupt (FH_TX), the ISR re-enables the
firmware load interrupt only to avoid races with other
flows as described in the commit below. When the firmware
is completely loaded, the thread that is loading the
firmware will enable all the interrupts to make sure that
the driver gets the ALIVE interrupt.
The problem with that is that the thread that is loading
the firmware is actually racing against the ISR and we can
get to the following situation:

CPU0					CPU1
iwl_pcie_load_given_ucode
	...
	iwl_pcie_load_firmware_chunk
		wait_for_interrupt
					<interrupt>
					ISR handles CSR_INT_BIT_FH_TX
					ISR wakes up the thread on CPU0
	/* enable all the interrupts
	 * to get the ALIVE interrupt
	 */
	iwl_enable_interrupts
					ISR re-enables CSR_INT_BIT_FH_TX only
	/* start the firmware */
	iwl_write32(trans, CSR_RESET, 0);

BUG! ALIVE interrupt will never arrive since it has been
masked by CPU1.

In order to fix that, change the ISR to first check if
STATUS_INT_ENABLED is set. If so, re-enable all the
interrupts. If STATUS_INT_ENABLED is clear, then we can
check what specific interrupt happened and re-enable only
that specific interrupt (RFKILL or FH_TX).

All the credit for the analysis goes to Kirtika who did the
actual debugging work.

Cc: <stable@vger.kernel.org> [4.5+]
Fixes: a6bd005fe9 ("iwlwifi: pcie: fix RF-Kill vs. firmware load race")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:16:12 +03:00
Johannes Berg 21cb3222fe iwlwifi: decouple PCIe transport from mac80211
The PCIe transport needs to store two pointers in each TX SKB, and
currently assumes mac80211's ieee80211_tx_info is present in the CB
to do that.

In order to remove that assumption, have the opmodes pass in the
offset to where the pointers can be stored in the CB and use the
offset in the PCIe code.

To make the disentanglement complete, remove mac80211.h includes
from everywhere in the generic iwlwifi code. This required adding
an include of cfg80211.h in one place.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:09:56 +03:00
Johannes Berg 0c4cb7314d iwlwifi: tracing: decouple from mac80211
In order to be able to properly record SKBs that didn't come through
mac80211, don't rely on the IEEE80211_TX_CTRL_PORT_CTRL_PROTO flag
but instead check for ETH_P_PAE directly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:08:56 +03:00
Johannes Berg 24ddddf367 iwlwifi: store cipher scheme independent of mac80211
In order to reduce reliance on mac80211 structs in the core
iwlwifi code, store the cipher schemes in the format given
by the firmware and convert it later, rather than storing it
in the mac80211 format.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:08:25 +03:00
Sara Sharon 60dec5233c iwlwifi: mvm: free RX reorder buffer on restart
Restart flow zeroes the rx_ba_sessions counter. Mac80211 asks
driver to tear down of the session only afterwards, and as a
result driver didn't free the data. Fix it.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Fixes: 10b2b2019d ("iwlwifi: mvm: add infrastructure for tracking BA session in driver")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:06:01 +03:00
Sara Sharon 35263a0311 iwlwifi: mvm: add RX aggregation prints
Add some prints to track BAID assignment.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:05:37 +03:00
Liad Kaufman 58f2cc57dc iwlwifi: mvm: support dqa-mode scd queue redirection
Make sure that in DQA mode, the SCD's configuration of a
queue is redirected to the lower AC of the streams of the
queue.

Make sure that this queue is redirected to the lowest AC
when adding a new RA/TID to an existing queue. If it isn't -
redirect the queue.

Also, as redirection revealed a bug in the marking of a
shared queue, this patch contains a small fix to make
sure a shared queue maintains the appropriate "shared queue
marking".

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 10:00:21 +03:00
Liad Kaufman e3118ad74d iwlwifi: mvm: support tdls in dqa mode
Support TDLS when working in DQA mode.

This is done mainly by NOT doing any special things
for TDLS, as the queues are dynamically created anyway,
so no need to allocate them ahead of time.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 09:59:55 +03:00
Sara Sharon e25d65f267 iwlwifi: pcie: don't use vid 0
In cases of hardware or DMA error, the vid read from
a zeroed location will be 0, and we will access the rxb
at index 0 in the global table, while it may be NULL or
owned by hardware.
Invalidate vid 0 in order to detect the situation and
bail out.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 09:59:28 +03:00
Emmanuel Grumbach 3edbc7daba iwlwifi: mvm: unmap the paging memory before freeing it
This led to a DMA splat.

Fixes: a6c4fb4441 ("iwlwifi: mvm: Add FW paging mechanism for the UMAC on PCI")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 09:58:33 +03:00
Johannes Berg 5e7d7eb9cc iwlwifi: remove iwl_ht_params.smps_mode
This struct member is never set, so remove it.

Since this is the last thing that needs mac80211.h, also change
the includes to no longer use mac80211.h

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 09:57:10 +03:00
Emmanuel Grumbach ad17b1d953 iwlwifi: mvm: fix the channel inhibition table for Channel 14
The value for Channel 14 was wrong. Fix it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 09:56:32 +03:00
Emmanuel Grumbach c934bce9de iwlwifi: mvm: fix coex related comments
Those comments were wrong, fix them.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 09:55:47 +03:00
Golan Ben-Ami e7c9bd1cc6 iwlwifi: mvm: write the correct internal TXF index
The TX fifos are arranged consecutively in the SMEM, beginning
with the regular fifos, and tailed by the internal fifos.
In the current code, while trying to read the internal fifos,
we read the fifos beginning with the index zero.
By doing this we actually re-read the regular fifos.

In order to read the internal fifos, start the reading index
from the number of regular fifos configured by the fw.

Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Fixes: 39654cb3a6 ("iwlwifi: don't access a nonexistent register upon assert")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 09:52:44 +03:00
Sara Sharon d5d0689aef iwlwifi: pcie: fix access to scratch buffer
This fixes a pretty ancient bug that hasn't manifested itself
until now.
The scratchbuf for command queue is allocated only for 32 slots
but is accessed with the queue write pointer - which can be
up to 256.
Since the scratch buf size was 16 and there are up to 256 TFDs
we never passed a page boundary when accessing the scratch buffer,
but when attempting to increase the size of the scratch buffer a
panic was quick to follow when trying to access the address resulted
in a page boundary.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Fixes: 38c0f334b3 ("iwlwifi: use coherent DMA memory for command header")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 09:40:33 +03:00
Ido Yariv 54f315cb08 iwlwifi: pcie: Enable MSI mode when using MSI interrupts
On some of the chipsets MSI & INTA interrupts are disabled by default in
the HW registers, and need to be explicitly enabled to be used.

In case MSI-X isn't used, make sure MSI mode is enabled by setting
the relevant HW register.

Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 09:39:16 +03:00
Luca Coelho da2830acf1 iwlwifi: mvm: read SAR BIOS table from ACPI
Read the SAR BIOS table from the ACPI and parse it into the
iwl_mvm_sar_table structure.  If the table is enabled, send it to the
firmware via REDUCE_TX_POWER_CMD.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 02:23:36 +03:00
Emmanuel Grumbach 3aa4359fe1 iwlwifi: mvm: cleanup the coex code
We removed support for old API for coexistence, but we
forgot to remove defines and variable that are not needed
anymore.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 02:19:21 +03:00
Sara Sharon ecf5142415 iwlwifi: mvm: checksum IPv6 fragmented packet
Our HW does not support checksum of fragmented packets.
Fix code accordingly to checksum those packets in the driver.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Fixes: 5e6a98dc48 ("iwlwifi: mvm: enable TCP/UDP checksum support for 9000 family")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 02:09:56 +03:00
striebit 849a962729 iwlmvm: mvm: set correct state in smart-fifo configuration
Currently the state sent in SF configuration is always
FULL_ON.
This commit sets the correct state (e.g. INIT_OFF
when station is not associated).

Fixes: commit f4a3ee493e ("iwlwifi: mvm: Always enable the smart FIFO")
Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 02:09:55 +03:00
Emmanuel Grumbach 2aabdbdc17 iwlwifi: pcie: enable interrupts before releasing the NIC's CPU
The NIC's CPU gets started after the firmware has been
written to its memory. The first thing it does is to
send an interrupt to let the driver know that it is
running. In order to get that interrupt, the driver needs
to make sure it is not masked. Of course, the interrupt
needs to be enabled in the driver before the CPU starts to
run.
I mistakenly inversed those two steps leading to races
which prevented the driver from getting the alive interrupt
from the firmware.
Fix that.

Cc: <stable@vger.kernel.org> [4.5+]
Fixes: a6bd005fe9 ("iwlwifi: pcie: fix RF-Kill vs. firmware load race")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 02:09:54 +03:00
Haim Dreyfuss e34d975e40 iwlwifi: Add a000 HW family support
Add a000 family configuration to iwl-cfg struct

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 02:09:50 +03:00
Sara Sharon 988b59684d iwlwifi: mvm: support new statistics notification
For 9000 family we will get extended statistics notification
with averaged data for RSSI, TCM and rogue AP detection.
Support it. Future patches will added the required algorithms.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 02:08:57 +03:00
Ayala Beker 2a53d166c4 iwlwifi: mvm: add support for GCMP encryption
Newer hardware supports GCMP and GCMP 256-bit ciphers.
Add support for adding/setting GCMP key for TX mode.

In the TX command handling GCMP-256 is handled in a different
way as the key size should be up to 128-bits:
Set the key value to the key index in the key table,
and specify that this key should be taken form the key table
instead of from the TX command.

While at it - convert security control flags to an enum.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 02:07:49 +03:00
Golan Ben-Ami 9c07e9aafc iwlwifi: Reserve iwl_fw_error_dump_type enum
Reserve a single iwl_fw_error_dump_type enum for external
code utilities.

Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 02:07:48 +03:00
Sara Sharon f65ebd888c iwlwifi: add dump of RFH
Add support of dumping new RFH instead of FH registers.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 02:07:40 +03:00
Guenter Roeck e160f635ab iwlwifi: dvm: Remove unused array 'iwlagn_loose_lookup'
gcc-6 reports the following error if -Werror=unused-const-variable
is enabled.

drivers/net/wireless/intel/iwlwifi/dvm/lib.c:210:21: error:
	'iwlagn_loose_lookup' defined but not used

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 01:26:19 +03:00
Oren Givon 2c4a247e42 iwlwifi: mvm: fix txq aggregation bug
Fix an issue where nullfunc frames and block ack requests
had the same tid as aggregation frames and were queued on
a non aggregation queue. The pending frames counter included
those frames but the check whether to decrement the pending
frames counter relied on the tid status and not on the txq id.
The result was an inconsistent state of the pending frames
counter followed by a failure to remove the station.
This failure triggered SYSASSERT 0x3421.

In addition, fix a situation in DQA mode where the number
of pending frames turned negative. This was due to the TX queue
being on the IWL_EMPTYING_HW_QUEUE_DELBA state and its frames
were still decremented.

Even though the SYSASSERT issue is fixed when DQA is disabled,
the issue is not completely solved when DQA is enabled and
should still be fixed.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Fixes: cf961e1662 ("iwlwifi: mvm: support dqa-mode agg on non-shared queue")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 01:24:44 +03:00
Arnd Bergmann 5a7d87da8d iwlwifi: mvm: avoid harmless -Wmaybe-uninialized warning
gcc is apparently unablel to track the state of the local 'resp_v2'
variable across the kzalloc() function, and warns about the response
variable being used without an initialization:

drivers/net/wireless/intel/iwlwifi/mvm/nvm.c: In function ‘iwl_mvm_update_mcc’:
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c:727:36: warning: ‘mcc_resp_v1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   resp_cp->n_channels = mcc_resp_v1->n_channels;
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c:721:3: warning: ‘mcc_resp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   memcpy(resp_cp, mcc_resp, resp_len);

The warning showed up in x86 allmodconfig after my patch to
unhide -Wmaybe-uninitialized warnings by default was merged,
though it always existed in randconfig builds. I did not
catch the warning earlier because I was testing on ARM, which
never produced the warning.

This rearranges the code in a way that improves readability for
both humans and the compiler, and that avoids the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 6fa52430f0 ("iwlwifi: mvm: change mcc update API")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 01:19:54 +03:00
Gregory Greenman 855f492f65 iwlwifi: mvm: rs: add rate scaling support for 160MHz channels
Expand TLC to support 160MHz channels. Full support for A-MSDU
case will be added separately.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 01:19:22 +03:00
Ayala Beker 99980ecfff iwlwifi: mvm: fix RX mpdu status enum
FW sets status for each RX packet.
Enum in the driver doesn't match with FW definition - fix it.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-07-06 01:18:43 +03:00