platform/kernel/linux-starfive.git
9 years agoath9k: ar9271_hw_pa_cal: use REG_READ_ARRAY
Oleksij Rempel [Sun, 22 Mar 2015 18:29:52 +0000 (19:29 +0100)]
ath9k: ar9271_hw_pa_cal: use REG_READ_ARRAY

insted of reading each register separatly
and waste 4ms on each operation, we can
use one shot read.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: add new function ath9k_hw_read_array
Oleksij Rempel [Sun, 22 Mar 2015 18:29:51 +0000 (19:29 +0100)]
ath9k: add new function ath9k_hw_read_array

REG_READ generate most overhead on usb bus. It send and read micro packages
and reduce usb bandwidth. To reduce this overhead we should read in batches.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: add multi_read to be compatible with ath9k_htc
Oleksij Rempel [Sun, 22 Mar 2015 18:29:50 +0000 (19:29 +0100)]
ath9k: add multi_read to be compatible with ath9k_htc

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: ar9271_hw_pa_cal: use RMW buffer
Oleksij Rempel [Sun, 22 Mar 2015 18:29:49 +0000 (19:29 +0100)]
ath9k: ar9271_hw_pa_cal: use RMW buffer

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: ar9271_hw_pa_cal: use proper makroses.
Oleksij Rempel [Sun, 22 Mar 2015 18:29:48 +0000 (19:29 +0100)]
ath9k: ar9271_hw_pa_cal: use proper makroses.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: ar9271_hw_pa_cal - use defs instead of magin numbers
Oleksij Rempel [Sun, 22 Mar 2015 18:29:47 +0000 (19:29 +0100)]
ath9k: ar9271_hw_pa_cal - use defs instead of magin numbers

This function uses mixed styles for register names/numbers which
is make harder reading and optimisation.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k_htc: add new WMI_REG_RMW_CMDID command
Oleksij Rempel [Sun, 22 Mar 2015 18:29:46 +0000 (19:29 +0100)]
ath9k_htc: add new WMI_REG_RMW_CMDID command

Since usb bus add extra delay on each request, a command
with read + write requests is too expensive. We can dramtically
reduce usb load by moving this command to firmware.

In my tests, this patch will reduce channel scan time
for about 5-10 seconds.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: Change REG_CR+2 to MSR
Taehee Yoo [Fri, 20 Mar 2015 10:31:33 +0000 (19:31 +0900)]
rtlwifi: Change REG_CR+2 to MSR

I changed REG_CR+2 and (MSR) to MSR because MSR is defined as (REG_CR + 2).

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agort2800usb: check Autorun mode on FW load only once
Stanislaw Gruszka [Thu, 19 Mar 2015 14:32:49 +0000 (15:32 +0100)]
rt2800usb: check Autorun mode on FW load only once

Seems H/W report correctly firmware Autorun value only at initialization
stage. When we close interface and open it again, Autorun value is 0 and
we try to load firmware what kills the device. To fix clear
REQUIRE_FIRMWARE firmware flag, to do not load firmware again, once we
discover Autorun mode.

Reported-and-tested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Fix AIC compilation error
Sujith Manoharan [Fri, 20 Mar 2015 13:44:50 +0000 (19:14 +0530)]
ath9k: Fix AIC compilation error

AIC needs to be registered only when BTCOEX is enabled.
This fixes the error reported by kbuild:

>> ERROR: "ar9003_hw_attach_aic_ops" [drivers/net/wireless/ath/ath9k/ath9k_hw.ko] undefined!

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: gpio: use predictable base for all BCM47XX buses
Rafał Miłecki [Sun, 15 Mar 2015 18:43:14 +0000 (19:43 +0100)]
bcma: gpio: use predictable base for all BCM47XX buses

Some BCM47XX SoC routers have LEDs connected to extra PCIe bcma buses.
Handling them in arch code requires predictable GPIO numbers.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: fix crash in SDIO RX path
Avinash Patil [Wed, 18 Mar 2015 14:42:52 +0000 (20:12 +0530)]
mwifiex: fix crash in SDIO RX path

With patch '960d6d08e39 "mwifiex: delay skb allocation for RX
until cmd53 over"' we no more pass skb parameter to MP aggregation setup
helper function. We instead pass length to be aggregated.

This patch fixes an issue where we were passing length parameter of NULL
skb to aggregation routine resulting into crash. We should instead pass
rx_len received from mp_regs.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: remove support for unreleased BCM4354 PCIe
Arend van Spriel [Wed, 18 Mar 2015 12:25:28 +0000 (13:25 +0100)]
brcmfmac: remove support for unreleased BCM4354 PCIe

There are no known BCM4354 PCIe devices released so removing
support from the driver until proven otherwise.

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>
9 years agobrcmfmac: only support the BCM43455/7 device
Arend van Spriel [Wed, 18 Mar 2015 12:25:27 +0000 (13:25 +0100)]
brcmfmac: only support the BCM43455/7 device

Recently support was added for the BCM4345 SDIO chipset by
commit 9c51026509d7 ("brcmfmac: Add support for BCM4345 SDIO chipset")
however this was verified using a BCM43455 device, which is
a more recent revision of the chip. This patch assure that
older revisions are not probed as they would fail.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Syed Asifful Dayyan <syedd@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>
9 years agobrcmfmac: add support for BCM43430 SDIO chipset
Arend van Spriel [Wed, 18 Mar 2015 12:25:26 +0000 (13:25 +0100)]
brcmfmac: add support for BCM43430 SDIO chipset

This patch added support for the BCM43430 802.11n SDIO chipset.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
9 years agobrcmfmac: add MODULE_FIRMWARE() macros for bcm4356 PCIe device
Arend van Spriel [Wed, 18 Mar 2015 12:25:25 +0000 (13:25 +0100)]
brcmfmac: add MODULE_FIRMWARE() macros for bcm4356 PCIe device

