cascardo/linux.git
8 years agoMerge tag 'iwlwifi-next-for-kalle-2015-06-03' of https://git.kernel.org/pub/scm/linux...
Kalle Valo [Wed, 3 Jun 2015 09:15:51 +0000 (12:15 +0300)]
Merge tag 'iwlwifi-next-for-kalle-2015-06-03' of https://git./linux/kernel/git/iwlwifi/iwlwifi-next

* a few fixes (re-enablement of interrupts for certain new
  platforms that have special power states)
* Rework completely the RBD allocation model towards new
  multi RX hardware.
* cleanups
* scan reworks continuation (Luca)

8 years agoiwlwifi: mvm: advertise only HW-supported ciphers
Johannes Berg [Wed, 20 May 2015 14:51:28 +0000 (16:51 +0200)]
iwlwifi: mvm: advertise only HW-supported ciphers

After the new ciphers CCMP-256 and GCMP-128/256 were implemented,
wpa_supplicant could start negotiating them and use the software
implementation. This, however, breaks D3 behaviour in the driver
since it means that WoWLAN will not be possible.

To avoid breaking that feature, advertise only ciphers that the
hardware supports.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: bump the iwlmvm API number to 15
Emmanuel Grumbach [Wed, 3 Jun 2015 06:54:18 +0000 (09:54 +0300)]
iwlwifi: bump the iwlmvm API number to 15

The driver is now ready to handle the -15.ucode.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: Add DC2DC_CONFIG_CMD (0x83) cmd & TLV
Matti Gottlieb [Sun, 31 May 2015 06:18:30 +0000 (09:18 +0300)]
iwlwifi: mvm: Add DC2DC_CONFIG_CMD (0x83) cmd & TLV

Add DC2DC_CONFIG_CMD (0x83) cmd.

Add IWL_UCODE_TLV_CAPA_DC2DC_CONFIG_SUPPORT tlv.

The command allows the driver get & set the DCDC's frequency tune.
(freq_tune is the divider that is used to calculate the actual DCDC's
clock rate)
The command always returns the current/updated frequency tune values of
the DCDC.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: Remove old scan commands
Matti Gottlieb [Sun, 31 May 2015 08:29:52 +0000 (11:29 +0300)]
iwlwifi: mvm: Remove old scan commands

The firmwares that used these commands is not supported
anymore. Remove them.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: prepare for higher API/CAPA bits
Johannes Berg [Mon, 1 Jun 2015 15:11:11 +0000 (17:11 +0200)]
iwlwifi: prepare for higher API/CAPA bits

Currently, loading the firmware fails when it has higher API or CAPA
bits than the driver supports. That's an issue with integration.

At the same time, actually using api[0] and capa[0] will become
confusing when we also have api[1] and capa[1], and it's almost
certain that we'll mix up the bits and use the bits for api[1] with
api[0] by accident.

Avoid all this by translating the API/CAPA bits to the regular kernel
test_bit() format, and also providing wrapper functions. Also use the
__bitwise__ facility of sparse to check that we're testing the right
one.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: simplify iwl_mvm_stop_roc()
Johannes Berg [Mon, 1 Jun 2015 21:38:23 +0000 (23:38 +0200)]
iwlwifi: mvm: simplify iwl_mvm_stop_roc()

As pointed out by smatch, there's no need for a loop that always
immediately terminates. Use an if statement instead and while at
it clean up the mvmvif initialization.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: dvm: enable IEEE80211_HW_SUPPORT_FAST_XMIT
Johannes Berg [Fri, 17 Apr 2015 13:50:43 +0000 (15:50 +0200)]
iwlwifi: dvm: enable IEEE80211_HW_SUPPORT_FAST_XMIT

Since the firmware is responsible for duration calculation, the
driver can easily support fast-xmit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: enable IEEE80211_HW_SUPPORT_FAST_XMIT
Johannes Berg [Fri, 17 Apr 2015 13:50:43 +0000 (15:50 +0200)]
iwlwifi: mvm: enable IEEE80211_HW_SUPPORT_FAST_XMIT

Since the firmware is responsible for duration calculation, the
driver can easily support fast-xmit.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: New RBD allocation model
Sara Sharon [Tue, 28 Apr 2015 09:56:54 +0000 (12:56 +0300)]
iwlwifi: pcie: New RBD allocation model

As a preperation for multiple RX queues change the RBD
allocation model.

The new model includes a background allocator. The allocator is
called by the interrupt handler when there are two released
buffers by the queue, and the allocator starts allocating eight
pages per request.
When the queue has released 8 pages it tries claiming the
request. If the pages are not ready - it keeps claiming.
This new model should make sure that RBDs are always available
across the multiple queues.

The RBDs are transferred between the allocator and the queue.
The queue moves the free RBDs upon freeing them to the allocator.
The allocator moves them back to the queue's possession when the
request is claimed.
The allocator has an initial pool to make sure there are always RBDs
available for the request completion.
Release of the buffers at exit is done per pools - the allocator
frees its own initial pool and the queue frees its own pool.

Existing code refactor -
-Queue's initial pool is the size of the queue only as the allocation
of the new buffers no longer uses this pool.
-Removal of replenish background work, and replenish calls in the
interrupt handler and restock().
-The replenish() and the rxq used_list are used only during
initialization.
-Moved page allocation to a new function for code reuse.

New code -
Allocator code - new structure and functions.
Interrupt handler uses the allocator functions for replenishing buffers.
Reuse of the restock() method.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: re-enable interrupts on resume
Eliad Peller [Thu, 28 May 2015 13:50:12 +0000 (16:50 +0300)]
iwlwifi: pcie: re-enable interrupts on resume

On resume, all the interrupts are masked (CSR_INT_MASK is 0),
and ict is disabled.

Re-configure them both.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: don't use EBS for P2P find
David Spinadel [Tue, 26 May 2015 07:32:19 +0000 (10:32 +0300)]
iwlwifi: mvm: don't use EBS for P2P find

