cascardo/linux.git
8 years agoath9k: remove ath9k_mod_tsf64_tu
Janusz Dziedzic [Fri, 27 Nov 2015 08:37:18 +0000 (09:37 +0100)]
ath9k: remove ath9k_mod_tsf64_tu

Remove ath9k_mod_tsf64_tu() function while we could
use div_u64_rem() function.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: MCC, print time elapsed between events
Janusz Dziedzic [Fri, 27 Nov 2015 08:37:17 +0000 (09:37 +0100)]
ath9k: MCC, print time elapsed between events

This is useful for MCC debugging and bug fixing.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: MCC, add NOA also in case of an AP
Janusz Dziedzic [Fri, 27 Nov 2015 08:37:15 +0000 (09:37 +0100)]
ath9k: MCC, add NOA also in case of an AP

In case of MCC and AP interface, add also NOA attr
that will inform stations about absence of an AP.
There is a chance that some stations will handle
this NOA attr correctly and will know exactly when
AP is present/absent.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: P2P_CLIENT, get/set NOA correctly
Janusz Dziedzic [Fri, 27 Nov 2015 08:37:13 +0000 (09:37 +0100)]
ath9k: P2P_CLIENT, get/set NOA correctly

In case we get BSS_CHANGED_P2P_PS early, from
mac80211, we didn't set NOA timer correctly,
while p2p_ps_vif was NULL.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: MCC enable Opportunistic Power Save
Janusz Dziedzic [Fri, 27 Nov 2015 08:37:12 +0000 (09:37 +0100)]
ath9k: MCC enable Opportunistic Power Save

When adding NOA attr enable Opportunistic Power Save.
Before we calculate ctwindow but didn't enable oppps.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: setup correct skb priority for nullfunc
Janusz Dziedzic [Fri, 27 Nov 2015 08:37:11 +0000 (09:37 +0100)]
ath9k: setup correct skb priority for nullfunc

After queue nullfunc for MCC case, we hit WARN_ON
in xmit.c:2398 while skb priority wasn't set.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: use u32 when calculate tsf
Janusz Dziedzic [Fri, 27 Nov 2015 08:37:10 +0000 (09:37 +0100)]
ath9k: use u32 when calculate tsf

Use u32 while ath9k_hw_gettsf32() and
ath9k_hw_gen_timer_start() require u32.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: P2P_CLIENT, send frames after 1ms AP/GO will aprear
Janusz Dziedzic [Fri, 27 Nov 2015 08:37:09 +0000 (09:37 +0100)]
ath9k: P2P_CLIENT, send frames after 1ms AP/GO will aprear

AP/GO will aprear after NOA, wait 1ms to be sure AP
could receive/answer this frames.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: queue null frames in case of MCC
Janusz Dziedzic [Fri, 27 Nov 2015 08:37:08 +0000 (09:37 +0100)]
ath9k: queue null frames in case of MCC

While mac80211 using null frames when connection polling,
we should queue this frames while NOA could be there, and
AP, P2P_GO could be not present.

Without this patch, with no traffic we often saw disconnections
while we try to send nullfunc when AP/GO wasn't present.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: print real timer value
Janusz Dziedzic [Fri, 27 Nov 2015 08:37:07 +0000 (09:37 +0100)]
ath9k: print real timer value

In case of low HZ before this patch we saw wrong
values in debug message. Print real timeout value.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: add debug messages to aggr/chanctx funcs
Janusz Dziedzic [Fri, 27 Nov 2015 08:37:06 +0000 (09:37 +0100)]
ath9k: add debug messages to aggr/chanctx funcs

Add/extend debug messages when chanctx used.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowil6210: prevent external wmi commands during suspend flow
Maya Erez [Tue, 24 Nov 2015 07:30:15 +0000 (09:30 +0200)]
wil6210: prevent external wmi commands during suspend flow

In __wmi_send we check if fw is ready at the beginning of the function.
While we wait for the completion of the previous command, system suspend
can be invoked and reset the HW, causing __wmi_send to read from HW
registers while it is not ready.
Taking the wmi_mutex in the reset flow when setting the FW ready bit
to zero will prevent the above race condition.

Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath5k: fix RTS/CTS by using proper rate flags
Bob Copeland [Thu, 19 Nov 2015 15:04:48 +0000 (10:04 -0500)]
ath5k: fix RTS/CTS by using proper rate flags

