cascardo/linux.git
9 years agoMerge tag 'nfc-next-3.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Fri, 30 May 2014 17:41:40 +0000 (13:41 -0400)]
Merge tag 'nfc-next-3.16-2' of git://git./linux/kernel/git/sameo/nfc-next

Samuel Ortiz <sameo@linux.intel.com> says:

"NFC: 3.16: Second pull request

This is the 2nd NFC pull request for 3.16. We have:

- Felica (Type3) tags support for trf7970a
- Type 4b tags support for port100
- st21nfca DTS typo fix
- A few sparse warning check fixes"

Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agortlwifi: rtl8192cu: remove check for CONFIG_AUTOSUSPEND
Paul Bolle [Sat, 24 May 2014 05:46:06 +0000 (07:46 +0200)]
rtlwifi: rtl8192cu: remove check for CONFIG_AUTOSUSPEND

A check for CONFIG_AUTOSUSPEND was included in this driver when it was
added in v2.6.39. But that Kconfig symbol doesn't exist. Remove that
check and the single line it hides.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agortlwifi: rtl8723ae: Remove duplicate inclusion of fw_common.h
Sachin Kamat [Thu, 29 May 2014 11:09:24 +0000 (16:39 +0530)]
rtlwifi: rtl8723ae: Remove duplicate inclusion of fw_common.h

fw_common.h was included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agortlwifi: rtl8723be: Remove duplicate inclusion of phy.h
Sachin Kamat [Thu, 29 May 2014 11:09:23 +0000 (16:39 +0530)]
rtlwifi: rtl8723be: Remove duplicate inclusion of phy.h

phy.h was included twice.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoath9k: Fix interface combinations for multi-channel concurrency
Rajkumar Manoharan [Thu, 29 May 2014 09:41:09 +0000 (15:11 +0530)]
ath9k: Fix interface combinations for multi-channel concurrency

Currently mac80211 does not support WDS and DFS with channel context
drivers. So advertise these features only when the driver is not
supporting channel context and modparam "use_chanctx" is introduced
for preparing channel context support in ath9k.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agomwifiex: change hscfg gap parameter to avoid potential firmware deadlock
Bing Zhao [Wed, 28 May 2014 04:39:34 +0000 (21:39 -0700)]
mwifiex: change hscfg gap parameter to avoid potential firmware deadlock

If host sleep parameter gap is set to 0xff, firmware will wait
for an ack from host to confirm the success of host wakeup.
This prevents firmware from uploading data packet before host
actually wakes up.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agomwifiex: set TDLS link for newly created RA list
Avinash Patil [Wed, 28 May 2014 04:39:33 +0000 (21:39 -0700)]
mwifiex: set TDLS link for newly created RA list

Current implementation sets tdls_link flag only while restoring
packets from TDLS queue. If traffic to peer starts after TDLS is
setup, there is no way to set TDLS link flag to true. Do this
while creating RA list and we confirm that there exist a TDLS
peer for which setup is complete.

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>
9 years agomwifiex: fix a crash in extended scan event processing
Avinash Patil [Wed, 28 May 2014 04:39:32 +0000 (21:39 -0700)]
mwifiex: fix a crash in extended scan event processing

[113.967694] Unable to handle kernel NULL pointer dereference
               at virtual address 00000020
............
[113.967859] PC is at mwifiex_update_rxreor_flags+0xfc/0x430
............
[113.968110] mwifiex_update_rxreor_flags+0xfc/0x430
[113.968129] mwifiex_handle_event_ext_scan_report+0x1e4/0x21c
[113.968148] mwifiex_process_sta_event+0x410/0x508
[113.968165] mwifiex_process_event+0x184/0x1e0
[113.968181] mwifiex_main_process+0x220/0x48c
[113.968197] mwifiex_sdio_interrupt+0xc8/0x1cc
[113.968210] sdio_irq_thread+0x11c/0x290

In case of legacy scan, adapter->curr_cmd is guranteed to be
non-NULL in check_next_scan_cmd. This may not be case in
extended scan where scan command response would come earlier and
set curr_cmd to NULL. Extended scan event comes later and while
trying to complete IOCTL for scan, driver would crash in
dereferencing adapter->curr_cmd->wait_q_enabled.

Avoid this by completing IOCTL in case of legacy scans only.
Internal scan would be completed while handling extended scan
command response.

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>
9 years agob43: N-PHY: optimize radio switching on/off
Rafał Miłecki [Tue, 27 May 2014 20:07:33 +0000 (22:07 +0200)]
b43: N-PHY: optimize radio switching on/off

Broadcom's wl 6.30.223.141 has some optimizations for radios 0x205[67].

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agob43: N-PHY: optimize init by doing some ops just once
Rafał Miłecki [Tue, 27 May 2014 20:07:32 +0000 (22:07 +0200)]
b43: N-PHY: optimize init by doing some ops just once

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agob43: PHY: allow init optimizations by tracking PHY state
Rafał Miłecki [Tue, 27 May 2014 20:07:31 +0000 (22:07 +0200)]
b43: PHY: allow init optimizations by tracking PHY state

PHY has to be often re-initialized (e.g. during band switching after PHY
reset), however some operations have to be performed only once (only
power reset affects them).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agowil6210: optimize wil_release_reorder_frames
Vladimir Kondratiev [Tue, 27 May 2014 11:45:50 +0000 (14:45 +0300)]
wil6210: optimize wil_release_reorder_frames

In case of receiving frame with sequence number far greater than current,
wil_release_reorder_frames() will iterate many times over empty buffer.

Optimize this case by checking buffer emptiness and simply update
head_seq_num without iterating.

Suggested-by: Vladimir Shulman <Vladimir.Shulman@Wilocity.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agowil6210: improve pointers printing
Vladimir Kondratiev [Tue, 27 May 2014 11:45:49 +0000 (14:45 +0300)]
wil6210: improve pointers printing