Don't use EBS for P2P find to make sure we find all GOs in
our only attempt.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add inactive state to ebs status
David Spinadel [Wed, 20 May 2015 08:56:59 +0000 (11:56 +0300)]
iwlwifi: mvm: add inactive state to ebs status

Currently EBS status in scan complete notifications is set to
success if EBS wasn't activated. FW will add a special return
value for cases when EBS wasn't activated and we add a print
of this status.

This change is needed for debug only, no behavior changes.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: Control access to the NIC's PM registers via iwl_cfg
Avri Altman [Mon, 11 May 2015 08:04:34 +0000 (11:04 +0300)]
iwlwifi: pcie: Control access to the NIC's PM registers via iwl_cfg

Allow a cleaner way to access those hw-dependent registers,
instead of using the product family type etc.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: wrt: add mipi type to debug types
Liad Kaufman [Tue, 19 May 2015 10:47:03 +0000 (13:47 +0300)]
iwlwifi: wrt: add mipi type to debug types

This adds the MIPI mode type to the types declared supported
by the driver. Without this patch, when using MIPI mode and
looking at the logs the user would see the debug destination
"UNKNOWN".

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: rs: pass rate directly to column checks
Eyal Shapira [Wed, 27 May 2015 19:00:03 +0000 (22:00 +0300)]
iwlwifi: mvm: rs: pass rate directly to column checks

A minor refactoring for following patches.
This enables the reuse of the checks functions.

type=cleanup

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoray_cs: Change 1 to true for bool type variable.
Shailendra Verma [Wed, 27 May 2015 00:55:57 +0000 (06:25 +0530)]
ray_cs: Change 1 to true for bool type variable.

The variable translate is bool type. So assigning true instead of 1.

Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: device dump support via devcoredump framework
Amitkumar Karwar [Tue, 26 May 2015 13:34:32 +0000 (06:34 -0700)]
mwifiex: device dump support via devcoredump framework

Currently device dump generated in the driver is retrieved
using ethtool set/get dump commands. We will get rid of
ethtool approach and use devcoredump framework.

Device dump can be trigger by
cat /debugfs/mwifiex/mlanX/device_dump
and when the dump operation is completed, data can be read by
cat /sys/class/devcoredump/devcdX/data

We have prepared following script to split device dump data
into multiple files.

 [root]# cat mwifiex_split_dump_data.sh
 #!/bin/bash
 # usage: ./mwifiex_split_dump_data.sh dump_data

 fw_dump_data=$1

 mem_type="driverinfo ITCM DTCM SQRAM APU CIU ICU MAC"

 for name in ${mem_type[@]}
 do
     sed -n "/Start dump $name/,/End dump/p" $fw_dump_data  > tmp.$name.log
     if [ ! -s tmp.$name.log ]
     then
         rm -rf tmp.$name.log
     else
         #Remove the describle info "Start dump" and "End dump"
         sed '1d' tmp.$name.log | sed '$d' > /data/$name.log
         if [ -s /data/$name.log ]
         then
             echo "generate /data/$name.log"
         else
             sed '1d' tmp.$name.log | sed '$d' > /var/$name.log
             echo "generate /var/$name.log"
         fi
         rm -rf tmp.$name.log
     fi
 done

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: use generic name 'device dump'
Amitkumar Karwar [Tue, 26 May 2015 13:34:31 +0000 (06:34 -0700)]
mwifiex: use generic name 'device dump'

Currently we are dumping driver information also inside
firmware dump API. We will call it as device dump and
dump driver and firmware data separately.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: minor changes in debug messages
Amitkumar Karwar [Tue, 26 May 2015 13:34:30 +0000 (06:34 -0700)]
mwifiex: minor changes in debug messages

Small letters are used in debug messages to match coding style
at other places.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: dump driver information for PCIe interface
Amitkumar Karwar [Tue, 26 May 2015 13:34:29 +0000 (06:34 -0700)]
mwifiex: dump driver information for PCIe interface

Currently we are dumping driver information only for SDIO
interface. This patch adds missing mwifiex_dump_drv_info()
call for PCIe interface.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: fix a possible double free issue
Amitkumar Karwar [Tue, 26 May 2015 13:34:28 +0000 (06:34 -0700)]
mwifiex: fix a possible double free issue

As drv_info_dump pointer doesn't get reset, we may end up
freeing the allocated memory twice.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: fix SDIO firmware dump problem
Amitkumar Karwar [Tue, 26 May 2015 13:34:27 +0000 (06:34 -0700)]
mwifiex: fix SDIO firmware dump problem

It's been observed that firmware doesn't go back to normal
state when all firmware memories are dumped. As a result,
further commands are blocked. This happens due to missing
driver change of writing READ DONE to control register for
SDIO interface.

This patch adds a missing change to fix the problem.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoiwlwifi: mvm: clean interfaces on drv_stop
Arik Nemtsov [Wed, 4 Mar 2015 11:16:03 +0000 (13:16 +0200)]
iwlwifi: mvm: clean interfaces on drv_stop

If a HW recovery was started but not completed since all interfaces went
down, make sure to cleanup all interfaces before clearing the HW_RESTART
flag.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: implement the BlockAck related debug triggers
Emmanuel Grumbach [Wed, 15 Apr 2015 09:43:46 +0000 (12:43 +0300)]
iwlwifi: mvm: implement the BlockAck related debug triggers

BlockAck sessions can have events that are interesting to
debug. When we send or receive a BAR, it is may indicate
that something bad is happening. Even more so when mac80211
tells us that a frame timed out in the reodering buffer.
Add a few triggers for BlockAck session debugging.
Allow per-TID debugging.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoMerge tag 'mac80211-next-for-davem-2015-05-06' into iwlwifi-next
Emmanuel Grumbach [Thu, 28 May 2015 10:36:49 +0000 (13:36 +0300)]
Merge tag 'mac80211-next-for-davem-2015-05-06' into iwlwifi-next

