platform/kernel/linux-rpi3.git
10 years agoath10k: ensure rx-frag ignores rssi
Ben Greear [Mon, 26 May 2014 09:46:04 +0000 (12:46 +0300)]
ath10k: ensure rx-frag ignores rssi

It seems ath10k firmware gives us no way to know
the rssi for rx-fragments.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: dont configure bssid for ap mode
Michal Kazior [Mon, 26 May 2014 09:46:03 +0000 (12:46 +0300)]
ath10k: dont configure bssid for ap mode

FW creates self-peer for AP internally.

This prevents ath10k from trying to create
explicit self-peer during hw recovery and thus
prevents a timeout and a warning during teardown:

  ath10k: removing stale peer $AP_BSSID from vdev_id 0

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: protect wep tx key setup
Michal Kazior [Mon, 26 May 2014 09:46:03 +0000 (12:46 +0300)]
ath10k: protect wep tx key setup

All configuration sequences should be protected
with conf_mutex to avoid concurrent/conflicting
requests.

This should make sure that wep tx key setup is not
performed while hw is restarted (at least).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: drain tx before restarting hw
Michal Kazior [Mon, 26 May 2014 09:46:03 +0000 (12:46 +0300)]
ath10k: drain tx before restarting hw

This makes sure no further tx requests are
submitted to HTT before driver teardown.

This should prevent invalid pointer/NULL
dereference on htt tx pool in ath10k_htt_tx() in
some cases of heavy traffic.

kvalo: remove the WARN_ON() if conf_mutex is held

Reported-By: Ben Greear <greearb@candelatech.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: perform hw restart lazily
Michal Kazior [Mon, 26 May 2014 09:46:03 +0000 (12:46 +0300)]
ath10k: perform hw restart lazily

This reduces risk of races and prepares for more
hw restart fixes.

It also makes sense to perform teardown after
mac80211 starts its restart routine as it
guarantees it has stopped itself by then
(including tx queues).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: clean up start() callback
Michal Kazior [Mon, 26 May 2014 09:46:02 +0000 (12:46 +0300)]
ath10k: clean up start() callback

This fixes failpath when override AC pdev param
setup fails and makes other pdev params setting
fail as well.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: make core registering async
Michal Kazior [Fri, 23 May 2014 10:28:47 +0000 (12:28 +0200)]
ath10k: make core registering async

If ath10k was built into the kernel it could stall
booting for 120 seconds by default (60 seconds for
each firmware API variant) waiting for firmware
files before userspace was ready or filesystems
mounted.

Fix this by making the core registering
asynchronous.

This also shoves off about 1 second from boot time
on most systems since the driver is now mostly
initialized in a worker and modprobe takes very
little time to complete.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: remove unnecessary tasklet_kill()
Michal Kazior [Fri, 23 May 2014 10:28:46 +0000 (12:28 +0200)]
ath10k: remove unnecessary tasklet_kill()

The tasklet is already guaranteed to be killed on
the teardown path.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: relocate core create/destroy functions
Michal Kazior [Fri, 23 May 2014 10:28:45 +0000 (12:28 +0200)]
ath10k: relocate core create/destroy functions

This will avoid unnecessary forward declaration of
any kind in the future.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: fix protected flag stripping
Michal Kazior [Fri, 23 May 2014 08:33:18 +0000 (11:33 +0300)]
ath10k: fix protected flag stripping

This prevents protected flag being stripped from
undecrypted raw sniffed frames when monitor
interface is active.

Reported-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Tested-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath9k/ath10k: remove unnecessary channel_switch_beacon callbacks
Luciano Coelho [Fri, 23 May 2014 08:04:50 +0000 (11:04 +0300)]
ath9k/ath10k: remove unnecessary channel_switch_beacon callbacks

The channel_switch_beacon callback is optional, so it doesn't have to
be defined if it's not going to do anything useful with it.  Both
ath9k and ath10k define the callback and just returns.  This commit
removes them.

Cc: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: fix ath10k_bmi_read32 macro
Frederic Danis [Fri, 23 May 2014 08:04:49 +0000 (11:04 +0300)]
ath10k: fix ath10k_bmi_read32 macro

tmp may be used uninitialized if ath10k_bmi_read_memory() returns
an error.

Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: prevent hif_stop being called twice
Michal Kazior [Fri, 16 May 2014 14:15:39 +0000 (17:15 +0300)]
ath10k: prevent hif_stop being called twice

Recently there was a bug discovered that involved
hif_stop() being called twice that ended up with a
double free_irq() call but it only manifested with
multiple MSI interrupts mapping.

Catch this kind of a problem early in driver
regardless of interrupt mapping.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: fix core start sequence
Michal Kazior [Fri, 16 May 2014 14:15:39 +0000 (17:15 +0300)]
ath10k: fix core start sequence

It was possible to call hif_stop() 2 times through
ath10k_htc_connect_init() timeout failpath which
could lead to double free_irq() kernel splat for
multiple MSI interrupt case.

Re-order init sequence to avoid this problem. The
HTC stop shouldn't stop HIF implicitly since it
doesn't implicitly start it. Since the re-ordering
required some functions to be split/removed/renamed
rename a few functions to make more sense while at
it.

Reported-By: Ben Greear <greearb@candelatech.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: support get/set antenna configurations.
Ben Greear [Fri, 16 May 2014 14:15:38 +0000 (17:15 +0300)]
ath10k: support get/set antenna configurations.

Verified that target's tx/rx chain register is set appropriately,
and that the tx rate goes down as number of chains
decrease, but I did not actually try to verify antenna
ceased to transmit when disabled.