use proper format %pad for the dma_addr_t arguments;
prefix %p with 0x, as %p don't print is by itself

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agowil6210: detect scan timeouts
Vladimir Kondratiev [Tue, 27 May 2014 11:45:48 +0000 (14:45 +0300)]
wil6210: detect scan timeouts

If scan has not finished in some reasonable time (10sec), interpret it as
if firmware error occurs but was not reported. Firmware should report
scan completion for every scan request, so it is error condition indeed.
Perform firmware recovery procedure.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agowil6210: inline functions for vring hi/lo watermarks
Vladimir Kondratiev [Tue, 27 May 2014 11:45:46 +0000 (14:45 +0300)]
wil6210: inline functions for vring hi/lo watermarks

Provide clear definition of the watermarks for the vring descriptor space.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agowil6210: limit fw error recovery attempts
Vladimir Kondratiev [Tue, 27 May 2014 11:45:45 +0000 (14:45 +0300)]
wil6210: limit fw error recovery attempts

In case there is something fundamentally wrong with the firmware
(example: RF cable disconnected), FW will always crash immediately
after reset. This leads to infinite fw error recovery loop.

Count consecutive unsuccessful error recovery attempts in a short period
of time, and stop doing recovery after some reasonable count.
It is still possible to manually reset fw doing
interface down/up sequence.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agowil6210: limit MTU
Vladimir Kondratiev [Tue, 27 May 2014 11:45:44 +0000 (14:45 +0300)]
wil6210: limit MTU

Obey 802.11 spec that defines max. data size 7920 bytes

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoath9k: Fix deadlock while updating p2p beacon timer
Rajkumar Manoharan [Tue, 27 May 2014 11:28:02 +0000 (16:58 +0530)]
ath9k: Fix deadlock while updating p2p beacon timer

pm_lock is taken twice while syncing HW TSF of p2p vif.
Fix this by taking the lock at caller side.

Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agobrcmfmac: remove firmware list from USB driver
Arend van Spriel [Tue, 27 May 2014 10:56:28 +0000 (12:56 +0200)]
brcmfmac: remove firmware list from USB driver

The USB driver was using a list for firmware info that was
used in suspend/resume scenario. Now that brcmfmac is using
the asynchronous firmware request this is no longer needed.

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>
9 years agobrcmfmac: Remove interrupt endpoint usage from USB driver.
Hante Meuleman [Tue, 27 May 2014 10:56:27 +0000 (12:56 +0200)]
brcmfmac: Remove interrupt endpoint usage from USB driver.

The USB bus driver always configured an USB intr EP urb. The
driver did not use the result at all and with newer firmware it is
causing continues errors on this EP.

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>
9 years agobrcmfmac: Increase max buffer size for receiving control message from dongle
Daniel Kim [Tue, 27 May 2014 10:56:26 +0000 (12:56 +0200)]
brcmfmac: Increase max buffer size for receiving control message from dongle

The max buffer size for receiving control message from dongle needs to be
increased considering possible block padding. Otherwise some big control
message can't be received due to buffer overrun check.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@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>
9 years agobrcmutil: assure unused bits are cleared in 11n chanspec
Arend van Spriel [Tue, 27 May 2014 10:56:25 +0000 (12:56 +0200)]
brcmutil: assure unused bits are cleared in 11n chanspec

The firmware channel specification is a bitfield using a
16-bit integer, but only 14 lsb are used. Upon encoding
this value assure all 16 bits are cleared.

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>
9 years agobrcmfmac: make brcmf_fw_nvram_strip() static
Arend van Spriel [Tue, 27 May 2014 10:56:24 +0000 (12:56 +0200)]
brcmfmac: make brcmf_fw_nvram_strip() static

The function brcmf_fw_nvram_strip() is no longer called so
it does not need to be exposed.

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>
9 years agobrcmfmac: use asynchronous firmware request in USB
Arend van Spriel [Tue, 27 May 2014 10:56:23 +0000 (12:56 +0200)]
brcmfmac: use asynchronous firmware request in USB

This patch adds use of asynchronous firmware request to
the driver USB layer.

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>
9 years agobrcmfmac: use asynchronous firmware request in SDIO
Arend van Spriel [Tue, 27 May 2014 10:56:22 +0000 (12:56 +0200)]
brcmfmac: use asynchronous firmware request in SDIO

This patch adds use of asynchronous firmware request to
the driver SDIO layer.

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>
9 years agobrcmfmac: introduce asynchronous firmware loading
Arend van Spriel [Tue, 27 May 2014 10:56:21 +0000 (12:56 +0200)]
brcmfmac: introduce asynchronous firmware loading

The driver needs firmware to be loaded to the device, which
is done through the firmware class API. The synchronous call
request_firmware() need root filesystem to be mounted and/or
user-mode helper. These may not be avaliable on the moment
it is called. Instead use request_firmware_nowait().

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>
9 years agobrcmfmac: Add log of superspeed device detection to USB probe.
Hante Meuleman [Tue, 27 May 2014 10:56:20 +0000 (12:56 +0200)]
brcmfmac: Add log of superspeed device detection to USB probe.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agobrcmfmac: rework usb callback operations
Arend van Spriel [Tue, 27 May 2014 10:56:19 +0000 (12:56 +0200)]
brcmfmac: rework usb callback operations

The resume callbacks do partly the same a the probe callback
so put common code in separate function for use in the callbacks.
This also fixes suspend/resume regression introduced by

    brcmfmac: remove .init() callback for internal bus interface

    The .init() callback was the first function called by the common
    bus function brcmf_bus_start(). Given that it is not really
    necessary and the bus layer can call it before calling the
    brcmf_bus_start() 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: John W. Linville <linville@tuxdriver.com>
9 years agobrcmfmac: call brcmf_detach() unconditional in sdio .remove() callback
Arend van Spriel [Tue, 27 May 2014 10:56:18 +0000 (12:56 +0200)]
brcmfmac: call brcmf_detach() unconditional in sdio .remove() callback