Lots of updates for net-next for this cycle. As usual, we have
a lot of small fixes and cleanups, the bigger items are:
 * proper mac80211 rate control locking, to fix some random crashes
   (this required changing other locking as well)
 * mac80211 "fast-xmit", a mechanism to reduce, in most cases, the
   amount of code we execute while going from ndo_start_xmit() to
   the driver
 * this also clears the way for properly supporting S/G and checksum
   and segmentation offloads

8 years agoiwlwifi: mvm: treat scan races also on UMAC scans
Luciano Coelho [Thu, 7 May 2015 14:21:09 +0000 (17:21 +0300)]
iwlwifi: mvm: treat scan races also on UMAC scans

For UMAC, we were not treating a race condition that happens in the
scan flows, because it was not using the same state flags.  Now that
UMAC and LMAC scans use the same state flags, we can also handle the
race conditions for UMAC.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: make UMAC scans use the stopping scan status
Luciano Coelho [Thu, 7 May 2015 14:05:30 +0000 (17:05 +0300)]
iwlwifi: mvm: make UMAC scans use the stopping scan status

UMAC scans now use the general scan status for almost everything, the
only part missing was in the scan complete notifications.  Change it
to use the stopping flags instead of clearing the flags when the stop
comes from above and clean the handler function a bit.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: combine regular and sched scan stop functions
Luciano Coelho [Thu, 7 May 2015 13:00:26 +0000 (16:00 +0300)]
iwlwifi: mvm: combine regular and sched scan stop functions

The regular and scheduled scan functions are very similar, so they can
be combined into one.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: tracing: add rx cmd header fields
Eliad Peller [Mon, 11 May 2015 12:51:22 +0000 (15:51 +0300)]
iwlwifi: tracing: add rx cmd header fields

Having explicit rx cmd header fields is useful, as it can
be used for event filtering (e.g. saving only debug logs,
rather than the whole data)

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: Remove redundant check for family type
Avri Altman [Thu, 14 May 2015 04:55:32 +0000 (07:55 +0300)]
iwlwifi: pcie: Remove redundant check for family type

This check for family type is redundant as the if clause above
checks a family-dependent Boolean (which is not set for family 8000 anyway).

Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: combine UMAC and LMAC scan_stop functions
Luciano Coelho [Thu, 7 May 2015 12:23:19 +0000 (15:23 +0300)]
iwlwifi: mvm: combine UMAC and LMAC scan_stop functions

The UMAC and LMAC scan_stop functions are now nearly identical, so
they can be combined into a single function instead.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: remove code that stops multiple UMAC scans of a type
Luciano Coelho [Thu, 7 May 2015 11:41:44 +0000 (14:41 +0300)]
iwlwifi: mvm: remove code that stops multiple UMAC scans of a type

We can only have one scan per type at the same time, so the code that
tries to stop several scans of a type is unnecessary.  Remove that to
reduce code complexity.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: refactor UMAC scan UID handling
Luciano Coelho [Thu, 7 May 2015 08:13:24 +0000 (11:13 +0300)]
iwlwifi: mvm: refactor UMAC scan UID handling

We can only have one scan of each type running at the same time, so we
can remove one attribute in the UID information we save.  We had array
index, UID and type, but only UID (== array_index) and type are
necessary.  Refactor the code to use this simplified array.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add support for 8 level scan priority API
Avraham Stern [Tue, 12 May 2015 09:19:48 +0000 (12:19 +0300)]
iwlwifi: mvm: add support for 8 level scan priority API

Add support for scan priority API with 8 levels instead of the
existing 3 levels. This API is needed to define the priority of
new ooc activities, e.g. gscan.
Add a TLV flag to indicate if the new API is supported so that
devices that does not support the new API will continue to use
the old one.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: rename some LMAC-specific scan functions
Luciano Coelho [Wed, 6 May 2015 13:03:39 +0000 (16:03 +0300)]
iwlwifi: mvm: rename some LMAC-specific scan functions

Some LMAC specific functions had too generic names
(i.e. *_scan_offload_*) and were hard to distinguish from functions
that are really generic.  Rename these functions to *_lmac_scan_* in
to make it more consistent and easier to read.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: rename umac scan stop function
Luciano Coelho [Tue, 5 May 2015 08:21:34 +0000 (11:21 +0300)]
iwlwifi: mvm: rename umac scan stop function

For consistency with the LMAC functions, rename the UMAC scan stop
function to iwl_mvm_umac_scan_stop().  Additionally, move things
around a bit to avoid an unnecessary forward declaration.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: combine part of the scan stop flows
Luciano Coelho [Tue, 5 May 2015 07:05:42 +0000 (10:05 +0300)]
iwlwifi: mvm: combine part of the scan stop flows

For UMAC scans, we were simply jumping into another function when scan
stop functions were called, while for LMAC scans, the flow continued.
To make the flows cleaner and more balanced, combine the UMAC part
into the main stop functions.  This also makes us take one step closer
into combining the state flags for both APIs.

Note that some STOPPING flags will be dangling in UMAC scans, but it
doesn't matter because they are not used in UMAC yet (and this will be
fixed in subsequent patches).

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: don't stop regular scans when going out of idle state
Luciano Coelho [Tue, 12 May 2015 06:30:36 +0000 (09:30 +0300)]
iwlwifi: mvm: don't stop regular scans when going out of idle state

It is not necessary to stop regular scans when going out of idle
state.  Previously, we were doing so for LMAC scans because the
iwl_mvm_scan_offload_stop() function was stopping both kinds of scans.
Now that we have more granularity, we can skip it.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: reorganize scan stopping functions
Luciano Coelho [Tue, 21 Apr 2015 10:34:10 +0000 (13:34 +0300)]
iwlwifi: mvm: reorganize scan stopping functions