kvalo: move ar->supp_*_chainmask initialisation to ath10k_mac_register()

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: fix pmf for action frames
Marek Kwaczynski [Wed, 14 May 2014 13:56:17 +0000 (16:56 +0300)]
ath10k: fix pmf for action frames

Fix sending and receiveing protected managment frames.
Lack of protected flag for received protected action frames
causes report these frames as unprotected robust action frames.
If the driver in AP mode sent frame with protected flag and
CCMP header using IEEE80211_KEY_FLAG_SW_MGMT_TX flag,
the FW encrypted frames once again. From user side all
received SA Query Requests and Responses were skipped and
all protected action frames were sent as malformed packets.

Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: get rid of pci_assign_resource() call from pci_probe
Bartosz Markowski [Wed, 14 May 2014 13:56:17 +0000 (16:56 +0300)]
ath10k: get rid of pci_assign_resource() call from pci_probe

On ARM-based (MSM mach), the pci_assign_resource() is passing
some invalid pointers and leading to L2 cache errors,
what prevents the PCI communication completly.

So far I have not found this funtion to be directly called by
any other wifi driver and did not found this assigning needed
on any other platform. So removing it completely.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: enable early device dumps
Michal Kazior [Wed, 14 May 2014 13:56:16 +0000 (16:56 +0300)]
ath10k: enable early device dumps

This can be useful for early initialization
debugging, i.e. ROM crashes.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: retry warm reset a few times
Michal Kazior [Wed, 14 May 2014 13:56:16 +0000 (16:56 +0300)]
ath10k: retry warm reset a few times

Sometimes warm reset works upon retry. It might be
related to imperfect warm reset routine, but for
now let's just do the retries.

This should improve the reliability of some chips
that hang/crash with cold reset which is used as a
last resort if warm reset fails.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: improve warm reset reliability
Michal Kazior [Wed, 14 May 2014 13:56:16 +0000 (16:56 +0300)]
ath10k: improve warm reset reliability

Warm reset is now able to recover after device
crashes which required a cold reset before.

This should greatly reduce chances of getting data
bus errors or host system freezes due to buggy
cold reset on some chips.

kvalo: use ath10k_pci_soc_*()

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: fix spelling mistake in comments
Ben Greear [Wed, 14 May 2014 13:56:14 +0000 (16:56 +0300)]
ath10k: fix spelling mistake in comments

Simple typo fix.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: fix handling of wierd MSDU chaining cases
Michal Kazior [Wed, 14 May 2014 13:23:31 +0000 (16:23 +0300)]
ath10k: fix handling of wierd MSDU chaining cases

Apparently firmware can sometimes report a
sequence with the first rx descriptor saying it's
not the last MSDU. In that case msdu_chaining
value could be overwritten saying it's not a
chained MSDU. This in turn led to skb_push panic
as the frame could be treated as an A-MSDU instead
of a chained MSDU.

Reported-By: Avery Pennarun <apenwarr@gmail.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: fix htt rx ring clean up
Michal Kazior [Wed, 14 May 2014 13:23:31 +0000 (16:23 +0300)]
ath10k: fix htt rx ring clean up

msdu_payId was read before txrx tasklet was killed
so it was possible to end up using an invalid
sk_buff pointer leading to a panic.

Make sure to sanitize rx ring sk_buff pointers and
make the clean up go through all possible entries
and not rely on coherent-DMA mapped u32 index
which could be (in theory) corrupted by the device
as well.

Reported-By: Avery Pennarun <apenwarr@gmail.com>
Reported-By: Ben Greear <greearb@candelatech.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoMerge remote-tracking branch 'wireless-next/master' into ath-next
Kalle Valo [Wed, 14 May 2014 13:20:08 +0000 (16:20 +0300)]
Merge remote-tracking branch 'wireless-next/master' into ath-next

10 years agorsi: Changed the return value to enable BA set-up
Jahnavi Meher [Mon, 12 May 2014 10:17:40 +0000 (15:47 +0530)]
rsi: Changed the return value to enable BA set-up

Signed-off-by: Jahnavi Meher <jahnavi.meher@redpinesignals.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: determine chanspec from struct cfg80211_chan_def info
Arend van Spriel [Mon, 12 May 2014 08:47:39 +0000 (10:47 +0200)]
brcmfmac: determine chanspec from struct cfg80211_chan_def info

The struct cfg80211_chan_def contains additional info to derive the
bandwidth and side-band information of the chanspec. This patch adds
chandef_to_chanspec() function used in IBSS join and starting AP
operation.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: handle 80MHz chanspecs in construct_reg_info() function
Arend van Spriel [Mon, 12 May 2014 08:47:38 +0000 (10:47 +0200)]
brcmfmac: handle 80MHz chanspecs in construct_reg_info() function

The device is queried about the usability of channels, but it did not
take 80MHz channels into consideration. This patch adds processing those
chanspecs and clear the NO_80MHZ flag for those control/primary channels.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky Lin <frankyl@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: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: get rid of brcmf_cfg80211_set_channel() function
Arend van Spriel [Mon, 12 May 2014 08:47:37 +0000 (10:47 +0200)]
brcmfmac: get rid of brcmf_cfg80211_set_channel() function

The function does not provide any additional functionality and is
used only once so just get rid of it.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky Lin <frankyl@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: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: enable 80Mhz in 5G custom regulatory rules
Arend van Spriel [Mon, 12 May 2014 08:47:36 +0000 (10:47 +0200)]
brcmfmac: enable 80Mhz in 5G custom regulatory rules

By default allow 80Mhz in custom regulatory rules of the 5G band so
the channels will not be flagged with N0_80MHZ.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky Lin <frankyl@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: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: provide VHT capability information to user-space
Arend van Spriel [Mon, 12 May 2014 08:47:35 +0000 (10:47 +0200)]
brcmfmac: provide VHT capability information to user-space