The function brcmf_detach() checks whether it needs to do his stuff
or can return immediately. No need to have the same check in the
calling code.

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>
9 years agobrcmfmac: rename nvram.[ch] for upcoming firmware handling functions
Arend van Spriel [Tue, 27 May 2014 10:56:17 +0000 (12:56 +0200)]
brcmfmac: rename nvram.[ch] for upcoming firmware handling functions

The firmware processing will be modified to use asynchronous request
firmware api. In preparation this patch is simple rename of source
and header file to which the functionality will be added.

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>
9 years agobrcmfmac: remove .init() callback for internal bus interface
Arend van Spriel [Tue, 27 May 2014 10:56:16 +0000 (12:56 +0200)]
brcmfmac: remove .init() callback for internal bus interface

The .init() callback was the first function called by the common
bus function brcmf_bus_start(). Given that it is not really
necessary and the bus layer can call it before calling the
brcmf_bus_start() function.

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>
9 years agobrcmfmac: make chandef_to_chanspec() function static
Arend van Spriel [Tue, 27 May 2014 10:56:15 +0000 (12:56 +0200)]
brcmfmac: make chandef_to_chanspec() function static

The function chandef_to_chanspec() was added by

    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.

However, it introduced a sparse warning because the function
is only called from within the source file wl_cfg80211.c.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
9 years agobrcmfmac: restore mpc before passing scan status to cfg80211
Arend van Spriel [Tue, 27 May 2014 10:56:14 +0000 (12:56 +0200)]
brcmfmac: restore mpc before passing scan status to cfg80211

Before informing cfg80211 about the scan status the device should
be put back in mpc state. If done after user-space may initiate
another (scheduled) scan and fail because scan is still busy as
shown in logging below:

[ 3301.367376] brcmfmac: brcmf_fweh_event_worker event ESCAN_RESULT (69)
[ 3301.377305] brcmfmac: brcmf_fweh_event_worker   version 2 flags 0 status 0
[ 3301.384993] brcmutil: event payload, len=12
[ 3301.389208] 00000000: 0c 00 00 00 6d 00 00 00 34 12 00 00
[ 3301.389214] brcmfmac: brcmf_sdio_kso_control Enter: on=0
[ 3301.402196] brcmfmac: brcmf_inform_bss scanned AP count (0)
[ 3301.407808] brcmfmac: brcmf_notify_escan_complete Enter
[ 3301.413064] brcmfmac: brcmf_notify_escan_complete ESCAN Completed scan: Done
[ 3301.420137] brcmfmac: brcmf_sdio_bus_txctl Enter
[ 3301.420368] brcmfmac: brcmf_cfg80211_sched_scan_start Enter
[ 3301.420370] brcmfmac: brcmf_cfg80211_sched_scan_start:
Scanning already: status (1)
[ 3301.440190] brcmfmac: brcmf_sdio_kso_control Enter: on=1
[ 3301.448695] brcmfmac: brcmf_sdio_tx_ctrlframe Enter
[ 3301.453662] brcmfmac: brcmf_sdio_bus_rxctl Enter
[ 3301.458326] brcmfmac: brcmf_sdio_isr Enter
[ 3301.462523] brcmfmac: brcmf_sdio_dpc Enter
[ 3301.466632] brcmfmac: brcmf_sdio_readframes Enter
[ 3301.471431] brcmfmac: brcmf_sdio_read_control Enter
[ 3301.476340] brcmfmac: brcmf_set_mpc MPC : 1

Reviewed-by: Hante Meuleman <meuleman@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>
9 years agobrcmfmac: reduce log level for invalid scheduled scan request
Arend van Spriel [Tue, 27 May 2014 10:56:13 +0000 (12:56 +0200)]
brcmfmac: reduce log level for invalid scheduled scan request

When a regular scan does not return any networks user-space does
request a scheduled scan without any matchset or ssid. This can
not be handled by the firmware so we return -EINVAL. However, as
this request is done let us not add an error message to the log.

Reviewed-by: Hante Meuleman <meuleman@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>
9 years agowcn36xx: Use kmemdup instead of kmalloc + memcpy
Benoit Taine [Mon, 26 May 2014 15:21:14 +0000 (17:21 +0200)]
wcn36xx: Use kmemdup instead of kmalloc + memcpy

This issue was reported by coccicheck using the semantic patch
at scripts/coccinelle/api/memdup.cocci

Signed-off-by: Benoit Taine <benoit.taine@lip6.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agomwifiex: use time_after()
Manuel Schölling [Sun, 25 May 2014 17:59:36 +0000 (19:59 +0200)]
mwifiex: use time_after()

To be future-proof and for better readability the time comparisons are
modified to use time_after() instead of plain, error-prone math.

Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoat76c50x-usb: Make WEP encryption working.
Andrea Merello [Sat, 24 May 2014 15:16:18 +0000 (17:16 +0200)]
at76c50x-usb: Make WEP encryption working.

Currently the driver uses HW encryption.
Whenever mac80211 calls the set_key() callback the driver restarts the
whole HW configuration procedure, in order to set (also) the new
WEP key.
However, by doing this, it causes the card to loose association information,
and the HW becomes unable to communicate with the BSS.

This patch adds support for sending another HW command, that sets only
the wep key, instead of resetting all.
Mac80211 key-set requests are thus handled via this new command.

Tested on my at76c503

Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoat76c50x-usb: Don't perform DMA from stack memory
Andrea Merello [Sat, 24 May 2014 15:07:12 +0000 (17:07 +0200)]
at76c50x-usb: Don't perform DMA from stack memory

Loading the driver with DMA debugging enabled makes the kernel to complain
about the ehci driver trying to perform DMA from memory from the stack.

[ 9848.229514] WARNING: CPU: 1 PID: 627 at lib/dma-debug.c:1153 check_for_stack+0xa4/0xf0()
[ 9848.237678] ehci-pci 0000:00:04.1: DMA-API: device driver maps memory fromstack [addr=ffff88006c80da01]