The iwl_mvm_scan_offload_stop() function is used to stop LMAC regular
scan, stop LMAC scheduled scan and stop UMAC scheduled scans (but not
UMAC regular scans), making it very difficult to read.

Reorganize the scan stopping functions by creating separate functions
to stop regular and scheduled scans, separating the LMAC stopping part
of the code from the rest and renaming the offload_stop function to
iwl_mvm_lmac_scan_stop().

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: BT Coex - fix shared antenna check with new API
Emmanuel Grumbach [Sat, 16 May 2015 19:47:56 +0000 (22:47 +0300)]
iwlwifi: mvm: BT Coex - fix shared antenna check with new API

The commit below fixed this for the old firmware API only.
Since the new firmware API hasn't been released yet, this
doesn't fix anything on currently existing firmwares.
This completes:

commit afcee962b09842d0f4191beb4a2d08251b4c7705
Author: Eyal Shapira <eyal@wizery.com>
Date:   Mon Feb 9 15:18:17 2015 +0200

    iwlwifi: mvm: fix BT coex shared antenna activity check

type=bugfix
bug=not-tracked
fixes=unknown

Reviewed-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: make iwl_mvm_config_sched_scan_profiles() static
Luciano Coelho [Tue, 5 May 2015 08:32:29 +0000 (11:32 +0300)]
iwlwifi: mvm: make iwl_mvm_config_sched_scan_profiles() static

The iwl_mvm_config_sched_scan_profiles() function is only used in
scan.c, so remove the declaration from mvm.h and make it static.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: fix the net-detect SSIDs report order
Luciano Coelho [Wed, 6 May 2015 07:45:42 +0000 (10:45 +0300)]
iwlwifi: mvm: fix the net-detect SSIDs report order

After the scan refactor, the order of the SSIDs passed to the firmware
in all scans (including net-detect) are inverted.  This was causing
the reporting code to use the wrong SSIDs.  To fix this, invert the
array index when accessing the saved match SSIDs to report the
wake-up.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: add UMAC scan iteration complete notification
Avraham Stern [Mon, 23 Mar 2015 13:09:27 +0000 (15:09 +0200)]
iwlwifi: mvm: add UMAC scan iteration complete notification

Add UMAC scan iteration complete notification. This notification can
be enabled by setting scan_iter_notif_enabled through debugfs.
Upon receiving this notification, print the list of channels that
have been scanned in this iteration. This is useful for debugging.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: print scanned channel list on scan iteration complete notification
Avraham Stern [Tue, 31 Mar 2015 13:22:33 +0000 (16:22 +0300)]
iwlwifi: mvm: print scanned channel list on scan iteration complete notification

When receiving scan iteration complete notification, print a list of
the channels that have been scanned in this iteration.
This is useful for debugging.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: BT Coex - allocate a short command on the stack
Emmanuel Grumbach [Mon, 11 May 2015 06:05:25 +0000 (09:05 +0300)]
iwlwifi: mvm: BT Coex - allocate a short command on the stack

The BT_CONFIG command used to be very long, hence it was
allocated on the heap in the previous API. In the new API,
this command is much smaller, and can now safely be
allocated on the stack.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: BT Coex - remove useless code
Emmanuel Grumbach [Sun, 10 May 2015 15:50:37 +0000 (18:50 +0300)]
iwlwifi: mvm: BT Coex - remove useless code

Since we don't need to configure the Ack / CTS kill mask
anymore in the new API, we don't need to iterate all the
interfaces upon rssi event on one of the interfaces.
Remove that code.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: remove the UMAC specific scan types
Luciano Coelho [Thu, 7 May 2015 07:10:57 +0000 (10:10 +0300)]
iwlwifi: mvm: remove the UMAC specific scan types

There is no need to have separate definitions for the UMAC scan types,
since they are the same as the LMAC types.  Remove UMAC scan types and
use the generic ones instead.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: Configure agg. queue before assigning it to STA
Andrei Otcheretianski [Tue, 5 May 2015 06:28:16 +0000 (09:28 +0300)]
iwlwifi: mvm: Configure agg. queue before assigning it to STA

In order to imeplement the extended VI session feature for Miracast, the FW
requires to detect the VI queue. The detection of the VI queue is done when
it is assigned to a STA with ADD_STA command, so by this time the FW expects
the queue to be already configured (mapped to VI AC and aggregation enabled).
Previously, the queue configuration was done after STA modificaton which
broke the extended VI session feature and resulted in higher latencies.
Fix this by calling iwl_mvm_enable_agg_txq before station modification.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: handle device start failure correctly
Johannes Berg [Thu, 7 May 2015 12:47:50 +0000 (14:47 +0200)]
iwlwifi: mvm: handle device start failure correctly

If the device fails to start correctly prior to loading the
regular runtime firmware (after having run the INIT firmware),
treat that error correctly by actually checking the return
value of _iwl_trans_start_hw() and stopping the device again
before returning an error.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: advertise randomised netdetect MAC address
Johannes Berg [Wed, 6 May 2015 12:56:51 +0000 (14:56 +0200)]
iwlwifi: mvm: advertise randomised netdetect MAC address

According to the nl80211 documentation, we can neither advertise
scheduled scan nor netdetect address randomisation. However, all
the products that currently require this don't have a need for
the full randomisation.

Therefore, advertise the feature anyway which results in host-
based randomisation, done whenever the system suspends. This is
sufficient for the platforms currently requiring this feature.

If we ever extend this in the future to do full randomisation in
the firmware, then certainly this will still be sufficient for
the current requirements, so it doesn't make a lot of sense to
split the feature bits.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: update thermal throttling values for 8000 devices
Ido Yariv [Tue, 5 May 2015 03:01:46 +0000 (23:01 -0400)]
iwlwifi: update thermal throttling values for 8000 devices

8000 devices have different thermal throttling values from previous
generations.

Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: 8000: fallback to default NVM file
Eran Harary [Sun, 19 Apr 2015 07:05:18 +0000 (10:05 +0300)]
iwlwifi: 8000: fallback to default NVM file