Although brcmfmac support several 11ac devices it did not advertise
VHT related information to cfg80211.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky Lin <frankyl@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: John W. Linville <linville@tuxdriver.com>
10 years agobrcm80211: extend channel conversion functions for 80MHz support
Arend van Spriel [Mon, 12 May 2014 08:47:34 +0000 (10:47 +0200)]
brcm80211: extend channel conversion functions for 80MHz support

The channel values used by firmware is handled using conversion functions
depending on the type of chip. These functions were already in place but
lacked proper support for 80MHz channel definitions. This patch adds the
support for that.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky Lin <frankyl@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: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: remove usage of cfg80211_get_chandef_type()
Arend van Spriel [Mon, 12 May 2014 08:47:33 +0000 (10:47 +0200)]
brcmfmac: remove usage of cfg80211_get_chandef_type()

In the .start_ap callback cfg80211_get_chandef_type() was used to
provide debug log info. However, this causes a warning when the
chandef contains VHT channel with 80MHz bandwidth. Avoid the warning
by just printing the channel and bandwidth instead.

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: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: Fix reconnect failure after beacon timeout
Daniel Kim [Mon, 12 May 2014 08:47:32 +0000 (10:47 +0200)]
brcmfmac: Fix reconnect failure after beacon timeout

The DISASSOC command needs to be sent to firmware when a connection
loss is detected by firmware (e.g., beacon timeout). Otherwise the
next connect request fails due to a lingering LINK(down) event from
firmware. This patch resolves the issue by using brcmf_link_down()
handler, instead of the incomplete duplicated codes.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Daniel Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: enhance nvram processing
Arend van Spriel [Mon, 12 May 2014 08:47:31 +0000 (10:47 +0200)]
brcmfmac: enhance nvram processing

The driver serializes the nvram firmware file before sending it
to the device. This patch enhances this to assure serialized data
is properly formatted and provide warnings on syntax failures.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky Lin <frankyl@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: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: Make FWS queueing configurable.
Hante Meuleman [Mon, 12 May 2014 08:47:30 +0000 (10:47 +0200)]
brcmfmac: Make FWS queueing configurable.

FWS is always queuing frames and using a worker for de-queueing,
this is not always efficient for all bus layer. For example SDIO
has an internal queue and worker making the queueing of FWS
unnecessary. Make it possible to bypass the worker if fws mode
is none using a bus interface configuration. For USB bus layer
this configuration is set true to have fws provide queueing
regardless the fws mode.

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: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: Move handling 802.1x frames to dhd_linux.
Hante Meuleman [Mon, 12 May 2014 08:47:29 +0000 (10:47 +0200)]
brcmfmac: Move handling 802.1x frames to dhd_linux.

Tracking and handling of 802.1x frames is done in two modules, it
is more logical and clear to move this to dhd_linux module.

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: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: Move out hdrpull from tx_finalize.
Hante Meuleman [Mon, 12 May 2014 08:47:28 +0000 (10:47 +0200)]
brcmfmac: Move out hdrpull from tx_finalize.

In tx_finalize the hdrpull is performed. For the new protocol
msgbuf this is complex, because it does not use protocol headers
in front of payload anymore and therefor can not determine interface
index in the hdr pulll operation. Move out the hdrpull operation
from tx_finalize to make msgbuf implementation easier.

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: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: Report the support of firmware roaming
Daniel Kim [Mon, 12 May 2014 08:47:27 +0000 (10:47 +0200)]
brcmfmac: Report the support of firmware roaming

Currently firmware roaming support is not reported to cfg80211.
This patch reports the support of firmware based roaming when
it is enabled.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Daniel Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: Give priority to 5GHz band in selecting target BSS
Daniel Kim [Mon, 12 May 2014 08:47:26 +0000 (10:47 +0200)]
brcmfmac: Give priority to 5GHz band in selecting target BSS

When a BSS provides both 2.4GHz and 5GHz bands, in many cases it
makes sense to choose 5GHz. Typically a 5GHz channel is less crowded
and has less interference and therefore its performance will be
better than a crowded 2.4 GHz channel. This patch configures
'join_pref' to induce firmware to preferably select 5GHz BSS.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Daniel Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_htc: use ath9k_cmn_debug_phy_err
Oleksij Rempel [Sun, 11 May 2014 08:04:40 +0000 (10:04 +0200)]
ath9k_htc: use ath9k_cmn_debug_phy_err

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: move phy_err to ath9k_cmn_debug_phy_err
Oleksij Rempel [Sun, 11 May 2014 08:04:39 +0000 (10:04 +0200)]
ath9k: move phy_err to ath9k_cmn_debug_phy_err

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_htc: use ath9k_cmn_debug_recv
Oleksij Rempel [Sun, 11 May 2014 08:04:38 +0000 (10:04 +0200)]
ath9k_htc: use ath9k_cmn_debug_recv

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: move recv to ath9k_cmn_debug_recv
Oleksij Rempel [Sun, 11 May 2014 08:04:37 +0000 (10:04 +0200)]
ath9k: move recv to ath9k_cmn_debug_recv

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k & ath9k_htc: move ath_rx_stats to cmn
Oleksij Rempel [Sun, 11 May 2014 08:04:36 +0000 (10:04 +0200)]
ath9k & ath9k_htc: move ath_rx_stats to cmn

and use it. This move need changes in both drivers.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: reorder or remove some includes
Oleksij Rempel [Sun, 11 May 2014 08:04:35 +0000 (10:04 +0200)]
ath9k: reorder or remove some includes