This is due to at76c50x-usb driver passing buffers allocated on the stack to
the USB layer, that attempts DMA. This occurs is several places.

This patch fixes the problem by allocating those buffers via kmalloc.

Since this adds some kfree() before leaving a couple of functions, I caught the
occasion to clean-up the exit path on error.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoath9k: avoid passing buffers to the hardware during flush
Felix Fietkau [Fri, 23 May 2014 17:21:34 +0000 (19:21 +0200)]
ath9k: avoid passing buffers to the hardware during flush

The commit "ath9k: fix possible hang on flush" changed the receive code
to always link rx descriptors of processed frames, even when flushing.
In some cases, this leads to flushed rx buffers being passed to the
hardware while rx is already stopped.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoath9k: simplify DFS pulse interval debug printing
Zefir Kurtisi [Fri, 23 May 2014 15:22:37 +0000 (17:22 +0200)]
ath9k: simplify DFS pulse interval debug printing

Make DFS pulse interval calculation independent
from CONFIG_ATH9K_DEBUGFS.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agorsi: avoid format string leak to thread name
Kees Cook [Thu, 22 May 2014 18:48:41 +0000 (11:48 -0700)]
rsi: avoid format string leak to thread name

Since the rsi_create_kthread interface does not include any format
string arguments, make sure that the resulting thread name can never
accidentally process the name as a format string.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
John W. Linville [Thu, 29 May 2014 17:03:47 +0000 (13:03 -0400)]
Merge branch 'for-upstream' of git://git./linux/kernel/git/bluetooth/bluetooth-next

Conflicts:
drivers/bluetooth/btusb.c

9 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
John W. Linville [Thu, 29 May 2014 16:55:38 +0000 (12:55 -0400)]
Merge git://git./linux/kernel/git/jberg/mac80211-next

9 years agomac80211: set new interfaces as idle upon init
Avraham Stern [Thu, 22 May 2014 09:17:47 +0000 (12:17 +0300)]
mac80211: set new interfaces as idle upon init

Mark new interfaces as idle to allow operations that require that
interfaces are idle to take place. Interface types that are always
not idle (like AP interfaces) will be set as not idle when they are
assigned a channel context.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Emmanuel Grumbach<emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: reduce packet loss notifications under load
Felix Fietkau [Fri, 23 May 2014 18:05:28 +0000 (20:05 +0200)]
mac80211: reduce packet loss notifications under load

During strong signal fluctuations under high throughput, few consecutive
failed A-MPDU transmissions can easily trigger packet loss notification,
and thus (in AP mode) client disconnection.

Reduce the number of false positives by checking the A-MPDU status flag
and treating a failed A-MPDU as a single packet.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: don't check netdev state for debugfs read/write
Arik Nemtsov [Mon, 26 May 2014 11:40:51 +0000 (14:40 +0300)]
mac80211: don't check netdev state for debugfs read/write

Doing so will lead to an oops for a p2p-dev interface, since it has
no netdev.

Cc: stable@vger.kernel.org
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agowireless: add missing WLAN_EID_BSS_INTOLERANT_CHL_REPORT
Jes Sorensen [Mon, 26 May 2014 16:06:34 +0000 (18:06 +0200)]
wireless: add missing WLAN_EID_BSS_INTOLERANT_CHL_REPORT

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: fix a memory leak on sta rate selection table
Felix Fietkau [Tue, 27 May 2014 20:33:57 +0000 (22:33 +0200)]
mac80211: fix a memory leak on sta rate selection table

