platform/kernel/linux-rpi.git
9 years agomwifiex: disable UAPSD mode when AP starts
Amitkumar Karwar [Fri, 30 Jan 2015 08:40:07 +0000 (00:40 -0800)]
mwifiex: disable UAPSD mode when AP starts

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

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

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

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

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

Memory is leaked after downloading already processed packet. This
patch fixes the problem by freeing returned skb. Other transmit
paths don't have this problem.

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Troy Tan <troy_tan@realsil.com.cn>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [V3.18]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agob43: AC-PHY: prepare place for developing new PHY support
Rafał Miłecki [Sun, 25 Jan 2015 17:01:37 +0000 (18:01 +0100)]
b43: AC-PHY: prepare place for developing new PHY support

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

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

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

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

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

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

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

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

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

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

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

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

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

These chipsets don't need changing clock mode.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: set wiphy params only once
Avinash Patil [Wed, 28 Jan 2015 10:11:59 +0000 (15:41 +0530)]
mwifiex: set wiphy params only once

RTS threshold, fragmentation threshold are per device properties.
Setting them on any interface would be reflected for all other
interfaces as well. This patch removes unnesessary command download
per interface.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: remove redundant nick_name variable
Avinash Patil [Wed, 28 Jan 2015 10:11:58 +0000 (15:41 +0530)]
mwifiex: remove redundant nick_name variable

This is not used anywhere execpt initialization.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agossb: Fix Sparse error in main
Pramod Gurav [Wed, 28 Jan 2015 05:49:47 +0000 (11:19 +0530)]
ssb: Fix Sparse error in main

This change fixes below sparse error:
drivers/ssb/main.c:94:16: warning: symbol 'ssb_sdio_func_to_bus'
was not declared. Should it be static?

Acked-by: Michael Buesch <m@bues.ch>
Signed-off-by: Pramod Gurav <pramod.gurav@smartplayin.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: fix nvram processing
Arend van Spriel [Sun, 25 Jan 2015 19:31:43 +0000 (20:31 +0100)]
brcmfmac: fix nvram processing

The nvram file can hold a key=value combination in which the value
may have spaces, ie. 'RAW1=80 02 fe ff'. The parsing functionality
did not deal with this so it gives an error message:

[621746.311635] brcmfmac: brcmf_nvram_handle_key
warning: ln=90:col=11: '=' expected, skip invalid key entry

because RAW1=80 is being considerd as key=value pair and it expects
'=' sign after '02' for next key=value pair. This entry can be
completely ignored as firmware does not need it.

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: store revinfo retrieval result
Arend van Spriel [Sun, 25 Jan 2015 19:31:42 +0000 (20:31 +0100)]
brcmfmac: store revinfo retrieval result

When revinfo retrieval fails we can not show the firmware version
in ethtool driver info. Store the result to be used when handling
ethtool driver info callback.

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: show firmware release info in ethtool driver info
Arend van Spriel [Sun, 25 Jan 2015 19:31:41 +0000 (20:31 +0100)]
brcmfmac: show firmware release info in ethtool driver info

The ethtool driver info already contained the unique firmware
identifier. This patch adds the firmware release version.

   $ ethtool -i wlan4
   driver: brcmfmac
   version: 6.10.224.22
   firmware-version: 01-32bd010f

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 obtain device revision info upon intialization
Arend van Spriel [Sun, 25 Jan 2015 19:31:40 +0000 (20:31 +0100)]
brcmfmac: always obtain device revision info upon intialization

Obtain device revision information and store it.

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: determine chip info when not provided by bus layer
Arend van Spriel [Sun, 25 Jan 2015 19:31:39 +0000 (20:31 +0100)]
brcmfmac: determine chip info when not provided by bus layer

In some scenarios the chip number and revision may not be provided
by the bus layer. If the chip number is not filled, the common
layer will ask the firmware for this information.

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 agobrcmutil: use define for boardrev string function
Arend van Spriel [Sun, 25 Jan 2015 19:31:38 +0000 (20:31 +0100)]
brcmutil: use define for boardrev string function