to fix compile errors

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_htc: use ath9k_cmn_debug_base_eeprom
Oleksij Rempel [Sun, 11 May 2014 08:04:34 +0000 (10:04 +0200)]
ath9k_htc: use ath9k_cmn_debug_base_eeprom

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: move base_eeprom debug code to ath9k_cmn_debug_base_eeprom
Oleksij Rempel [Sun, 11 May 2014 08:04:33 +0000 (10:04 +0200)]
ath9k: move base_eeprom debug code to ath9k_cmn_debug_base_eeprom

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_htc: use ath9k_cmn_debug_modal_eeprom
Oleksij Rempel [Sun, 11 May 2014 08:04:32 +0000 (10:04 +0200)]
ath9k_htc: use ath9k_cmn_debug_modal_eeprom

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k-common: create common-debug and move modal_eeprom to cmn
Oleksij Rempel [Sun, 11 May 2014 08:04:31 +0000 (10:04 +0200)]
ath9k-common: create common-debug and move modal_eeprom to cmn

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agob43: drop SSB dependency
Rafał Miłecki [Sat, 10 May 2014 17:14:09 +0000 (19:14 +0200)]
b43: drop SSB dependency

This adds choice submenu "Supported bus types" as two simple bool
configs would allow user to compile b43 without any bus support
(prety useless).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agob43: adjust code to compile without SSB
Rafał Miłecki [Sat, 10 May 2014 17:52:18 +0000 (19:52 +0200)]
b43: adjust code to compile without SSB

Users of new (BCMA based) wireless chipsets may not want to enable SSB.
This is hopefully the last code patch for dropping SSB dependency.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoorinoco_usb: Fix broken firmware load error checking
Ondrej Zary [Fri, 9 May 2014 16:10:34 +0000 (18:10 +0200)]
orinoco_usb: Fix broken firmware load error checking

The check of ezusb_firmware_download() return value (added by commit
488ec878034eccb852267b0e27ce9d511f75c587) is broken because
ezusb_firmware_download() returns 1 on success.
This causes the driver not to work with the following error:
orinoco_usb: probe of 3-3:1.0 failed with error -14

Check the return value only for negative values.

This fix should be applied to -stable kernels too.

Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: non-functional: calculate DFS pulse interval per-wiphy
Zefir Kurtisi [Fri, 9 May 2014 13:19:42 +0000 (15:19 +0200)]
ath9k: non-functional: calculate DFS pulse interval per-wiphy

Systems with multiple DFS channel detectors need to track
timestamp of previous pulse per instance to display the
correct pulse interval.

Since the interval value is used for debug printing only,
this is a non-functional modification.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoamend "ath9k: Allow platform override without EEPROM override"
Helmut Schaa [Thu, 8 May 2014 11:48:38 +0000 (13:48 +0200)]
amend "ath9k: Allow platform override without EEPROM override"

Originally Helmut posted a v2 of the "ath9k: Allow platform override
without EEPROM override", but I had prematurely commited the original
as commit 552a515707a.  This commit restores the tree to what Helmut
intended with his v2 submission. -- JWL

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agortlwifi: rtl8723be: add msi module parameter
Adam Lee [Mon, 5 May 2014 08:33:38 +0000 (16:33 +0800)]
rtlwifi: rtl8723be: add msi module parameter

The msi module parameter offers an option to enable or disable MSI
interrupts mode, for debugging and workaround(in case) convenience.

Signed-off-by: Adam Lee <adam.lee@canonical.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agortlwifi: rtl8188ee: add msi module parameter
Adam Lee [Mon, 5 May 2014 08:33:37 +0000 (16:33 +0800)]
rtlwifi: rtl8188ee: add msi module parameter

The msi module parameter offers an option to enable or disable MSI
interrupts mode. For now, some users report RTL8188EE works only with
MSI on their certain platforms, some others report it works only without
MSI, this parameter will help.

Signed-off-by: Adam Lee <adam.lee@canonical.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agortlwifi: make MSI support a module parameter
Adam Lee [Mon, 5 May 2014 08:33:36 +0000 (16:33 +0800)]
rtlwifi: make MSI support a module parameter

This makes MSI support a module parameter, for debugging and workaround
convenience.

Signed-off-by: Adam Lee <adam.lee@canonical.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: only call ieee80211_beacon_loss in managed mode
Grazvydas Ignotas [Tue, 22 Apr 2014 00:09:55 +0000 (03:09 +0300)]
wl1251: only call ieee80211_beacon_loss in managed mode

ieee80211_beacon_loss() is only to be called in managed mode,
but the firmware may send the sync timeout event at any time,
so do a check before calling.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: fix mixed up args for join
Grazvydas Ignotas [Tue, 22 Apr 2014 00:09:54 +0000 (03:09 +0300)]
wl1251: fix mixed up args for join

The join arguments are mixed up, passing beacon_interval instead of
channel and channel instead of beacon_interval. Fix them.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowl1251: fix null data for IBSS
Grazvydas Ignotas [Tue, 22 Apr 2014 00:09:53 +0000 (03:09 +0300)]
wl1251: fix null data for IBSS

Fix the WARN below by not calling ieee80211_nullfunc_get() in IBSS mode,
but setting up empty template the same way wl12xx driver does.

WARNING: CPU: 0 PID: 914 at net/mac80211/tx.c:2750 ieee80211_nullfunc_get+0xc0/0xd0 [mac80211]()
Modules linked in: wl1251_sdio wl1251 mac80211 cfg80211
...
[<c00439c0>] (warn_slowpath_null)
[<bf0bdfdc>] (ieee80211_nullfunc_get [mac80211])
[<bf134774>] (wl1251_op_bss_info_changed [wl1251])
[<bf099e14>] (ieee80211_bss_info_change_notify [mac80211])
...