If the rate control algorithm uses a selection table, it
is leaked when the station is destroyed - fix that.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Reported-by: Christophe Prévotaux <cprevotaux@nltinc.com>
Fixes: 0d528d85c519 ("mac80211: improve the rate control API")
Cc: stable@vger.kernel.org # v3.10+
[add commit log entry, remove pointless NULL check]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville [Tue, 27 May 2014 17:47:27 +0000 (13:47 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless

9 years agoregdb: Generalize the mW to dBm power conversion
chaitanya.mgit@gmail.com [Mon, 26 May 2014 12:31:44 +0000 (18:01 +0530)]
regdb: Generalize the mW to dBm power conversion

Generalize the power conversion from mW to dBm
using log. This should fix the below compilation
error for country NO which adds a new power value
2000mW which is not handled earlier.

 CC [M]  net/wireless/wext-sme.o
 CC [M]  net/wireless/regdb.o
net/wireless/regdb.c:1130:1: error: Unknown undeclared here (not in
a function)
net/wireless/regdb.c:1130:9: error: expected } before power
make[2]: *** [net/wireless/regdb.o] Error 1
make[1]: *** [net/wireless] Error 2
make: *** [net] Error 2

Reported-By: John Walker <john@x109.net>
Signed-off-by: Chaitanya T K <chaitanya.mgit@gmail.com>
Acked-by: John W. Linville <linville@tuxdriver.com>
[remove unneeded parentheses, fix rounding by using %.0f]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: fix IBSS join by initializing last_scan_completed
Krzysztof Hałasa [Mon, 26 May 2014 12:14:46 +0000 (14:14 +0200)]
mac80211: fix IBSS join by initializing last_scan_completed

Without this fix, freshly rebooted Linux creates a new IBSS
instead of joining an existing one. Only when jiffies counter
overflows after 5 minutes the IBSS can be successfully joined.

Signed-off-by: Krzysztof Hałasa <khalasa@piap.pl>
[edit commit message slightly]
Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: send events when devices are added/removed
Johannes Berg [Mon, 26 May 2014 11:52:25 +0000 (13:52 +0200)]
cfg80211: send events when devices are added/removed

We're currently sending NEW_WIPHY events for renames (which
is a bit odd, but now can't be changed), but also send them
for really new devices that register.

Also send DEL_WIPHY events when a device is removed, the
event ID for this was already reserved.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: fix virtual monitor interface addition
Emmanuel Grumbach [Sun, 25 May 2014 12:35:41 +0000 (15:35 +0300)]
mac80211: fix virtual monitor interface addition

Since the commit below, cfg80211_chandef_dfs_required()
will warn if it gets a an NL80211_IFTYPE_UNSPECIFIED iftype
as explicitely written in the commit log.
When an virtual monitor interface is added, its type is set
in ieee80211_sub_if_data.vif.type, but not in
ieee80211_sub_if_data.wdev.iftype which is passed to
cfg80211_chandef_dfs_required() hence resulting in the
following warning:

WARNING: CPU: 1 PID: 21265 at net/wireless/chan.c:376 cfg80211_chandef_dfs_required+0xbc/0x130 [cfg80211]()
Modules linked in: [...]
CPU: 1 PID: 21265 Comm: ifconfig Tainted: G        W  O 3.13.11+ #12
Hardware name: Dell Inc. Latitude E6410/0667CC, BIOS A01 03/05/2010
 0000000000000009 ffff88008f5fdb08 ffffffff817d4219 ffff88008f5fdb50
 ffff88008f5fdb40 ffffffff8106f57d 0000000000000000 0000000000000000
 ffff880081062fb8 ffff8800810604e0 0000000000000001 ffff88008f5fdba0
Call Trace:
 [<ffffffff817d4219>] dump_stack+0x4d/0x66
 [<ffffffff8106f57d>] warn_slowpath_common+0x7d/0xa0
 [<ffffffff8106f5ec>] warn_slowpath_fmt+0x4c/0x50
 [<ffffffffa04ea4ec>] cfg80211_chandef_dfs_required+0xbc/0x130 [cfg80211]
 [<ffffffffa06b1024>] ieee80211_vif_use_channel+0x94/0x500 [mac80211]
 [<ffffffffa0684e6b>] ieee80211_add_virtual_monitor+0x1ab/0x5c0 [mac80211]
 [<ffffffffa0686ae5>] ieee80211_do_open+0xe75/0x1580 [mac80211]
 [<ffffffffa0687259>] ieee80211_open+0x69/0x70 [mac80211]
[snip]

Fixes: 00ec75fc5a64 ("cfg80211: pass the actual iftype when calling cfg80211_chandef_dfs_required()")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Acked-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add a single-transaction driver op to switch contexts
Luciano Coelho [Fri, 23 May 2014 11:33:12 +0000 (14:33 +0300)]
mac80211: add a single-transaction driver op to switch contexts

In some cases, when the driver is already using all the channel
contexts it can handle at once, we have to do an in-place switch
(ie. we cannot afford using an extra context temporarily for the
transaction).  But some drivers may not support switching the channel
context assigned to a vif on the fly (ie. without unassigning and
assigning it) while others may only work if the context is changed on
the fly, without unassigning it first.

To allow these different scenarios, add a new driver operation that
let's the driver decide how to handle an in-place switch.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoNFC: trf7970a: Add support for Felica Type 3 tags
Mark A. Greer [Mon, 14 Apr 2014 17:04:10 +0000 (10:04 -0700)]
NFC: trf7970a: Add support for Felica Type 3 tags

Add support for the Felica protocol and Type 3 tags.
Both 212 and 424 kbps are supported.

Signed-off-by: Mark A. Greer <mgreer@animalcreek.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
9 years agoNFC: nfc_sock_link() can be static
Fengguang Wu [Sun, 25 May 2014 22:53:10 +0000 (00:53 +0200)]
NFC: nfc_sock_link() can be static

CC: Hiren Tandel <hirent@marvell.com>
CC: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
9 years agoNFC: digital: digital_in_send_attrib_req() can be static
Fengguang Wu [Sun, 25 May 2014 22:52:15 +0000 (00:52 +0200)]
NFC: digital: digital_in_send_attrib_req() can be static

CC: "Mark A. Greer" <mgreer@animalcreek.com>
CC: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
9 years agoNFC: dts: st21nfca_i2c: Correct minor typo in documentation
Christophe Ricard [Tue, 20 May 2014 19:45:04 +0000 (21:45 +0200)]
NFC: dts: st21nfca_i2c: Correct minor typo in documentation

Replaced st,st21nfca-i2c by st,st21nfca_i2c to be concistent
with below configuration and driver in drivers/nfc/st21nfca/

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
9 years agoNFC: digital: Randomize poll cycles
Thierry Escande [Sat, 10 May 2014 11:06:02 +0000 (13:06 +0200)]
NFC: digital: Randomize poll cycles

This change adds some entropy to polling cycles, choosing the next
polling rf technology randomly. This reflects the change done in the
pn533 driver, avoiding possible infinite loop for devices that export 2
targets on 2 different modulations. If the first target is not
readable, we will stay in an error loop for ever.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
9 years agoNFC: digital: Return proper error code when sending ATR_REQ
Thierry Escande [Fri, 11 Apr 2014 22:03:08 +0000 (00:03 +0200)]
NFC: digital: Return proper error code when sending ATR_REQ

The error code returned by digital_in_send_cmd() was not returned by
digital_in_send_atr_req().

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
9 years agoNFC: port100: Add support for type 4B tag
Thierry Escande [Fri, 11 Apr 2014 22:03:17 +0000 (00:03 +0200)]
NFC: port100: Add support for type 4B tag

This patch adds support for ISO-DEP protocol over NFC-B rf technology
by adding NFC_PROTO_ISO14443_B to the supported protocols and an entry
for framing configuration.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
9 years agoBluetooth: Clearly distinguish mgmt LTK type from authenticated property
Johan Hedberg [Fri, 23 May 2014 10:19:53 +0000 (13:19 +0300)]
Bluetooth: Clearly distinguish mgmt LTK type from authenticated property

On the mgmt level we have a key type parameter which currently accepts
two possible values: 0x00 for unauthenticated and 0x01 for
authenticated. However, in the internal struct smp_ltk representation we
have an explicit "authenticated" boolean value.

To make this distinction clear, add defines for the possible mgmt values
and do conversion to and from the internal authenticated value.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
9 years agomwifiex: use 'const' qualifier for 2nd arg of mwifiex_tdls_add_ht_oper
John W. Linville [Thu, 22 May 2014 18:21:12 +0000 (14:21 -0400)]
mwifiex: use 'const' qualifier for 2nd arg of mwifiex_tdls_add_ht_oper

Fixes the following warning:

  CC      drivers/net/wireless/mwifiex/tdls.o
drivers/net/wireless/mwifiex/tdls.c: In function ‘mwifiex_prep_tdls_encap_data’:
drivers/net/wireless/mwifiex/tdls.c:475:4: warning: passing argument 2 of ‘mwifiex_tdls_add_ht_oper’ discards ‘const’ qualifier from pointer target type [enabled by
default]
    ret = mwifiex_tdls_add_ht_oper(priv, peer, 1, skb);
    ^
drivers/net/wireless/mwifiex/tdls.c:190:1: note: expected ‘u8 *’ but argument is of type ‘const u8 *’
 mwifiex_tdls_add_ht_oper(struct mwifiex_private *priv, u8 *mac,
 ^
drivers/net/wireless/mwifiex/tdls.c:481:4: warning: passing argument 2 of ‘mwifiex_tdls_add_ht_oper’ discards ‘const’ qualifier from pointer target type [enabled by
default]
    ret = mwifiex_tdls_add_ht_oper(priv, peer, 0, skb);
    ^
drivers/net/wireless/mwifiex/tdls.c:190:1: note: expected ‘u8 *’ but argument is of type ‘const u8 *’
 mwifiex_tdls_add_ht_oper(struct mwifiex_private *priv, u8 *mac,
 ^

Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoath9k: fix sleep timer during suspend
Rajkumar Manoharan [Thu, 22 May 2014 08:41:41 +0000 (14:11 +0530)]
ath9k: fix sleep timer during suspend

On idle state, sleep timer is scheduled to put the chip into fullsleep.
But during suspend, this timer is scheduled after the chip is moved to
fullsleep forcibily. This is causing below unnecessary error messages
in kernel log during suspend.

ath: phy2: timeout (100000 us) on reg 0x806c: 0xdeadbeef & 0x01f00000
!= 0x00000000
ath: phy2: RX failed to go idle in 10 ms RXSM=0xdeadbeef
ath: phy2: DMA failed to stop in 10 ms AR_CR=0xdeadbeef AR_DIAG_SW=0xdeadbeef
DMADBG_7=0xdeadbeef

Reported-by: Arkh4mKn1ght <arkh4mkn1ght@gmail.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoath9k: Handle multiple keys while setting tx filters
Rajkumar Manoharan [Thu, 22 May 2014 07:05:49 +0000 (12:35 +0530)]
ath9k: Handle multiple keys while setting tx filters

The keycache index is used to abort transmission for given station
when it goes to sleep state. But the commit "ath9k_hw: Abort transmission
for sleeping station" is not handling multi-key station. Fix that.

Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agomwifiex: update seq number correctly for packets from TDLS peer
Avinash Patil [Thu, 22 May 2014 05:02:31 +0000 (22:02 -0700)]
mwifiex: update seq number correctly for packets from TDLS peer

This patch adds handling of updating rx sequence number for
packets received from TDLS peer. Current implementation of
mwifiex_queueing_ra_based assumes station would always receive
packets from AP which is not true in case of TDLS.
Fix this by adding this case.

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>
9 years agomwifiex: set TDLS flags for AMSDU packets
Avinash Patil [Thu, 22 May 2014 05:02:30 +0000 (22:02 -0700)]
mwifiex: set TDLS flags for AMSDU packets

This patch fixes an issue where AMSDU packets for TDLS link
would flow over infra link. This happened because we were
missing setting TDLS flag in TxPD on AMSDU packets.

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>
9 years agomwifiex: delete TDLS link upon Teardown event
Avinash Patil [Thu, 22 May 2014 05:02:29 +0000 (22:02 -0700)]
mwifiex: delete TDLS link upon Teardown event

If userspace application does not take care of TDLS teardown
event, TDLS link would be present in driver database and thus
driver would send such packets on direct link while peer has
already severed link causing data traffic failure. Disable TDLS
link upon teardown event so as to ensure this does not happen.

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>
9 years agomwifiex: silence TDLS link delete failure for nonexistent link
Avinash Patil [Thu, 22 May 2014 05:02:28 +0000 (22:02 -0700)]
mwifiex: silence TDLS link delete failure for nonexistent link

If TDLS link delete command fails because of non-existent peer
or TDLS peer is absent from driver's entry, it means link was
already deleted. In such case print debug messages with lower
severity.

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>
9 years agomwifiex: avoid TDLS check for packets destined to AP
Avinash Patil [Thu, 22 May 2014 05:02:27 +0000 (22:02 -0700)]
mwifiex: avoid TDLS check for packets destined to AP

In station role if TDLS is supported, we traverse TDLS peer list
to see if packet's destination address matches with TDLS peer.
Packets destined to AP are not sent over TDLS link and hence
avoid this list traversal for such packets.

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>
9 years agoath9k: fix build error with disabled debug
Zefir Kurtisi [Wed, 21 May 2014 10:40:35 +0000 (12:40 +0200)]
ath9k: fix build error with disabled debug

DFS pulse interval printing is only available
when CONFIG_ATH9K_DEBUGFS is set.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agob43: N-PHY: add missing calib values for radio 0x2026 rev 11
Rafał Miłecki [Wed, 21 May 2014 06:44:21 +0000 (08:44 +0200)]
b43: N-PHY: add missing calib values for radio 0x2026 rev 11

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agob43: fix list of 5 GHz channels for 802.11n cards
Rafał Miłecki [Wed, 21 May 2014 06:44:20 +0000 (08:44 +0200)]
b43: fix list of 5 GHz channels for 802.11n cards

Broadcom hardware uses a bit tricky hw_value-s for 5 GHz channels,
values 184-228 are used for 4920-5140 MHz center frequencies. Normally
you expect channels 7-16 (e.g. 5060 MHz is channel 12, not 212). We never
meant to register hw_value 228 with freq 6140 MHz (5000 + 228 * 5).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agob43: fix typo in define name for 2 GHz channels (s/CHAN4G/CHAN2G/)
Rafał Miłecki [Wed, 21 May 2014 06:44:19 +0000 (08:44 +0200)]
b43: fix typo in define name for 2 GHz channels (s/CHAN4G/CHAN2G/)

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agolibertas: fix return value when processing invalid packet
Dan Williams [Thu, 22 May 2014 12:32:41 +0000 (07:32 -0500)]
libertas: fix return value when processing invalid packet

Nothing actually uses the return value yet, but we might as well
make it correct, like process_rxed_802_11_packet() does for the
same case.  Also ensure that if monitor mode is enabled (and
thus process_rxed_802_11_packet() is called) that the debugging
enter/leave functions are balanced.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agort2x00: Endless loop on hub port power down
Richard Genoud [Thu, 3 Apr 2014 14:48:56 +0000 (16:48 +0200)]
rt2x00: Endless loop on hub port power down

I've met an endless (or at least very long) loop if I power down the usb
port on witch a usb wifi key is plugged.
(Ok, it's not very smart to power down a usb port when a usb key is in
used... but still, I think that should not lead to an endless loop).

I have a lot of:
ieee80211 phy1: rt2x00usb_vendor_request: Error - Vendor Request 0x07 failed for offset 0x0438 with error -71

(-71==-EPROTO)

How to reproduce:
- plug an usb wifi key
- ip link set wlan0 up
- hub-ctrl -b usb_bus -d usb_device -P usb_port -p 0

hub-ctrl source: https://github.com/codazoda/hub-ctrl.c/blob/master/hub-ctrl.c

The following patch prevents the endless loop, but I'm really not sure
that The Right Way To Do It (R)

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agocarl9170: fix leaks at failure path in carl9170_usb_probe()
Alexey Khoroshilov [Sat, 28 Sep 2013 03:51:51 +0000 (23:51 -0400)]
carl9170: fix leaks at failure path in carl9170_usb_probe()

carl9170_usb_probe() does not handle request_firmware_nowait() failure
that leads to several leaks in this case.
The patch adds all required deallocations.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Thu, 22 May 2014 18:01:43 +0000 (14:01 -0400)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

9 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
John W. Linville [Thu, 22 May 2014 17:58:36 +0000 (13:58 -0400)]
Merge git://git./linux/kernel/git/jberg/mac80211-next

9 years agoMerge tag 'nfc-next-3.16-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Thu, 22 May 2014 17:56:46 +0000 (13:56 -0400)]
Merge tag 'nfc-next-3.16-1' of git://git./linux/kernel/git/sameo/nfc-next

Samuel Ortiz <sameo@linux.intel.com> says:

"NFC: 3.16: First pull request

This is the NFC pull request for 3.16. We have:

- STMicroeectronics st21nfca support. The st21nfca is an HCI chipset and
  thus relies on the HCI stack. This submission provides support for tag
  redaer/writer mode (including Type 5) and device tree bindings.

- PM runtime support and a bunch of bug fixes for TI's trf7970a.

- Device tree support for NXP's pn544. Legacy platform data support is
  obviously kept intact.

- NFC Tag type 4B support to the NFC Digital stack.

- SOCK_RAW type support to the raw NFC socket, and allow NCI
  sniffing from that. This can be extended to report HCI frames and also
  proprietarry ones like e.g. the pn533 ones."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Thu, 22 May 2014 17:53:27 +0000 (13:53 -0400)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-fixes

9 years agocfg80211: allow RSSI compensation
Emmanuel Grumbach [Sun, 18 May 2014 07:15:24 +0000 (10:15 +0300)]
cfg80211: allow RSSI compensation

Channels in 2.4GHz band overlap, this means that if we
send a probe request on channel 1 and then move to channel
2, we will hear the probe response on channel 2. In this
case, the RSSI will be lower than if we had heard it on
the channel on which it was sent (1 in this case).

The firmware / low level driver can parse the channel in
the DS IE or HT IE and compensate the RSSI so that it will
still have a valid value even if we heard the frame on an
adjacent channel. This can be done up to a certain offset.

Add this offset as a configuration for the low level driver.
A low level driver that can compensate the low RSSI in this
case should assign the maximal offset for which the RSSI
value is still valid.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoiwlwifi: mvm: remove vif argument from power_update_mac
Arik Nemtsov [Thu, 15 May 2014 14:31:51 +0000 (17:31 +0300)]
iwlwifi: mvm: remove vif argument from power_update_mac

The power update function looks at all current vifs to determine the power
policy. It doesn't use the current vif. Instead the value was overwritten
and used internally.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: make iwl_mvm_update_beacon_abort static
Emmanuel Grumbach [Tue, 20 May 2014 08:28:18 +0000 (11:28 +0300)]
iwlwifi: mvm: make iwl_mvm_update_beacon_abort static

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: remove debugfs hook for reduced tx power
Emmanuel Grumbach [Tue, 20 May 2014 10:54:27 +0000 (13:54 +0300)]
iwlwifi: mvm: remove debugfs hook for reduced tx power

This was not used is unlikely to be used, just kill it.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: disable reduced Tx power when not applicable
Emmanuel Grumbach [Tue, 20 May 2014 12:48:18 +0000 (15:48 +0300)]
iwlwifi: mvm: disable reduced Tx power when not applicable

I forgot to disable the reduced Tx power in a few paths.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: pass force_assoc_off all the way down to avoid hacks
Luciano Coelho [Tue, 13 May 2014 14:33:38 +0000 (17:33 +0300)]
iwlwifi: mvm: pass force_assoc_off all the way down to avoid hacks

In some cases, we need to force the association to be off in the
MAC_CONTEXT_CMD command we send to the firmware.  Instead of having to
hack the vif->bss_conf.assoc value, pass it all the way down the call
chain.

Additionally, for the iwl_mvm_mac_ctxt_add() case, we *always* set
forced_assoc_off to true, so we can remove the hack in the d3 code
that was forcing it to off by hacking the bss_conf.assoc value.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoiwlwifi: mvm: don't filter out the first beacon
Avri Altman [Tue, 20 May 2014 05:03:24 +0000 (08:03 +0300)]
iwlwifi: mvm: don't filter out the first beacon

Enabling beacon filtering should be done only after a beacon
has been received. Doing that too early will cause
disconnections.
This has already been fixed, but the fix didn't take care
about the case where the beacon is received after the
association, it waited only for association which is not
enough.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agoMerge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next
Emmanuel Grumbach [Wed, 21 May 2014 09:49:38 +0000 (12:49 +0300)]
Merge remote-tracking branch 'iwlwifi-fixes/master' into iwlwifi-next

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Conflicts:
drivers/net/wireless/iwlwifi/mvm/mac80211.c

9 years agoiwlwifi: mvm: disable beacon filtering
Emmanuel Grumbach [Sun, 18 May 2014 16:05:23 +0000 (19:05 +0300)]
iwlwifi: mvm: disable beacon filtering

This feature has been causing trouble - disable it for now.

Cc: <stable@vger.kernel.org> [3.13+]
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
9 years agocfg80211: don't set reg timeout for user-handled hint
Arik Nemtsov [Sun, 11 May 2014 08:50:44 +0000 (11:50 +0300)]
cfg80211: don't set reg timeout for user-handled hint

Otherwise every "indoor" setting by usermode will cause a regdomain reset.

Acked-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: implement cfg80211_get_station cfg80211 API
Antonio Quartulli [Mon, 19 May 2014 19:53:21 +0000 (21:53 +0200)]
cfg80211: implement cfg80211_get_station cfg80211 API

Implement and export the new cfg80211_get_station() API.
This utility can be used by other kernel modules to obtain
detailed information about a given wireless station.

It will be in particular useful to batman-adv which will
implement a wireless rate based metric.

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: export the expected throughput
Antonio Quartulli [Mon, 19 May 2014 19:53:20 +0000 (21:53 +0200)]
mac80211: export the expected throughput

Add get_expected_throughput() API to mac80211 so that each
driver can implement its own version based on the RC
algorithm they are using (might be using an HW RC algo).
The API returns a value expressed in Kbps.

Also, add the new get_expected_throughput() member
to the rate_control_ops structure in order to be
able to query the RC algorithm (this patch provides an
implementation of this API for both minstrel and
minstrel_ht).

The related member in the station_info object is now
filled accordingly when dumping a station.

Cc: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoath9k: fixup "ath9k_htc: fix build with disabled debug"
John W. Linville [Tue, 20 May 2014 19:34:37 +0000 (15:34 -0400)]
ath9k: fixup "ath9k_htc: fix build with disabled debug"

Apparently Oleksij's compile testing was no better than mine initially
was... :-(

Cc: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9 years agoBluetooth: Update smp_confirm to return a response code
Johan Hedberg [Tue, 20 May 2014 06:45:52 +0000 (09:45 +0300)]
Bluetooth: Update smp_confirm to return a response code

Now that smp_confirm() is called "inline" we can have it return a
response code and have the sending of it be done in the shared place for
command handlers. One exception is when we're entering smp.c from mgmt.c
when user space responds to authentication, in which case we still need
our own code to call smp_failure().

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
9 years agoBluetooth: Update smp_random to return a response code
Johan Hedberg [Tue, 20 May 2014 06:45:51 +0000 (09:45 +0300)]
Bluetooth: Update smp_random to return a response code

Since we're now calling smp_random() "inline" we can have it directly
return a response code and have the shared command handler send the
response.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
9 years agoBluetooth: Rename smp->smp_flags to smp->flags
Johan Hedberg [Tue, 20 May 2014 06:45:50 +0000 (09:45 +0300)]
Bluetooth: Rename smp->smp_flags to smp->flags

There's no reason to have "smp" in this variable name since it is
already part of the SMP struct which provides sufficient context.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
9 years agoBluetooth: Remove unnecessary work structs from SMP code
Johan Hedberg [Tue, 20 May 2014 06:45:49 +0000 (09:45 +0300)]
Bluetooth: Remove unnecessary work structs from SMP code

When the SMP code was initially created (mid-2011) parts of the
Bluetooth subsystem were still not converted to use workqueues. This
meant that the crypto calls, which could sleep, couldn't be called
directly. Because of this the "confirm" and "random" work structs were
introduced.

These days the entire Bluetooth subsystem runs through workqueues which
makes these structs unnecessary. This patch removes them and converts
the calls to queue them to use direct function calls instead.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
9 years agoBluetooth: Fix setting initial local auth_req value
Johan Hedberg [Tue, 20 May 2014 06:45:48 +0000 (09:45 +0300)]
Bluetooth: Fix setting initial local auth_req value

There is no reason to have the initial local value conditional to
whether the remote value has bonding set or not. We can either way start
off with the value we received.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
9 years agoBluetooth: Make SMP context private to smp.c
Johan Hedberg [Tue, 20 May 2014 06:45:47 +0000 (09:45 +0300)]
Bluetooth: Make SMP context private to smp.c

There are no users of the smp_chan struct outside of smp.c so move it
away from smp.h. The addition of the l2cap.h include to hci_core.c,
hci_conn.c and mgmt.c is something that should have been there already
previously to avoid warnings of undeclared struct l2cap_conn, but the
compiler warning was apparently shadowed away by the mention of
l2cap_conn in the struct smp_chan definition.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>