firefly-linux-kernel-4.4.55.git
9 years agoMerge tag 'iwlwifi-next-for-kalle-2015-02-03' of https://git.kernel.org/pub/scm/linux...
Kalle Valo [Fri, 6 Feb 2015 06:57:37 +0000 (08:57 +0200)]
Merge tag 'iwlwifi-next-for-kalle-2015-02-03' of https://git./linux/kernel/git/iwlwifi/iwlwifi-next

* Add support for beamforming
* Enable stuck queue detection for iwlmvm
* A few fixes for EBS scan
* Fixes for various failure paths
* Improvements for TDLS Offchannel

9 years agobrcm80211: Delete unnecessary checks before two function calls
Markus Elfring [Wed, 4 Feb 2015 19:28:49 +0000 (20:28 +0100)]
brcm80211: Delete unnecessary checks before two function calls

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

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agohostap: Delete an unnecessary check before the function call "kfree"
Markus Elfring [Wed, 4 Feb 2015 19:06:39 +0000 (20:06 +0100)]
hostap: Delete an unnecessary check before the function call "kfree"

The kfree() 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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoorinoco: Delete an unnecessary check before the function call "kfree"
Markus Elfring [Wed, 4 Feb 2015 18:53:11 +0000 (19:53 +0100)]
orinoco: Delete an unnecessary check before the function call "kfree"

The kfree() 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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Delete an unnecessary check before the function call "relay_close"
Markus Elfring [Wed, 4 Feb 2015 17:48:28 +0000 (18:48 +0100)]
ath9k: Delete an unnecessary check before the function call "relay_close"

The relay_close() 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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agocw1200: Less function calls in cw1200_load_firmware_cw1200() after error detection
Markus Elfring [Wed, 4 Feb 2015 16:28:41 +0000 (17:28 +0100)]
cw1200: Less function calls in cw1200_load_firmware_cw1200() after error detection

The functions kfree() and release_firmware() were called in a few cases
by the cw1200_load_firmware_cw1200() function during error handling even if
the passed variables contained still a null pointer.

Corresponding implementation details could be improved by adjustments for
jump targets.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agocw1200: Delete an unnecessary check before the function call "release_firmware"
Markus Elfring [Wed, 4 Feb 2015 15:32:15 +0000 (16:32 +0100)]
cw1200: 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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoorinoco: orinoco_tmd use msecs_to_jiffies for conversion
Nicholas Mc Guire [Wed, 4 Feb 2015 08:07:41 +0000 (03:07 -0500)]
orinoco: orinoco_tmd use msecs_to_jiffies for conversion

This is only an API consolidation and should make things more readable
it replaces var * HZ / 1000 by msecs_to_jiffies(var).

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoorinoco: orinoco_pci use msecs_to_jiffies for conversion
Nicholas Mc Guire [Wed, 4 Feb 2015 08:07:40 +0000 (03:07 -0500)]
orinoco: orinoco_pci use msecs_to_jiffies for conversion

This is only an API consolidation and should make things more readable
it replaces var * HZ / 1000 by msecs_to_jiffies(var).

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoorinoco: orinoco_plx use msecs_to_jiffies for conversion
Nicholas Mc Guire [Wed, 4 Feb 2015 08:07:39 +0000 (03:07 -0500)]
orinoco: orinoco_plx use msecs_to_jiffies for conversion

This is only an API consolidation and should make things more readable
it replaces var * HZ / 1000 by msecs_to_jiffies(var).

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agocw1200: use msecs_to_jiffies for conversion
Nicholas Mc Guire [Wed, 4 Feb 2015 07:39:49 +0000 (02:39 -0500)]
cw1200: use msecs_to_jiffies for conversion

This is only an API consolidation to make things more readable.
Instances of  HZ / CONST  are replaced by appropriate msecs_to_jiffies().

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath5k: fix spontaneus AR5312 freezes
Sergey Ryazanov [Tue, 3 Feb 2015 21:21:13 +0000 (00:21 +0300)]
ath5k: fix spontaneus AR5312 freezes

Sometimes while CPU have some load and ath5k doing the wireless
interface reset the whole WiSoC completely freezes. Set of tests shows
that using atomic delay function while we wait interface reset helps to
avoid such freezes.

The easiest way to reproduce this issue: create a station interface,
start continous scan with wpa_supplicant and load CPU by something. Or
just create multiple station interfaces and put them all in continous
scan.

