]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/log
mirror_ubuntu-artful-kernel.git
11 years agoBluetooth: Fix setting host feature bits for SSP
Johan Hedberg [Wed, 24 Oct 2012 21:09:51 +0000 (00:09 +0300)]
Bluetooth: Fix setting host feature bits for SSP

When we get a successful command complete for HCI_Write_SSP_Mode we need
to update the host feature bits for the hdev struct accordingly.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Disallow LE scanning and connecting in peripheral role
Johan Hedberg [Wed, 24 Oct 2012 18:12:03 +0000 (21:12 +0300)]
Bluetooth: Disallow LE scanning and connecting in peripheral role

When an adapter is in the LE peripheral role scanning for other devices
or initiating connections to them is not allowed. This patch makes sure
that such attempts will result in appropriate error returns.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Add flag for LE GAP Peripheral role
Johan Hedberg [Wed, 24 Oct 2012 18:12:02 +0000 (21:12 +0300)]
Bluetooth: Add flag for LE GAP Peripheral role

This patch adds a flag to be used for LE GAP Peripheral role. In this
role undirected advertising will be enabled and operations not allowed
in Peripheral role (such as scanning and initiating connections) will be
disallowed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Make use feature test macros
Johan Hedberg [Wed, 24 Oct 2012 18:12:01 +0000 (21:12 +0300)]
Bluetooth: Make use feature test macros

For better code readability and avoiding simple bugs of checking the
wrong byte of the features make use of feature test macros whenever
possible.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Add missing feature test macros
Johan Hedberg [Wed, 24 Oct 2012 18:12:00 +0000 (21:12 +0300)]
Bluetooth: Add missing feature test macros

This patch adds missing feature test macros needed for various use cases
and also sorts the macros according to the feature bit location in the
feature mask (for easy lookup).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix updating host feature bits for LE
Johan Hedberg [Wed, 24 Oct 2012 18:11:59 +0000 (21:11 +0300)]
Bluetooth: Fix updating host feature bits for LE

When LE has been enabled with the simultaneous BR/EDR & LE parameter set
to true we should also update the host features stored in struct hci_dev
accordingly.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: mgmt: Restrict BR/EDR settings to BR/EDR-only adapters
Johan Hedberg [Wed, 24 Oct 2012 18:11:58 +0000 (21:11 +0300)]
Bluetooth: mgmt: Restrict BR/EDR settings to BR/EDR-only adapters

This patch makes sure that settings which are specific for BR/EDR
capable adapters are not allowed for non-BR/EDR (e.g. LE-only) adapters.
Instead, a "not supported" error is returned of such a setting is
attempted to be set for a non-BR/EDR adapter.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix HCI command sending when powering on LE-only adapters
Johan Hedberg [Wed, 24 Oct 2012 18:11:57 +0000 (21:11 +0300)]
Bluetooth: Fix HCI command sending when powering on LE-only adapters

This patch makes sure that we don't send BR/EDR-only commands for
LE-only adapters when they get powered on. Doing this would just cause
command errors.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth:Replace list_for_each with list_for_each_entry() helper
Denis Kirjanov [Mon, 22 Oct 2012 13:22:01 +0000 (17:22 +0400)]
Bluetooth:Replace list_for_each with list_for_each_entry() helper

Replace list_for_each with list_for_each_entry() helper

Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoar5523: make buffer size variable unsigned
Dan Carpenter [Tue, 30 Oct 2012 18:04:26 +0000 (21:04 +0300)]
ar5523: make buffer size variable unsigned

A negative buffer size doesn't make sense and it breaks this check in
ar5523_get_max_rxsz():