The rates in the tx control rateset do not have the protection
flags applied, so RTS/CTS would never get enabled if requested.

Fix by using the rate flags in the rates returned by
ieee80211_get_tx_rates().

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath6kl: Don't print error message when recv is canceled
Steve deRosier [Wed, 18 Nov 2015 22:51:28 +0000 (14:51 -0800)]
ath6kl: Don't print error message when recv is canceled

An error message ath6kl_htc_rxmsg_pending_handler isn't appropate for when
the error is ECANCELED. This could be the result of a perfectly appropriate
RX cancel due to shutdown or suspend. This allows the right cleanup to
continue, but without an alarming error message in this particular case.

Signed-off-by: Steve deRosier <steve.derosier@lairdtech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath9k: Simplify and fix eeprom endianness swapping
Martin Blumenstingl [Sat, 31 Oct 2015 12:57:32 +0000 (13:57 +0100)]
ath9k: Simplify and fix eeprom endianness swapping

The three eeprom implementations had quite some duplicate code when it
came to endianness swapping.
Additionally there was a bug in eeprom_4k and eeprom_9287 which
prevented the endianness swapping from working correctly, because the
swapping code was guarded within an "if (!ath9k_hw_use_flash(ah))". In
eeprom_def this check did not exist, so it seems that eeprom_def was the
only implementation where endianness swapping worked.

This patch takes the duplicate code and moves it from eeprom_* to
eeprom.c. The new code is derived from eeprom_def, while taking into
account the specifics from the other implementations.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: do not use coherent memory for allocated device memory chunks
Felix Fietkau [Mon, 30 Nov 2015 18:32:01 +0000 (19:32 +0100)]
ath10k: do not use coherent memory for allocated device memory chunks

Coherent memory is more expensive to allocate (and constrained on some
architectures where it has to be pre-allocated). It is also completely
unnecessary, since the host has no reason to even access these allocated
memory spaces

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: remove unnecessary amsdu/ampdu assignment in debugfs
Mohammed Shafi Shajakhan [Mon, 30 Nov 2015 16:59:39 +0000 (22:29 +0530)]
ath10k: remove unnecessary amsdu/ampdu assignment in debugfs

The default values of max_num_amsdu / max_num_amdpu is assigned a
default value as part of 'ath10k_core_init_firmware_features'

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoMerge tag 'iwlwifi-next-for-kalle-2015-12-01' of https://git.kernel.org/pub/scm/linux...
Kalle Valo [Thu, 3 Dec 2015 15:23:43 +0000 (17:23 +0200)]
Merge tag 'iwlwifi-next-for-kalle-2015-12-01' of https://git./linux/kernel/git/iwlwifi/iwlwifi-next

* BT coex improvements (Avri, Moshe)
* D3 operation bugfixes (Luca, Eliad)
* Rate control improvements (Eyal)
* Firmware debugging infra improvements (Golan)
* Ground work for multi Rx (Johannes)
* Various security fixes (Johannes)

8 years agoMerge ath-next from ath.git
Kalle Valo [Thu, 3 Dec 2015 15:10:25 +0000 (17:10 +0200)]
Merge ath-next from ath.git

Major changes:

ath10k

* support Manegement Frame Protection (MFP)
* add thermal throttling support for 10.4 firmware
* add support for pktlog in QCA99X0
* add debugfs file to enable Bluetooth coexistence feature
* use firmware's native mesh interface type instead of raw mode

8 years agoiwlwifi: remove IWL_DL_LED
Eliad Peller [Wed, 18 Nov 2015 14:10:57 +0000 (16:10 +0200)]
iwlwifi: remove IWL_DL_LED

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

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

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

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

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

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

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

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

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