Also perform join command regardless of bss_type as that seems to be
required for proper operation.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoRevert "wl1251: enforce changed hw encryption support on monitor state change"
Grazvydas Ignotas [Tue, 22 Apr 2014 00:09:52 +0000 (03:09 +0300)]
Revert "wl1251: enforce changed hw encryption support on monitor state change"

This reverts commit b90a1165a72fabdc260abaa9eeadcbfd29e267eb.

That commit (or rather, hack) triggers a scary WARN in IBSS (ad-hoc) mode.
Steps to reproduce:
    ifconfig wlan0 down
    iwconfig wlan0 mode ad-hoc
    ifconfig wlan0 up
------------[ cut here ]------------
WARNING: CPU: 0 PID: 905 at kernel/workqueue.c:1400 __queue_work+0x21c/0x2f4()
Modules linked in: wl1251_sdio wl1251 mac80211 cfg80211
CPU: 0 PID: 905 Comm: ifconfig Not tainted 3.15.0-rc2#233
[<c0015f38>] (unwind_backtrace) from [<c0012938>]
[<c0012938>] (show_stack) from [<c05d4034>]
[<c05d4034>] (dump_stack) from [<c0043984>]
[<c0043984>] (warn_slowpath_common) from [<c00439c0>]
[<c00439c0>] (warn_slowpath_null) from [<c005b6c8>]
[<c005b6c8>] (__queue_work) from [<c005b820>]
[<c005b820>] (queue_work_on) from [<bf134ac0>]
[<bf134ac0>] (wl1251_op_config [wl1251])
[<bf099a70>] (ieee80211_hw_config [mac80211])
...
This happens because ieee80211_connection_loss() is not expected to be
called in IBSS mode (mac80211 ends up queuing uninitialized work
in that case).

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville [Tue, 13 May 2014 19:27:44 +0000 (15:27 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless

10 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Tue, 13 May 2014 18:52:34 +0000 (14:52 -0400)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-fixes

10 years agoiwlwifi: mvm: prevent sched scan while not idle
David Spinadel [Tue, 13 May 2014 11:29:36 +0000 (14:29 +0300)]
iwlwifi: mvm: prevent sched scan while not idle

Prevent sched scan while not idle (including during association or in AP
mode) instead of while associated only.

This fixes my previous commit which was incomplete:

commit bd5e4744a6ca64299b57a2682c720d00a475a734
Author: David Spinadel <david.spinadel@intel.com>
Date:   Thu Apr 24 13:15:29 2014 +0300

    iwlwifi: mvm: do no sched scan while associated

    Currently the FW doesn't support sched scan while associated,
    Prevent it.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix off-by-one in scan channels configuration
Eliad Peller [Sun, 11 May 2014 16:59:43 +0000 (19:59 +0300)]
iwlwifi: mvm: fix off-by-one in scan channels configuration

tail should be equal to the last valid index, so
decrease it by one.

This error causes in "a gap" in some cases (as well as
some possible out-of-bound write), finally resulting in
ucode assertion.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agobrcmfmac: Fix iovar 'bw_cap' set command failure
Daniel Kim [Fri, 9 May 2014 10:37:05 +0000 (12:37 +0200)]
brcmfmac: Fix iovar 'bw_cap' set command failure

Fix iovar 'bw_cap' set command failure introduced by

  commit ff3b0fba6f25555ef59c55d138a467d0f81d82d7
  Author: Arend van Spriel <arend@broadcom.com>
  Date:   Sat Mar 15 12:00:57 2014 +0100

      brcmfmac: fallback to mimo_bw_cap for older firmwares

This resulted in disabling 20MHz operation in the firmware.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Daniel Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
John W. Linville [Mon, 12 May 2014 18:12:19 +0000 (14:12 -0400)]
Merge git://git./linux/kernel/git/jberg/mac80211

10 years agoiwlwifi: mvm: fix setting channel in monitor mode
Emmanuel Grumbach [Thu, 8 May 2014 06:48:10 +0000 (09:48 +0300)]
iwlwifi: mvm: fix setting channel in monitor mode

There was a deadlock in monitor mode when we were setting the
channel if the channel was not 1.

======================================================
[ INFO: possible circular locking dependency detected ]
3.14.3 #4 Not tainted
-------------------------------------------------------
iw/3323 is trying to acquire lock:
 (&local->chanctx_mtx){+.+.+.}, at: [<ffffffffa062e2f2>] ieee80211_vif_release_channel+0x42/0xb0 [mac80211]

but task is already holding lock:
 (&local->iflist_mtx){+.+...}, at: [<ffffffffa0609e0a>] ieee80211_set_monitor_channel+0x5a/0x1b0 [mac80211]

which lock already depends on the new lock.

the existing dependency chain (in reverse order) is:

-> #2 (&local->iflist_mtx){+.+...}:
       [<ffffffff810d95bb>] __lock_acquire+0xb3b/0x13b0
       [<ffffffff810d9ee0>] lock_acquire+0xb0/0x1f0
       [<ffffffff817eb9c8>] mutex_lock_nested+0x78/0x4f0
       [<ffffffffa06225cf>] ieee80211_iterate_active_interfaces+0x2f/0x60 [mac80211]
       [<ffffffffa0518189>] iwl_mvm_recalc_multicast+0x49/0xa0 [iwlmvm]
       [<ffffffffa051822e>] iwl_mvm_configure_filter+0x4e/0x70 [iwlmvm]
       [<ffffffffa05e6d43>] ieee80211_configure_filter+0x153/0x5f0 [mac80211]
       [<ffffffffa05e71f5>] ieee80211_reconfig_filter+0x15/0x20 [mac80211]
       [snip]

-> #1 (&mvm->mutex){+.+.+.}:
       [<ffffffff810d95bb>] __lock_acquire+0xb3b/0x13b0
       [<ffffffff810d9ee0>] lock_acquire+0xb0/0x1f0
       [<ffffffff817eb9c8>] mutex_lock_nested+0x78/0x4f0
       [<ffffffffa0517246>] iwl_mvm_add_chanctx+0x56/0xe0 [iwlmvm]
       [<ffffffffa062ca1e>] ieee80211_new_chanctx+0x13e/0x410 [mac80211]
       [<ffffffffa062d953>] ieee80211_vif_use_channel+0x1c3/0x5a0 [mac80211]
       [<ffffffffa06035ab>] ieee80211_add_virtual_monitor+0x1ab/0x6b0 [mac80211]
       [<ffffffffa06052ea>] ieee80211_do_open+0xe6a/0x15a0 [mac80211]
       [<ffffffffa0605a79>] ieee80211_open+0x59/0x60 [mac80211]
       [snip]

-> #0 (&local->chanctx_mtx){+.+.+.}:
       [<ffffffff810d6cb7>] check_prevs_add+0x977/0x980
       [<ffffffff810d95bb>] __lock_acquire+0xb3b/0x13b0
       [<ffffffff810d9ee0>] lock_acquire+0xb0/0x1f0
       [<ffffffff817eb9c8>] mutex_lock_nested+0x78/0x4f0
       [<ffffffffa062e2f2>] ieee80211_vif_release_channel+0x42/0xb0 [mac80211]
       [<ffffffffa0609ec3>] ieee80211_set_monitor_channel+0x113/0x1b0 [mac80211]
       [<ffffffffa058fb37>] cfg80211_set_monitor_channel+0x77/0x2b0 [cfg80211]
       [<ffffffffa056e0b2>] __nl80211_set_channel+0x122/0x140 [cfg80211]
       [<ffffffffa0581374>] nl80211_set_wiphy+0x284/0xaf0 [cfg80211]
       [snip]

other info that might help us debug this:

Chain exists of:
  &local->chanctx_mtx --> &mvm->mutex --> &local->iflist_mtx

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&local->iflist_mtx);
                               lock(&mvm->mutex);
                               lock(&local->iflist_mtx);
  lock(&local->chanctx_mtx);

 *** DEADLOCK ***

This deadlock actually occurs:
INFO: task iw:3323 blocked for more than 120 seconds.
      Not tainted 3.14.3 #4
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
iw              D ffff8800c8afcd80  4192  3323   3322 0x00000000
 ffff880078fdb7e0 0000000000000046 ffff8800c8afcd80 ffff880078fdbfd8
 00000000001d5540 00000000001d5540 ffff8801141b0000 ffff8800c8afcd80
 ffff880078ff9e38 ffff880078ff9e38 ffff880078ff9e40 0000000000000246
Call Trace:
 [<ffffffff817ea841>] schedule_preempt_disabled+0x31/0x80
 [<ffffffff817ebaed>] mutex_lock_nested+0x19d/0x4f0
 [<ffffffffa06225cf>] ? ieee80211_iterate_active_interfaces+0x2f/0x60 [mac80211]
 [<ffffffffa06225cf>] ? ieee80211_iterate_active_interfaces+0x2f/0x60 [mac80211]
 [<ffffffffa052a680>] ? iwl_mvm_power_mac_update_mode+0xc0/0xc0 [iwlmvm]
 [<ffffffffa06225cf>] ieee80211_iterate_active_interfaces+0x2f/0x60 [mac80211]
 [<ffffffffa0529357>] _iwl_mvm_power_update_binding+0x27/0x80 [iwlmvm]
 [<ffffffffa0516eb1>] iwl_mvm_unassign_vif_chanctx+0x81/0xc0 [iwlmvm]
 [<ffffffffa062d3ff>] __ieee80211_vif_release_channel+0xdf/0x470 [mac80211]
 [<ffffffffa062e2fa>] ieee80211_vif_release_channel+0x4a/0xb0 [mac80211]
 [<ffffffffa0609ec3>] ieee80211_set_monitor_channel+0x113/0x1b0 [mac80211]
 [<ffffffffa058fb37>] cfg80211_set_monitor_channel+0x77/0x2b0 [cfg80211]
 [<ffffffffa056e0b2>] __nl80211_set_channel+0x122/0x140 [cfg80211]
 [<ffffffffa0581374>] nl80211_set_wiphy+0x284/0xaf0 [cfg80211]

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=75541

Cc: <stable@vger.kernel.org> [3.13+]
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agomac80211: fix vif name tracing
Eliad Peller [Wed, 26 Feb 2014 12:46:35 +0000 (14:46 +0200)]
mac80211: fix vif name tracing

If sdata doesn't have a valid dev (e.g. in case of monitor
vif), the vif_name field was initialized with (a length of)
some short string, but later was set to a different,
potentially larger one.