if (!ar->rxbufsz || ar->rxbufsz > AR5523_SANE_RXBUFSZ) { ...

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortlwifi: rtl8192c: rtl8192ce: rtl8192cu: rtl8192se: rtl8192de: Shorten some variable...
Larry Finger [Thu, 25 Oct 2012 18:46:31 +0000 (13:46 -0500)]
rtlwifi: rtl8192c: rtl8192ce: rtl8192cu: rtl8192se: rtl8192de: Shorten some variable names

The private data areas for these drivers contain some very long variable
names that cause difficulty in fitting source lines to an 80-character
limit.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortlwifi: rtl8192c: rtl8192ce: Add support for B-CUT version of RTL8188CE
Larry Finger [Thu, 25 Oct 2012 18:46:30 +0000 (13:46 -0500)]
rtlwifi: rtl8192c: rtl8192ce: Add support for B-CUT version of RTL8188CE

Realtek devices with designation RTL8188CE-VL have the so-called B-cut
of the wireless chip. This patch adds the special programming needed by
these devices. In addition, a variable that was static has been moved into
the private data area as it is now needed in two different routines. This
change also fixes a minor bug that would be present if a system had more
than one RTL81{88,92}CE devices. Other drivers in the rtlwifi family had
already made this change, thus the variable already exists in the private
data structure.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Anisse Astier <anisse@astier.eu>
Cc: Li Chaoming <chaoming_li@realsil.com.cn>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville [Mon, 29 Oct 2012 20:05:51 +0000 (16:05 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless

Conflicts:
drivers/net/wireless/mwifiex/cfg80211.c

11 years agossb: handle BCM43222 in pmu code.
Hauke Mehrtens [Thu, 25 Oct 2012 16:39:29 +0000 (18:39 +0200)]
ssb: handle BCM43222 in pmu code.

The BCM43222 with the chipid 43222 or 0xa8d6 in hex do not need any
special handling in the pmu code. This prevents some error messages
being shown.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: add PCI ID 0x4350
Hauke Mehrtens [Thu, 25 Oct 2012 16:39:28 +0000 (18:39 +0200)]
ssb: add PCI ID 0x4350

14e4:4350 is found on a Broadcom BCM43222.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Dump BTCOEX tuning parameters
Rajkumar Manoharan [Thu, 25 Oct 2012 11:46:54 +0000 (17:16 +0530)]
ath9k: Dump BTCOEX tuning parameters

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: validate MCI stuck after RTC wakeup
Rajkumar Manoharan [Thu, 25 Oct 2012 11:46:53 +0000 (17:16 +0530)]
ath9k_hw: validate MCI stuck after RTC wakeup

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Fix concurrent tx on lower tx power
Rajkumar Manoharan [Thu, 25 Oct 2012 11:46:52 +0000 (17:16 +0530)]
ath9k_hw: Fix concurrent tx on lower tx power

Whenever WLAN receives scheduling msg from BT, it reduces tx power
based on RSSI level. And then BT starts simultaneous transmission
along with WLAN. Sometimes HW MAC compares tx power that is used
prior to power reduction which is causing BT transmission to defer.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Enable hw PLL power save for AR9565
Rajkumar Manoharan [Thu, 25 Oct 2012 11:46:51 +0000 (17:16 +0530)]
ath9k_hw: Enable hw PLL power save for AR9565

This reduced the power consumption to half in full and network sleep.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Enable hw PLL power save for AR9462
Rajkumar Manoharan [Thu, 25 Oct 2012 11:41:31 +0000 (17:11 +0530)]
ath9k_hw: Enable hw PLL power save for AR9462

This reduced the power consumption to half in full and network sleep.

Cc: stable@vger.kernel.org
Cc: Paul Stewart <pstew@chromium.org>
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoar5523: Add new driver
Pontus Fuchs [Tue, 23 Oct 2012 18:33:57 +0000 (20:33 +0200)]
ar5523: Add new driver

This driver is for the AR5523 chipset from Atheros. It was created
in 2007 by Christoph Hellwig but it was never finished. I found it a
couple of months ago and after some polishing it's working pretty
fine.

The driver was written with the FreeBSD driver (uath) as reference,
which was written with the reverse-engineered windows driver as
reference, hence the feature set is very limited. Station mode
only, no HW crypto offload.

Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: store IEs per virtual interface
Arend van Spriel [Mon, 22 Oct 2012 20:55:41 +0000 (13:55 -0700)]
brcmfmac: store IEs per virtual interface

For AP feature the IEs are stored in global structure. For future
functionality like P2P-GO it needs to be stored per virtual interface
so better store it in the virtual interface structure.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: remove unnecessary macro usage in brcmf_cfg80211_resume()
Arend van Spriel [Mon, 22 Oct 2012 20:55:40 +0000 (13:55 -0700)]
brcmfmac: remove unnecessary macro usage in brcmf_cfg80211_resume()

The macro wiphy_to_cfg() is a bit redundant as the function already
has a pointer variable to brcmf_cfg80211_info structure.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: add virtual interface support in brcmf_cfg80211_suspend()
Arend van Spriel [Mon, 22 Oct 2012 20:55:39 +0000 (13:55 -0700)]
brcmfmac: add virtual interface support in brcmf_cfg80211_suspend()

With multiple interfaces suspend will need to iterate over all and
bring down the link.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: use memset when setting a broadcast mac address
Arend van Spriel [Mon, 22 Oct 2012 20:55:38 +0000 (13:55 -0700)]
brcmfmac: use memset when setting a broadcast mac address

The driver had a global constant ether_bcast, which was copied
whenever a broadcast mac address was needed. This patch does a
memset(dest, 0xFF, ETH_ALEN) instead and consequently removes
the global ether_bcast.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: rename check_sys_up() to check_vif_up()
Arend van Spriel [Mon, 22 Oct 2012 20:55:37 +0000 (13:55 -0700)]
brcmfmac: rename check_sys_up() to check_vif_up()

The function now return the status for a virtual interface so
it seems better rename the function to understand what it does.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: remove unused enumeration wl_prof_list
Arend van Spriel [Mon, 22 Oct 2012 20:55:36 +0000 (13:55 -0700)]
brcmfmac: remove unused enumeration wl_prof_list

The enumeration wl_prof_list is no longer used so it can be safely
removed.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: cleanup brcmf_cfg80211_profile structure
Arend van Spriel [Mon, 22 Oct 2012 20:55:35 +0000 (13:55 -0700)]
brcmfmac: cleanup brcmf_cfg80211_profile structure

A couple of unused fields have been removed and kernel-doc info has
been added to the structure.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: remove debugfs functionality from wl_cfg80211.c
Arend van Spriel [Mon, 22 Oct 2012 20:55:34 +0000 (13:55 -0700)]
brcmfmac: remove debugfs functionality from wl_cfg80211.c

In wl_cfg80211.c debugfs directory was created to expose
dtim_period and beacon_interval. However, this can be easily
obtained using iw so it is removed from the driver.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: separate connection status from scanning status
Arend van Spriel [Mon, 22 Oct 2012 20:55:33 +0000 (13:55 -0700)]
brcmfmac: separate connection status from scanning status

The connection status is to be kept per virtual interface and
the scanning status is for device. So they need to be separated
for multiple interface support.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: use vif struct to check_sys_up() function
Arend van Spriel [Mon, 22 Oct 2012 20:55:32 +0000 (13:55 -0700)]
brcmfmac: use vif struct to check_sys_up() function

This checks the status that will soon be moved to virtual
interface data so preparing for that use the structure
brcmf_cfg80211_vif as parameter instead.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meulemen <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: store profile information per virtual interface
Arend van Spriel [Mon, 22 Oct 2012 20:55:31 +0000 (13:55 -0700)]
brcmfmac: store profile information per virtual interface

The profile information applies to an interface so each virtual
interface needs it. So it is removed from brcmf_cfg80211_info
and added to brcmf_cfg80211_vif structure.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: introduce brcmf_cfg80211_vif structure
Arend van Spriel [Mon, 22 Oct 2012 20:55:30 +0000 (13:55 -0700)]
brcmfmac: introduce brcmf_cfg80211_vif structure

This patch introduces the brcmf_cfg80211_vif structure which is
used to keep track of multiple virtual interfaces in the driver.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: remove brcmf_find_bssidx() function
Arend van Spriel [Mon, 22 Oct 2012 17:36:27 +0000 (10:36 -0700)]
brcmfmac: remove brcmf_find_bssidx() function

The function brcmf_find_bssidx() is no longer used so remove
it from the driver code.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: change parameter list for send_key_to_dongle()
Arend van Spriel [Mon, 22 Oct 2012 17:36:26 +0000 (10:36 -0700)]
brcmfmac: change parameter list for send_key_to_dongle()

The first two parameters given to send_key_to_dongle() are redundant
so they have been removed.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: use fwil for default configuration setup.
Hante Meuleman [Mon, 22 Oct 2012 17:36:25 +0000 (10:36 -0700)]
brcmfmac: use fwil for default configuration setup.

modify the setup code to use the refactored firmware interface layer.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: streamline header parse code of sdio glom read
Franky Lin [Mon, 22 Oct 2012 17:36:24 +0000 (10:36 -0700)]
brcmfmac: streamline header parse code of sdio glom read

Use brcmf_sdio_hdparser to handle header of super frame and sub
frame in glomming frame read.

Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: use struct brcmf_if as interface object for fwil functions
Arend van Spriel [Mon, 22 Oct 2012 17:36:23 +0000 (10:36 -0700)]
brcmfmac: use struct brcmf_if as interface object for fwil functions

The functions for communicating were given the net_device only because
its private data contained struct brcmf_if object. However, not all
firmware related interfaces will be associated with a net_device. To
accomodate provisioning firmware for such interfaces the struct
brcmf_if object will be passed to the fwil functions.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: add function converting ieee80211_channel to chanspec
Arend van Spriel [Mon, 22 Oct 2012 17:36:22 +0000 (10:36 -0700)]
brcmfmac: add function converting ieee80211_channel to chanspec

The firmware carries channel information in a different format
as the provided ieee80211_channel structure. Conversion is needed
when receiving requests from cfg80211 carrying ieee80211_channel
structures. This patch adds a utility function to do that.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: use bssidx from struct brcmf_if for bsscfg specific commands
Arend van Spriel [Mon, 22 Oct 2012 17:36:21 +0000 (10:36 -0700)]
brcmfmac: use bssidx from struct brcmf_if for bsscfg specific commands

The firmware interface has functions to send bsscfg specific commands
to the device. These functions currently have a bssidx parameter, but
that same information is stored in struct brcmf_if, which is in the
private data of the net_device parameter.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: rework driver initialization in brcmf_bus_start()
Arend van Spriel [Mon, 22 Oct 2012 17:36:20 +0000 (10:36 -0700)]
brcmfmac: rework driver initialization in brcmf_bus_start()

In brcmf_bus_start() a number of settings are sent to the device. For
this functions are used that bypass the common firmware interface.
By reordering the code in brcmf_bus_start() this bypass can be removed.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: extend struct brcmf_if with bssidx field
Arend van Spriel [Mon, 22 Oct 2012 17:36:19 +0000 (10:36 -0700)]
brcmfmac: extend struct brcmf_if with bssidx field

When the firmware notifies the driver about adding a new interface
it also provides an index for the bss associated with this interface.
This index will be needed for upcoming features like peer-to-peer.
By adding this index in struct brcmf_if it is easy to obtain as this
will be associated with the net_device private data.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: clean usb download code.
Hante Meuleman [Mon, 22 Oct 2012 17:36:18 +0000 (10:36 -0700)]
brcmfmac: clean usb download code.

reuse ioctl waiting method.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: remove redundant function brcmf_c_mkiovar_bsscfg
Hante Meuleman [Mon, 22 Oct 2012 17:36:17 +0000 (10:36 -0700)]
brcmfmac: remove redundant function brcmf_c_mkiovar_bsscfg

function brcmf_c_mkiovar_bsscfg became redundant with refactoring
of firmware interface layer.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: change testmode command to use new firmware interface layer
Hante Meuleman [Mon, 22 Oct 2012 17:36:16 +0000 (10:36 -0700)]
brcmfmac: change testmode command to use new firmware interface layer

switch to new firmware interface layer and remove redundant code.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: remove unused iswl variable.
Hante Meuleman [Mon, 22 Oct 2012 17:36:15 +0000 (10:36 -0700)]
brcmfmac: remove unused iswl variable.

Variable iswl always gets initialised to the same and support for
this var is not needed.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: refactor firmware interface layer.
Hante Meuleman [Mon, 22 Oct 2012 17:36:14 +0000 (10:36 -0700)]
brcmfmac: refactor firmware interface layer.

Refactor the functions that are related to getting and setting
data to and and from the firmware.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agocarl9170: split up carl9170_handle_mpdu
Christian Lamparter [Mon, 22 Oct 2012 13:01:29 +0000 (15:01 +0200)]
carl9170: split up carl9170_handle_mpdu

carl9170_handle_mpdu is the final part of the
rx path of the driver. It splits the raw data
streams from the device into skb packets and
passes them on to mac80211. As a result of
continuous updates, it grew over the years when
new code was added by the following commits:
- report A-MPDU status
- fix HT peer BA session corruption
- A-MPDU frame type filter
- ...

This patch splits the routine into two stages.
The first stage only deals with the details
about extracting and verifying the data from
the incoming stream. Whereas the second stage
packs it into skbs and passes it on to mac80211.

Reported-by: Javier Lopez <jlopex@cozybit.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: rx path enhancement to derive priv only once
Avinash Patil [Sat, 20 Oct 2012 02:19:21 +0000 (19:19 -0700)]
mwifiex: rx path enhancement to derive priv only once

We derive mwifiex_private structure which is per interface from
received skb's rx_info. Once priv is derived, same priv can be
propagated to other functions instead of callee deriving priv
from rx_info again.

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>
11 years agomwifiex: handle extended supported rates IE for AP
Avinash Patil [Sat, 20 Oct 2012 02:19:20 +0000 (19:19 -0700)]
mwifiex: handle extended supported rates IE for AP

During start_ap handler, some rates come as extended supported
rates IE - part of beacon tail IE. This patch adds support for
parsing them and adding to bss_rates TLV for bss_start command
to firmware.

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>
11 years agoRevert "mwifiex: retrieve correct max_power information in reg_notifier handler"
Amitkumar Karwar [Sat, 20 Oct 2012 02:19:19 +0000 (19:19 -0700)]
Revert "mwifiex: retrieve correct max_power information in reg_notifier handler"

This reverts commit 34202e28fe7fc8551313f9a035a8857db83de757

We made "34202ee.." because we didn't support custom regulatory rules
at that time. But now we use our own custom regulatory rules, so it
needs to be changed back.

Also, chan->max_power calculations in cfg80211 were broken. Hence we
started using chan->max_reg_power. Now it has got fixed in
following commit.

commit 5e31fc0815a4e2c72b1b495fe7a0d8f9bfb9e4b4
Author: Stanislaw Gruszka <sgruszka@redhat.com>
Date:   Tue Jul 24 08:35:39 2012 +0200

    wireless: reg: restore previous behaviour of chan->max_power calculations

Hence we will use chan->max_power instead of chan->max_reg_power.

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>
11 years agomwifiex: disable channel filtering for SSID specific scan from user
Amitkumar Karwar [Sat, 20 Oct 2012 02:19:18 +0000 (19:19 -0700)]
mwifiex: disable channel filtering for SSID specific scan from user

If MWIFIEX_DISABLE_CHAN_FILT bit in scan mode bitmap is set,
firmware will turn off the filtering of scan responses from
adjacent channels.

Currently the bit is set only for internal SSID specific scan
performed during association. We will set it for user requested
SSID specific scan as well.

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>
11 years agomwifiex: minor cleanup and a fix in scan semaphore usage
Amitkumar Karwar [Sat, 20 Oct 2012 02:19:17 +0000 (19:19 -0700)]
mwifiex: minor cleanup and a fix in scan semaphore usage

mwifiex_request_scan() takes care of synchronous internal scan
performed by driver during association.
Currently the semaphore acquired for the scan is unnecessarily
released at the end of different paths. Also, failure paths
returning error code other than "-1" are not considered.

We will release it at the end of routine to fix above issues.

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>
11 years agomwifiex: abort scan upon interface down
Amitkumar Karwar [Sat, 20 Oct 2012 02:19:16 +0000 (19:19 -0700)]
mwifiex: abort scan upon interface down

When the interface is down, we will abort scan by calling
cfg80211_scan_done() with abort option. This fixes WARN_ON
triggered by cfg80211 in wdev_cleanup_work().

Driver's internal variables/flags are cleared once we get
response for current scan command. Meanwhile we will block
new scan request from cfg80211.

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>
11 years agomwifiex: use LOW_PRIORITY scan flag provided in scan request
Amitkumar Karwar [Sat, 20 Oct 2012 02:19:15 +0000 (19:19 -0700)]
mwifiex: use LOW_PRIORITY scan flag provided in scan request

We will delay/abort scan operation based on traffic for low
priority scan.

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>
11 years agobcma: suspend/resume callbacks should be conditionally compiled on CONFIG_PM_SLEEP
Yuanhan Liu [Tue, 16 Oct 2012 14:59:02 +0000 (22:59 +0800)]
bcma: suspend/resume callbacks should be conditionally compiled on CONFIG_PM_SLEEP

This will fix warnings like following when CONFIG_PM_SLEEP is not set:

        warning: 'xxx_suspend' defined but not used [-Wunused-function]
        warning: 'xxx_resume' defined but not used [-Wunused-function]

Because
SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)

Only references the callbacks on CONFIG_PM_SLEEP (instead of CONFIG_PM).

Cc: John W. Linville <linville@tuxdriver.com>
Cc: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Add new BT profile info A2DP_Voice
Rajkumar Manoharan [Mon, 15 Oct 2012 09:59:55 +0000 (15:29 +0530)]
ath9k: Add new BT profile info A2DP_Voice

When the BT connection is initiated by headset, it's possible that headset
requests to make one A2DP and one Voice connection over the same link.
BT firmware will send a new profile A2DP_Voice in this case. So WLAN
has to take care of this new profile for tuning BTCOEX parameters.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: adjust duty cycle for FTP profile for AR9565
Rajkumar Manoharan [Mon, 15 Oct 2012 09:59:54 +0000 (15:29 +0530)]
ath9k: adjust duty cycle for FTP profile for AR9565

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Set default MCI config for AR9565
Rajkumar Manoharan [Mon, 15 Oct 2012 09:59:53 +0000 (15:29 +0530)]
ath9k_hw: Set default MCI config for AR9565

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Configure new switch table for AR9565 BTCOEX
Rajkumar Manoharan [Mon, 15 Oct 2012 09:59:52 +0000 (15:29 +0530)]
ath9k_hw: Configure new switch table for AR9565 BTCOEX

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Fix max rx rate drop for AR9565
Rajkumar Manoharan [Mon, 15 Oct 2012 09:59:51 +0000 (15:29 +0530)]
ath9k_hw: Fix max rx rate drop for AR9565

Whenever i_coff of IQ calibration is too high, AR9565 drops max
rx rate to MCS4. Skipping IQ update at this time can avoid this
problem for AR9565.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Fix frequent BT rx recovery
Rajkumar Manoharan [Mon, 15 Oct 2012 09:59:50 +0000 (15:29 +0530)]
ath9k_hw: Fix frequent BT rx recovery

While resuming from S3, BT host issues HCI reset command and it
causes BT firmware to busy with security key calculation. At this
movement, WLAN detects MCI hardware error of MCI_CONT_INFO_TIMEOUT
and then it starts the recovery sequence repeatedly. Too many
recovery sequences would exhaust the BT kernel message pool. This
patch imposes a duration between consecutive BT recovery procedure.
Thus it solves BT firmware panic issue reported in AR9565.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Disable MCI stat counter by default for AR9565
Rajkumar Manoharan [Mon, 15 Oct 2012 09:59:49 +0000 (15:29 +0530)]
ath9k_hw: Disable MCI stat counter by default for AR9565

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: turn off RXIQ calibration while re-calibrating radio
Bala Shanmugam [Mon, 15 Oct 2012 09:59:48 +0000 (15:29 +0530)]
ath9k: turn off RXIQ calibration while re-calibrating radio

TXIQ and RXIQ share the same data path to upload the measurement
result, we should turn off RXIQ calibration while re-calibrating radio

Signed-off-by: Bala Shanmugam <bkamatch@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Set appropriate bit for AR9565 in btc control register
Bala Shanmugam [Mon, 15 Oct 2012 09:59:47 +0000 (15:29 +0530)]
ath9k: Set appropriate bit for AR9565 in btc control register

Signed-off-by: Bala Shanmugam <bkamatch@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Fix selfgen chainmask for 9565
Rajkumar Manoharan [Mon, 15 Oct 2012 09:59:46 +0000 (15:29 +0530)]
ath9k_hw: Fix selfgen chainmask for 9565

Self generated MCI messages is configured to use chain 1. As
ar9565 is 1x1 solution, It can not use Chain 1. Hence fix
Chain 1 for ar9462 alone. Not doing so, could affect WLAN
connectivity in ar9565 as LNA sharing is not informed by BT.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Enable OSLA hw fix for AR9565
Rajkumar Manoharan [Mon, 15 Oct 2012 09:59:45 +0000 (15:29 +0530)]
ath9k_hw: Enable OSLA hw fix for AR9565

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: adjust WLAN and BT concurrent transmission
Rajkumar Manoharan [Fri, 12 Oct 2012 08:37:25 +0000 (14:07 +0530)]
ath9k: adjust WLAN and BT concurrent transmission

The simulataneous transmission of both WLAN and BT might cause
increase in power levels. To avoid regulatory violation, WLAN tx
power will be adjusted according to BT power index based on avaliability
of BT scheduling messages. WLAN tx power reduction might affect its
performance. So WLAN tx power is only be lowered when the signal strength
is good enough. Otherwise concurrent tx will be disabled and WLAN uses
it default power levels. Also concurrent tx is disabled whenever WLAN is
moving to off-channel which might be used by BT.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: fill channel mode in caldata
Rajkumar Manoharan [Fri, 12 Oct 2012 08:37:24 +0000 (14:07 +0530)]
ath9k: fill channel mode in caldata

It is useful to have channel mode in caldata to find out
whether operaing channel is in HT40/20 when we are currently
on offchannel. It will be used by BTCOEX to enable/disable
concurrent tx mechanism later.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Add concurrent WLAN and BT tx support for MCI based chips
Rajkumar Manoharan [Fri, 12 Oct 2012 08:37:23 +0000 (14:07 +0530)]
ath9k: Add concurrent WLAN and BT tx support for MCI based chips

This feature enables both WLAN and BT can transmit simultaneously
by setting WLAN and BT to equal priorities. Whenever both are
transmitting, it might violate regulatory power limits. To avoid
regulatory violation, WLAN tx power will be adjusted according to BT
power index based on avaliability of BT scheduling message. If the
combined power exceeds threshold, BT transmission will be held off.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Send WLAN channel info to BT
Rajkumar Manoharan [Fri, 12 Oct 2012 08:37:22 +0000 (14:07 +0530)]
ath9k: Send WLAN channel info to BT

WLAN updates channel bitmap when associated and disassociated. Channel
bitmap will reflect whare are the channels used or affected by WLAN and
BT should avoid using those. Not doing so, could affect BT traffic
as both WLAN and BT is operating on same channel.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Advertize beacon_int_infra_match
Mohammed Shafi Shajakhan [Mon, 8 Oct 2012 16:00:54 +0000 (21:30 +0530)]
ath9k: Advertize beacon_int_infra_match

Currently ath9k need to have beacon interval matched
between STA mode and beaconing mode. Advertize this
through interface combinations.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_htc: Remove interface combination specific checks
Mohammed Shafi Shajakhan [Mon, 8 Oct 2012 16:00:53 +0000 (21:30 +0530)]
ath9k_htc: Remove interface combination specific checks

Once the driver advertizes interface combination logic
based on its firmware/hardware limitation, cfg80211
takes care of all the necessary logic such as maximum
beaconing vifs, standlone interface etc.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_htc: Advertise interface combinations supported
Mohammed Shafi Shajakhan [Mon, 8 Oct 2012 16:00:52 +0000 (21:30 +0530)]
ath9k_htc: Advertise interface combinations supported

This will allow us to create virtual interface the driver supports.
Also this ensures multivif support and limitation advertised
by the driver is taken care in cfg80211 itself.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Ensure we set FTP_STOMP_LOW weight when WLAN is idle
Mohammed Shafi Shajakhan [Mon, 8 Oct 2012 16:00:51 +0000 (21:30 +0530)]
ath9k: Ensure we set FTP_STOMP_LOW weight when WLAN is idle

When WLAN is idle ensure we downgrade to FTP_STOMP_LOW weight
(from STOMP_LOW) to provide more bandwidth for BT FTP profile.
WLAN's idleness can be estimated by taking into account of the
rx data packets and just ignore beacons, qos nullfunc etc.

Also update bt_wait_time even if the chip is in NETWORK SLEEP
mode. This should help BT throughput when WLAN is idle.

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agocarl9170: fix spurious transmissions in sniffer mode
Christian Lamparter [Tue, 11 Sep 2012 21:18:34 +0000 (23:18 +0200)]
carl9170: fix spurious transmissions in sniffer mode

Several people have complained about an unusual
and undocumented feature of the AR9170 hardware:

In siffer mode, the hardware generates spurious
ACK frames for every received frame... even
broadcasts.

The reason for this malfunction is unknown:
<http://marc.info/?l=linux-wireless&m=134517238506033>
But there's a workaround: Instead of the special
sniffer mode, the hardware will be put into
station mode and all rx filters are disabled.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reported-by: Marco Fonseca <marco@tampabay.rr.com>
Reported-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge tag 'nfc-next-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Mon, 29 Oct 2012 18:52:37 +0000 (14:52 -0400)]
Merge tag 'nfc-next-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-3.0

This is the first NFC pull request for 3.8

With this one we have:

- pn544 p2p support.
- pn544 physical and HCI layers separation. We are getting the pn544 driver
  ready to support non i2c physical layers.
- LLCP SNL (Service Name Lookup). This is the NFC p2p service discovery
  protocol.
- LLCP datagram sockets (connection less) support.
- IDR library usage for NFC devices indexes assignement.
- NFC netlink extension for setting and getting LLCP link characteristics.
- Various code style fixes and cleanups spread over the pn533, LLCP, HCI and
  pn544 code.

11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Mon, 29 Oct 2012 18:52:04 +0000 (14:52 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next

11 years agoath9k: fix stale pointers potentially causing access to free'd skbs
Felix Fietkau [Thu, 25 Oct 2012 22:31:11 +0000 (00:31 +0200)]
ath9k: fix stale pointers potentially causing access to free'd skbs

bf->bf_next is only while buffers are chained as part of an A-MPDU
in the tx queue. When a tid queue is flushed (e.g. on tearing down
an aggregation session), frames can be enqueued again as normal
transmission, without bf_next being cleared. This can lead to the
old pointer being dereferenced again later.

This patch might fix crashes and "Failed to stop TX DMA!" messages.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
John W. Linville [Mon, 29 Oct 2012 18:14:48 +0000 (14:14 -0400)]
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211

11 years agoNFC: Extend netlink interface for LTO, RW, and MIUX parameters support
Thierry Escande [Wed, 17 Oct 2012 12:43:39 +0000 (14:43 +0200)]
NFC: Extend netlink interface for LTO, RW, and MIUX parameters support

NFC_CMD_LLC_GET_PARAMS: request LTO, RW, and MIUX parameters for a device

NFC_CMD_LLC_SET_PARAMS: set one or more of LTO, RW, and MIUX parameters for
a device. LTO must be set before the link is up otherwise -EINPROGRESS is
returned. RW and MIUX can be set at anytime and will be passed in subsequent
CONNECT and CC messages. If one of the passed parameters is wrong none is
set and -EINVAL is returned.

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agomac80211: make sure data is accessible in EAPOL check
Johannes Berg [Thu, 25 Oct 2012 22:41:23 +0000 (00:41 +0200)]
mac80211: make sure data is accessible in EAPOL check

The code to allow EAPOL frames even when the station
isn't yet marked associated needs to check that the
incoming frame is long enough and due to paged RX it
also can't assume skb->data contains the right data,
it must use skb_copy_bits(). Fix this to avoid using
data that doesn't really exist.

Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: verify that skb data is present
Johannes Berg [Thu, 25 Oct 2012 22:36:40 +0000 (00:36 +0200)]
mac80211: verify that skb data is present

A number of places in the mesh code don't check that
the frame data is present and in the skb header when
trying to access. Add those checks and the necessary
pskb_may_pull() calls. This prevents accessing data
that doesn't actually exist.

To do this, export ieee80211_get_mesh_hdrlen() to be
able to use it in mac80211.

Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: check management frame header length
Johannes Berg [Thu, 25 Oct 2012 22:33:36 +0000 (00:33 +0200)]
mac80211: check management frame header length

Due to pskb_may_pull() checking the skb length, all
non-management frames are checked on input whether
their 802.11 header is fully present. Also add that
check for management frames and remove a check that
is now duplicate. This prevents accessing skb data
beyond the frame end.

Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agowireless: drop invalid mesh address extension frames
Johannes Berg [Thu, 25 Oct 2012 19:51:59 +0000 (21:51 +0200)]
wireless: drop invalid mesh address extension frames

The mesh header can have address extension by a 4th
or a 5th and 6th address, but never both. Drop such
frames in 802.11 -> 802.3 conversion along with any
frames that have the wrong extension.

Cc: stable@vger.kernel.org
Reviewed-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix SSID copy on IBSS JOIN
Antonio Quartulli [Fri, 26 Oct 2012 16:54:25 +0000 (18:54 +0200)]
mac80211: fix SSID copy on IBSS JOIN

The 'ssid' field of the cfg80211_ibss_params is a u8 pointer and
its length is likely to be less than IEEE80211_MAX_SSID_LEN most
of the time.

This patch fixes the ssid copy in ieee80211_ibss_join() by using
the SSID length to prevent it from reading beyond the string.

Cc: stable@vger.kernel.org
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
[rewrapped commit message, small rewording]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoNFC: Purge LLCP socket Tx queues when being disconnected
Samuel Ortiz [Fri, 26 Oct 2012 16:20:10 +0000 (18:20 +0200)]
NFC: Purge LLCP socket Tx queues when being disconnected

The Tx queues are no longer valid when we receive a disconnection or when
the LLCP link goes down. In the later case we also purge the entire local
Tx queue.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Remove CONFIG_EXPERIMENTAL from the NCI Makefile
Kees Cook [Tue, 23 Oct 2012 20:04:11 +0000 (13:04 -0700)]
NFC: Remove CONFIG_EXPERIMENTAL from the NCI Makefile

This config item has not carried much meaning for a while now and is
almost always enabled by default. As agreed during the Linux kernel
summit, remove it.

Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Remove CONFIG_EXPERIMENTAL from the LLCP Makefile
Kees Cook [Tue, 23 Oct 2012 20:04:10 +0000 (13:04 -0700)]
NFC: Remove CONFIG_EXPERIMENTAL from the LLCP Makefile

This config item has not carried much meaning for a while now and is
almost always enabled by default. As agreed during the Linux kernel
summit, remove it.

Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Remove CONFIG_EXPERIMENTAL
Kees Cook [Tue, 23 Oct 2012 20:04:09 +0000 (13:04 -0700)]
NFC: Remove CONFIG_EXPERIMENTAL

This config item has not carried much meaning for a while now and is
almost always enabled by default. As agreed during the Linux kernel
summit, remove it.

Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Fix some code style and whitespace issues
Szymon Janc [Wed, 17 Oct 2012 13:23:39 +0000 (15:23 +0200)]
NFC: Fix some code style and whitespace issues

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Use IDR library to assing NFC devices IDs
Samuel Ortiz [Mon, 22 Oct 2012 13:57:58 +0000 (15:57 +0200)]
NFC: Use IDR library to assing NFC devices IDs

As a consequence the NFC device IDs won't be increasing all the time,
as IDR provides the first available ID.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: pn533: Remove unused arg parameter
Waldemar Rymarkiewicz [Thu, 11 Oct 2012 12:04:01 +0000 (14:04 +0200)]
NFC: pn533: Remove unused arg parameter

Get rid of unused arg param in pn533_init_target_complete and
in pn533_start_poll_complete.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: pn533: Fix in/out frame buffer allocation
Waldemar Rymarkiewicz [Thu, 11 Oct 2012 12:03:58 +0000 (14:03 +0200)]
NFC: pn533: Fix in/out frame buffer allocation

Max frame size should be 264 bytes as per spec and not limited to
endpoint MaxPacketSize which is 64 in my case (acr122 reader).

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Return NULL when no LLCP socket for a dsap,ssap couple is found
Samuel Ortiz [Tue, 16 Oct 2012 19:15:59 +0000 (21:15 +0200)]
NFC: Return NULL when no LLCP socket for a dsap,ssap couple is found

The previous code was always returning the last socket from the
LLCP socket list.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Implement LLCP connection less Tx path
Samuel Ortiz [Tue, 16 Oct 2012 13:04:10 +0000 (15:04 +0200)]
NFC: Implement LLCP connection less Tx path

It simply involves getting the client dsap and ssap and calling the UI
frame building and sending routine.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: UI frame sending routine implementation
Samuel Ortiz [Tue, 16 Oct 2012 13:01:40 +0000 (15:01 +0200)]
NFC: UI frame sending routine implementation

UI frames still need to follow the MIU rule, and they need to use the
client passed dsap as the listening socket dsap is stuck on SDP.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Forward LLCP datagrams to userspace
Samuel Ortiz [Mon, 15 Oct 2012 15:44:44 +0000 (17:44 +0200)]
NFC: Forward LLCP datagrams to userspace

With connection less PDUs we have to send the SSAP and DSAP as well.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Handle LLCP UI frames
Samuel Ortiz [Mon, 15 Oct 2012 14:14:37 +0000 (16:14 +0200)]
NFC: Handle LLCP UI frames

UI (Unnumbered Information) frames are used for sending data over
connection less links.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Keep connection less bound sockets alive when DEP link goes down
Samuel Ortiz [Mon, 15 Oct 2012 13:09:52 +0000 (15:09 +0200)]
NFC: Keep connection less bound sockets alive when DEP link goes down

When DEP goes down, bound cl sockets can be kept alive as there is no
reason to kill a connection less server socket because the LLCP link
went down.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>