Signed-off-by: Derek Basehore <dbasehore@chromium.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: rs: fix a warning message
Dan Carpenter [Sat, 21 Nov 2015 10:33:38 +0000 (13:33 +0300)]
iwlwifi: mvm: rs: fix a warning message

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

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

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

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

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

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: Align bt-coex priority with requirements
Avri Altman [Mon, 2 Nov 2015 12:16:07 +0000 (14:16 +0200)]
iwlwifi: mvm: Align bt-coex priority with requirements

Fix the gaps between the system requirements and our code.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Golan Ben-Ami <golan.ben.ami@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoath10k: implement fw_checksums debugfs file
Kalle Valo [Wed, 25 Nov 2015 13:38:41 +0000 (15:38 +0200)]
ath10k: implement fw_checksums debugfs file

When debugging firmware problems it's useful to check checksums of each
component. Add a debugfs interface to retrieve crc32 checksums:

# cat /sys/kernel/debug/ieee80211/phy0/ath10k/fw_checksums
firmware-N.bin          cc3fb466
athwlan                 c0089f21
otp                     f3efeb4f
codeswap                00000000
board-N.bin             bebc7c08
board                   bebc7c08

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: print crc32 checksums for firmware and board files
Kalle Valo [Wed, 25 Nov 2015 13:38:34 +0000 (15:38 +0200)]
ath10k: print crc32 checksums for firmware and board files

To detect cases if the firmare or board file is corrupted or otherwise modified print crc32 value
of both. Now the output looks like:

ath10k_pci 0000:02:00.0: pci irq msi interrupts 1 irq_mode 0 reset_mode 0
ath10k_pci 0000:02:00.0: qca99x0 hw2.0 target 0x01000000 chip_id 0x003801ff sub 168c:0002
ath10k_pci 0000:02:00.0: kconfig debug 1 debugfs 1 tracing 1 dfs 1 testmode 1
ath10k_pci 0000:02:00.0: firmware ver 10.4.1.00030-1 api 5 features no-p2p crc32 d2901e01
ath10k_pci 0000:02:00.0: board_file api 1 bmi_id 1:1 crc32 7e56fd07
ath10k_pci 0000:02:00.0: htt-ver 2.2 wmi-op 6 htt-op 4 cal otp max-sta 512 raw 0 hwcrypto 1

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: split driver info messages during device initialisation
Kalle Valo [Wed, 25 Nov 2015 13:38:27 +0000 (15:38 +0200)]
ath10k: split driver info messages during device initialisation

Earlier we printed all the info messages after a successful device
initialisation and firmware boot, but that's problematic if something goes
wrong and there's no easy way to know what firmware version was used and so on.

Split the info messages into smaller pieces and print them as soon as we have
the info available.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: always show bmi chip ids and subdevice ids
Kalle Valo [Wed, 25 Nov 2015 13:38:19 +0000 (15:38 +0200)]
ath10k: always show bmi chip ids and subdevice ids

That way we can split the messages to be printed in different stages of
device initialisation.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: reorganise hardware and firmware info messages
Kalle Valo [Wed, 25 Nov 2015 13:38:12 +0000 (15:38 +0200)]
ath10k: reorganise hardware and firmware info messages

This is to make it easier to split them later and also make room for crc32
checksums.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: fix otp board id error message
Kalle Valo [Wed, 25 Nov 2015 13:38:05 +0000 (15:38 +0200)]
ath10k: fix otp board id error message

We check board id from all board types, not just qca99x0, so the error message
was misleading.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: apply Mesh subtype when Mesh interface created.
Peter Oh [Tue, 24 Nov 2015 17:37:35 +0000 (09:37 -0800)]
ath10k: apply Mesh subtype when Mesh interface created.

QCA988X firmware starting from 10.2.4.70.12-2 has capability to support
Mesh Control Field Present bit in QoS field in native Wi-Fi mode.
Hence apply Mesh subtype according to the WMI service map.

Firmware will allows unicast, broadcast, multicast, and WDS frame
(FromDS = 1 and ToDS = 1) to be received via the interface, once Mesh
subtype is used.

The firmware and this patch together make native Wi-Fi mode comply to
IEEE802.11s Mesh frame in open mode, but the firmware doesn't yet
support secured Mesh mode.