Set a default NVM in case the userspace specifies a file
that doesn't match the hardware version. This allows not
to change the boot scripts when someone replaces the device
with a newer hardware step.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: Add debugfs entry for Tx power limit
Matti Gottlieb [Mon, 4 May 2015 06:34:37 +0000 (09:34 +0300)]
iwlwifi: mvm: Add debugfs entry for Tx power limit

Add debugfs entry for showing the different Tx power restrictions that are
caused due to various reasons.

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: simplify return value
Emmanuel Grumbach [Tue, 28 Apr 2015 18:32:47 +0000 (21:32 +0300)]
iwlwifi: pcie: simplify return value

This was spot by Coccinelle.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: bump API to 14
Emmanuel Grumbach [Tue, 26 May 2015 08:59:53 +0000 (11:59 +0300)]
iwlwifi: bump API to 14

The iwlmvm driver is now able to handle -14.ucode.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: refactor common transport alloc/init code
Johannes Berg [Fri, 22 May 2015 09:28:58 +0000 (11:28 +0200)]
iwlwifi: refactor common transport alloc/init code

The transport modules all need to allocate memory and set up
certain values. Refactor that code into a new common function
to share it and to simplify the error handling.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: mvm: small fix in a comment about UMAC scan schedules
Luciano Coelho [Mon, 25 May 2015 06:36:53 +0000 (09:36 +0300)]
iwlwifi: mvm: small fix in a comment about UMAC scan schedules

The UMAC API supports multiple scan schedules, but now we use only a
single one.  Change the comment to make this clear and avoid
confusion.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: Remove use of the deprecacted PTR_RET
Nicholas Krause [Sun, 24 May 2015 00:53:21 +0000 (20:53 -0400)]
iwlwifi: Remove use of the deprecacted PTR_RET

This removes the use of the two deprecated calls to the
macro PTR_RET in iwl_mvm_get_regdomain and replaces them
both to PTR_ERR_OR_ZERO.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
[Commit message editing]
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agobrcmfmac: allow NVRAM values to contain spaces
Rafał Miłecki [Sat, 23 May 2015 07:15:33 +0000 (09:15 +0200)]
brcmfmac: allow NVRAM values to contain spaces

Platform NVRAMs often contain values with spaces. Even if right now most
firmware-supported entries are simple values, we shouldn't reject these
with spaces. It was semi-confirmed by Broadcom in the early patch adding
support for platform NVRAMs.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: treat \0 as end of comment when parsing NVRAM
Rafał Miłecki [Wed, 20 May 2015 11:59:54 +0000 (13:59 +0200)]
brcmfmac: treat \0 as end of comment when parsing NVRAM

This fixes brcmfmac dealing with NVRAM coming from platform e.g. from a
flash MTD partition. In such cases entries are separated by \0 instead
of \n which caused ignoring whole content after the first "comment".
While platform NVRAM doesn't usually contain comments, we switch to
COMMENT state after e.g. finding an unexpected char in key name.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: simplify check finding NVRAM v1 device path
Rafał Miłecki [Wed, 20 May 2015 09:01:08 +0000 (11:01 +0200)]
brcmfmac: simplify check finding NVRAM v1 device path

With a simple use of snprintf and small buffer we can compare NVRAM
entry value with a full string. This way we avoid checking random chars
at magic offsets.
Tested on BCM43602 with NVRAM hacked to use v1 format.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: simplify check stripping v2 NVRAM
Rafał Miłecki [Wed, 20 May 2015 07:34:21 +0000 (09:34 +0200)]
brcmfmac: simplify check stripping v2 NVRAM

Comparing NVRAM entry with a full filtering string is simpler than
comparing it with a short prefix and then checking random chars at magic
offsets. The cost of snprintf relatively low, we execute it just once.
Tested on BCM43602 with NVRAM hacked to use V2 format.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoadd mt7601u driver
Jakub Kicinski [Tue, 26 May 2015 09:16:00 +0000 (11:16 +0200)]
add mt7601u driver

Add support for the simplest of MediaTek Wi-Fi devices - MT7601U.
It is a single stream bgn chip with no bells or whistles.
This driver is partially based on Felix's mt76 but IMHO it doesn't
make sense to merge the two right now because MT7601U is a design
somewhere between old Ralink devices and new Mediatek chips.  There
wouldn't be all that much code sharing with the devices mt76 supports.
Situation may obviously change when someone decides to extend m76 with
support for the more recent USB dongles.

The driver supports only station mode.  I'm hoping to add AP support
when time allows.

This driver sat on GitHub for quite a while and got some testing there:
http://github.com/kuba-moo/mt7601u

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: fix invalid access to struct acpi_device fields
Arend van Spriel [Wed, 27 May 2015 17:31:41 +0000 (19:31 +0200)]
brcmfmac: fix invalid access to struct acpi_device fields

The fields of struct acpi_device are only known when CONFIG_ACPI is
defined. Fix this by using a helper function. This will resolve the
issue found in linux-next:

 ../brcmfmac/bcmsdh.c: In function 'brcmf_ops_sdio_probe':
 ../brcmfmac/bcmsdh.c:1139:7: error: dereferencing pointer to incomplete type
   adev->flags.power_manageable = 0;
       ^

Fixes: f0992ace680c ("brcmfmac: prohibit ACPI power management ...")
Cc: Fu, Zhonghui <zhonghui.fu@linux.intel.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoiwlwifi: mvm: fix ROC reference accounting
Eliad Peller [Sun, 19 Apr 2015 08:41:04 +0000 (11:41 +0300)]
iwlwifi: mvm: fix ROC reference accounting

commit b112889c5af8124 ("iwlwifi: mvm: add Aux ROC request/response flow")
added aux ROC flow in addition to the existing ROC flow. While doing
it, it moved the ROC reference release to a common work item, which
is being called for both the ROC and aux ROC flows.

