Supporting 8K A-MSDU means that we need to allocate order 1
pages for every Rx packet. Even when there is no traffic.
This adds stress on the memory manager. The handling of
compound pages is also less trivial for the memory manager
and not using them will make the allocation code run faster
although I didn't really measure.
Eric also pointed out that having huge buffers with little
data in them is not very nice towards the TCP stack since
the truesize of the skb is huge. This doesn't allow TCP
to have a big Rx window.
See https://patchwork.kernel.org/patch/2167711/ for details.
Note that very few vendors will actually send A-MSDU.
Disable this feature by default.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sparse warns about invalid assignment in
drivers/net/wireless/ti/wl1251/cmd.c:451:42: warning: invalid assignment: |=
drivers/net/wireless/ti/wl1251/cmd.c:451:42: left side has type restricted __le16
drivers/net/wireless/ti/wl1251/cmd.c:451:42: right side has type int
Hence type converted right side to __le16.
Signed-off-by: Surendra Patil <surendra.tux@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Larry Finger [Fri, 28 Feb 2014 21:16:47 +0000 (15:16 -0600)]
rtlwifi: rtl8723ae: rtl8723-common: Create new driver for common code
The drivers for RTL8723AE and RTL8723BE have some code in common.
This commit creates a driver for this code that will be shared, and
copies those common routines from rtl8723ae's phy code.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Larry Finger [Fri, 28 Feb 2014 21:16:46 +0000 (15:16 -0600)]
rtlwifi: Prepare existing drivers for new driver
A driver for the RTL8723BE will soon be added. This patch adds the
necessary parts to the common headers, and modifies the existing
drivers for those changes.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Larry Finger [Fri, 28 Feb 2014 21:16:43 +0000 (15:16 -0600)]
rtlwifi: btcoexist: Add new mini driver
A new driver in the rtlwifi family for the RTL8723BE will soon be added.
The bluetooth coexistence code for this device has been split into a separate
mini driver as it will be shared with other devices. This commit adds the
the headers and sources, and modifies Kconfig and Makefile to configure and
build this driver.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
andrea merello [Tue, 18 Feb 2014 01:10:46 +0000 (02:10 +0100)]
rtl818x: make sure TX descriptor writes are done before kicking DMA
The TX descriptors are consumed by the HW using DMA.
Even if in the driver code the TX descriptor writes appears before
the HW "dma kick" register writes, the CPU may reorder them.
If this happens, the TX may not happen at all becase the "valid"
descriptor flag may have not been set yet.
This patch adds a write memory barrier to ensures the TX
descriptor is written before writing to the HW "dma kick" register.
Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
andrea merello [Tue, 18 Feb 2014 01:10:45 +0000 (02:10 +0100)]
rtl818x: Make sure the TX descriptor "valid" flag is written by last
The TX descriptors are consumed by the HW using DMA.
Even if in the driver code the memory write that sets the "valid"
flag appears after all other writes, the CPU may reorder writes,
causing the HW to consider as valid a not-fully-written yet
descriptor.
This may cause HW incorrect behaviour.
This can happen because (AFAIK) the HW may attempt DMA
asynchronously without waiting to be kicked by the following
register write.
This patch adds a write memory barrier to enforce writes ordering.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Zhao, Gang [Sat, 1 Mar 2014 06:26:29 +0000 (14:26 +0800)]
wireless: Kconfig: add missing dependency
Previous driver changes to airo, atmel, wl3501_cs, and usb_zd1201 need
to include <net/cfg80211.h>, which depends on CFG80211, so add the
missing dependency.
Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Fri, 28 Feb 2014 18:02:25 +0000 (19:02 +0100)]
ath9k_hw: tweak noise immunity thresholds for older chipsets
Older chipsets are more sensitive to high PHY error counts, and the
current noise immunity thresholds were based on tests run at QCA with
newer chipsets.
This patch brings back the values from the old ANI implementation for
old chipsets, and it also disables weak signal detection on an earlier
noise immunity level, to improve overall radio stability on affected
devices.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Fri, 28 Feb 2014 18:02:24 +0000 (19:02 +0100)]
ath9k_hw: toggle weak signal detection in AP mode on older chipsets
The commit 80b4205b "ath9k: Fix OFDM weak signal detection for AP mode"
prevented weak signal detection changes from taking effect in AP mode on
all chipsets, claiming it is "not allowed".
The main reason for not disabling weak signal detection in AP mode is
that typically beacon RSSI is used to track whether it is needed to
boost range, and this is unavailable in AP mode for obvious reasons.
The problem with not disabling weak signal detection is that older
chipsets are very sensitive to high PHY error counts. When faced with
heavy noise, this can lead to an excessive amount of "Failed to stop
TX DMA" errors in the field.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
According to 802.11n-2012 standard in paragraph PPDU Fromat(20.3.2) HT-mixed
format Hearder PPDU contains : L_STF, L_LTF, L_SIG, HT_SIG, HT_STF, HT_LTF
they are symbols in the preamble, there are in time unit(us) that's for why
it can't be computed in bytes
Signed-off-by: Sylvain ROGER RIEUNIER <sylvain.roger.rieunier@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arend van Spriel [Tue, 25 Feb 2014 19:30:38 +0000 (20:30 +0100)]
brcmfmac: reset suspend flag upon sdio suspend failure
The suspend callback first sets the suspend flag used in the driver
but after that the actual suspend is done, which may fail. Reset the
flag upon suspend failure.
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: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Amitkumar Karwar [Fri, 28 Feb 2014 03:35:18 +0000 (19:35 -0800)]
mwifiex: update MCS information as per antenna settings
Even if the device is changed to 1X1 mode, data is sent with
higher MCS rates after association.
This patch fixes the problem by updating MCS information field
in HT capability when antenna setting changes so that correct
information will be advertised in association and probe request.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Amitkumar Karwar [Fri, 28 Feb 2014 03:35:17 +0000 (19:35 -0800)]
mwifiex: replace num_cmd_timeout with is_cmd_timedout
Command timeout happens when firmware goes into bad state.
There is no chance that next command will be successful after
this. Hence we will maintain a flag instead of count.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arend van Spriel [Thu, 27 Feb 2014 18:25:00 +0000 (19:25 +0100)]
brcmfmac: use pre-allocated scatter-gather table for txglomming
Instead of allocating a scatter-gather table for every transmit
reuse a pre-allocated table. The transmit path will be faster by
taking out this allocation.
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Daniel Kim [Tue, 25 Feb 2014 19:30:36 +0000 (20:30 +0100)]
brcmfmac: Correct mcs index report
There is a mismatch between the mcs index(0-7) reported to cfg80211
and the actual mcs index(0-15) in use. This patch resolves the mismatch
by setting mcs info with the number of chains read from FW.
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>
Amitkumar Karwar [Fri, 28 Feb 2014 03:35:17 +0000 (19:35 -0800)]
mwifiex: stop AP at shutdown time
Deauth is sent to AP when the device is acting as station at
shutdown time. Similarly we should stop AP operation also.
mwifiex_deauthenticate() takes care closing the connection
based on provided interface type.
Add a new function to simplify the code.
Reported-by: Avery Pennarun <apenwarr@gmail.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Amitkumar Karwar [Fri, 28 Feb 2014 03:35:16 +0000 (19:35 -0800)]
mwifiex: skipping pending commands after unload
We skip downloading other commands after FUNC_SHUTDOWN is queued
during driver unload. Main thread should be woken up each time
after freeing skipped command so that FUNC_SHUTDOWN gets served
in case if there are other pending commands before FUNC_SHUTDOWN.
Also, call mwifiex_complete_cmd() only for synchronous commands.
Reported-by: Avery Pennarun <apenwarr@gmail.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Maithili Hinge <maithili@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Amitkumar Karwar [Fri, 28 Feb 2014 03:35:15 +0000 (19:35 -0800)]
mwifiex: abort scan while cancelling pending command
mwifiex_cancel_pending_ioctl() and
mwifiex_cancel_all_pending_cmd() are called in command timeout
and driver unload paths respectively.
If scan operation is in progress, we should abort it smoothly.
Reported-by: Tim Shepard <shep@alum.mit.edu> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Amitkumar Karwar [Fri, 28 Feb 2014 03:35:13 +0000 (19:35 -0800)]
mwifiex: change transmit buffer size for 8897
Currently default Tx buffer size configured to firmware is 2K
for all chipsets. This patch changes it to 4K for SD/PCIe/USB
8897 chipsets as per firmware requirements.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bing Zhao [Fri, 28 Feb 2014 03:35:12 +0000 (19:35 -0800)]
mwifiex: remove global variable cmd_wait_q_required
There is a race condition while queuing synchronous command and
asynchronous command requested from different threads, because
the wait_q_enabled flag is set based on a global variable
cmd_wait_q_required.
The issue is fixed by removing this global variable and using a
unified function with an argument 'sync' passed into the
function.
Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Need to fill translation table before calling WMI with WMI_VRING_CFG_CMDID
since firmware may generate events during this call; and events need translation
table filled to be properly dispatched
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
When FW notifies about BACK status change, it provides ring ID.
Process BA status for requested connection only. As for now, FW
don't report Rx BACK status, it reports Tx one instead.
As per current algorithm used in the firmware, imply Rx BACK
state is in sync with Tx one
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hardware do not support "real" broadcast on the air.
Use method similar to the Directed Multicast Service (DMS) as
described in the 10.23.15.2 "DMS procedures"
This service copies frame and delivers unicast for each associated peer
Do the following: send original frame to 1-st Tx vring, and send copies
to all other active vrings.
As currently hardware/firmware don't support A-MSDU, convert broadcast
frame to unicast instead of wrapping it in A-MSDU
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Enable multiple (up to 8 - HW/FW limitation) simultaneous connections.
Each connection has its own CID (connection ID) that describes chip's
beam-forming entity. Tx Vring should refer to correct CID for frame to reach
its destination.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Print '_' for the 'idle' descriptors - this makes vring representation more visible.
Also, for the Tx side, differentiate descriptors having associated skb's - print ones
with skb as 'H' and without as 'h'. Good to represent scattered frames.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
wil6210: [DEBUG] allow to query Rx and all Tx VRING descriptors
Expand debug capabilities to query all Tx/Rx descriptors. Usefull to analyse
various hardware/software stall situations. Printed is whole descriptor content
and the frame itself.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hante Meuleman [Wed, 26 Feb 2014 12:32:32 +0000 (13:32 +0100)]
brcmfmac: Use atomic functions for intstatus update.
The intstatus in sdio code can be updated from different
threads. To protect intstatus access, atomic functions are
used. The loop was replaced using atomic_set_mask().
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>
Paul Stewart [Wed, 26 Feb 2014 00:31:37 +0000 (16:31 -0800)]
mwifiex: Track BA sequence number reset
Some stations reset the sequence number for traffic-ids (TIDs)
as they initiate a block-ACK session. In order to detect such
behavior, mwifiex must note the starting sequence number given
during the ADDBA request. If the first received sequence number
after the ADDBA falls outside the receive window for this TID but
after the the ADDBA starting sequence number, we can assume that
this AP has reset its sequence number during the ADDBA. In this
case we must adjust the input window backward to incorporate this
received sequence number instead of ignoring it. Otherwise, we
could fail to successfully retrieve an arbitrarily large number
of downstream frames at the beginning of the block-ACK session.
Signed-off-by: Paul Stewart <pstew@chromium.org> Acked-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hante Meuleman [Tue, 25 Feb 2014 19:30:33 +0000 (20:30 +0100)]
brcmfmac: Small cleanup of redundant code.
In time some of the code got redundant, without being noticed.
This patch does not change any functionality, just removes
redundant code.
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>
Hante Meuleman [Tue, 25 Feb 2014 19:30:32 +0000 (20:30 +0100)]
brcmfmac: Remove immediate sleep support from SDIO.
Immediate sleep support is an aggressive power saving option
that has not been enabled in brcmfmac and is removed to
simplify code.
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>
Hante Meuleman [Tue, 25 Feb 2014 19:30:31 +0000 (20:30 +0100)]
brcmfmac: Minimize SDIO dpc scheduling.
SDIO dpc scheduling is done (repeated) when counter is set. This
counter gets decreased when dpc is finished. It is more efficient
to set counter to 0 before the dpc is actullay run. This will
minimize the frequency with which dpc is executed.
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>
Hante Meuleman [Tue, 25 Feb 2014 19:30:30 +0000 (20:30 +0100)]
brcmfmac: de-init driver layers in correct order.
First clean up fw signalling, before cleaning up the bus and
proto layer. Old order can cause oops in some circumstances.
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>
Hante Meuleman [Tue, 25 Feb 2014 19:30:29 +0000 (20:30 +0100)]
brcmfmac: Correct header debug dump for sdio tx hdrs.
Reviewed-by: Arend Van Spriel <arend@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>
Arend van Spriel [Tue, 25 Feb 2014 19:30:28 +0000 (20:30 +0100)]
brcmfmac: remove unused variable data_len from brcmf_sdio_bus_txdata()
The local variable data_len is assigned but never used so get rid
of it.
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com> Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arend van Spriel [Tue, 25 Feb 2014 19:30:27 +0000 (20:30 +0100)]
brcmfmac: fix use of skb control buffer in SDIO driver part
The SDIO driver has a 16-bit field defined in the skbuff control buffer.
However, it is accessed as a u32 overwriting other control info. Another
issue is that the field is not initialized for networking packets, but
the control buffer content is unspecified as other networking layers can
use it.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
Hante Meuleman [Tue, 25 Feb 2014 19:30:26 +0000 (20:30 +0100)]
brcmfmac: Make firmeware roaming a module param.
Internal firmware roaming is enabled by default. This patch
makes it possible to disable internal firmware roaming by
specifying roamoff=1 as module param.
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>
mwl8k: Adding support to gather survey per channel
Survey stats such as channel busy time, rx busy time
and noise are collected when sw_scan starts for every
switched new channel. This happens till sw_scan stops.
All the collected stats are shared up when get_survey()
is called.
This implements support for ACS feature from Hostapd.
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Nishant Sarmukadam <nishants@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Zhao, Gang [Tue, 18 Feb 2014 13:36:01 +0000 (21:36 +0800)]
zd1201: replace function ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}
Replace ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan} with more
generic ieee80211_{channel_to_frequency, frequency_to_channel}.
Function ieee80211_frequency_to_channel() will return 0 if frequency
is not correctly provided, so no need to set channel to 0 explicitly.
Include <net/cfg80211.h> for the defination of IEEE80211_BAND_2GHZ.
Because <net/cfg80211.h> includes <linux/ieee80211.h>, so we can
replace <linux/ieee80211.h> with <net/cfg80211.h>.
This change is a preparation for the removal of function
ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}.
Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Zhao, Gang [Tue, 18 Feb 2014 13:35:59 +0000 (21:35 +0800)]
wl3501_cs: replace function ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}
Replace ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan} with more
generic ieee80211_{channel_to_frequency, frequency_to_channel}.
Include <net/cfg80211.h> for the defination of IEEE80211_BAND_2GHZ.
Because <net/cfg80211.h> includes <linux/ieee80211.h>, so we can
replace <linux/ieee80211.h> with <net/cfg80211.h>.
This change is a preparation for the removal of function
ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}.
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Zhao, Gang [Tue, 18 Feb 2014 13:35:58 +0000 (21:35 +0800)]
atmel: replace function ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}
Replace ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan} with more
generic ieee80211_{channel_to_frequency, frequency_to_channel}.
Include <net/cfg80211.h> for the defination of IEEE80211_BAND_2GHZ.
Because <net/cfg80211.h> includes <linux/ieee80211.h>, so we can
replace <linux/ieee80211.h> with <net/cfg80211.h>.
This change is a preparation for the removal of function
ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}.
Cc: Simon Kelley <simon@thekelleys.org.uk> Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Zhao, Gang [Tue, 18 Feb 2014 13:35:57 +0000 (21:35 +0800)]
airo: replace function ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}
Replace ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan} with more
generic ieee80211_{channel_to_frequency, frequency_to_channel}.
Include <net/cfg80211.h> for the defination of IEEE80211_BAND_2GHZ.
Because <net/cfg80211.h> includes <linux/ieee80211.h>, so we can
replace <linux/ieee80211.h> with <net/cfg80211.h>.
This change is a preparation for the removal of function
ieee80211_{dsss_chan_to_freq, freq_to_dsss_chan}.
Signed-off-by: Zhao, Gang <gamerh2o@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
andrea merello [Tue, 18 Feb 2014 01:10:44 +0000 (02:10 +0100)]
rtl818x: add comments to explain few not obvious HW configs.
Certain HW options (TX packet retry count, CW configuration and
TX power configuration) can be specified in both the TX packet
descriptor and also into HW "global" registers.
The HW is thus configured to honour the global register or the
TX descriptor field depending by the case.
This patch adds few comments that hopefully clarify in which cases
the driver uses one method and in which cases it uses the other.
Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
andrea merello [Tue, 18 Feb 2014 01:10:43 +0000 (02:10 +0100)]
rtl818x: make dev_alloc_skb() null pointer check to really work
During driver initialization, some skbs are preallocated for RX.
Currenly if the allocation fails, the driver's allocation routine
exits immediatly but it will return zero (success) anyway.
In this way the driver will continue initialization with buggy
pointers around.
This patch makes the driver's allocation routine to return
an error value and to print a complaint message when skb allocation
fails.
In this way its caller will not go further, avoinding the driver to
successfully load, and preventing dereferencing buggy pointers.
An hint is thus printed about why the driver failed.
Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
andrea merello [Sat, 22 Feb 2014 16:57:23 +0000 (17:57 +0100)]
rtl818x: check for pci_map_single() success when initializing RX ring
During initialization a number of RX skbs are allocated and mapped
for DMA.
Currently if pci_map_single() fails, it will result in passing to the
HW a wrong DMA address (to write to!).
This patch adds check for this condition and eventually causes the
driver not to initialize, avoiding at least dangerous DMAs.
Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
andrea merello [Tue, 18 Feb 2014 01:10:41 +0000 (02:10 +0100)]
rtl818x: pci_iomap() should pair with pci_iounmap()
Currently the driver uses pci_iomap() but iounmap() is called in
the error path
Change to use pci_iounmap() instead.
Reported-by: Huqiu Liu <liuhq11@mails.tsinghua.edu.cn> Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
andrea merello [Tue, 18 Feb 2014 01:10:40 +0000 (02:10 +0100)]
rtl818x: Explicitly enable contetion window
Currently the contention window enable/disable HW flag is not
touched by the driver.
This patch explicitly set it to the correct value to make sure
contention window is enabled (AFAIK contention window must be
enabled in most (if not all) cases.
Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Move the power GPIO handling from the board code into
the driver. This is a dependency for device tree support.
Signed-off-by: Sebastian Reichel <sre@debian.org> Reviewed-by: Pavel Machek <pavel@ucw.cz> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Luciano Coelho [Fri, 14 Feb 2014 23:05:52 +0000 (00:05 +0100)]
wl1251: split wl251 platform data to a separate structure
Move the wl1251 part of the wl12xx platform data structure into a new
structure specifically for wl1251. Change the platform data built-in
block and board files accordingly.
Signed-off-by: Luciano Coelho <coelho@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Reviewed-by: Sebastian Reichel <sre@debian.org> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bing Zhao [Thu, 27 Feb 2014 04:11:22 +0000 (20:11 -0800)]
mwifiex: do not advertise usb autosuspend support
As many Surface Pro I & II users have found out, the mwifiex_usb
doesn't support usb autosuspend, and it has caused some system
stability issues.
Bug 69661 - mwifiex_usb on MS Surface Pro 1 is unstable
Bug 60815 - Interface hangs in mwifiex_usb
Bug 64111 - mwifiex_usb USB8797 crash failed to get signal
information
USB autosuspend get triggered when Surface Pro's AC power is
removed or powertop enables power saving on USB8797 device.
Driver's suspend handler is called here, but resume handler
won't be called until the AC power is put back on or powertop
disables power saving for USB8797.
We need to refactor the suspend/resume handlers to support
usb autosuspend properly. For now let's just remove it.
Cc: <stable@vger.kernel.org> # 3.5+ Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johan Hedberg [Fri, 28 Feb 2014 18:26:13 +0000 (20:26 +0200)]
Bluetooth: Remove unnecessary stop_scan_complete function
The stop_scan_complete function was used as an intermediate step before
doing the actual connection creation. Since we're using hci_request
there's no reason to have this extra function around, i.e. we can simply
put both HCI commands into the same request.
The single task that the intermediate function had, i.e. indicating
discovery as stopped is now taken care of by a new
HCI_LE_SCAN_INTERRUPTED flag which allows us to do the discovery state
update when the stop scan command completes.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Johan Hedberg [Fri, 28 Feb 2014 18:26:12 +0000 (20:26 +0200)]
Bluetooth: Fix trying to disable scanning twice
The discovery process has a timer for disabling scanning, however
scanning might be disabled through other means too like the auto-connect
process. We should therefore ensure that the timer is never active
after sending a HCI command to disable scanning.
There was some existing code in stop_scan_complete trying to avoid the
timer when a connect request interrupts a discovery procedure, but the
other way around was not covered. This patch covers both scenarios by
canceling the timer as soon as we get a successful command complete for
the disabling HCI command.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Johan Hedberg [Fri, 28 Feb 2014 16:10:03 +0000 (18:10 +0200)]
Bluetooth: Delay LTK encryption to let remote receive all keys
Some devices may refuse to re-encrypt with the LTK if they haven't
received all our keys yet. This patch adds a 250ms delay before
attempting re-encryption with the LTK.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Johan Hedberg [Fri, 28 Feb 2014 16:10:02 +0000 (18:10 +0200)]
Bluetooth: Re-encrypt link after receiving an LTK
It's not strictly speaking required to re-encrypt a link once we receive
an LTK since the connection is already encrypted with the STK. However,
re-encrypting with the LTK allows us to verify that we've received an
LTK that actually works.
This patch updates the SMP code to request encrypting with the LTK in
case we're in master role and waits until the key refresh complete event
before notifying user space of the distributed keys.
A new flag is also added for the SMP context to ensure that we
re-encryption only once in case of multiple calls to smp_distribute_keys.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Johan Hedberg [Fri, 28 Feb 2014 15:45:46 +0000 (17:45 +0200)]
Bluetooth: Add timeout for LE connection attempts
LE connection attempts do not have a controller side timeout in the same
way as BR/EDR has (in form of the page timeout). Since we always do
scanning before initiating connections the attempts are always expected
to succeed in some reasonable time.
This patch adds a timer which forces a cancellation of the connection
attempt within 20 seconds if it has not been successful by then. This
way we e.g. ensure that mgmt_pair_device times out eventually and gives
an error response.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Johan Hedberg [Fri, 28 Feb 2014 15:45:45 +0000 (17:45 +0200)]
Bluetooth: Add defines for LE initiator filter policy
This patch adds defines for the initiator filter policy parameter values
of the HCI_LE_Create_Connection command. They will be used in a
subsequent patch to check whether we should have a timeout for the
connection attempt or not.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Johan Hedberg [Fri, 28 Feb 2014 10:54:17 +0000 (12:54 +0200)]
Bluetooth: Use hdev->init/resp_addr values for smp_c1 function
Now that we have nicely tracked values of the initiator and responder
address information we can pass that directly to the smp_c1 function
without worrying e.g. about who initiated the connection. This patch
updates the two places in smp.c to use the new variables.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>