Signed-off-by: Peter Oh <poh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: introduce new subtypes for proxy STA and Mesh
Peter Oh [Tue, 24 Nov 2015 17:37:34 +0000 (09:37 -0800)]
ath10k: introduce new subtypes for proxy STA and Mesh

QCA988X firmware starting from 10.2.4.70.12-2 supports new
vdev subtypes for proxy STA and Mesh, hence add them to be used
as needed.

Signed-off-by: Peter Oh <poh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: update WMI 10.x service map
Peter Oh [Tue, 24 Nov 2015 17:37:33 +0000 (09:37 -0800)]
ath10k: update WMI 10.x service map

Update WMI 10.x service map to sync with firmware 10.2.4.70.12-2
released on 11/11/2015 which is the latest QCA988X firmware as of
11/18/2015.

Signed-off-by: Peter Oh <poh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: Fix write permission on few debugfs files
Mohammed Shafi Shajakhan [Tue, 24 Nov 2015 16:56:37 +0000 (22:26 +0530)]
ath10k: Fix write permission on few debugfs files

Fix write permission for few of the debugfs entries
which support write file operations as well.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: stop abusing GFP_DMA
Felix Fietkau [Tue, 24 Nov 2015 10:36:52 +0000 (11:36 +0100)]
ath10k: stop abusing GFP_DMA

Allocations from the DMA zone were originally added for legacy ISA
stuff, or PCI devices that have specific limitations in their DMA
addressing capabilities. It has no place in ath10k, which can do
full 32-bit DMA.

Fixes memory allocation errors on some platforms.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: Enable AP + STA interface combination support for 10.x
Mohammed Shafi Shajakhan [Sat, 21 Nov 2015 09:54:41 +0000 (15:24 +0530)]
ath10k: Enable AP + STA interface combination support for 10.x

Enable AP + STA interface combination support for 10.x and
this enables Repeater mode testing (with WDS Repeater combinations
as well). Fix indentation as well.

Based on the suggestions from Michal and Yanbo Li,
thanks to them

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agoath10k: fix board data fetch error message
Peter Oh [Fri, 20 Nov 2015 17:33:14 +0000 (09:33 -0800)]
ath10k: fix board data fetch error message

The error message order of board data fetch is board info,
directory, and then file name, hence place print arguments
in the order.

Fixes: 0a51b343abfe ("ath10k: add board 2 API support")
Signed-off-by: Peter Oh <poh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8 years agowireless: airo: re-use mac_pton()
Andy Shevchenko [Fri, 27 Nov 2015 16:29:31 +0000 (18:29 +0200)]
wireless: airo: re-use mac_pton()

mac_pton() converts 6-byte MAC / BSSID to binary format. Change an open coded
variant by the generic one.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcm80211: fix error code in brcmf_pcie_exit_download_state()
Dan Carpenter [Fri, 27 Nov 2015 13:43:27 +0000 (16:43 +0300)]
brcm80211: fix error code in brcmf_pcie_exit_download_state()

The original code returns 1 on failure and 0 on success but the caller
was expecting an error code on failure.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agolibertas: cleanup a variable name
Dan Carpenter [Thu, 26 Nov 2015 12:04:49 +0000 (15:04 +0300)]
libertas: cleanup a variable name

"&card->priv->driver_lock" and "&priv->driver_lock" are the same and
it's nicer to use the shorter one consistently.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agort2x00: type bug in _rt2500usb_register_read()
Dan Carpenter [Thu, 26 Nov 2015 11:55:23 +0000 (14:55 +0300)]
rt2x00: type bug in _rt2500usb_register_read()

This code causes a static checker bug.

drivers/net/wireless/ralink/rt2x00/rt2500usb.c:232 _rt2500usb_register_read()
warn: passing casted pointer 'value' to 'rt2500usb_register_read()' 32 vs 16.

If the low 16 bits were initialized to zero then this code would only be
a problem on big endian systems.  But in this case this is case the low
16 bits are never initialized.  This is called from a function which is
created using a macro:

RT2X00DEBUGFS_OPS(csr, "0x%.8x\n", u32);