This patch partially reverts the commit 1846ac3dbec0 ("ath5k: Use
usleep_range where possible"), which replaces initial udelay()
by usleep_range().

I do not know actual source of this issue, but all looks like that HW
freeze is caused by transaction on internal SoC bus, while wireless
block is in reset state.

Also I should note that I do not know how many chips are affected, but I
did not see this issue with chips, other than AR5312.

CC: Jiri Slaby <jirislaby@gmail.com>
CC: Nick Kossifidis <mickflemm@gmail.com>
CC: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Fixes: 1846ac3dbec0 ("ath5k: Use usleep_range where possible")
Reported-by: Christophe Prevotaux <c.prevotaux@rural-networks.com>
Tested-by: Christophe Prevotaux <c.prevotaux@rural-networks.com>
Tested-by: Eric Bree <ebree@nltinc.com>
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Choose correct rate for 2GHz channel
Sujith Manoharan [Mon, 2 Feb 2015 12:51:13 +0000 (18:21 +0530)]
ath9k: Choose correct rate for 2GHz channel

Set the transmit rate for the keep-alive frames
as 1M/CCK when the current channel is in the
2GHz band.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Clear TSF2 properly
Sujith Manoharan [Mon, 2 Feb 2015 12:51:12 +0000 (18:21 +0530)]
ath9k: Clear TSF2 properly

Chips in the AR9003 family have a second TSF, which
needs to be cleared when putting the card to
sleep.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Program AR_WA correctly
Sujith Manoharan [Mon, 2 Feb 2015 12:51:11 +0000 (18:21 +0530)]
ath9k: Program AR_WA correctly

Setting the required configuration in the PCIE
WorkAround register needs to be done after all the
WoW parameters have been set.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Fix issues with WoW enable
Sujith Manoharan [Mon, 2 Feb 2015 12:51:10 +0000 (18:21 +0530)]
ath9k: Fix issues with WoW enable

This patch addresses several issues with the
ath9k_hw_wow_enable() routine:

* The usage of set/clr variables is removed. Writing
  the required values to registers is cleaner.

* The shift value of 28 for the contention window field
  in AR_WOW_PATTERN is incorrect, change it to 27.

* Disabling Keep Alive needs to be done based on the
  LINK_CHANGE option. This is done unconditionally now,
  fix this.

* The workaround for the D1/D3 issue is required only
  for AR9462.

* The bitfield for enabling pattern matching for packets
  less than 256 bytes has expanded for new chips, handle
  this accordingly.

* General cleanup.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Register correct WOW details with mac80211
Sujith Manoharan [Mon, 2 Feb 2015 12:51:09 +0000 (18:21 +0530)]
ath9k: Register correct WOW details with mac80211

Since the number of user patterns is higher for
newer chips, make sure that this is registered
during initialization.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Add support for more WOW patterns
Sujith Manoharan [Mon, 2 Feb 2015 12:51:08 +0000 (18:21 +0530)]
ath9k: Add support for more WOW patterns

Newer chips like WB222, WB335 support more than
8 user-configurable patterns. This patch adds
support for it by setting up the correct HW
registers.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8192ee: Fix problems with calculating free space in FIFO
Larry Finger [Tue, 3 Feb 2015 17:15:18 +0000 (11:15 -0600)]
rtlwifi: rtl8192ee: Fix problems with calculating free space in FIFO

This driver utilizes a FIFO buffer for RX descriptors. There are four places
in the code where it calculates the number of free slots. Several of those
locations do the calculation incorrectly. To fix these and to prevent future
mistakes, a common inline routine is created.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [V3.18]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8192ee: Fix handling of new style descriptors
Troy Tan [Tue, 3 Feb 2015 17:15:17 +0000 (11:15 -0600)]
rtlwifi: rtl8192ee: Fix handling of new style descriptors

The hardware and firmware for the RTL8192EE utilize a FIFO list of
descriptors. There were some problems with the initial implementation.
The worst of these failed to detect that the FIFO was becoming full,
which led to the device needing to be power cycled. As this condition
is not relevant to most of the devices supported by rtlwifi, a callback
routine was added to detect this situation. This patch implements the
necessary changes in the pci handler, and the linkage into the appropriate
rtl8192ee routine.

Signed-off-by: Troy Tan <troy_tan@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [V3.18]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: Remove msm platform related code
Hamad Kadmany [Sun, 1 Feb 2015 08:55:16 +0000 (10:55 +0200)]
wil6210: Remove msm platform related code

Current implementation depends on msm-bus driver which
is not merged into mainline kernel therefore
this code is removed

Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: print ciphers in debug info
Vladimir Kondratiev [Sun, 1 Feb 2015 08:55:15 +0000 (10:55 +0200)]
wil6210: print ciphers in debug info

Print (at debug level) all cipher and AKM suites

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: more Tx debug
Vladimir Kondratiev [Sun, 1 Feb 2015 08:55:14 +0000 (10:55 +0200)]
wil6210: more Tx debug

Print Tx descriptors
Print ring index for all Tx related messages
Sort prefixes: Tx for transmit, TxC for completion, added "D"
for descriptor related prints

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: fix race between xmit and Tx vring de-allocation
Vladimir Kondratiev [Sun, 1 Feb 2015 08:55:13 +0000 (10:55 +0200)]
wil6210: fix race between xmit and Tx vring de-allocation

Use spinlock, this should not impact Tx as lock is always free
except for de-allocation.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: avoid Tx descriptor double write
Vladimir Kondratiev [Sun, 1 Feb 2015 08:55:12 +0000 (10:55 +0200)]
wil6210: avoid Tx descriptor double write

Non-cacheable Tx descriptor for the last fragment of
multi-fragment frame used to be written back twice.

Refactor code to always write non-cacheable descriptor
only once

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: remove old Tx work-around
Vladimir Kondratiev [Sun, 1 Feb 2015 08:55:11 +0000 (10:55 +0200)]
wil6210: remove old Tx work-around

In the Tx, work around used to force destination index 0
to be used. This is no more necessary, as firmware supports
multiple destinations

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Fix max pattern check
Sujith Manoharan [Fri, 30 Jan 2015 13:35:37 +0000 (19:05 +0530)]
ath9k: Fix max pattern check

Since the maximum number of configurable patterns
is chip-specific, use the HW capability instead
of a fixed value for checking if a free pattern
slot is available.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Cleanup reg_wow.h
Sujith Manoharan [Fri, 30 Jan 2015 13:35:36 +0000 (19:05 +0530)]
ath9k: Cleanup reg_wow.h

* Remove unnecessary comments.
* Remove unused macros.
* Indent the macros.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Remove incorrect register macros
Sujith Manoharan [Fri, 30 Jan 2015 13:35:35 +0000 (19:05 +0530)]
ath9k: Remove incorrect register macros

These macros are applicable to pre-AR9003 chips
and the addresses are different for the AR9003
family. Since they are unused anyway, remove them.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Move WOW registers to reg_wow.h
Sujith Manoharan [Fri, 30 Jan 2015 13:35:34 +0000 (19:05 +0530)]
ath9k: Move WOW registers to reg_wow.h

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Register max WOW patterns
Sujith Manoharan [Fri, 30 Jan 2015 13:35:33 +0000 (19:05 +0530)]
ath9k: Register max WOW patterns

Since the number of patterns that can be configured in
the HW is higher for newer chips, store the chip-specific
value in ath9k_hw_wow.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Add a HW structure for WOW
Sujith Manoharan [Fri, 30 Jan 2015 13:35:32 +0000 (19:05 +0530)]
ath9k: Add a HW structure for WOW

This can be used to hold the WOW state in
ath9k_hw.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Simplify user pattern configuration
Sujith Manoharan [Fri, 30 Jan 2015 13:35:31 +0000 (19:05 +0530)]
ath9k: Simplify user pattern configuration

There is no need to allocate a new structure and
free it for every user pattern, instead use local
variables.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Add a debugfs file for WOW
Sujith Manoharan [Fri, 30 Jan 2015 13:35:30 +0000 (19:05 +0530)]
ath9k: Add a debugfs file for WOW

This can be used to force WOW for cards that
are not present in the supported PCI ID list.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Remove ath9k_hw_wow_event_to_string
Sujith Manoharan [Fri, 30 Jan 2015 13:35:29 +0000 (19:05 +0530)]
ath9k: Remove ath9k_hw_wow_event_to_string

Printing the value of the wakeup status is sufficient.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Remove unused BMISS processing
Sujith Manoharan [Fri, 30 Jan 2015 13:35:28 +0000 (19:05 +0530)]
ath9k: Remove unused BMISS processing

The various variables tracking bmiss interrupts
are not really used anywhere except in a debug
message. Remove them since they have no functional
purpose.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Check WOW triggers properly
Sujith Manoharan [Fri, 30 Jan 2015 13:35:27 +0000 (19:05 +0530)]
ath9k: Check WOW triggers properly

This patch makes sure that valid WOW triggers
are present before trying to suspend the device.
Also, introduce and use ATH_OP_WOW_ENABLED to
bypass PCI suspend and clear it in resume().

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Fix wow init/deinit
Sujith Manoharan [Fri, 30 Jan 2015 13:35:26 +0000 (19:05 +0530)]
ath9k: Fix wow init/deinit

Registering the card as a wakeup source needs to
be done once, during initialization. When the WOW
configuration changes, the card's status as wakeup
source needs to be changed too and this is done
via the set_wakeup() callback. Also, make sure
the device is removed properly using ath9k_deinit_wow().

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Check multi-channel context for WOW
Sujith Manoharan [Fri, 30 Jan 2015 13:35:25 +0000 (19:05 +0530)]
ath9k: Check multi-channel context for WOW

If CONFIG_ATH9K_CHANNEL_CONTEXT is enabled, check whether
multiple contexts are active and if so, return 1 without
enabling WOW since we don't support it in this case.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Check early for multi-vif/STA conditions
Sujith Manoharan [Fri, 30 Jan 2015 13:35:24 +0000 (19:05 +0530)]
ath9k: Check early for multi-vif/STA conditions

If multiple interfaces are active or there is no
associated station interface, bail out early and
return 1 so that mac80211 can proceed with the normal
suspend routine.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Remove redundant device_can_wakeup() check
Sujith Manoharan [Fri, 30 Jan 2015 13:35:23 +0000 (19:05 +0530)]
ath9k: Remove redundant device_can_wakeup() check

WOW capability is registered with mac80211 only when
the device has the ability to wakeup, so there is no
need to check in the suspend() routine.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Return early for error conditions
Sujith Manoharan [Fri, 30 Jan 2015 13:35:22 +0000 (19:05 +0530)]
ath9k: Return early for error conditions

Do not try to cancel work instances and ANI when
the device is not present or WOW triggers are
not configured. Bail out early and use ath_err()
for such error conditions.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Remove ATH9K_HW_WOW_DEVICE_CAPABLE
Sujith Manoharan [Fri, 30 Jan 2015 13:35:21 +0000 (19:05 +0530)]
ath9k: Remove ATH9K_HW_WOW_DEVICE_CAPABLE

Enabling WOW based on the chip is incorrect since
it needs to be done for specific sub-devices which
have proper platform support.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: disable UAPSD mode when AP starts
Amitkumar Karwar [Fri, 30 Jan 2015 08:40:07 +0000 (00:40 -0800)]
mwifiex: disable UAPSD mode when AP starts

When AP is started, firmware exits power save mode. This
means power save manager of AP takes priority over station.
Firmware stop sending periodic AWAKE events to host.

We may have UAPSD enabled on station which buffers data
packets until AWAKE event from firmware. Data path is
unnecessarily blocked in this case. This patch disables
UAPSD mode to reenable transmit data path.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: fix NULL packet downloading issues
Amitkumar Karwar [Fri, 30 Jan 2015 08:40:06 +0000 (00:40 -0800)]
mwifiex: fix NULL packet downloading issues

This patch makes sure that skb is freed after downloading
NULL packet in error cases. Also, USB chipsets return
-EINPROGRESS after downloading packets, they are freed in
USB completion handler later. We will add missing change
to set tx_lock_flag for USB which blocks further packets.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: fix memory leak in mwifiex_send_processed_packet()
Amitkumar Karwar [Fri, 30 Jan 2015 08:40:05 +0000 (00:40 -0800)]
mwifiex: fix memory leak in mwifiex_send_processed_packet()

Memory is leaked after downloading already processed packet. This
patch fixes the problem by freeing returned skb. Other transmit
paths don't have this 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>
9 years agomwifiex: correction in wakeup timer handling
Amitkumar Karwar [Fri, 30 Jan 2015 08:40:04 +0000 (00:40 -0800)]
mwifiex: correction in wakeup timer handling

Wakeup timer is in sync with 'pm_wakeup_fw_try' flag. It
has been started instead of cancelling at one place. This
patch corrects it.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8192ee: Fix DMA stalls
Troy Tan [Tue, 20 Jan 2015 17:01:26 +0000 (11:01 -0600)]
rtlwifi: rtl8192ee: Fix DMA stalls

There are instances where the DMA engine stalls. The new code detects
such stalls and restarts DMA without needing a power reset.

Signed-off-by: Troy Tan <troy_tan@realsil.com.cn>
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>
9 years agortlwifi: rtl8192ee: Fix parsing of received packet
Troy Tan [Tue, 20 Jan 2015 17:01:24 +0000 (11:01 -0600)]
rtlwifi: rtl8192ee: Fix parsing of received packet

The firmware supplies two kinds of packets via the RX mechanism. Besides the
normal data received over the air, these packets may contain bluetooth status
and other information. The present code fails to detect which kind of
information was received.

Signed-off-by: Troy Tan <troy_tan@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [V3.18]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8192ee: Fix TX hang due to failure to update TX write point
Troy Tan [Tue, 20 Jan 2015 17:01:23 +0000 (11:01 -0600)]
rtlwifi: rtl8192ee: Fix TX hang due to failure to update TX write point

Initially, the routine to update the write point in the FIFO buffer was
coded to save CPU time by not doing the calculation every interrupt. This
was an error and results in TX hangs.

Signed-off-by: Troy Tan <troy_tan@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [V3.18]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8192ee: Fix adhoc fail
Troy Tan [Tue, 20 Jan 2015 17:01:22 +0000 (11:01 -0600)]
rtlwifi: rtl8192ee: Fix adhoc fail

When the buffer descriptor index exceeds 2, then a TX HANG condition
will result.

Signed-off-by: Troy Tan <troy_tan@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [V3.18]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoiwlwifi: mvm: reduce quota threshold
Johannes Berg [Mon, 2 Feb 2015 12:22:27 +0000 (13:22 +0100)]
iwlwifi: mvm: reduce quota threshold

The quota threshold should be reduced to 4 to update the
firmware more frequently.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: don't send a command the firmware doesn't know
Emmanuel Grumbach [Mon, 2 Feb 2015 17:49:43 +0000 (19:49 +0200)]
iwlwifi: mvm: don't send a command the firmware doesn't know

-9.ucode doesn't know the command SHARED_MEM_CFG yet.

Fixes: 04fd2c28226f ("iwlwifi: mvm: add rxf and txf to dump data")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: Fix building channels in scan_config_cmd
Ilan Peer [Fri, 23 Jan 2015 19:13:01 +0000 (21:13 +0200)]
iwlwifi: mvm: Fix building channels in scan_config_cmd

Use the chanel hw_value and not the center frequency when
building channel array for scan_config_cmd.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: Enable EBS also in single scan on umac interface
Haim Dreyfuss [Mon, 5 Jan 2015 13:00:35 +0000 (15:00 +0200)]
iwlwifi: mvm: Enable EBS also in single scan on umac interface

Enable EBS on one shot scans if supported by FW.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Reviewed-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: fix failure path when power_update fails in add_interface
Luciano Coelho [Tue, 27 Jan 2015 13:06:57 +0000 (15:06 +0200)]
iwlwifi: mvm: fix failure path when power_update fails in add_interface

When iwl_mvm_power_update_mac() is called, we have already added the
mac context, so if this call fails we should remove the mac.

CC: <stable@vger.kernel.org> [3.15+]
Fixes: commit e5e7aa8e2561 ('iwlwifi: mvm: refactor power code')
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: Fix a few EBS error handling bugs
Haim Dreyfuss [Tue, 13 Jan 2015 09:54:51 +0000 (11:54 +0200)]
iwlwifi: mvm: Fix a few EBS error handling bugs

Last EBS status wasn't set to success in the initialization, which
caused the first scan to be without EBS. Fix that.

When EBS is not enabled by the driver, the FW still sends ebs_status success,
which can override EBS failure state. Consider only EBS failures, to avoid
such override. Last_ebs_success is set back to true upon disconnection.

Last_ebs_success wasn't set in umac scan abort flow, fix that too.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: allow to define the stuck queue timer per queue
Emmanuel Grumbach [Mon, 12 Jan 2015 12:38:29 +0000 (14:38 +0200)]
iwlwifi: allow to define the stuck queue timer per queue

Different queue can have different behavior. While it can be
unacceptable for a certain queue to be stuck for 2 seconds
(e.g. the command queue), it can happen that another queue
will stay stuck for even longer (a queue servicing a power
saving client in GO).
The op_mode can even make the timeout be a function of the
listen interval.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: enable watchdog on Tx queues for mvm
Emmanuel Grumbach [Sun, 11 Jan 2015 15:19:39 +0000 (17:19 +0200)]
iwlwifi: mvm: enable watchdog on Tx queues for mvm

This watchdog allows to monitor the transmit queues. When a
queue doesn't progress for a too long time, a timer fires
and then, debug data can be collected.
This watchdog has never been enabled on dvm controlled
devices, so don't enable it there.
In order to have it running on mvm controlled devices, we
need to fix a small issue in the transport layer: mvm
controlled devices use the shadow registers optimization.
In this case, the watchdog wasn't running at all, even if
enabled by the module parameter. Fix that on the way.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: ignore stale TDLS ch-switch responses
Arik Nemtsov [Thu, 22 Jan 2015 12:24:44 +0000 (14:24 +0200)]
iwlwifi: mvm: ignore stale TDLS ch-switch responses

During out-of-channel activities (e.g. scan) TDLS ch-switch responses from
a peer are kept in FW. These packets arrive only after the out-of-channel
activity is complete, which can be in the order of several seconds.

Since TDLS ch-sw has no dialog-token-like mechanism for distinguishing
sessions, use the GP2 time of the incoming ch-switch response to discern
validity. For this purpose record the GP2 time of an outgoing TDLS ch-sw
request and compare to the Rx time of the ch-sw response.
The methods works in practice since the GP2 time of FW-deferred Rx is
accurate and contains the real Rx timestamp.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: improve TDLS ch-sw state machine
Arik Nemtsov [Thu, 22 Jan 2015 10:19:26 +0000 (12:19 +0200)]
iwlwifi: mvm: improve TDLS ch-sw state machine

Add a response-received state and add more limits on allowed requests
in each state of the connection. Previously ch-switch requests from
other peers could interrupt an outgoing active ch-switch. Also stale
packets from the current peer could disrupt the channel switch state.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: pcie: disable the SCD_BASE_ADDR when we resume from WoWLAN
Emmanuel Grumbach [Thu, 29 Jan 2015 19:34:00 +0000 (21:34 +0200)]
iwlwifi: pcie: disable the SCD_BASE_ADDR when we resume from WoWLAN

The base address of the scheduler in the device's memory
(SRAM) comes from two different sources. The periphery
register and the alive notification from the firmware.
We have a check in iwl_pcie_tx_start that ensures that
they are the same.
When we resume from WoWLAN, the firmware may have crashed
for whatever reason. In that case, the whole device may be
reset which means that the periphery register will hold a
meaningless value. When we come to compare
trans_pcie->scd_base_addr (which really holds the value we
had when we loaded the WoWLAN firmware upon suspend) and
the current value of the register, we don't see a match
unsurprisingly.
Trick the check to avoid a loud yet harmless WARN.
Note that when the WoWLAN has crashed, we will see that
in iwl_trans_pcie_d3_resume which will let the op_mode
know. Once the op_mode is informed that the WowLAN firmware
has crashed, it can't do much besides resetting the whole
device.

CC: <stable@vger.kernel.org>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: pcie: prepare the enablement of 31 TFD queues
Emmanuel Grumbach [Sun, 25 Jan 2015 08:36:31 +0000 (10:36 +0200)]
iwlwifi: pcie: prepare the enablement of 31 TFD queues

Some devices have 31 TFD queues. Don't enable it yet since
there are still issues with it, but at least prepare the
code for it. There was a bug in the read pointer assignment,
fix that. Also, move the inline functions to iwl-scd.h which
is the right place.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: rs: enable forcing single stream Tx decision
Eyal Shapira [Wed, 28 Jan 2015 12:44:06 +0000 (14:44 +0200)]
iwlwifi: mvm: rs: enable forcing single stream Tx decision

In certain testing scenarios we'd like to force a decision
between STBC/BFER/SISO. In the normal scenario this decision
is done by the FW. Enable this option vis debugfs.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: add beamformer support
Eyal Shapira [Fri, 16 Jan 2015 20:37:04 +0000 (22:37 +0200)]
iwlwifi: mvm: add beamformer support

VHT Beamformer (BFER) will be used if the peer supports it
and there's a benefit to use it vs. STBC or SISO.
The driver now tells the FW whether BFER and/or STBC are
allowed but the FW will make the decision to use either
or stick to SISO on its own.
BFER is limited to a single remote peer. The driver takes
care of ensuring this to the FW and prioritizes with which
peer BFER will be used.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: pcie: don't dump useless data when a TFD queue hangs
Emmanuel Grumbach [Sun, 25 Jan 2015 13:54:40 +0000 (15:54 +0200)]
iwlwifi: pcie: don't dump useless data when a TFD queue hangs

Printing all the scratch data of the TFDs of that queue is
useless and stuffed the kernel log with data. Remove that.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: always use mac color zero
Luciano Coelho [Thu, 29 Jan 2015 10:48:20 +0000 (12:48 +0200)]
iwlwifi: mvm: always use mac color zero

We don't really need to use different mac colors when adding mac
contexts, because they're not used anywhere.  In fact, the firmware
doesn't accept 255 as a valid color, so we get into a SYSASSERT 0x3401
when we reach that.

Remove the color increment to use always zero and avoid reaching 255.

CC: <stable@vger.kernel.org> [3.10+]
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: remove space padding after sysassert description
Johannes Berg [Wed, 28 Jan 2015 22:43:24 +0000 (23:43 +0100)]
iwlwifi: mvm: remove space padding after sysassert description

There's really no reason to pad out the field with spaces at the
end of the line - they're practically invisible there anyway.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: don't reprobe if we fail during reconfig and fw_restart is false
Luciano Coelho [Wed, 28 Jan 2015 07:00:27 +0000 (09:00 +0200)]
iwlwifi: mvm: don't reprobe if we fail during reconfig and fw_restart is false

If we don't want to restart the firmware, don't reprobe either in case
of a failure during reconfiguration.  This allows us to debug failures
in the reconfig flow as well.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agob43: AC-PHY: prepare place for developing new PHY support
Rafał Miłecki [Sun, 25 Jan 2015 17:01:37 +0000 (18:01 +0100)]
b43: AC-PHY: prepare place for developing new PHY support

There are new (not anymore?) Broadcom 802.11ac wireless cards based on
chipsets like BCM4352 and BCM4360. They use a new PHY type (called
simply AC) that will require new specific code.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agob43: support bcma core reset on AC-PHY hardware
Rafał Miłecki [Sun, 25 Jan 2015 13:39:34 +0000 (14:39 +0100)]
b43: support bcma core reset on AC-PHY hardware

AC-PHY hardware includes new control 0x3 bits that need to be set to the
0x1 by default.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: implement host code support for PCIe Gen 2 devices
Rafał Miłecki [Sun, 25 Jan 2015 12:41:19 +0000 (13:41 +0100)]
bcma: implement host code support for PCIe Gen 2 devices

This is stil incomplete, so we don't add PCI IDs of new devices yet.
Purpose of this patch is to allow testing & adjusting rest of the code.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: add early_init function for PCIe core and move some fix into it
Rafał Miłecki [Sun, 25 Jan 2015 10:11:14 +0000 (11:11 +0100)]
bcma: add early_init function for PCIe core and move some fix into it

There are some PCIe core fixes that need to be applied before accessing
SPROM, otherwise reading it may fail.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: add empty PCIe hostmode functions if support is disabled
Rafał Miłecki [Sun, 25 Jan 2015 13:02:48 +0000 (14:02 +0100)]
bcma: add empty PCIe hostmode functions if support is disabled

This allows us to drop some #ifdef magic (mess).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: detect SPROM revision 11
Rafał Miłecki [Sat, 24 Jan 2015 17:47:20 +0000 (18:47 +0100)]
bcma: detect SPROM revision 11

Extracting values from it is still unsupported, but at least we'll
display some meaningful error now.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: simplify freeing cores (internal devices structs)
Rafał Miłecki [Sat, 24 Jan 2015 17:47:19 +0000 (18:47 +0100)]
bcma: simplify freeing cores (internal devices structs)

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: fix watchdog on some ARM chipsets
Rafał Miłecki [Fri, 23 Jan 2015 23:23:21 +0000 (00:23 +0100)]
bcma: fix watchdog on some ARM chipsets

These chipsets don't need changing clock mode.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Enable manual peak detect calibration
Sujith Manoharan [Wed, 28 Jan 2015 12:24:26 +0000 (17:54 +0530)]
ath9k: Enable manual peak detect calibration

On some AR955x/QCA953x boards, noise floor calibration
gets stuck and the cause is a hardware/BB issue. To fix
this, peak detect calibration in the HW is disabled
and is done in the driver instead. There a few differences
with the calibration routine for older chips like
AR9331.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Set correct peak detect threshold
Sujith Manoharan [Wed, 28 Jan 2015 12:24:25 +0000 (17:54 +0530)]
ath9k: Set correct peak detect threshold

The value is different for PCOEM cards and AR955x/AR953x.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Fix manual peak calibration initialization
Sujith Manoharan [Wed, 28 Jan 2015 12:24:24 +0000 (17:54 +0530)]
ath9k: Fix manual peak calibration initialization

The LNA gain setting override needs to be done
only for AR9330 and PCOEM chips.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Add a macro to identify PCOEM chips
Sujith Manoharan [Wed, 28 Jan 2015 12:24:23 +0000 (17:54 +0530)]
ath9k: Add a macro to identify PCOEM chips

This can be used if we need to apply register settings
for all PCOEM solutions (in the AR9003 family).

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Update AR955x initvals
Sujith Manoharan [Wed, 28 Jan 2015 12:24:22 +0000 (17:54 +0530)]
ath9k: Update AR955x initvals

This patch disables HW peak detect calibration for
AR955x, since it is problematic on a few boards.
Instead, manual calibration will be done in the
driver.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Update QCA953x initvals
Sujith Manoharan [Wed, 28 Jan 2015 12:24:21 +0000 (17:54 +0530)]
ath9k: Update QCA953x initvals

This patch disables HW peak detect calibration for
QCA953x, since it is problematic on a few boards.
Instead, manual calibration will be done in the
driver.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agob43: Fix locking FIXME in beacon update top half
Michael Büsch [Mon, 26 Jan 2015 17:26:17 +0000 (18:26 +0100)]
b43: Fix locking FIXME in beacon update top half

b43 has a FIXME about locking in the mac80211 set-beacon-int callback for a long time.
As it turns out there actually is a tiny race window that could result in
a use-after-free bug of the 'current_beacon' memory.
Nobody ever reported this, so it probably never happened.

Fix this by adding a spin lock that protects the current_beacon access.
We must not be in atomic context while accessing hardware (due to SDIO),
so the beacon update bottom half has to clone the skb and release the lock
before writing it to hardware.

Let's all hope that this stops the troll who is trying to submit incorrect
fixes for this issue repeatedly.
And let's hope that I'm not a troll, too, who just hides even more evil code
in an even more complex attempt to fix the issue.

Signed-off-by: Michael Buesch <m@bues.ch>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: 11h handling for AP interface
Avinash Patil [Wed, 28 Jan 2015 10:24:25 +0000 (15:54 +0530)]
mwifiex: 11h handling for AP interface

This patch enables 11h extensions in FW upon detecting DFS
channel in start radar detection/channel switch handlers.
Patch also takes care of disabling 11h when non DFS channels
are to be set during start_ap handler.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Qingshui Gao <gaoqs@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: channel switch support for mwifiex
Avinash Patil [Wed, 28 Jan 2015 10:24:24 +0000 (15:54 +0530)]
mwifiex: channel switch support for mwifiex

This patch adds cfg80211 channel_switch support for mwifiex.
Upon receiving channel switch request, driver would parse channel
switch announcement IE from beacon_data.
If TX is blocked, netdev queues are stopped. IEs from csa_beacon
are then parsed and set to FW.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Qingshui Gao <gaoqs@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: handle radar detect event from FW
Avinash Patil [Wed, 28 Jan 2015 10:24:23 +0000 (15:54 +0530)]
mwifiex: handle radar detect event from FW

This patch adds support for radar_detected event from FW.
Driver in turn would stop netdev queues to stop TX traffic and
issue RADAR_DETECT event to cfg80211.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Qingshui Gao <gaoqs@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: support for channel report for radar detection
Avinash Patil [Wed, 28 Jan 2015 10:24:22 +0000 (15:54 +0530)]
mwifiex: support for channel report for radar detection

This patch adds support for channel report enabling.
Channel report event happens if radar is detected on specified channel
after driver has issued radar detect command within CAC time.
Driver in turn sends RADAR_DETECTED event to cfg80211 to tell radar was
detected within CAC time.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Qingshui Gao <gaoqs@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: add cfg80211 start_radar_detection handler
Avinash Patil [Wed, 28 Jan 2015 10:24:21 +0000 (15:54 +0530)]
mwifiex: add cfg80211 start_radar_detection handler

This patch adds support for cfg80211 start_radar_detection handler.
Upon reception of start_radar_detection, driver prepares radar detect
command to FW.

Delayed work is queued for CAC time which sends radar detection finished
event to cfg80211.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Qingshui Gao <gaoqs@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: separate function for parsing head and tail IEs
Avinash Patil [Wed, 28 Jan 2015 10:24:20 +0000 (15:54 +0530)]
mwifiex: separate function for parsing head and tail IEs

Head & Tail IEs are supposed to be added to beacon and probe response.
This patch adds separate function for parsing head and tail IEs from
cfg80211_beacon_data and sets them to FW.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Qingshui Gao <gaoqs@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: refactor start_ap handler
Avinash Patil [Wed, 28 Jan 2015 10:24:19 +0000 (15:54 +0530)]
mwifiex: refactor start_ap handler

Refactor mwifiex_cfg80211_start_ap by creating separate function
to set AP channel and another for configuring other AP parameters
and starting AP.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Qingshui Gao <gaoqs@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: update IEs after AP has started
Avinash Patil [Wed, 28 Jan 2015 10:24:18 +0000 (15:54 +0530)]
mwifiex: update IEs after AP has started

This patch moves IE management routine to end of start_ap handler.
IEs now would be updated after AP has started.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Qingshui Gao <gaoqs@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: store AP configuration in private structure
Avinash Patil [Wed, 28 Jan 2015 10:24:17 +0000 (15:54 +0530)]
mwifiex: store AP configuration in private structure

Store AP configuration in private structure so that we know
current AP configuration.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Qingshui Gao <gaoqs@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: do not send regulatory update while starting AP
Avinash Patil [Wed, 28 Jan 2015 10:24:16 +0000 (15:54 +0530)]
mwifiex: do not send regulatory update while starting AP

When regulatory domain changes, cfg80211 already issues request
to change regulatory domain to driver via reg_notifier.
There is no need to set regulatory again during start_ap.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Qingshui Gao <gaoqs@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: support conversion to any virtual interface type
Avinash Patil [Wed, 28 Jan 2015 10:12:05 +0000 (15:42 +0530)]
mwifiex: support conversion to any virtual interface type

Currently, we support virtual interface type change from
station<=>adhoc or station <=> p2p client/GO.
This patch adds support to change virtual interface type to
any of the type advertised in interface combinations.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: handle PS events on AP interface as well
Avinash Patil [Wed, 28 Jan 2015 10:12:04 +0000 (15:42 +0530)]
mwifiex: handle PS events on AP interface as well

This patch adds support to handle PS events on AP interface as well.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: manage virtual interface limits efficiently
Avinash Patil [Wed, 28 Jan 2015 10:12:03 +0000 (15:42 +0530)]
mwifiex: manage virtual interface limits efficiently

Currently interface limits are checked by seeing if bss_mode for
particular priv is set. If bss_mode is not set, interface creation
is allowed. This patch adds framework to initializes maximum virtual
interfaces supported during load time and check current number of
interfaces created agains allowed interface limit during new virtual
interface creation.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: add init parameter to init command routine
Avinash Patil [Wed, 28 Jan 2015 10:12:02 +0000 (15:42 +0530)]
mwifiex: add init parameter to init command routine

FW initialization routine can also be called while changing
virtual interface types.
This patch adds bool parameter "init" to init command routine
so as to differentiate between initialization during driver load
and change virtual interface handler.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: store permanant mac address in adapter structure
Avinash Patil [Wed, 28 Jan 2015 10:12:01 +0000 (15:42 +0530)]
mwifiex: store permanant mac address in adapter structure

This would be used to set mac address while changing virtual
interface to different types.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: do not declare wdev as pointer
Avinash Patil [Wed, 28 Jan 2015 10:12:00 +0000 (15:42 +0530)]
mwifiex: do not declare wdev as pointer

wdev is used even after del_virtual_interface handler in cfg80211
in nl80211_post_doit. Since we have freed wdev in handling of
del_virtual_intf, this can result into crash while deleting
interface.
Avoid this be not declaring wdev which part of
mwifiex_private structure but struct wireless_dev type.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>