Introducing a define that the caller of brcmu_boardrev_str() can
use to allocate enough room for buffer passed to the function.

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: do not load firmware when device is already running
Arend van Spriel [Sun, 25 Jan 2015 19:31:37 +0000 (20:31 +0100)]
brcmfmac: do not load firmware when device is already running

In brcmf_usb_probe_cb() the device is checked to determine whether
it is already running firmware. However, when no firmware download
is needed it still continues to request the firmware files. This
is fixed by returning after successful setup.

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: Reopen netdev queue on bus state data.
Hante Meuleman [Sun, 25 Jan 2015 19:31:36 +0000 (20:31 +0100)]
brcmfmac: Reopen netdev queue on bus state data.

During suspend the bus state is put in the down state. When data
is being transmitted during this state then the netdev queue will
be close. This patch will wake the queue on state data if the
queue was closed.

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: SDIO: avoid using bus state for private states.
Hante Meuleman [Sun, 25 Jan 2015 19:31:35 +0000 (20:31 +0100)]
brcmfmac: SDIO: avoid using bus state for private states.

Each bus driver is maintaing an exported bus state indicating
if upper layers can or cannot send data. SDIO is using this state
also for more private states. This makes handling the states and
state changes complex. This patch minimises the exposed states
and makes SDIO keep track of an internal state where necessary.

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: wait for driver to go idle during suspend
Arend van Spriel [Sun, 25 Jan 2015 19:31:34 +0000 (20:31 +0100)]
brcmfmac: wait for driver to go idle during suspend

Before going in suspend state the watchdog thread needs to put the
device in bus sleep state, which assures it can go in deep-sleep
state during D3 state.

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: pass DEAUTH/DISASSOC reason code to user-space
Arend van Spriel [Sun, 25 Jan 2015 19:31:33 +0000 (20:31 +0100)]
brcmfmac: pass DEAUTH/DISASSOC reason code to user-space

The driver always called cfg80211_disconnected() with reason parameter
set to zero, ie. unknown. However, firmware does provide a valid
802.11 reason code in DEAUTH and DISASSOC event message to the driver.
This patch passes the reason code to cfg80211_disconnected().

Reviewed-by: Daniel (Deognyoun) Kim <dekim@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: use SDIO DPC for control frames.
Hante Meuleman [Sun, 25 Jan 2015 19:31:32 +0000 (20:31 +0100)]
brcmfmac: use SDIO DPC for control frames.

Control frames are normally handled outside DPC, but sometimes
within DPC. To simplify code always handle control within DPC.

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: prevent possible deadlock on resuming SDIO device.
Hante Meuleman [Sun, 25 Jan 2015 19:31:31 +0000 (20:31 +0100)]
brcmfmac: prevent possible deadlock on resuming SDIO device.

When the system is resumed a deadlock can occur when DPC gets
entered before resume is complete. This patch fixes this by
properly checking the suspend state outside the claim_host code
block.

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: Relax scheduling of msgbuf worker on high throughput.
Hante Meuleman [Sun, 25 Jan 2015 19:31:30 +0000 (20:31 +0100)]
brcmfmac: Relax scheduling of msgbuf worker on high throughput.

On every tx the flow worker is triggered. When running high
throughput data this causes an excessive amount of times the worker
gets activated. This patch starts scheduling the worker more relaxed
once outstanding tx has reached a certain depth.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: move Rx reorder buffer allocation out of spinlock
Vladimir Kondratiev [Sun, 25 Jan 2015 08:52:51 +0000 (10:52 +0200)]
wil6210: move Rx reorder buffer allocation out of spinlock

This fixes issue reported by Dan Carpenter:
The patch 3277213feb1b: "wil6210: ADDBA/DELBA flows" from Dec 23,
2014, leads to the following static checker warning:

        drivers/net/wireless/ath/wil6210/rx_reorder.c:205 wil_tid_ampdu_rx_alloc()
        error: scheduling with locks held: 'spin_lock:tid_rx_lock'