We end up copying uninitialized data to the user which is bogus and an
information leak.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: Fix double free on exception at module load.
Hante Meuleman [Wed, 25 Nov 2015 10:32:47 +0000 (11:32 +0100)]
brcmfmac: Fix double free on exception at module load.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: Unify methods to define and map firmware files.
Hante Meuleman [Wed, 25 Nov 2015 10:32:46 +0000 (11:32 +0100)]
brcmfmac: Unify methods to define and map firmware files.

All bus drivers (sdio, usb and pcie) require firmware files which
needs to be downloaded to the device, The definitions and mapping
of device id and revision to firmware and nvram file is done by
each bus driver. This patch creates common functions and defines
to simplify and unify the definition of these firmware and nvram
files and mapping.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: assure net_ratelimit() is declared before use
Arend van Spriel [Wed, 25 Nov 2015 10:32:45 +0000 (11:32 +0100)]
brcmfmac: assure net_ratelimit() is declared before use

Under some kernel configuration we get build issue with implicit
declaration of net_ratelimit() function. Fix this by explicitly
including the file providing the prototype.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: Add beamforming support.
Hante Meuleman [Wed, 25 Nov 2015 10:32:43 +0000 (11:32 +0100)]
brcmfmac: Add beamforming support.

Some devices support beamforming. This patch enables tx beamforming
if supported and reports beamforming capabilities per channel if
supported.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: Cleanup roaming configuration.
Hante Meuleman [Wed, 25 Nov 2015 10:32:42 +0000 (11:32 +0100)]
brcmfmac: Cleanup roaming configuration.

Put all roaming configuration related code in one place and
configure timeout based upon roaming setting.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: Remove redundant parameter action from scan.
Hante Meuleman [Wed, 25 Nov 2015 10:32:41 +0000 (11:32 +0100)]
brcmfmac: Remove redundant parameter action from scan.

ESCAN is always performed using action start scan. No need to
pass this parameter on to different functions.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: no retries on rxglom superframe errors
Franky Lin [Wed, 25 Nov 2015 10:32:40 +0000 (11:32 +0100)]
brcmfmac: no retries on rxglom superframe errors

Aborting the current read attempt on the superframe also removes the
packet from the pipeline. Retries should not be attempted on the next
packet since it would not be a superframe(either a superframe descriptor
or other data packet) and should not be handled by brcmf_sdio_rxglom

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: Change error print on wlan0 existence.
Hante Meuleman [Wed, 25 Nov 2015 10:32:39 +0000 (11:32 +0100)]
brcmfmac: Change error print on wlan0 existence.

During initialization of the device, but also on some other
moments the driver prints an error that the netdev already exists.
This is a result of the way the driver is initializing the
firmware and not really an error. The code is not treating it as
an error either. This error print has resulted in many questions
by users and is confusing and incorrect. This patch changes the
error log into a debug info log.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: Return actual error by fwil.
Hante Meuleman [Wed, 25 Nov 2015 10:32:38 +0000 (11:32 +0100)]
brcmfmac: Return actual error by fwil.

FWIL is always mapping back errors to EBADE. This is not very
conventient when trying to understand problems by reading logs.
Some callers print the error code, but that is quite useless
when the exact error code is not returned. It also makes it
impossible to differentiate based on error code. This patch
changes the return of EBADE into the actual error code.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: Cleanup ssid storage.
Hante Meuleman [Wed, 25 Nov 2015 10:32:37 +0000 (11:32 +0100)]
brcmfmac: Cleanup ssid storage.

SSIDs used for connect and p2p got stored, but never used.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowcn36xx: use new response format for wcn3620 remove_bsskey
Andy Green [Tue, 10 Nov 2015 08:25:55 +0000 (03:25 -0500)]
wcn36xx: use new response format for wcn3620 remove_bsskey

On wcn3620, firmware response to remove_bsskey uses the new, larger
"v2" format

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowcn36xx: use new response format for wcn3620 trigger_ba
Andy Green [Tue, 10 Nov 2015 08:25:54 +0000 (03:25 -0500)]
wcn36xx: use new response format for wcn3620 trigger_ba