This resulted in out-of-bounds write, which usually
appeared as garbage in the trace log.

Simply trace sdata->name, as it should always have the
correct name for both cases.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: allow VHT with peers not capable of 40MHz
Johannes Berg [Fri, 9 May 2014 07:56:53 +0000 (09:56 +0200)]
mac80211: allow VHT with peers not capable of 40MHz

There are two (related) issues with this.

One case, reported by Michal, is related to hostap: it unsets the
20/40 capability bit for stations that associate when it's in 20
MHz mode.

The other case, reported by Eyal, is that some APs like Netgear
R6300v2 and probably others based on the BCM4360 chipset can be
configured for doing VHT at 20Mhz. In this case the beacon has
a VHT IE but the HT cap indicates transmitter only support 20Mhz.

In both of these cases, we currently avoid VHT and use only HT
this means we can't use the highest rates (MCS8), so fixing this
leads to throughput improvements.

Reported-by: Michal Kazior <michal.kazior@tieto.com>
Reported-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Thu, 8 May 2014 15:36:40 +0000 (11:36 -0400)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

10 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwif...
John W. Linville [Thu, 8 May 2014 15:28:35 +0000 (11:28 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/iwlwifi/iwlwifi-fixes

10 years agortl8187: make CTS-to-self protection work
Andrea Merello [Wed, 7 May 2014 15:54:46 +0000 (17:54 +0200)]
rtl8187: make CTS-to-self protection work

CTS protection was not working properly because the HW needs
RTS flag to be asserted, and it need also RTS duration field to be
filled with CTS-to-self duration.

This patch makes the driver to do this.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agortl8180: make CTS-to-self protection work
Andrea Merello [Wed, 7 May 2014 15:53:17 +0000 (17:53 +0200)]
rtl8180: make CTS-to-self protection work

CTS protection was not working properly because the HW still need
RTS flag to be asserted, and it need also RTS rate field to be
set with CTS-to-self rate and RTS duration field to be filled with
CTS-to-self duration.

This patch makes the driver to do this.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agortl8180: report mac80211 short preamble RX flag
Andrea Merello [Wed, 7 May 2014 15:52:16 +0000 (17:52 +0200)]
rtl8180: report mac80211 short preamble RX flag

This patch make it possible to mac80211 to know whether a frame
has been received with short preamble.

It simply checks for the "splcp" flag in the RX status
descriptor, and eventually set RX_FLAG_SHORTPRE in mac80211
rx status structure.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agortl8187: report mac80211 short preamble RX flag
Andrea Merello [Wed, 7 May 2014 15:51:43 +0000 (17:51 +0200)]
rtl8187: report mac80211 short preamble RX flag

This patch make it possible to mac80211 to know whether a frame
has been received with short preamble.

It simply checks for the "splcp" flag in the RX status
descriptor, and eventually set RX_FLAG_SHORTPRE in mac80211
rx status structure.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Allow platform override without EEPROM override
Helmut Schaa [Wed, 7 May 2014 07:28:31 +0000 (09:28 +0200)]
ath9k: Allow platform override without EEPROM override

Add a new platform data flag "use_eeprom" that indicates that the eeprom
found on the card itself should be used instead of the one present in
the platform data.

This allows to override the MAC address of a PCI card while preserving
the eeprom data from the card itself.

The default behavior is preserved.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: add HT operation IE in TDLS setup confirm
Avinash Patil [Wed, 7 May 2014 05:02:45 +0000 (22:02 -0700)]
mwifiex: add HT operation IE in TDLS setup confirm

This patch adds support to populate HT operatation IE in TDLS
setup confirm command. This is required for setting wider
bandwidths for TDLS operations.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: disable TDLS link upon tear down event
Avinash Patil [Wed, 7 May 2014 05:02:44 +0000 (22:02 -0700)]
mwifiex: disable TDLS link upon tear down event

This patch adds code to disable TDLS link upon reception of TDLS
teardown event from peer. Teardown event can happen either
because of TDLS teardown packet from peer or internal timeout
configured during TDLS setup. Event is propogated to cfg80211
so that userspace application can take appropriate action.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: configure inactivity timeout for TDLS link
Avinash Patil [Wed, 7 May 2014 05:02:43 +0000 (22:02 -0700)]
mwifiex: configure inactivity timeout for TDLS link

This patch adds configuration timeout for TDLS link. This is
configuered at the time of TDLS link configuration. If TDLS link
is inactive for more than timeout, FW will tear this link.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoiwlwifi: pcie: disable interrupts upon PCIe alloc
Emmanuel Grumbach [Sun, 13 Apr 2014 13:03:11 +0000 (16:03 +0300)]
iwlwifi: pcie: disable interrupts upon PCIe alloc

In case RFKILL is in KILL position, the NIC will issue an
interrupt straight away. This interrupt won't be sent
because it is masked in the hardware.
But if our interrupt service routine is called for another
reason (SHARED_IRQ), then we'll look at the interrupt cause
and service it. This can cause bad things if we are not
ready yet.
Explicitly clean the interrupt cause register to make sure
we won't service anything before we are ready to.

Cc: <stable@vger.kernel.org> [3.14]
Reported-and-tested-by: Alexander Monakov <amonakov@gmail.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: enable MCS9 for Tx
Eyal Shapira [Mon, 28 Apr 2014 11:20:29 +0000 (14:20 +0300)]
iwlwifi: mvm: rs: enable MCS9 for Tx

After fixes to the rs algorithm reenable MCS9.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix sparse warning when _DEBUGFS isn't set
Emmanuel Grumbach [Tue, 6 May 2014 20:37:07 +0000 (23:37 +0300)]
iwlwifi: mvm: fix sparse warning when _DEBUGFS isn't set

Since the declaration of iwl_mvm_fw_error_rxf_dump and
iwl_mvm_fw_error_sram_dump is under
ifdef CONFIG_IWLWIFI_DEBUGFS, do the same for their
implementation.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: implement mac80211's flush callback
Emmanuel Grumbach [Mon, 24 Mar 2014 10:08:53 +0000 (12:08 +0200)]
iwlwifi: mvm: implement mac80211's flush callback

This allows mac80211 to flush the Tx queues before it sends
critical management frames.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi:mvm: Add AP/GO channel switch support
Andrei Otcheretianski [Tue, 22 Oct 2013 03:01:12 +0000 (05:01 +0200)]
iwlwifi:mvm: Add AP/GO channel switch support

Publish WIPHY_FLAG_HAS_CHANNEL_SWITCH if the fw supports
newly introduced IWL_UCODE_TLV_API_CSA_FLOW.
When CSA starts, save the switching vif inside mvm and during the CSA period
configure fw with a new beacon after each beacon transmission in order to
update the csa counters.
Also, handle correctly the CSA unbind-bind flow which is triggered by mac80211
when the actual channel switch happens.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: wait for d0i3 exit in some more ampdu actions
Eliad Peller [Tue, 22 Apr 2014 10:33:29 +0000 (13:33 +0300)]
iwlwifi: mvm: wait for d0i3 exit in some more ampdu actions

Some ampdu actions change queues by direct target access.

Since the bus is disabled in d0i3, make sure to exit d0i3
before handling these actions.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm/pcie: capture last commands on firmware error
Johannes Berg [Thu, 24 Apr 2014 08:41:31 +0000 (10:41 +0200)]
iwlwifi: mvm/pcie: capture last commands on firmware error

When a firmware error occurs, capture the last 32 commands
(which are still in memory) in the error dump debugfs file.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: do no sched scan while associated
David Spinadel [Thu, 24 Apr 2014 10:15:29 +0000 (13:15 +0300)]
iwlwifi: mvm: do no sched scan while associated

Currently the FW doesn't support sched scan while associated,
Prevent it.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoath9k_hw: get QCA953x WMAC revision via platform_data
Felix Fietkau [Sun, 4 May 2014 23:33:01 +0000 (01:33 +0200)]
ath9k_hw: get QCA953x WMAC revision via platform_data

The SREV register in the WMAC register space does not contain the chip
revision, so it needs to be passed in from the kernel.

With an updated kernel, this fixes tx gain table selection.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoRTL8192CU: Increase max APFM_ONMAC polling count
Andy Spencer [Fri, 2 May 2014 06:48:13 +0000 (06:48 +0000)]
RTL8192CU: Increase max APFM_ONMAC polling count

With certain hardware combinations the poll interval is exceeded before
initialization completes.

Tested on a MacBookPro10,1 using a Sabrent USB-A11N USB adapter.

Signed-off-by: Andy Spencer <andy753421@ucla.edu>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Advertise support for AP mode channel width changes
Rajkumar Manoharan [Thu, 1 May 2014 11:37:43 +0000 (17:07 +0530)]
ath9k: Advertise support for AP mode channel width changes

This will enable AP mode to change channel width dynamically
based on 20/40 intolerance report sent by associated client.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Prevent divide-by-zero upon bad beacon_interval.
Ben Greear [Wed, 30 Apr 2014 19:02:05 +0000 (12:02 -0700)]
ath9k: Prevent divide-by-zero upon bad beacon_interval.

A similar patch fixed crashes seen on an ath9k system
when testing against a broken ath10k AP.  This patch
is slightly less protective, but probably will do the
job and is less redundant.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoMerge branch 'rfkill-gpio-cleanups' of git://git.kernel.org/pub/scm/linux/kernel...
John W. Linville [Tue, 6 May 2014 18:43:34 +0000 (14:43 -0400)]
Merge branch 'rfkill-gpio-cleanups' of git://git./linux/kernel/git/jberg/mac80211-next

10 years agoiwlwifi: pcie: get rid of q->n_bd
Johannes Berg [Thu, 24 Apr 2014 07:57:40 +0000 (09:57 +0200)]
iwlwifi: pcie: get rid of q->n_bd

This variable always tracks a constant value (256) so there's
no need to have it. Removing it simplifies code generation,
reducing the .text size (by about 240 bytes on x86-64.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
John W. Linville [Tue, 6 May 2014 18:05:51 +0000 (14:05 -0400)]
Merge git://git./linux/kernel/git/jberg/mac80211

10 years agoiwlwifi: pcie: use bool for iwl_pcie_txq_build_tfd() argument
Johannes Berg [Wed, 23 Apr 2014 17:00:56 +0000 (19:00 +0200)]
iwlwifi: pcie: use bool for iwl_pcie_txq_build_tfd() argument

The 'reset' argument is clearly a boolean, so use bool instead
of u8 with 0/1 values.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: make LED support optional
Johannes Berg [Thu, 24 Apr 2014 14:31:08 +0000 (16:31 +0200)]
iwlwifi: make LED support optional

If there's no LED on the system, it doesn't make a lot of sense
to include close to 4k of LED-related code (mostly in mac80211),
so instead of forcing LED support into the kernel, don't build
iwlwifi/mac80211 LED support if there's no LED class support.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: EliadX Peller <eliad@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix bug in parse_nvm_sections
Eran Harary [Wed, 30 Apr 2014 12:31:59 +0000 (15:31 +0300)]
iwlwifi: mvm: fix bug in parse_nvm_sections

The old code checks if hw_section_num is valid while the
right thing to do is to check if section[hw_section_num].data
is valid.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Reviewed-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: select the MAC address according to priority
Eran Harary [Mon, 28 Apr 2014 12:22:40 +0000 (15:22 +0300)]
iwlwifi: mvm: select the MAC address according to priority

For family 8000 products, the driver should take the MAC
address from the mac_override section and only if this
section is empty it should take it from the HW section.

Signed-off-by: Eran Harary <eran.harary@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: Prioritize external nvm values on top of the OTP values
Eran Harary [Tue, 25 Mar 2014 12:14:44 +0000 (14:14 +0200)]
iwlwifi: mvm: Prioritize external nvm values on top of the OTP values

Read first the nvm sections from the OTP, then read the nvm
sections from the external file and override the OTP values
(if there were any values in the OTP).

Signed-off-by: Eran Harary <eran.harary@intel.com>
Reviewed-by: Dor Shaish <dor.shaish@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>