firefly-linux-kernel-4.4.55.git
9 years agomwifiex: recover from skb allocation failures during RX
Zhaoyang Liu [Mon, 23 Mar 2015 14:20:56 +0000 (19:50 +0530)]
mwifiex: recover from skb allocation failures during RX

This patch adds recovery mechanism for SDIO RX during SKB allocation
failures.
For allocation failures during multiport aggregation, we skip and drop RX
packets.
For single port read case, we will use preallocated card->mpa_rx.buf to
complete cmd53 read.
Now we terminate SDIO operations only upon cmd53 failures.

CC: James Cameron <quozl@laptop.org>
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: stop command path in suspend handler
Avinash Patil [Mon, 23 Mar 2015 14:20:55 +0000 (19:50 +0530)]
mwifiex: stop command path in suspend handler

Cancel all pending commands including scan commands and stop CAC
during cfg80211 suspend handler.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: remove an unneede NULL check in mwifiex_init_adapter()
Dan Carpenter [Mon, 23 Mar 2015 09:35:51 +0000 (12:35 +0300)]
mwifiex: remove an unneede NULL check in mwifiex_init_adapter()

"adapter->sleep_cfm" is always non-NULL at this point.  Static checkers
complain that we already dereference it at the start of the function
when we do:

skb_put(adapter->sleep_cfm, sizeof(struct mwifiex_opt_sleep_confirm));

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: Fix issue in the SDIO reset path of mwifiex.
Maithili Hinge [Mon, 23 Mar 2015 06:01:25 +0000 (23:01 -0700)]
mwifiex: Fix issue in the SDIO reset path of mwifiex.

SDIO reset was not happening properly on mwifiex as cancel_work_sync
in mwifiex_sdio_remove used to kill the calling work function itself.
Due to this, the interface was not getting removed and card was not
getting added again. Reset work function has been made independent
of adapter variable and cancel_work_sync has been moved to cleanup
function.

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 agoath9k: use REG_RMW and rmw buffer in ath9k_hw_def_set_gain
Oleksij Rempel [Sun, 22 Mar 2015 18:30:03 +0000 (19:30 +0100)]
ath9k: use REG_RMW and rmw buffer in ath9k_hw_def_set_gain

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: use REG_RMW and rmw buffer in ath9k_hw_4k_set_board_values
Oleksij Rempel [Sun, 22 Mar 2015 18:30:02 +0000 (19:30 +0100)]
ath9k: use REG_RMW and rmw buffer in ath9k_hw_4k_set_board_values

replace REG_WRITE to REG_RMW and place every thing in one
RMW buffer.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: use REG_RMW and rmw buffer in ath9k_hw_4k_set_gain
Oleksij Rempel [Sun, 22 Mar 2015 18:30:01 +0000 (19:30 +0100)]
ath9k: use REG_RMW and rmw buffer in ath9k_hw_4k_set_gain

it is possible to reduce time needed for this function
by rplacing REG_WRITE with REG_RMW (plus dummy 0) and putt all commands
in same buffer.

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

it will reduce exution time from 14ms to 2ms on ar9271

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

use REG_RMW in ath9k_hw_analog_shift_rmw.
It will double execution speed on usb bus.

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

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

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

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

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

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

this will reduce some overhead on usb bus.

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 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>