On wcn3620, firmware response to trigger_ba uses the new, larger
"v2" format

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowcn36xx: handle new hal response format
Andy Green [Tue, 10 Nov 2015 08:25:53 +0000 (03:25 -0500)]
wcn36xx: handle new hal response format

wcn3620 has a new message structure for the reply to some hal
commands.  This patch adds the struct and helper routine that
uses it if the chip is wcn3620, or falls back to the old
helper routine.

We don't know what to do with the candidate list he sends back,
but we can at least accept and ignore it nicely instead of dying.

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowcn36xx: swallow two wcn3620 IND messages
Andy Green [Tue, 10 Nov 2015 08:25:52 +0000 (03:25 -0500)]
wcn36xx: swallow two wcn3620 IND messages

WCN3620 can asynchronously send two new kinds of indication message,
since we can't handle them just accept them quietly.

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agowcn36xx: introduce WCN36XX_HAL_AVOID_FREQ_RANGE_IND
Andy Green [Tue, 10 Nov 2015 08:25:51 +0000 (03:25 -0500)]
wcn36xx: introduce WCN36XX_HAL_AVOID_FREQ_RANGE_IND

WCN3620 firmware introduces a new async indication, we need to
add it as a known message type so we can accept it

Signed-off-by: Andy Green <andy.green@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoiwlwifi: mvm: remove unnecessary check in iwl_mvm_is_d0i3_supported()
Luca Coelho [Mon, 26 Oct 2015 11:43:12 +0000 (13:43 +0200)]
iwlwifi: mvm: remove unnecessary check in iwl_mvm_is_d0i3_supported()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Add mplut and sync2sco and corunning to debugfs.

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

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

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

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

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

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

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

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

This function updates the pairwise keys as well.

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

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

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

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

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: check FW's response for nvm access write cmd
Matti Gottlieb [Mon, 2 Nov 2015 11:01:54 +0000 (13:01 +0200)]
iwlwifi: mvm: check FW's response for nvm access write cmd

In case of using an external NVM file, the driver sends to the
FW the different nvm sections. In the response of the cmd, the
FW states the status of the writing of the chunk.

Currently the value is not checked by the driver.

Check FW's response for writing the nvm chunk in the NVM_ACCESS_CMD.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: ignore LMAC scan notifications when running UMAC scans
Luca Coelho [Fri, 6 Nov 2015 08:57:11 +0000 (10:57 +0200)]
iwlwifi: mvm: ignore LMAC scan notifications when running UMAC scans

If the firmware sends LMAC scan notifications while a UMAC scan is
running, just WARN and ignore it, otherwise the scanning state gets
messed up.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: Enable MPLUT only on supported hw
Avri Altman [Thu, 29 Oct 2015 14:50:57 +0000 (16:50 +0200)]
iwlwifi: mvm: Enable MPLUT only on supported hw

When there's a bt-wifi contention that requires arbitration,
we use a priority-based mechanism to decide which comm wins.
Over time, use cases become more and more complex, with multiple
concurrent active links with different traffic types and different QoS
requirements, on both WiFi and BT sides.
This, in turn, requires us to elaborate our prioritization mechanism.
However, our legacy products included hw that does not supports this,
so selectively enable this on specific hw - as signaled by the firmware.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: dvm: remove stray debug code
Johannes Berg [Fri, 6 Nov 2015 11:00:36 +0000 (12:00 +0100)]
iwlwifi: dvm: remove stray debug code

This code was needed during initial PAN bringup, but now is
just cruft - remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: Configure fragmented scan for scheduled scan
Avraham Stern [Tue, 10 Nov 2015 12:56:24 +0000 (14:56 +0200)]
iwlwifi: mvm: Configure fragmented scan for scheduled scan

Configure the FW to use fragmented scan when the traffic load is high
or low latency traffic is on. This is useful for scans that are
managed by the FW (e.g. scheduled scan).

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: trans: make various conversion macros inlines
Johannes Berg [Thu, 12 Nov 2015 15:16:01 +0000 (16:16 +0100)]
iwlwifi: trans: make various conversion macros inlines