This resulted in invalid reference accounting, as no reference was
taken in case of aux ROC, while a reference was released on completion.

Fix it by adding a reference for the aux ROC as well, and release
only the relevant references on completion (according to the set bits).

While at it, convert cancel_work_sync() to flush_work(), in order
to make sure the references are being cleaned properly.

Fixes: b112889c5af8 ("iwlwifi: mvm: add Aux ROC request/response flow")
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoiwlwifi: pcie: don't call set_pwr functions for family 8000
Luciano Coelho [Mon, 27 Apr 2015 18:38:10 +0000 (21:38 +0300)]
iwlwifi: pcie: don't call set_pwr functions for family 8000

We should not call the iwl_pcie_set_pwr() functions in the
suspend/resume flows for family 8000, because the register used is
locked in devices from this family.  Doing this causes an NMI
protection error (RT_NMI_INTERRUPT_PREG_PROTECTION).

To fix this, skip those calls if the device family is
IWL_DEVICE_FAMILY_8000.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
8 years agoMerge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next
Emmanuel Grumbach [Tue, 26 May 2015 16:20:34 +0000 (19:20 +0300)]
Merge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next

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

8 years agobrcmfmac: add support for dma indices feature
Franky Lin [Wed, 20 May 2015 12:09:51 +0000 (14:09 +0200)]
brcmfmac: add support for dma indices feature

PCIe full dongle firmware can support a dma indices feature with which
firmware can update/fetch the read/write indices of message buffer
rings on both host to dongle and dongle to host directions. The support is
announced by firmware through shared flags.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@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: remove dummy cache flush/invalidate function
Franky Lin [Wed, 20 May 2015 12:09:50 +0000 (14:09 +0200)]
brcmfmac: remove dummy cache flush/invalidate function

brcmf_dma_flush and brcmf_dma_invalidate_cache are not necessary and
have never been implemented.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@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: remove pci shared structure rev4 support
Franky Lin [Wed, 20 May 2015 12:09:49 +0000 (14:09 +0200)]
brcmfmac: remove pci shared structure rev4 support

All pcie full dongle chips supported by fmac are using rev 5+ shared
structure. This patch removes the rev4 related code.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@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: Improve throughput by scheduling msbug flow worker.
Hante Meuleman [Wed, 20 May 2015 12:09:48 +0000 (14:09 +0200)]
brcmfmac: Improve throughput by scheduling msbug flow worker.

The tx flow worker in msgbuf gets scheduled at tx till a certain
threshold has been reached. Then the tx completes will take over
the scheduling. When amsdu and ampdu is used the frames are
transferred wireless in a very bulky fashion, in combination
with this scheduling algorithm and buffer limiters in the stack
this can result in limited throughput. This change causes the
flow worker to be scheduled more frequently from tx.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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: allow device tree node without 'interrupts' property
Arend van Spriel [Wed, 20 May 2015 12:09:47 +0000 (14:09 +0200)]
brcmfmac: allow device tree node without 'interrupts' property

As described in the device tree bindings for 'brcm,bcm4329-fmac'
nodes, the interrupts property is optional. So adding a check
for the presence of this property before attempting to parse
and map the interrupt. If not present or parsing fails return
and fallback to in-band sdio interrupt.

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 agomwifiex: reduce severity of debug messages for mgmt rx
Avinash Patil [Wed, 20 May 2015 11:06:06 +0000 (16:36 +0530)]
mwifiex: reduce severity of debug messages for mgmt rx

This would ensure dmesg logs are not spammed with "unknown mgmt frame
subtype" messages.

Reviewed-by: James Cameron <quozl@laptop.org>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: fix typos in Kconfig
Kevin Lo [Tue, 19 May 2015 02:18:34 +0000 (10:18 +0800)]
rtlwifi: fix typos in Kconfig

This patch fixes typos in drivers/net/wirless/rtlwifi/Kconfig.

Signed-off-by: Kevin Lo <kevlo@kevlo.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobcma: add module_bcma_driver()
Hauke Mehrtens [Thu, 14 May 2015 21:05:49 +0000 (23:05 +0200)]
bcma: add module_bcma_driver()

This makes it possible to save some lines of code in drivers with an
simple bcma driver registration.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k: split ar5008_hw_spur_mitigate and reuse common code in ar9002_hw_spur_mitigate.
Oleksij Rempel [Sun, 17 May 2015 19:49:19 +0000 (21:49 +0200)]
ath9k: split ar5008_hw_spur_mitigate and reuse common code in ar9002_hw_spur_mitigate.

[ar5008 and ar9002]_hw_spur_mitigate have big portion of identical code.
This patch will move common part of ar5008_hw_spur_mitigate to
ar5008_hw_cmn_spur_mitigate and reuse it in ar9002_hw_spur_mitigate.

As noticed by Joe Perches I reuse ar9002_hw_spur_mitigate (const) version of
declarations for pilot_mask_reg and chan_mask_reg.

There should be no other difference with original code.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: Remove the clear interrupt routine from all drivers
Vincent Fann [Sat, 16 May 2015 02:29:27 +0000 (21:29 -0500)]
rtlwifi: Remove the clear interrupt routine from all drivers

Several of these drivers have there TX randomly blocked for 3~5 seconds while
measuring tx throughput (iperf). The root couse happens in rtl_pci_flush().
The function uses a while-loop to wait for TX queue length to decrease to 0.
The TX queue length counts the number of packets that are queued in the driver.
The driver relys on the TX OK interrupt to return skb and reduce TX queue length.

The interrupt subroutine disables interupts, reads the interrupt registers, and
then clears the registers in the beginning of _rtl_pci_interrupt(). After all
interupts process are finished, the driver invokes enable_interrupt() to enable
interupts. This behavior is normal for an interrupt subroutine.