The BCM4356 PCIe wireless device was added recently but overlooked
the fact that the MODULE_FIRMWARE() macros were missing for the
firmwares needed by this device.

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>
9 years agobrcmfmac: Remove unnecessary new-line in pcie console logging.
Hante Meuleman [Wed, 18 Mar 2015 12:25:24 +0000 (13:25 +0100)]
brcmfmac: Remove unnecessary new-line in pcie console logging.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: Update msgbuf commonring size for improved throughput.
Hante Meuleman [Wed, 18 Mar 2015 12:25:23 +0000 (13:25 +0100)]
brcmfmac: Update msgbuf commonring size for improved throughput.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: Add necessary memory barriers for SDIO.
Hante Meuleman [Wed, 18 Mar 2015 12:25:22 +0000 (13:25 +0100)]
brcmfmac: Add necessary memory barriers for SDIO.

SDIO uses a thread to handle all communication with the device,
for this data is exchanged between threads. This data needs proper
memory barriers to make sure that data "exchange" is going correct.

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>
9 years agobrcmfmac: avoid runtime-pm for sdio host controller
Arend van Spriel [Wed, 18 Mar 2015 12:25:21 +0000 (13:25 +0100)]
brcmfmac: avoid runtime-pm for sdio host controller

Several host controllers supporting runtime-pm are causing issues
with our sdio wireless cards because they disable the sdio interrupt
upon going into runtime suspend. This patch avoids that by doing
a pm_runtime_forbid() call during the probe. Tested with Sony Vaio
Duo 13 which uses sdhci-acpi host controller.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
9 years agomwifiex: missing curly braces in mwifiex_write_data_complete()
Dan Carpenter [Wed, 18 Mar 2015 08:22:35 +0000 (11:22 +0300)]
mwifiex: missing curly braces in mwifiex_write_data_complete()

It's clear from the indenting that curly braces were intended here.

Fixes: e35000ead491 ('mwifiex: preprocess packets from TX queue')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agort2x00: add new rt2800usb device DWA 130
Scott Branden [Mon, 16 Mar 2015 17:59:52 +0000 (10:59 -0700)]
rt2x00: add new rt2800usb device DWA 130

Add the USB Id to link the D-Link DWA 130 USB Wifi adapter
to the rt2830 driver.

Signed-off-by: Scott Branden <sbranden@broadcom.com>
Signed-off-by: Pieter Truter <ptruter@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: fall back to pseudo-DMS mcast for secure link and PBSS
Vladimir Kondratiev [Sun, 15 Mar 2015 14:00:24 +0000 (16:00 +0200)]
wil6210: fall back to pseudo-DMS mcast for secure link and PBSS

Multicast is not yet properly supported for all connection types;
actually, only non-secure AP is supported. For all other cases,
fall back to old "pseudo-DMS" approach. Namely, for:
- PBSS
- secure connection

When re-routing MCAST Rx->Tx on the AP, do not Tx back to the origin
of the frame

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: implement broadcast/multicast data
Vladimir Kondratiev [Sun, 15 Mar 2015 14:00:23 +0000 (16:00 +0200)]
wil6210: implement broadcast/multicast data

Use dedicated vring for multicast frames; this vring allocated for
AP and PBSS (both P2P GO and client) configurations

For short frames, use MCS0; for long - MCS1

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: add bcast structures to WMI
Vladimir Kondratiev [Sun, 15 Mar 2015 14:00:22 +0000 (16:00 +0200)]
wil6210: add bcast structures to WMI

Sync with the wmi definitions from the firmware team

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: Prefer ether_addr_copy() over memcpy()
Vladimir Kondratiev [Sun, 15 Mar 2015 14:00:21 +0000 (16:00 +0200)]
wil6210: Prefer ether_addr_copy() over memcpy()

Fix checkpatch warning:
WARNING: Prefer ether_addr_copy() over memcpy() if the
Ethernet addresses are __aligned(2)

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: Align Rx frames on 4*n+2 by having SNAP
Vladimir Kondratiev [Sun, 15 Mar 2015 14:00:19 +0000 (16:00 +0200)]
wil6210: Align Rx frames on 4*n+2 by having SNAP

For the networking code and for hardware network accelerators,
it is better to have IP header 4*n aligned. On the other side,
DMA on Rx path require buffer to be aligned on 4*n as well.
Having 14 bytes of Ethernet header, these 2 alignment
requests are in contradiction.

To solve this, order hardware offload block to not remove
SNAP header. This adds extra 6 bytes between addresses and
ethertype, making it 20 bytes total. This way, both buffer and
IP header are 4*n aligned. Remaining is only to remove SNAP
by shifting addresses 6 bytes. This involves data copying, so
this feature should be disabled unless required by the platform.

Module parameter "rx_align_2" (bool, default - false)
introduced to control this feature. Feature is completely disabled
when parameter is false.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: fix check for FW responsiveness
Vladimir Kondratiev [Sun, 15 Mar 2015 14:00:17 +0000 (16:00 +0200)]
wil6210: fix check for FW responsiveness

"echo" used to be called when no firmware loaded to the NIC,
this causes error output.

Probe firmware with "echo" only after it returned "ready" event.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: optimize index manipulation in wil_vring_reap_rx
Vladimir Kondratiev [Sun, 15 Mar 2015 14:00:16 +0000 (16:00 +0200)]
wil6210: optimize index manipulation in wil_vring_reap_rx

Use temporal variable for often used vring->swhead;
and use proper index in debug printing - vring->swhead
used before was modified in wil_vring_advance_head
and then increased value was used in debug print

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agocw1200: Fix suspend
Lars-Peter Clausen [Sun, 15 Mar 2015 13:26:20 +0000 (14:26 +0100)]
cw1200: Fix suspend

The cw1200 driver implements suspend and resume callbacks and assigns them
to the suspend and resume fields of the device_driver struct. These
callbacks are never actually called by anything though.