Make the various conversion functions typesafe, so we don't
accidentally try to call them with the wrong pointers and
cast them to something that will crash.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: dvm: remove Kconfig default
Johannes Berg [Fri, 13 Nov 2015 09:57:56 +0000 (10:57 +0100)]
iwlwifi: dvm: remove Kconfig default

The split of iwlwifi into DVM and MVM was a long time ago now,
so we can remove the "default IWLWIFI" that we had to keep all
existing .config files with working defaults during the split.
This is no longer necessary, practically nobody should now be
upgrading a .config that's older than the split.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: add support for 12K Receive Buffers
Emmanuel Grumbach [Tue, 10 Nov 2015 09:57:41 +0000 (11:57 +0200)]
iwlwifi: add support for 12K Receive Buffers

802.11ac allows A-MSDU that can be up to 12KB long. Since
an entire A-MSDU needs to fit into one single Receive
Buffer (RB), add support for big RBs.
Since this adds lots of pressure to the memory manager and
significantly increase the true_size of the RX buffers,
don't enable this by default.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: nvm: fix up phy section when reading it
Johannes Berg [Thu, 17 Sep 2015 13:54:47 +0000 (15:54 +0200)]
iwlwifi: nvm: fix up phy section when reading it

This is a workaround to an OTP bug. In Series 8000 1x1, the OTP
0xA052 defines 2x2 antenna configuration. This workaround overrides
the decision based on HW id and on MIMO disabled bit which is
correct in the OTP and set to disabled. This fixes the previous
workaround "force 1x1 antenna in Series 8000".

Signed-off-by: Moshe Harel <moshe.harel@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoMerge remote-tracking branch 'iwlwifi-fixes/master' into next
Emmanuel Grumbach [Thu, 26 Nov 2015 14:38:24 +0000 (16:38 +0200)]
Merge remote-tracking branch 'iwlwifi-fixes/master' into next

8 years agolibertas: check for NULL before use
sudip [Tue, 24 Nov 2015 08:21:38 +0000 (13:51 +0530)]
libertas: check for NULL before use

If kzalloc fails it will return NULL. Lets check for NULL first before
using the pointer.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: btcoexist: re-use %*ph specifier to hexdump
Andy Shevchenko [Wed, 18 Nov 2015 14:09:18 +0000 (16:09 +0200)]
rtlwifi: btcoexist: re-use %*ph specifier to hexdump

Instead of printing each byte from the given buffer the code is converted to
use %*ph specifier.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: Delete unnecessary checks before the function call "kfree_skb"
Markus Elfring [Mon, 16 Nov 2015 12:12:25 +0000 (13:12 +0100)]
rtlwifi: Delete unnecessary checks before the function call "kfree_skb"

The kfree_skb() function tests whether its argument is NULL and then
returns immediately. Thus the test around the calls is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: constify brcmf_bus_ops structures
Julia Lawall [Sat, 14 Nov 2015 16:22:07 +0000 (17:22 +0100)]
brcmfmac: constify brcmf_bus_ops structures

The brcmf_bus_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k_htc: check for underflow in ath9k_htc_rx_msg()
Dan Carpenter [Fri, 6 Nov 2015 10:01:20 +0000 (13:01 +0300)]
ath9k_htc: check for underflow in ath9k_htc_rx_msg()

We check for overflow here, but we don't check for underflow so it
causes a static checker warning.

Fixes: fb9987d0f748 ('ath9k_htc: Support for AR9271 chipset.')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcm80211: Delete an unnecessary check before the function call "release_firmware"
Markus Elfring [Fri, 6 Nov 2015 07:48:23 +0000 (08:48 +0100)]
brcm80211: Delete an unnecessary check before the function call "release_firmware"

The release_firmware() function tests whether its argument is NULL and then
returns 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: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: Add wowl wake indication report.
Hante Meuleman [Thu, 29 Oct 2015 19:33:19 +0000 (20:33 +0100)]
brcmfmac: Add wowl wake indication report.

On wakeup of the system (resume) a wowl wakeup indication report
can be sent to cfg80211. This patch adds support for this. The
report specifies if the device was responsible for the wakeup
and if so, will specify the exact reason.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>