But enable_interrupt() invokes clear_interrupt() again. This unexpected interrupt
clearing may cleari me fresh TX OK interrupts. These missing interrupts cause TX
queue length to never reduce to 0i, which causes rtl_pci_flush() to be stuck in
unterminated while-loop.

This patch removes clear_interrupt() in enable_interrupt() to avoid this behavior.

Signed-off-by: Vincent Fann <vincent_fann@realtek.com>
Signed-off-by: Shao Fu <shaofu@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [3.18+]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8821ae: Fix problem with regulatory information
Shao Fu [Fri, 15 May 2015 21:33:03 +0000 (16:33 -0500)]
rtlwifi: rtl8821ae: Fix problem with regulatory information

The driver was not setting a channel plan. Now it gets it from EEPROM.

Signed-off-by: Shao Fu <shaofu@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8723be: Update driver for regulatory changes
Shao Fu [Fri, 15 May 2015 21:33:02 +0000 (16:33 -0500)]
rtlwifi: rtl8723be: Update driver for regulatory changes

The driver is converted to use the channel plan in the EEPROM.

Signed-off-by: Shao Fu <shaofu@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8192ee: Apply the regulatory changes to driver
Shao Fu [Fri, 15 May 2015 21:33:01 +0000 (16:33 -0500)]
rtlwifi: rtl8192ee: Apply the regulatory changes to driver

The driver was setting a channel plan for the world. Now it reads it fromi
EEPROM.

In addition, a typo was fixed.

Signed-off-by: Shao Fu <shaofu@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8188ee: Apply the new regulatory information
Shao Fu [Fri, 15 May 2015 21:33:00 +0000 (16:33 -0500)]
rtlwifi: rtl8188ee: Apply the new regulatory information

The driver was setting a channel plan for the world. Now it reads it from
EEPROM.

Signed-off-by: Shao Fu <shaofu@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: Update regulatory database
Shao Fu [Fri, 15 May 2015 21:32:59 +0000 (16:32 -0500)]
rtlwifi: Update regulatory database