Modify the driver to properly use dev_pm_ops so that the suspend function
is actually executed upon suspend and drop the empty resume function.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortl8188ee: fix build break due to missing rtl_hal_pwrseqcmdparsing definition
Jeff Layton [Sat, 14 Mar 2015 16:07:17 +0000 (12:07 -0400)]
rtl8188ee: fix build break due to missing rtl_hal_pwrseqcmdparsing definition

I've been getting this error when building mainline kernels using
Fedora's config files:

    drivers/net/wireless/rtlwifi/rtl8188ee/hw.c: In function ‘_rtl88ee_init_mac’:
    drivers/net/wireless/rtlwifi/rtl8188ee/hw.c:853:2: error: implicit declaration of function ‘rtl_hal_pwrseqcmdparsing’ [-Werror=implicit-function-declaration]
      if (!rtl_hal_pwrseqcmdparsing(rtlpriv, PWR_CUT_ALL_MSK,
      ^
    cc1: some warnings being treated as errors
    scripts/Makefile.build:258: recipe for target 'drivers/net/wireless/rtlwifi/rtl8188ee/hw.o' failed

I'm not sure if this is the correct fix, but it does seem to allow the
build to complete. I suspect that this was broken by commit 34ed780a6afc
(rtlwifi: Fix problems with building an allyesconfig). Most of the files
that removed the include of pwrseqcmd.h, added one for ../pwrseqcmd.h.
The rtl8188ee driver had it removed it but didn't add the include of the
file in the parent directory.

Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Start AIC calibration during MCI reset
Sujith Manoharan [Sat, 14 Mar 2015 05:57:57 +0000 (11:27 +0530)]
ath9k: Start AIC calibration during MCI reset

When a MCI reset is done, make sure that AIC
is started.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Handle MCI_STATE_AIC_CAL
Sujith Manoharan [Sat, 14 Mar 2015 05:57:56 +0000 (11:27 +0530)]
ath9k: Handle MCI_STATE_AIC_CAL

Add the main AIC calibration function to
handle MCI_STATE_AIC_CAL.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Handle MCI_STATE_AIC_START
Sujith Manoharan [Sat, 14 Mar 2015 05:57:55 +0000 (11:27 +0530)]
ath9k: Handle MCI_STATE_AIC_START

This patch adds a function to handle the
MCI message MCI_STATE_AIC_START.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Handle MCI_STATE_AIC_CAL_RESET
Sujith Manoharan [Sat, 14 Mar 2015 05:57:54 +0000 (11:27 +0530)]
ath9k: Handle MCI_STATE_AIC_CAL_RESET

Add a routine to handle the MCI_STATE_AIC_CAL_RESET
message.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Disable AIC by default
Sujith Manoharan [Sat, 14 Mar 2015 05:57:53 +0000 (11:27 +0530)]
ath9k: Disable AIC by default

Since various MCI messages need to be
handled, along with driver-level support
in upper layers, disable AIC for now.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Process the AIC calibration results
Sujith Manoharan [Sat, 14 Mar 2015 05:57:52 +0000 (11:27 +0530)]
ath9k: Process the AIC calibration results

This patch adds support for post-processing
the AIC calibration results.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Finish AIC calibration
Sujith Manoharan [Sat, 14 Mar 2015 05:57:51 +0000 (11:27 +0530)]
ath9k: Finish AIC calibration

Set the appropriate bits in the HW after
AIC calibration is done.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Handle MCI_STATE_AIC_CAL_SINGLE
Sujith Manoharan [Sat, 14 Mar 2015 05:57:50 +0000 (11:27 +0530)]
ath9k: Handle MCI_STATE_AIC_CAL_SINGLE

This patch adds routines to handle the MCI
message AIC_CAL_SINGLE, starting the required
HW calibration.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Add register definitions for AIC
Sujith Manoharan [Sat, 14 Mar 2015 05:57:49 +0000 (11:27 +0530)]
ath9k: Add register definitions for AIC

Various registers to control and check AIC
status.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Register private AIC ops
Sujith Manoharan [Sat, 14 Mar 2015 05:57:48 +0000 (11:27 +0530)]
ath9k: Register private AIC ops

AIC can be disabled or enabled on a per-card
basis using MCI configuration, so register a function
to check its status.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Add initial structures for AIC
Sujith Manoharan [Sat, 14 Mar 2015 05:57:47 +0000 (11:27 +0530)]
ath9k: Add initial structures for AIC

These are necessary for implementing AIC,
supported by chips like WB222.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: delay skb allocation for RX until cmd53 over
Zhaoyang Liu [Fri, 13 Mar 2015 12:07:59 +0000 (17:37 +0530)]
mwifiex: delay skb allocation for RX until cmd53 over

This patch moves SKB allocation for RX packets from current
place i.e. after reading MP regs to place where we already
have read data from SDIO bus ie after cmd53.

mp_rx_aggr_setup has been modified accordingly to set
skb_arr to NULL.

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Shengzhen Li <szli@marvell.com>
Reviewed-by: Amitkumar Karwar <akarwar@marvell.com>
Reviewed-by: Cathy Luo <cluo@marvell.com>
Reviewed-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: add SDIO rx single port aggregation
Zhaoyang Liu [Fri, 13 Mar 2015 12:07:58 +0000 (17:37 +0530)]
mwifiex: add SDIO rx single port aggregation

This patch brings in support for SDIO single port rx aggregation
to mwifiex.
Maximum read size support by SDIO cmd53 is 64K.
Based on multi port aggregation which is already part of mwifiex, idea here
is multiple packets received in FW can be aggregated into single buffer.
A separate upload type is defined for such packet aggregated to single port.
Packets from this single buffer are later deaggregated into individual packets.
This way, driver can receive more packets each time through single SDIO cmd53;
thereby reducing no of times MMC bus is accessed.

SDIO SP aggregation support is advertised by FW during load time and driver
would get FW block size in command response of HostCmd_CMD_SDIO_SP_RX_AGGR_CFG.

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Marc Yang <yangyang@marvell.com>
Reviewed-by: Amitkumar Karwar <akarwar@marvell.com>
Reviewed-by: Cathy Luo <cluo@marvell.com>
Reviewed-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: preprocess packets from TX queue
Zhaoyang Liu [Fri, 13 Mar 2015 12:07:57 +0000 (17:37 +0530)]
mwifiex: preprocess packets from TX queue

During profiling, we discovered that driver remains idle for time
when pakcet is downloaded to FW but no TX_DONE has been received
i.e. while data_sent is true.

This patch adds enhancement to TX routine where we preprocess
packets from TX queue, make them ready for TX and add them to
separate TX queue.

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Marc Yang <yangyang@marvell.com>
Signed-off-by: Chin-ran Lo <crlo@marvell.com>
Reviewed-by: Cathy Luo <cluo@marvell.com>
Reviewed-by: Amitkumar Karwar <akarwar@marvell.com>
Reviewed-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: remove_bss_prio_lock
Zhaoyang Liu [Fri, 13 Mar 2015 12:07:56 +0000 (17:37 +0530)]
mwifiex: remove_bss_prio_lock

This patch does away with spinlock in
mwifiex_wmm_get_highest_priolist_ptr in order to improve TP.

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: get rid of BA setup helper functions
Zhaoyang Liu [Fri, 13 Mar 2015 12:07:55 +0000 (17:37 +0530)]
mwifiex: get rid of BA setup helper functions

This patch removes BA setup helper routines
mwifiex_is_bastream_setup and  mwifiex_is_amsdu_in_ampdu_allowed.

Current code will use two functions to check bastream setup and
amsdu in ampdu. This patch change these functions to flags, thus
avoiding redundant spin_lock check while dequeuing TX packets.

Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Reviewed-by: Cathy Luo <cluo@marvell.com>
Reviewed-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: avoid queue_work while work is ongoing
Shengzhen Li [Fri, 13 Mar 2015 12:07:54 +0000 (17:37 +0530)]
mwifiex: avoid queue_work while work is ongoing

Current code does not check whether main_work_queue or
rx_work_queue is running when preparing to do queue_work,
this code fix add check before calling queue_work, reducing
unnecessary queue_work switch.

This change instead sets more_task flag to ensure we run main_process
superloop once again.

Signed-off-by: Shengzhen Li <szli@marvell.com>
Signed-off-by: Zhaoyang Liu <liuzy@marvell.com>
Reviewed-by: Cathy Luo <cluo@marvell.com>
Reviewed-by: Amitkumar Karwar <akarwar@marvell.com>
Reviewed-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: enhance SD8897 MP aggregation limits
Avinash Patil [Fri, 13 Mar 2015 12:07:53 +0000 (17:37 +0530)]
mwifiex: enhance SD8897 MP aggregation limits

SD8897 support buffers of 4K and 16 such ports can be accomodated.
So basically 64K buffer size in single aggregation is supported.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: rename alloc_rx_buf to alloc_dma_aligned_buf
Avinash Patil [Fri, 13 Mar 2015 12:07:52 +0000 (17:37 +0530)]
mwifiex: rename alloc_rx_buf to alloc_dma_aligned_buf

Rename this function to reflect its purpose correctly.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: lock main process till reinitialization of vif is over
Avinash Patil [Fri, 13 Mar 2015 12:07:51 +0000 (17:37 +0530)]
mwifiex: lock main process till reinitialization of vif is over

A crash was detected while changing virtual interface type is in
progress. This was tracked to race condition in accessing bss_priority
table while change is in progress. This patch ensures that main_process
and rx_process works are locked while we change virtual interface.

Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowl18xx: show rx_frames_per_rates as an array as it really is
Nicolas Iooss [Fri, 13 Mar 2015 07:17:14 +0000 (15:17 +0800)]
wl18xx: show rx_frames_per_rates as an array as it really is

In struct wl18xx_acx_rx_rate_stat, rx_frames_per_rates field is an
array, not a number.  This means WL18XX_DEBUGFS_FWSTATS_FILE can't be
used to display this field in debugfs (it would display a pointer, not
the actual data).  Use WL18XX_DEBUGFS_FWSTATS_FILE_ARRAY instead.

This bug has been found by adding a __printf attribute to
wl1271_format_buffer.  gcc complained about "format '%u' expects
argument of type 'unsigned int', but argument 5 has type 'u32 *'".

Fixes: c5d94169e818 ("wl18xx: use new fw stats structures")
Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agort2x00usb: drop rt2x00usb_disable_radio() from rt2800usb_disable_radio()
Sebastian Andrzej Siewior [Thu, 12 Mar 2015 14:35:46 +0000 (15:35 +0100)]
rt2x00usb: drop rt2x00usb_disable_radio() from rt2800usb_disable_radio()

I have here FRITZ!WLAN USB Stick N v2 / idVendor=057c, idProduct=8501
and every single of this requests ends up with:

|ieee80211 phy0: rt2x00usb_vendor_request: Error - Vendor Request 0x0c  failed for offset 0x0000 with error -32

I was browsing the the vedor code and I haven't seen such request so I
remove it with this patch. If I wasn't look enough or if this error is
expected then please excuse :)

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agort2x00usb: check USB's request error code in rt2800usb_autorun_detect()
Sebastian Andrzej Siewior [Thu, 12 Mar 2015 14:35:45 +0000 (15:35 +0100)]
rt2x00usb: check USB's request error code in rt2800usb_autorun_detect()

rt2800usb_autorun_detect() blindly assumes assumes that it worked while
it could have failed. Check the error code here.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agort2x00usb: initialize the read value in case of failure
Sebastian Andrzej Siewior [Thu, 12 Mar 2015 14:35:44 +0000 (15:35 +0100)]
rt2x00usb: initialize the read value in case of failure

My understanding ist that rt2x00usb_register_read() is void and so the
reader is unaware of read errors and assumes that whatever was on the
stack as it was about to read.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: use del_timer variant in interrupt context
Amitkumar Karwar [Thu, 12 Mar 2015 07:38:40 +0000 (00:38 -0700)]
mwifiex: use del_timer variant in interrupt context

We might be in interrupt context at few places. So replace
del_timer_sync() with del_timer(). This patch fixes a kernel
trace problem seen occasionally during our testing.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: Add support for auto ARP in mwifiex.
Maithili Hinge [Thu, 12 Mar 2015 07:38:39 +0000 (00:38 -0700)]
mwifiex: Add support for auto ARP in mwifiex.

This patch adds support for auto ARP feature in mwifiex.
The device will respond to ARP requests from the network
with ARP response in suspended state without waking up the host.
This feature is enabled in the driver by default.

Signed-off-by: Maithili Hinge <maithili@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: fix a bug in Rx multiport aggregation logic
Cathy Luo [Thu, 12 Mar 2015 08:29:31 +0000 (01:29 -0700)]
mwifiex: fix a bug in Rx multiport aggregation logic

It's been observed Rx aggregated packets are always followed
by a single Rx packet. This patch improves our logic to add
that extra packet in next aggregation.

Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: No need to export rtl_evm_dbm_jaguar anymore
Priit Laes [Wed, 11 Mar 2015 20:03:27 +0000 (22:03 +0200)]
rtlwifi: No need to export rtl_evm_dbm_jaguar anymore

This function is used only by rtl8821ae so move it there

Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: Clean rtl_evm_db_to_percentage a bit
Priit Laes [Wed, 11 Mar 2015 20:03:25 +0000 (22:03 +0200)]
rtlwifi: Clean rtl_evm_db_to_percentage a bit

Signed-off-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: allow 40MHz radar detection width
Zefir Kurtisi [Tue, 10 Mar 2015 16:49:31 +0000 (17:49 +0100)]
ath9k: allow 40MHz radar detection width

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: add DFS support for extension channel
Zefir Kurtisi [Tue, 10 Mar 2015 16:49:30 +0000 (17:49 +0100)]
ath9k: add DFS support for extension channel

In HT40 modes, pulse events on primary and extension
channel are processed individually. If valid, a pulse
event will be fed into the detector
* for primary frequency, or
* for extension frequency (+/-20MHz based on HT40-mode)
* or both

With that, a 40MHz radar will result in two individual
radar events.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: restart only triggering DFS detector line
Zefir Kurtisi [Tue, 10 Mar 2015 16:49:29 +0000 (17:49 +0100)]
ath9k: restart only triggering DFS detector line

To support HT40 DFS mode, a triggering detector must
reset only itself but not other detector lines.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoRevert "bcma: Kconfig: Let it depend on PCI"
Rafał Miłecki [Thu, 5 Mar 2015 17:25:12 +0000 (18:25 +0100)]
Revert "bcma: Kconfig: Let it depend on PCI"

This reverts commit b09f5ec18b16b82f4db8a735e453332db7514275.

Now that we have fully working BCMA_DRIVER_PCI symbol (in can be safely
disabled), there is no risk bcma will try to use PCI code without PCI
available.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: allow disabling (not building) PCI driver
Rafał Miłecki [Thu, 5 Mar 2015 17:25:11 +0000 (18:25 +0100)]
bcma: allow disabling (not building) PCI driver

It isn't required for bcma bus on SoCs, so provide some empty functions
and allow disabling it.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: move PCI IRQ control function to host specific code
Rafał Miłecki [Thu, 5 Mar 2015 17:25:10 +0000 (18:25 +0100)]
bcma: move PCI IRQ control function to host specific code

This function isn't really related to any bus core. It touches PCI
device config registers only, so move it to the (PCI) host file.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8192cu: remove unused arguments from _beacon_function_enable()
Taehee Yoo [Mon, 9 Mar 2015 15:07:08 +0000 (00:07 +0900)]
rtlwifi: rtl8192cu: remove unused arguments from _beacon_function_enable()

Remove unnecessary parameter in rtl8192cu/hw.c

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agolibertas_tf: if_usb.c: don't export static symbol
Julia Lawall [Wed, 11 Mar 2015 16:56:30 +0000 (17:56 +0100)]
libertas_tf: if_usb.c: don't export static symbol

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
type T;
identifier f;
@@

static T f (...) { ... }

@@
identifier r.f;
declarer name EXPORT_SYMBOL_GPL;
@@

-EXPORT_SYMBOL_GPL(f);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: fix watchdog timer regression
Arend van Spriel [Wed, 11 Mar 2015 15:11:33 +0000 (16:11 +0100)]
brcmfmac: fix watchdog timer regression

The watchdog timer is used to put the device in a low-power mode when
it is idle for some time. This timer is stopped during that mode and
should be restarted upon activity. This has been broken by commit
d4150fced0365 ("brcmfmac: Simplify watchdog sleep."). This patch
restores the behaviour as it was before that commit.

Reported-by: Pontus Fuchs <pontusf@broadcom.com>
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>
9 years agobrcmfmac: take save&restore memory into account for SDIO shared info
Arend van Spriel [Wed, 11 Mar 2015 15:11:32 +0000 (16:11 +0100)]
brcmfmac: take save&restore memory into account for SDIO shared info

The firmware provides pointer to SDIO shared information at end of
RAM during firmware initialization. End of RAM is obviously determined
by the actual ram size, but part of that may be used for save&restore
memory. In that case another location in RAM will hold the pointer.

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>
9 years agobrcmfmac: extract ram size info from internal memory registers
Arend van Spriel [Wed, 11 Mar 2015 15:11:31 +0000 (16:11 +0100)]
brcmfmac: extract ram size info from internal memory registers

Instead of hard-coded memory sizes it is possible to obtain that
information from the internal memory registers.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
9 years agobrcmfmac: assure device is ready for download after brcmf_chip_attach()
Arend van Spriel [Wed, 11 Mar 2015 15:11:30 +0000 (16:11 +0100)]
brcmfmac: assure device is ready for download after brcmf_chip_attach()

Make the brcmf_chip_attach() function responsible for putting the
device in a state where it is accessible for firmware download.

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>
9 years agobrcmfmac: rename chip download functions
Arend van Spriel [Wed, 11 Mar 2015 15:11:29 +0000 (16:11 +0100)]
brcmfmac: rename chip download functions

The functions brcmf_chip_[enter/exit]_download() are not exclusively
used for firmware download so rename these more appropriate.

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>
9 years agobrcmfmac: always perform cores checks
Arend van Spriel [Wed, 11 Mar 2015 15:11:28 +0000 (16:11 +0100)]
brcmfmac: always perform cores checks

Instead of checking the cores in the chip only if CONFIG_BRCMDBG
is selected perform the check always and extend it with more sanity
checking.

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>
9 years agobrcmfmac: remove duplication of ramsize info
Arend van Spriel [Wed, 11 Mar 2015 15:11:27 +0000 (16:11 +0100)]
brcmfmac: remove duplication of ramsize info

Removing the ramsize from the brcmf_sdio structure to avoid
duplication. The information is available in brcmf_chip
structure.

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>
9 years agoath9k: make ath_frame_info fit into reduced-size rate_driver_data
Florian Westphal [Tue, 10 Mar 2015 14:44:22 +0000 (15:44 +0100)]
ath9k: make ath_frame_info fit into reduced-size rate_driver_data

pre-requisite to shrink size of ieee80211_tx_info which in turn is
needed to shrink skb->cb to 40 bytes again.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoar5523: use container_of
Florian Westphal [Tue, 10 Mar 2015 14:25:39 +0000 (15:25 +0100)]
ar5523: use container_of

If we want to shrink skb->cb then we'd have to see about
reducing struct ieee80211_tx_info, which gets embedded inside
skb->cb[].

It provides a scratch space to be used by wireless drivers.
ar5523 uses the maximum space available today (40 bytes), but it seems
we don't need this -- data->skb pointer seems to always point back to the
skb whose cb buffer the data structure resides, iow, given a pointer to the
embedded control buffer we can infer the skb address.

Tested-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Fix RTT chainmask usage
Sujith Manoharan [Mon, 9 Mar 2015 08:50:10 +0000 (14:20 +0530)]
ath9k: Fix RTT chainmask usage

Since the RTT registers need to be configured for all
valid chains irrespective of the runtime chainmask,
use the actual chainmask of the chip.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Check allowed PCIE powersave configuration
Sujith Manoharan [Mon, 9 Mar 2015 08:50:09 +0000 (14:20 +0530)]
ath9k: Check allowed PCIE powersave configuration

When assigning the initvals for PCIE sleep/awake
registers, check the configuration that has been
assigned to pll_pwrsave during initialization. Also,
display a warning if we don't have valid arrays.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Initialize pll_pwrsave for AR9462/AR9565
Sujith Manoharan [Mon, 9 Mar 2015 08:50:08 +0000 (14:20 +0530)]
ath9k: Initialize pll_pwrsave for AR9462/AR9565

Cards based on AR9462/AR9565 support more PCIE
power save mechanisms, so register them correctly.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Fix PLL powersave for AR9485
Sujith Manoharan [Mon, 9 Mar 2015 08:50:07 +0000 (14:20 +0530)]
ath9k: Fix PLL powersave for AR9485

Use the value in ah->config.pll_pwrsave to determine
which array needs to be loaded. Also, initialize
pll_pwrsave to 1 by default.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Add PCIE powersave macros
Sujith Manoharan [Mon, 9 Mar 2015 08:50:06 +0000 (14:20 +0530)]
ath9k: Add PCIE powersave macros

These will be used to handle chip-specific
power save configuration.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: support AP isolation
Vladimir Kondratiev [Sun, 8 Mar 2015 13:42:03 +0000 (15:42 +0200)]
wil6210: support AP isolation

For the AP, configuration may say not to bridge traffic between
wireless clients. This is conveyed from user space (ex: hostapd has
ap_isolate parameter) with NL80211_CMD_SET_BSS, to the driver's
cfg80211 ops method change_bss

Add support for this setting.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: re-submit Rx frames to the wireless media if appropriate
Vladimir Kondratiev [Sun, 8 Mar 2015 13:42:02 +0000 (15:42 +0200)]
wil6210: re-submit Rx frames to the wireless media if appropriate

This is for AP only. If Rx data frame targeted to one of associated clients,
transmit it back to the wireless media and don't deliver to the host.
For the multicast frames, deliver to both host and wireless media.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: NAPI completion refactor
Vladimir Kondratiev [Sun, 8 Mar 2015 13:42:01 +0000 (15:42 +0200)]
wil6210: NAPI completion refactor

It is expected that driver completes NAPI when less than
full budget is consumed.

Fulfill this requirement.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: Add support for BCM4345 SDIO chipset.
Syed Asifful Dayyan [Fri, 6 Mar 2015 17:40:42 +0000 (18:40 +0100)]
brcmfmac: Add support for BCM4345 SDIO chipset.

These changes add support for BCM4345 SDIO chipset.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Syed Asifful Dayyan <syedd@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: Fix race condition in msgbuf ioctl processing.
Hante Meuleman [Fri, 6 Mar 2015 17:40:41 +0000 (18:40 +0100)]
brcmfmac: Fix race condition in msgbuf ioctl processing.

Msgbuf is using a wait_event_timeout to wait for the response on
an ioctl. The wakeup routine uses waitqueue_active to see if
wait_event_timeout has been called. There is a chance that the
response arrives before wait_event_timeout is called, this
will result in situation that wait_event_timeout never gets
woken again and assumed result will be a timeout. This patch
removes that errornous situation by always setting the
ctl_completed var before checking for queue active.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: Fix possible race-condition.
Hante Meuleman [Fri, 6 Mar 2015 17:40:40 +0000 (18:40 +0100)]
brcmfmac: Fix possible race-condition.

SDIO is using a "shared" variable to handoff ctl frames to DPC
and to see when they are done. In a timeout situation this can
lead to erroneous situation where DPC started to handle the ctl
frame while the timeout expired. This patch will fix this by
adding locking around the shared variable.

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>
9 years agobrcmfmac: Simplify watchdog sleep.
Hante Meuleman [Fri, 6 Mar 2015 17:40:39 +0000 (18:40 +0100)]
brcmfmac: Simplify watchdog sleep.

The watchdog thread is used to put the SDIO bus to sleep when the
system is idling. This patch simplifies the way it is determined
when sleep can be entered.

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>
9 years agobrcmfmac: Fix oops when SDIO device is removed.
Hante Meuleman [Fri, 6 Mar 2015 17:40:38 +0000 (18:40 +0100)]
brcmfmac: Fix oops when SDIO device is removed.

On removal of SDIO card both functions of card will be getting
a remove call. When the first is hanging in ctrl frame xmit then
the second will cause oops. This patch fixes the xmit ctrl
handling in case of serious errors and also limits the handling
for remove to function 1 only.

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>
9 years agortlwifi: Remove duplicated prototype
Taehee Yoo [Fri, 6 Mar 2015 15:47:17 +0000 (00:47 +0900)]
rtlwifi: Remove duplicated prototype

Remove duplicated prototype in base.h

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath5k: fix reset race
Sergey Ryazanov [Wed, 4 Mar 2015 02:12:11 +0000 (05:12 +0300)]
ath5k: fix reset race

To prepare for reset ath5k should finish all asynchronous tasks. At
first, it disables the interrupt generation, then it waits for the
interrupt handler and tasklets completion, and then proceeds to the HW
configuration update. But it does not consider that the interrupt
handler or tasklet re-enables the interrupt generation. And we fall in a
situation when ath5k assumes that interrupts are disabled, but it is
not.

This can lead to different consequences, such as reception of the frame,
when we do not expect it. Under certain circumstances, this can lead to
the following warning:

  WARNING: at ath5k/base.c:589 ath5k_tasklet_rx+0x318/0x6ec [ath5k]()
  invalid hw_rix: 1a
  [..]
  Call Trace:
  [<802656a8>] show_stack+0x48/0x70
  [<802dd92c>] warn_slowpath_common+0x88/0xbc
  [<802dd98c>] warn_slowpath_fmt+0x2c/0x38
  [<81b51be8>] ath5k_tasklet_rx+0x318/0x6ec [ath5k]
  [<8028ac64>] tasklet_action+0x8c/0xf0
  [<80075804>] __do_softirq+0x180/0x32c
  [<80196ce8>] irq_exit+0x54/0x70
  [<80041848>] ret_from_irq+0x0/0x4
  [<80182fdc>] ioread32+0x4/0xc
  [<81b4c42c>] ath5k_hw_set_sleep_clock+0x2ec/0x474 [ath5k]
  [<81b4cf28>] ath5k_hw_reset+0x50/0xeb8 [ath5k]
  [<81b50900>] ath5k_reset+0xd4/0x310 [ath5k]
  [<81b557e8>] ath5k_config+0x4c/0x104 [ath5k]
  [<80d01770>] ieee80211_hw_config+0x2f4/0x35c [mac80211]
  [<80d09aa8>] ieee80211_scan_work+0x2e4/0x414 [mac80211]
  [<8022c3f4>] process_one_work+0x28c/0x400
  [<802df8f8>] worker_thread+0x258/0x3c0
  [<801b5710>] kthread+0xe0/0xec
  [<800418a8>] ret_from_kernel_thread+0x14/0x1c

Fix this issue by adding a new status flag, which forbids to re-enable
the interrupt generation until the HW configuration is completed.

Note: previous patch, which reorders the Rx disable code helps to avoid
the above warning, but not fixes the root cause of unexpected frame
receiving.

CC: Jiri Slaby <jirislaby@gmail.com>
CC: Nick Kossifidis <mickflemm@gmail.com>
CC: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Reported-by: Christophe Prevotaux <cprevotaux@nltinc.com>
Tested-by: Christophe Prevotaux <cprevotaux@nltinc.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 agoath5k: channel change fix
Sergey Ryazanov [Wed, 4 Mar 2015 02:12:10 +0000 (05:12 +0300)]
ath5k: channel change fix

ath5k updates the channel pointer and after that it stops the Rx logic
and apply channel to HW. In case of channel switch, such sequence
creates a small window when a frame, which is received on the old
channel is considered as a frame received on the new one.

The most notable consequence of this situation occurs during the switch
from 2 GHz band (CCK+OFDM) to the 5GHz band (OFDM-only). Frame received
with CCK rate, e.g. beacon received at the 1mbps, causes the following
warning:

  WARNING: at ath5k/base.c:589 ath5k_tasklet_rx+0x318/0x6ec [ath5k]()
  invalid hw_rix: 1a
  [..]
  Call Trace:
  [<802656a8>] show_stack+0x48/0x70
  [<802dd92c>] warn_slowpath_common+0x88/0xbc
  [<802dd98c>] warn_slowpath_fmt+0x2c/0x38
  [<81b51be8>] ath5k_tasklet_rx+0x318/0x6ec [ath5k]
  [<8028ac64>] tasklet_action+0x8c/0xf0
  [<80075804>] __do_softirq+0x180/0x32c
  [<80196ce8>] irq_exit+0x54/0x70
  [<80041848>] ret_from_irq+0x0/0x4
  [<80182fdc>] ioread32+0x4/0xc
  [<81b4c42c>] ath5k_hw_set_sleep_clock+0x2ec/0x474 [ath5k]
  [<81b4cf28>] ath5k_hw_reset+0x50/0xeb8 [ath5k]
  [<81b50900>] ath5k_reset+0xd4/0x310 [ath5k]
  [<81b557e8>] ath5k_config+0x4c/0x104 [ath5k]
  [<80d01770>] ieee80211_hw_config+0x2f4/0x35c [mac80211]
  [<80d09aa8>] ieee80211_scan_work+0x2e4/0x414 [mac80211]
  [<8022c3f4>] process_one_work+0x28c/0x400
  [<802df8f8>] worker_thread+0x258/0x3c0
  [<801b5710>] kthread+0xe0/0xec
  [<800418a8>] ret_from_kernel_thread+0x14/0x1c

The easiest way to reproduce this warning is to run scan with dualband
NIC in noisy environments, when the channel 11 runs multiple APs. In my
tests if the APs num >= 12, the warning appears in the first few
seconds of scanning.

In order to fix this, the Rx disable code moved to a higher level and
placed before the channel pointer update. This is also makes the code a
bit more symmetrical, since we disable and enable the Rx in the same
function.

In fact, at the pointer update time new frames should not appear,
because interrupt generation at this point should already be disabled.
The next patch should address this issue.

CC: Jiri Slaby <jirislaby@gmail.com>
CC: Nick Kossifidis <mickflemm@gmail.com>
CC: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Reported-by: Christophe Prevotaux <cprevotaux@nltinc.com>
Tested-by: Christophe Prevotaux <cprevotaux@nltinc.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 agoMerge tag 'iwlwifi-next-for-kalle-2015-03-12' of https://git.kernel.org/pub/scm/linux...
Kalle Valo [Fri, 13 Mar 2015 13:09:18 +0000 (15:09 +0200)]
Merge tag 'iwlwifi-next-for-kalle-2015-03-12' of https://git./linux/kernel/git/iwlwifi/iwlwifi-next

* Location Aware Regulatory was added by Arik
* 8000 device family work
* Update to the BT Coex firmware API

9 years agovxlan: Don't set s_addr in vxlan_create_sock
Simon Horman [Fri, 13 Mar 2015 02:00:58 +0000 (11:00 +0900)]
vxlan: Don't set s_addr in vxlan_create_sock

In the case of AF_INET s_addr was set to INADDR_ANY (0) which which both
symmetric with the AF_INET6 case, where s_addr is not set, and unnecessary
as udp_conf is zeroed out earlier in the same function.

I suspect this change does not have any run-time effect due to compiler
optimisations. But it does make the code a little easier on the/my eyes.

Cc: Tom Herbert <therbert@google.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agompls: In mpls_egress verify the packet length.
Eric W. Biederman [Thu, 12 Mar 2015 23:22:59 +0000 (18:22 -0500)]
mpls: In mpls_egress verify the packet length.

Reobert Shearman noticed that mpls_egress is failing to verify that
the bytes to be examined are in fact present in the packet before
mpls_egress reads those bytes.

As suggested by David Miller reduce this to a single pskb_may_pull
call so that we don't do unnecessary work in the fast path.

Reported-by: Robert Shearman <rshearma@brocade.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet/macb: Only adjust tx_clk on link change
Jaeden Amero [Thu, 12 Mar 2015 23:07:54 +0000 (18:07 -0500)]
net/macb: Only adjust tx_clk on link change

The PHY state machine (in drivers/net/phy/phy.c) will unconditionally
call phydev->adjust_link (macb_handle_link_change) when polling in the
PHY_CHANGELINK state. As currently written, macb always ends up
requesting a new tx_clk frequency in macb_handle_link_change. It is a
waste of time to request a new tx_clk frequency if the link state hasn't
changed, as the tx_clk will already be configured properly.

Let's only request a new tx_clk clock frequency when necessary.

Signed-off-by: Jaeden Amero <jaeden.amero@ni.com>
Cc: Josh Cartwright <joshc@ni.com>
Cc: Soren Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agorhashtable: Fix read-side crash during rehash
Herbert Xu [Fri, 13 Mar 2015 01:54:10 +0000 (12:54 +1100)]
rhashtable: Fix read-side crash during rehash

This patch fixes a typo rhashtable_lookup_compare where we fail
to recompute the hash when looking up the new table.  This causes
elements to be missed and potentially a crash during a resize.

Reported-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agorhashtable: kill ht->shift atomic operations
Daniel Borkmann [Thu, 12 Mar 2015 14:28:40 +0000 (15:28 +0100)]
rhashtable: kill ht->shift atomic operations

Commit c0c09bfdc415 ("rhashtable: avoid unnecessary wakeup for worker
queue") changed ht->shift to be atomic, which is actually unnecessary.

Instead of leaving the current shift in the core rhashtable structure,
it can be cached inside the individual bucket tables.

There, it will only be initialized once during a new table allocation
in the shrink/expansion slow path, and from then onward it stays immutable
for the rest of the bucket table liftime.

That allows shift to be non-atomic. The patch also moves hash_rnd
management into the table setup. The rhashtable structure now consumes
3 instead of 4 cachelines.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Ying Xue <ying.xue@windriver.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agorhashtable: Fix reader/rehash race
Herbert Xu [Thu, 12 Mar 2015 11:07:49 +0000 (22:07 +1100)]
rhashtable: Fix reader/rehash race

There is a potential race condition between readers and the rehasher.
In particular, the rehasher could have started a rehash while the
reader finishes a scan of the old table but fails to see the new
table pointer.

This patch closes this window by adding smp_wmb/smp_rmb.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>