drivers/net/wireless/ath/wil6210/rx_reorder.c
   202  struct wil_tid_ampdu_rx *wil_tid_ampdu_rx_alloc(struct wil6210_priv *wil,
   203                                                  int size, u16 ssn)
   204  {
   205          struct wil_tid_ampdu_rx *r = kzalloc(sizeof(*r), GFP_KERNEL);
                                                                 ^^^^^^^^^^
   206
   207          if (!r)
   208                  return NULL;
   209
   210          r->reorder_buf =
   211                  kcalloc(size, sizeof(struct sk_buff *), GFP_KERNEL);
                                                                ^^^^^^^^^^^
   212          r->reorder_time =
   213                  kcalloc(size, sizeof(unsigned long), GFP_KERNEL);
                                                             ^^^^^^^^^^^
   214          if (!r->reorder_buf || !r->reorder_time) {
   215                  kfree(r->reorder_buf);
   216                  kfree(r->reorder_time);
   217                  kfree(r);
   218                  return NULL;
   219          }
   220

[ snip ]

   331          spin_lock_bh(&sta->tid_rx_lock);
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spin lock held.

   332
   333          wil_tid_ampdu_rx_free(wil, sta->tid_rx[tid]);
   334          sta->tid_rx[tid] = wil_tid_ampdu_rx_alloc(wil, agg_wsize, ssn);
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
function called with the lock held.

   335
   336          spin_unlock_bh(&sta->tid_rx_lock);

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: implement cfg80211 probe_client() op
Vladimir Kondratiev [Sun, 25 Jan 2015 08:52:50 +0000 (10:52 +0200)]
wil6210: implement cfg80211 probe_client() op

Access point require this API to check peer alive status.
Assume peer is alive when it is connected, because
firmware implements keep alive checks and will disconnect
peer if it is not alive.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: implement skb Tx status reporting
Vladimir Kondratiev [Sun, 25 Jan 2015 08:52:49 +0000 (10:52 +0200)]
wil6210: implement skb Tx status reporting

Implement Tx status reporting using skb_complete_wifi_ack().

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: remove unnecessary interrupt moderation module parameters
Vladimir Shulman [Sun, 25 Jan 2015 08:52:48 +0000 (10:52 +0200)]
wil6210: remove unnecessary interrupt moderation module parameters

Interrupt moderation parameters will never be passed as module
parameters. For product, they will be hard-coded after lab testing,
and for debugging, they can be altered via debugfs.

Signed-off-by: Vladimir Shulman <qca_shulmanv@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: interrupt moderation configuration update
Vladimir Shulman [Sun, 25 Jan 2015 08:52:47 +0000 (10:52 +0200)]
wil6210: interrupt moderation configuration update

Due to HW limitation, inter-packet gap timeout max value is 13 usec.
Update of current thresholds from 15 to 13 usec.

Signed-off-by: Vladimir Shulman <qca_shulmanv@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: tuning rings size
Vladimir Shulman [Sun, 25 Jan 2015 08:52:46 +0000 (10:52 +0200)]
wil6210: tuning rings size

Tuning rings size for performance optimization.
Increasing Tx ring size, allows buffering more packets for HW, thus
eliminating idle periods which were observed with smaller ring at
high throughput, because HW was fetching packets faster than driver was
filling them into the TX ring. Rx ring was similarly increased to
avoid same problems in Rx.

Signed-off-by: Vladimir Shulman <qca_shulmanv@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: Add Tx queue len configuration
Vladimir Shulman [Sun, 25 Jan 2015 08:52:45 +0000 (10:52 +0200)]
wil6210: Add Tx queue len configuration

Tx queue was hard-coded to 1000 in ether_setup. Add wil_dev_setup
function which configures tx queue len to chosen default value
after calling ether_setup.

Signed-off-by: Vladimir Shulman <qca_shulmanv@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: ignore firmware failure to gracefully stop AP
Dedy Lansky [Sun, 25 Jan 2015 08:52:44 +0000 (10:52 +0200)]
wil6210: ignore firmware failure to gracefully stop AP

upon cfg80211_stop_ap, a graceful AP shutdown is requested from firmware
followed by firmware reset.
In case graceful request failed, error was returned to cfg80211.

The change is to return success in this scenario, because firmware
reset will anyhow shutdown the AP.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: fix timing of netif_carrier_on indication
Dedy Lansky [Sun, 25 Jan 2015 08:52:43 +0000 (10:52 +0200)]
wil6210: fix timing of netif_carrier_on indication

netif_carrier_on indication was too late. In case Rx packet received
before netif_carrier_on indication, upper layers could not send
Tx packet back.

The fix is to indicate netif_carrier_on earlier:
for STA, indicate netif_carrier_on when association starts.
for AP/PCP, indicate netif_carrier_on upon starting AP/PCP.

Signed-off-by: Dedy Lansky <qca_dlansky@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: sync WMI with firmware
Vladimir Kondratiev [Sun, 25 Jan 2015 08:52:42 +0000 (10:52 +0200)]
wil6210: sync WMI with firmware

Incorporate changes from firmware.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8192cu: Set fw_ready flag
Taehee Yoo [Sat, 24 Jan 2015 11:55:40 +0000 (20:55 +0900)]
rtlwifi: rtl8192cu: Set fw_ready flag

After rtl8192cu download firmware routine, set fw_ready flag.

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 agomwifiex: selectively choose ext_scan support
Avinash Patil [Fri, 23 Jan 2015 11:39:19 +0000 (17:09 +0530)]
mwifiex: selectively choose ext_scan support

Some devices do not support extended scan.
This patch adds support to enble ext_scan selectively.
For SD/PCIe interfaces, deefine ext_scan_support as part of
card structure and use it to initialize ext_scan in adapter
during registering device. For USB interfaces, we initialize
ext_scan during register_dev handler.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: add support for USB8801
Yogesh Ashok Powar [Fri, 23 Jan 2015 11:39:18 +0000 (17:09 +0530)]
mwifiex: add support for USB8801

USB8801 is Marvell's 1x1 802.11bgn offering.
Patch adds Device IDs support and defines TX buffer size.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Frank Huang <frankh@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: add support for SD8801
Yogesh Ashok Powar [Fri, 23 Jan 2015 11:39:17 +0000 (17:09 +0530)]
mwifiex: add support for SD8801

SD8801 is Marvell's 1x1 802.11bgn offering.
This patch adds Device IDs for SD8801 and also defines card
structure which has definition for register offsets, buffer sizes etc.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Frank Huang <frankh@marvell.com>
Reviewed-by: James Cameron <quozl@laptop.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k and ath9k_htc: rename variable "led_blink"
Hong Xu [Sat, 24 Jan 2015 11:34:03 +0000 (03:34 -0800)]
ath9k and ath9k_htc: rename variable "led_blink"

ath9k and ath9k_htc use the variable name "led_blink" to indicate
whether the module parameter "blink" is on. This name is easy to
conflict with other variables, and has caused a compiler error found
by kbuild test bot. The compiler error is as following:

drivers/net/wireless/ath/ath9k/ath9k_htc.o:(.data+0x47c): multiple definition of `led_blink'
drivers/net/wireless/ath/ath9k/ath9k.o:(.bss+0x20): first defined here

Fixes: 3a939a671225 ("ath9k_htc: Add a module parameter to disable blink")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Hong Xu <hong@topbug.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortl8192cu: fix the mesh beaconing
Chun-Yeow Yeoh [Fri, 23 Jan 2015 08:59:24 +0000 (16:59 +0800)]
rtl8192cu: fix the mesh beaconing

Patch "rtlwifi: add support to send beacon frame" allows
the beaconing of rtl8192cu. But mesh beaconing is not
working. Fix this.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: add support to send beacon frame.
Taehee Yoo [Wed, 21 Jan 2015 07:58:19 +0000 (16:58 +0900)]
rtlwifi: add support to send beacon frame.

In AP mode, beacon frame is necessary to keep connection.
this patch adds a sending beacon frame routine in initialization routine.

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 agomwifiex: set netif carrier off in ndo_open
Johannes Berg [Mon, 19 Jan 2015 10:24:36 +0000 (15:54 +0530)]
mwifiex: set netif carrier off in ndo_open

This patch adds fix to set carrier state off during ndo_open.
Carrier should be set to ON when device is ready to send data.
In case of station/adhoc interface device is able to transfer
data after successful association/join operation.
For AP this would be after bss_active event.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: use standard bus scanning during early register
Rafał Miłecki [Mon, 19 Jan 2015 07:30:30 +0000 (08:30 +0100)]
bcma: use standard bus scanning during early register

Starting with kernel 3.19-rc1 early registration of bcma on MIPS is done
a bit later, with memory allocator available. This allows us to simplify
code by using standard bus scanning method.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoatmel: Remove open-coded and wrong strcasecmp
Rasmus Villemoes [Wed, 21 Jan 2015 11:52:07 +0000 (12:52 +0100)]
atmel: Remove open-coded and wrong strcasecmp

The kernel's string library does in fact have strcasecmp, at least
since ded220bd8f08 ("[STRING]: Move strcasecmp/strncasecmp to
lib/string.c"). Moreover, this open-coded version is in fact wrong: If
the strings only differ in their last character, a and b have already
been incremented to point to the terminating NUL bytes, so they would
wrongly be treated as equal.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agop54pci: add handling of signal case
Nicholas Mc Guire [Tue, 20 Jan 2015 05:26:17 +0000 (06:26 +0100)]
p54pci: add handling of signal case

if(!wait_for_completion_interruptible_timeout(...))
only handles the timeout case - this patch adds handling the
signal case the same as timeout.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agop54: add handling of the signal case
Nicholas Mc Guire [Tue, 20 Jan 2015 05:25:43 +0000 (06:25 +0100)]
p54: add handling of the signal case

if(!wait_for_completion_interruptible_timeout(...))
only handles the timeout case - this patch adds handling the
signal case the same as timeout.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath5k: document a fall-through case in ath5k_hw_set_opmode
John Linville [Mon, 19 Jan 2015 19:09:15 +0000 (14:09 -0500)]
ath5k: document a fall-through case in ath5k_hw_set_opmode

Coverity: CID 114932

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k_htc: remove dead code in error path of ath9k_htc_txcompletion_cb
John Linville [Mon, 19 Jan 2015 19:02:21 +0000 (14:02 -0500)]
ath9k_htc: remove dead code in error path of ath9k_htc_txcompletion_cb

This clause is conditioned on htc_hdr != NULL, but it will only be NULL
when that check is reached.

Coverity: CID 114318

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: Use put_unaligned_le32
Vaishali Thakkar [Fri, 16 Jan 2015 16:06:14 +0000 (21:36 +0530)]
brcmfmac: Use put_unaligned_le32

This patch introduces the use of function put_unaligned_le32.

This is done using Coccinelle and semantic patch used is as follows:

@a@
typedef u32, __le32, uint32_t;
{u32,__le32,uint32_t} e32;
identifier tmp;
expression ptr;
expression y,e;
type T;
type T;
@@

- tmp = cpu_to_le32(y);

<+... when != tmp
(
- memcpy(ptr, (T)&tmp, \(4\|sizeof(u32)\|sizeof(__le32)\|sizeof(uint32_t)\|sizeof(e32)\));
+ put_unaligned_le32(y,ptr);
|
- memcpy(ptr, (T)&tmp, ...);
+ put_unaligned_le32(y,ptr);
)
...+>
? tmp = e

@@ type T; identifier a.tmp; @@

- T tmp;
...when != tmp

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: clean bus initialization code
Rafał Miłecki [Fri, 16 Jan 2015 19:59:39 +0000 (20:59 +0100)]
bcma: clean bus initialization code

This moves main bus init code to the main.c and renames old function to
make its purpose clear.
Thanks to this change we'll also be able to separate scanning from
registration (and support PCIe Gen 2 devices) in the future.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agob43: stop leds during suspend
Sabrina Dubroca [Mon, 19 Jan 2015 14:34:32 +0000 (15:34 +0100)]
b43: stop leds during suspend

Call b43_leds_stop during suspend to avoid this WARN:

WARNING: CPU: 1 PID: 0 at net/mac80211/util.c:755 ieee80211_can_queue_work.isra.11+0x35/0x50 [mac80211]()
queueing ieee80211 work while going to suspend

 [...]

Call Trace:
 [<c165fb2a>] dump_stack+0x48/0x69
 [<c1052f7b>] warn_slowpath_common+0x8b/0xc0
 [<f9c30225>] ? ieee80211_can_queue_work.isra.11+0x35/0x50 [mac80211]
 [<f9c30225>] ? ieee80211_can_queue_work.isra.11+0x35/0x50 [mac80211]
 [<c1052fe3>] warn_slowpath_fmt+0x33/0x40
 [<f9c30225>] ieee80211_can_queue_work.isra.11+0x35/0x50 [mac80211]
 [<f9c30260>] ieee80211_queue_work+0x20/0x40 [mac80211]
 [<f9f25d78>] b43_led_brightness_set+0x28/0x30 [b43]
 [<c14f3835>] led_timer_function+0xd5/0xe0
 [<c10cb534>] call_timer_fn+0xa4/0x4a0

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowlcore: unlock on error in wl1271_op_suspend()
Dan Carpenter [Thu, 15 Jan 2015 11:43:40 +0000 (14:43 +0300)]
wlcore: unlock on error in wl1271_op_suspend()

We recently introduced a new error path which needs an unlock.

Fixes: 6d5a748d4836 ('wlcore: add ability to reduce FW interrupts during suspend')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi/rtl8192de: remove redundant else if check
Colin Ian King [Tue, 13 Jan 2015 14:07:34 +0000 (14:07 +0000)]
rtlwifi/rtl8192de: remove redundant else if check

The else if check condition checks for the opposite of the
if check, hence the else if check is redundant and can be
replaced with a simple else:

if (rtlpriv->rtlhal.macphymode == SINGLEMAC_SINGLEPHY) {
..
} else if (rtlpriv->rtlhal.macphymode != SINGLEMAC_SINGLEPHY) {
..
}

replaced with:

if (rtlpriv->rtlhal.macphymode == SINGLEMAC_SINGLEPHY) {
..
} else {
..
}

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k_htc: Add a module parameter to disable blink
Hong Xu [Sun, 11 Jan 2015 19:45:53 +0000 (11:45 -0800)]
ath9k_htc: Add a module parameter to disable blink

Add an option "blink" to enable or disable the LED blink. The default
value is set to 1 so that existing users would not experience any
unexpected changes.

Signed-off-by: Hong Xu <hong@topbug.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowcn36xx: initiate TX BA sessions
Bob Copeland [Fri, 9 Jan 2015 19:15:52 +0000 (14:15 -0500)]
wcn36xx: initiate TX BA sessions

Currently, wcn36xx only asks for a TX BA session if it has
already established one for RX.  Thus, two wcn36xx devices cannot
do a-mpdu between themselves since they both wait for the other
to go first.  Fix this by starting a BA session after a few QoS
data frames have been sent to a STA.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowcn36xx: move set_tx_pdu inside set_tx_data/mgmt
Bob Copeland [Fri, 9 Jan 2015 19:15:51 +0000 (14:15 -0500)]
wcn36xx: move set_tx_pdu inside set_tx_data/mgmt

The pdu is part of the buffer descriptor, so it makes
sense that one function would fill both.  Also, passing
the whole skb instead of just the header pointer to the
set_tx_data function paves the way for using its fields
for ampdu setup inside set_tx_data().

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowcn36xx: initialize dxe lock
Bob Copeland [Fri, 9 Jan 2015 19:15:50 +0000 (14:15 -0500)]
wcn36xx: initialize dxe lock

The dxe lock is missing its initialization, so add it.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowcn36xx: initialize skb_lock
Bob Copeland [Fri, 9 Jan 2015 19:15:49 +0000 (14:15 -0500)]
wcn36xx: initialize skb_lock

ctl->skb_lock is never initialized, a fact caught by lockdep.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowcn36xx: don't process 'valid' descriptors
Bob Copeland [Fri, 9 Jan 2015 19:15:48 +0000 (14:15 -0500)]
wcn36xx: don't process 'valid' descriptors

The DMA engine will reset the valid bit after a descriptor is
complete; any with the valid bit still set may still be in
use by the hardware, so check that before freeing the descriptor.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowcn36xx: let device generate qos seq numbers
Bob Copeland [Fri, 9 Jan 2015 19:15:47 +0000 (14:15 -0500)]
wcn36xx: let device generate qos seq numbers

wcn36xx currently sends an incorrect sequence number into the BA session
setup firmware command: it should be saving or updating the ssn in the
TX_START ampdu_action callback instead of waiting until TX_OPERATIONAL.
However, we can sidestep the issue by letting the hardware generate the
sequence numbers for QoS frames, as is done in prima, so do that.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowcn36xx: use !! when assigning int as a boolean
Bob Copeland [Fri, 9 Jan 2015 19:15:46 +0000 (14:15 -0500)]
wcn36xx: use !! when assigning int as a boolean

bd->tx_comp is a single bit in a bitfield, so assigning
"info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS" only happens
to work because TX_STATUS is defined to BIT(0); if it were
any other bit this assignment would fail.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowcn36xx: initialize device defaults on start
Bob Copeland [Fri, 9 Jan 2015 19:15:45 +0000 (14:15 -0500)]
wcn36xx: initialize device defaults on start

Set up default configuration for the device when we call start.
The defaults come from dumps from the prima driver for the same
hardware.

This fixes transmit A-MPDU; previously only one MPDU would be
sent per A-MPDU due to missing MAX_MPDUS_IN_AMPDU setting.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowlcore: fix copy-paste bug: assign from src struct not dest
Giel van Schijndel [Wed, 7 Jan 2015 19:38:37 +0000 (20:38 +0100)]
wlcore: fix copy-paste bug: assign from src struct not dest

Signed-off-by: Giel van Schijndel <me@mortis.eu>
Reported-at: http://www.viva64.com/en/b/0299/
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: do not emit messages while holding spinlock
Avinash Patil [Wed, 7 Jan 2015 12:40:25 +0000 (18:10 +0530)]
mwifiex: do not emit messages while holding spinlock

Avoid printing dev_{warn/dbg} messages while holding spinlock.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: check driver status in connect and scan handlers
Amitkumar Karwar [Wed, 7 Jan 2015 11:57:39 +0000 (03:57 -0800)]
mwifiex: check driver status in connect and scan handlers

Ignore scan and connection requests from cfg80211 when driver
unload is in process or previous command has timed out due to
a firmware bug. This patch fixes corner case system crash
issues.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Fix no-ack frame status
Sujith Manoharan [Fri, 19 Dec 2014 01:03:55 +0000 (06:33 +0530)]
ath9k: Fix no-ack frame status

Check if the frame has been completed without any
error and use IEEE80211_TX_STAT_NOACK_TRANSMITTED to
indicate successful transmission of no-ack frames.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoMerge tag 'iwlwifi-next-for-kalle-2015-01-22' of https://git.kernel.org/pub/scm/linux...
Kalle Valo [Fri, 23 Jan 2015 15:51:54 +0000 (17:51 +0200)]
Merge tag 'iwlwifi-next-for-kalle-2015-01-22' of https://git./linux/kernel/git/iwlwifi/iwlwifi-next

* more work for new devices (4165 / 8260)
* cleanups / improvemnts in rate control
* fixes for TDLS
* major statistics work from Johannes - more to come
* improvements for the fw error dump infrastructure
* usual amount of small fixes here and there (scan, D0i3 etc...)

9 years agoiwlwifi: mvm: fix rx chains configuration in phy ctxt cmd
Liad Kaufman [Thu, 22 Jan 2015 17:01:35 +0000 (19:01 +0200)]
iwlwifi: mvm: fix rx chains configuration in phy ctxt cmd

In the PHY_CTXT command sent to the FW the TX chains were
indeed configured by the values of both FW TLVs and of NVM,
but the RX chains were left out and configured only by FW
TLV.

This causes problems in 4165 HW, where there are 1x1
antennas, and the wrong configuration denies the driver
from connecting to the AP.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>