Driver rtlwifi maintains its own regulatory information, The Chrome Autotest
(https://www.chromium.org/chromium-os/testing/autotest-user-doc)
showed some errors. This patch adds the necessary information for rtlwifi.

Signed-off-by: Shao Fu <shaofu@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agorndis_wlan: harmless issue calling set_bit()
Dan Carpenter [Thu, 14 May 2015 08:37:50 +0000 (11:37 +0300)]
rndis_wlan: harmless issue calling set_bit()

These are used like:

set_bit(WORK_LINK_UP, &priv->work_pending);

The problem is that set_bit() takes the actual bit number and not a mask
so static checkers get upset.  It doesn't affect run time because we do
it consistently, but we may as well clean it up.

Fixes: 6010ce07a66c ('rndis_wlan: do link-down state change in worker thread')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoath9k_htc: memory corruption calling set_bit()
Dan Carpenter [Thu, 14 May 2015 08:34:48 +0000 (11:34 +0300)]
ath9k_htc: memory corruption calling set_bit()

In d8a2c51cdcae ('ath9k_htc: Use atomic operations for op_flags') we
changed things like this:

- if (priv->op_flags & OP_TSF_RESET) {
+ if (test_bit(OP_TSF_RESET, &priv->op_flags)) {

The problem is that test_bit() takes a bit number and not a mask.  It
means that when we do:

set_bit(OP_TSF_RESET, &priv->op_flags);

Then it sets the (1 << 6) bit instead of the 6 bit so we are setting a
bit which is past the end of the unsigned long.

Fixes: d8a2c51cdcae ('ath9k_htc: Use atomic operations for op_flags')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: avoid gcc-5.1 warning
Arnd Bergmann [Tue, 12 May 2015 21:54:25 +0000 (23:54 +0200)]
brcmfmac: avoid gcc-5.1 warning

gcc-5.0 gained a new warning in the fwsignal portion of the brcmfmac
driver:

drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c: In function 'brcmf_fws_txs_process':
drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c:1478:8: warning: 'skb' may be used uninitialized in this function [-Wmaybe-uninitialized]

This is a false positive, and marking the brcmf_fws_hanger_poppkt function
as 'static inline' makes the warning go away. I have checked the object
file output and while a little code gets moved around, the size of
the binary remains identical.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agocarl9170: match wait_for_completion_timeout return type
Nicholas Mc Guire [Tue, 12 May 2015 18:18:38 +0000 (20:18 +0200)]
carl9170: match wait_for_completion_timeout return type

Return type of wait_for_completion_timeout is unsigned long not int.
An appropriately named unsigned long is added, and the assignments
as well as error checking fixed up.

API conformance testing for completions with coccinelle spatches are being
used to locate API usage inconsistencies:
./drivers/net/wireless/ath/carl9170/usb.c:675
int return assigned to unsigned long

Patch was compile tested with x86_64_defconfig + CONFIG_ATH_CARDS=m,
CONFIG_CARL9170=m

Patch is against 4.1-rc3 (localversion-next is -next-20150512)

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: change dbg print func to mwifiex_dbg
Zhaoyang Liu [Mon, 11 May 2015 19:18:20 +0000 (00:48 +0530)]
mwifiex: change dbg print func to mwifiex_dbg

This patch changes all debug print functions from dev_dbg/dev_err/dev_info
to mwifiex specific debug functions.

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: add dump data debug support
Zhaoyang Liu [Mon, 11 May 2015 19:18:19 +0000 (00:48 +0530)]
mwifiex: add dump data debug support

This patch is to add support for data hexdump debug feature.
It is controlled by level debug_mask in adapter structure.

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: add prints debug ctrl support
Zhaoyang Liu [Mon, 11 May 2015 19:18:18 +0000 (00:48 +0530)]
mwifiex: add prints debug ctrl support

This patch adds support for debugging print control in mwifiex driver.

The debug level can be controlled via either by modules load parameter
debug_mask or by writing to debug_mask in debugfs file.

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agomwifiex: add support for FW memory read/write operations
Chin-ran Lo [Mon, 11 May 2015 19:18:17 +0000 (00:48 +0530)]
mwifiex: add support for FW memory read/write operations

This patch adds support for FW memory read/write operations via debugfs.
This is useful during debugging FW issues.

Examples:

For reading FW memory location:
echo r 0x01ac > /sys/kernel/debug/mwifiex/mlan0/memrw
cat /sys/kernel/debug/mwifiex/mlan0/memrw

For writing FW memory location:
echo w 0x01ac 0x55aa > /sys/kernel/debug/mwifiex/mlan0/memrw

Signed-off-by: Chin-ran Lo <crlo@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: btcoexist: Fix interference between rtl8723be and Bluetooth
Daniel Drake [Mon, 11 May 2015 19:00:27 +0000 (14:00 -0500)]
rtlwifi: btcoexist: Fix interference between rtl8723be and Bluetooth

During usage of the new Bluetooth driver for Realtek devices, it was found
that BT scans were inhibited for the RTL8723BE when wireless was active. The
exact cause of this interference is not known yet, but a satisfactory work
around has been found that does not seem to have any visible side effects.

Signed-off-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Shao Fu <shaofu@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoadm8211: fixed the possible pci cache line sizes inside switch-case
Okash Khawaja [Mon, 11 May 2015 11:58:31 +0000 (12:58 +0100)]
adm8211: fixed the possible pci cache line sizes inside switch-case

The PCI cache line size value was being compared against decimal values
prefixed with 0x.

Fixed the literals to use the correct hex values.

This has not been tested due to lack of hardware. However, the value in
`cline` is PCI cache line size, which is the CPU's cache line size.
It is less likely for cache line sizes to be 22 or 50, and more likely for
them to be 16 or 32. Also, as far as I understand, cache line size is used for
things like aligning DMA requests with CPU cache line, which improve
performance but wouldn't break anything if the value doesn't match. In
this case, we will fall through to the default case which leaves `reg`
unchanged.

Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoadm8211: fix checkpatch errors for indentation and new line
Okash Khawaja [Mon, 11 May 2015 11:53:25 +0000 (12:53 +0100)]
adm8211: fix checkpatch errors for indentation and new line

This patch fixes these checkpatch.pl errors around a single switch-case
block:

ERROR: switch and case should be at the same indent
ERROR: trailing statements should be on next line

More specifically, the fix has been applied to the five occurances of
the errors listed below.

ERROR: switch and case should be at the same indent
#1100: FILE: adm8211.c:1100:
+               switch (cline) {
[...]
+                 default: reg |= (0x0 << 14);

ERROR: trailing statements should be on next line
#1101: FILE: adm8211.c:1101:
+               case  0x8: reg |= (0x1 << 14);

ERROR: trailing statements should be on next line
#1103: FILE: adm8211.c:1103:
+               case 0x16: reg |= (0x2 << 14);

ERROR: trailing statements should be on next line
#1105: FILE: adm8211.c:1105:
+               case 0x32: reg |= (0x3 << 14);

ERROR: trailing statements should be on next line
#1107: FILE: adm8211.c:1107:
+                 default: reg |= (0x0 << 14);

Signed-off-by: Okash Khawaja <okash.khawaja@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agobrcmfmac: prohibit ACPI power management for brcmfmac driver
Fu, Zhonghui [Mon, 11 May 2015 02:41:32 +0000 (10:41 +0800)]
brcmfmac: prohibit ACPI power management for brcmfmac driver

ACPI will manage WiFi chip's power state during suspend/resume
process on some tablet platforms(such as ASUS T100TA). This is
not supported by brcmfmac driver now, and the context of WiFi
chip will be damaged after resume. This patch informs ACPI not
to manage WiFi chip's power state.

Signed-off-by: Zhonghui Fu <zhonghui.fu@linux.intel.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8192cu: Remove rtl92c_init_beacon_max_error's parameter
Taehee Yoo [Sat, 9 May 2015 09:16:51 +0000 (18:16 +0900)]
rtlwifi: rtl8192cu: Remove rtl92c_init_beacon_max_error's parameter

parameter "infra_mode" of rtl92c_init_beacon_max_error() is not used.
so i remove this.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8192cu: Remove setting REG_BCN_MAX_ERR code in _rtl92cu_set_media_status().
Taehee Yoo [Sat, 9 May 2015 09:15:23 +0000 (18:15 +0900)]
rtlwifi: rtl8192cu: Remove setting REG_BCN_MAX_ERR code in _rtl92cu_set_media_status().

Initialization routine set REG_BCN_MAX_ERR to 0xFF.
also _rtl92cu_set_media_status set REG_BCN_MAX_ERR to same value.
so i remove this code.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agortlwifi: rtl8188ee: Fix pwrseqcmd.h include path.
Lauri Kenttä [Fri, 8 May 2015 19:01:53 +0000 (22:01 +0300)]
rtlwifi: rtl8188ee: Fix pwrseqcmd.h include path.

Signed-off-by: Lauri Kenttä <lauri.kentta@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
8 years agoMerge ath-next from ath.git
Kalle Valo [Mon, 25 May 2015 12:12:21 +0000 (15:12 +0300)]
Merge ath-next from ath.git

Major changes:

ath10k:

* qca6174 power consumption improvements, enable ASPM etc (Michal)

wil6210:

* support Wi-Fi Simple Configuration in STA mode

8 years agocxgb4: Add PHY firmware support for T420-BT cards
Hariprasad Shenai [Fri, 22 May 2015 16:28:21 +0000 (21:58 +0530)]
cxgb4: Add PHY firmware support for T420-BT cards

Add support for flashing 10GBaseT adapter with BCM 84834 PHY and
Aquantia AQ1202 PHY.

Updating of the PHY firmware must happen before the INITIALIZE_CMD.

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>