kernel/kernel-generic.git
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Fri, 8 Mar 2013 20:52:21 +0000 (15:52 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/jberg/mac80211-next

11 years agomwifiex: add WOWLAN support
Amitkumar Karwar [Tue, 5 Mar 2013 00:27:59 +0000 (16:27 -0800)]
mwifiex: add WOWLAN support

Currently 'magic-packet' and 'patterns' options in 'iw wowlan'
command are supported.

Appropriate packet filters for wowlan are configured in firmware
based on provided patterns and/or magic-packet option.

For examples,

wake-on ARP request for 192.168.0.100:
iw phy0 wowlan enable patterns ff:ff:ff:ff:ff:ff 20+08:06
  46+c0:a8:00:64

wake-on RX packets sent from IP address 192.168.0.88:
iw phy0 wowlan enable patterns 34+c0:a8:00:58

wake-on RX packets with TCP destination port 80
iw phy0 wowlan enable patterns 44+50

wake-on MagicPacket:
iw phy0 wowlan enable magic-packet

wake-on MagicPacket or patterns:
iw phy0 wowlan enable magic-packet patterns 12+00:11:22:33:44:55
  18+00:50:43:21

wake-on IPv4 multicast packets:
iw phy0 wowlan enable patterns 01:00:5e

wake-on IPv6 multicast packets:
iw phy0 wowlan enable patterns 33:33

disable all wowlan options
iw phy0 wowlan disable

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: add "ethtool wol" command support
Amitkumar Karwar [Tue, 5 Mar 2013 00:27:58 +0000 (16:27 -0800)]
mwifiex: add "ethtool wol" command support

Host sleep wakeup condition is configured using this command.

Supports Wake-on: pumb

For examples:

wake-on any unicast packets:
ethtool -s mlan0 wol u

wake-on multicast/broadcast packet:
ethtool -s mlan0 wol mb

wake-on unicast packets and MAC events:
ethtool -s mlan0 wol pu

wake-on unicast/multicast/broadcast packets and MAC events:
ethtool -s mlan0 wol pmbu

disable all wake-on options:
ethtool -s mlan0 wol d

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: shorten the host sleep configuration macro names
Amitkumar Karwar [Tue, 5 Mar 2013 00:27:57 +0000 (16:27 -0800)]
mwifiex: shorten the host sleep configuration macro names

As we are adding a few more macros in this category in next
patch, this cleanup work is required.

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: modify skb->truesize for PCIE Rx
Avinash Patil [Tue, 5 Mar 2013 00:27:56 +0000 (16:27 -0800)]
mwifiex: modify skb->truesize for PCIE Rx

We allocate SKB buffers of 4K size to make sure that we process
RX AMSDU of 4K. So when skb->len is lesser than 4K; we should
modify skb->truesize. This resolves an issue where kernel has
allocated packets with 2K assumption and starts dropping packets
for large size data transfer.

This fix is already present for USB; extend it to PCIE.

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: avoid [-Wmaybe-uninitialized] warnings in pcie.c
Bing Zhao [Tue, 5 Mar 2013 00:27:55 +0000 (16:27 -0800)]
mwifiex: avoid [-Wmaybe-uninitialized] warnings in pcie.c

drivers/net/wireless/mwifiex/pcie.c:1157:9: warning:
  'desc2' may be used uninitialized in this function
  [-Wmaybe-uninitialized]
drivers/net/wireless/mwifiex/pcie.c:1048:31: note:
  'desc2' was declared here

drivers/net/wireless/mwifiex/pcie.c:1159:9: warning:
  'desc' may be used uninitialized in this function
  [-Wmaybe-uninitialized]
drivers/net/wireless/mwifiex/pcie.c:1047:32: note:
  'desc' was declared here

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: fix [-Wunused-function] warnings on pcie suspend/resume
Bing Zhao [Tue, 5 Mar 2013 00:27:54 +0000 (16:27 -0800)]
mwifiex: fix [-Wunused-function] warnings on pcie suspend/resume

drivers/net/wireless/mwifiex/pcie.c:204:12: warning:
  'mwifiex_pcie_resume' defined but not used [-Wunused-function]
drivers/net/wireless/mwifiex/pcie.c:166:12: warning:
  'mwifiex_pcie_suspend' defined but not used [-Wunused-function]

The suspend/resume handlers ought to be under CONFIG_PM directive.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: remove static forward declarations in pcie.c
Bing Zhao [Tue, 5 Mar 2013 00:27:53 +0000 (16:27 -0800)]
mwifiex: remove static forward declarations in pcie.c

move functions up just to avoid static forward declaration for
mwifiex_pcie_resume.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Report rx-crc-errors in ethtool stats.
Ben Greear [Mon, 4 Mar 2013 23:31:17 +0000 (15:31 -0800)]
ath9k: Report rx-crc-errors in ethtool stats.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Report txerr-filtered errors in debugfs.
Ben Greear [Mon, 4 Mar 2013 23:31:16 +0000 (15:31 -0800)]
ath9k: Report txerr-filtered errors in debugfs.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: HT-PHY: make it BCMA-only
Rafał Miłecki [Mon, 4 Mar 2013 15:39:10 +0000 (16:39 +0100)]
b43: HT-PHY: make it BCMA-only

HT-PHY was found only on BCM4331 which is a BCMA-based chipset. This is
reallly unlikely we will ever see HT-PHY on SSB thus make the whole code
BCMA specific. This will allow us to call various BCMA-specific
functions directly (without extra checks).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Fix fixed antenna for AR9462
Sujith Manoharan [Mon, 4 Mar 2013 07:12:55 +0000 (12:42 +0530)]
ath9k_hw: Fix fixed antenna for AR9462

When the RX chainmask is set to 0x2 for AR9462, certain values
from chain1 have to be programmed for chain0 also.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Update initvals for AR9462
Sujith Manoharan [Mon, 4 Mar 2013 07:12:54 +0000 (12:42 +0530)]
ath9k_hw: Update initvals for AR9462

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Use helper functions to simplify HW reset
Sujith Manoharan [Mon, 4 Mar 2013 07:12:53 +0000 (12:42 +0530)]
ath9k_hw: Use helper functions to simplify HW reset

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Remove CHANNEL_CW_INT
Sujith Manoharan [Mon, 4 Mar 2013 07:12:52 +0000 (12:42 +0530)]
ath9k_hw: Remove CHANNEL_CW_INT

This flag is used for indicating channel interference and
we currently do nothing with it, so remove it.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: add parameter to brcmf_proto_hdrpush() for data offset
Arend van Spriel [Sun, 3 Mar 2013 11:45:32 +0000 (12:45 +0100)]
brcmfmac: add parameter to brcmf_proto_hdrpush() for data offset

The function brcmf_proto_hdrpush() increases the header space and
fills in the protocol header fields. One field is the data offset
which is currently fixed to zero meaning the data follows right
after the header. The parameter is added to determine the actual
start of data. This will be used for firmware signalling.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmutil: add dequeue function with filtering
Arend van Spriel [Sun, 3 Mar 2013 11:45:31 +0000 (12:45 +0100)]
brcmutil: add dequeue function with filtering

Adding a packet dequeue function that will return packets that
pass the provided match function.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: assure brcmf_txcomplete() is called in failure paths
Arend van Spriel [Sun, 3 Mar 2013 11:45:30 +0000 (12:45 +0100)]
brcmfmac: assure brcmf_txcomplete() is called in failure paths

For transmit packets the function brcmf_txcomplete() must be
called. This should be done as well when for some reason the
transmit fails to assure proper tx post processing. This patch
fixes the code paths in brcmf_usb_tx() that forgot to do so.

Reviewed-by: Piotr Haber <phaber@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>
11 years agobrcmfmac: release transmit packet in brcmf_txcomplete()
Arend van Spriel [Sun, 3 Mar 2013 11:45:29 +0000 (12:45 +0100)]
brcmfmac: release transmit packet in brcmf_txcomplete()

In the bus-specific driver code each call to brcmf_txcomplete() is
following by a free of that packet. This patch moves that free to
the brcmf_txcomplete() function.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@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>
11 years agobrcmfmac: add support for TLV based firmware signalling
Arend van Spriel [Sun, 3 Mar 2013 11:45:28 +0000 (12:45 +0100)]
brcmfmac: add support for TLV based firmware signalling

The firmware and host can exchange signals which are carried within
the data packets. These are TLV based signals that are inserted
before the actual data, ie. ethernet frame.

This commit adds the new source module for this feature and enables
RSSI signals from firmware.

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>
11 years agobrcmutil: add macros for setting bitfields using mask/shift operations
Arend van Spriel [Sun, 3 Mar 2013 11:45:27 +0000 (12:45 +0100)]
brcmutil: add macros for setting bitfields using mask/shift operations

Added inline functions to set bitfields in an unsigned integer variable.

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>
11 years agobrcmfmac: increase required skbuff headroom for firmware signalling
Arend van Spriel [Sun, 3 Mar 2013 11:45:26 +0000 (12:45 +0100)]
brcmfmac: increase required skbuff headroom for firmware signalling

In preparation of firmware signalling feature additional headroom is
needed to accommodate signalling protocol data between host and
firmware.

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>
11 years agobrcmfmac: remove null-pointer check in .sched_scan_start() callback
Arend van Spriel [Sun, 3 Mar 2013 11:45:25 +0000 (12:45 +0100)]
brcmfmac: remove null-pointer check in .sched_scan_start() callback

In brcmf_cfg80211_sched_scan_start() the request parameter was checked
for being non-null. However, it never is so remove the check which gets
rid of following smatch warning:

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c:2904
brcmf_cfg80211_sched_scan_start()
warn: variable dereferenced before check 'request' (see line 2897)

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: cleanup module information macros
Arend van Spriel [Sun, 3 Mar 2013 11:45:23 +0000 (12:45 +0100)]
brcmfmac: cleanup module information macros

The output of modinfo shows a bit of strangeness because module
information macros are used in multiple source files:

license:        Dual BSD/GPL
description:    Broadcom 802.11 wireless LAN fullmac driver.
author:         Broadcom Corporation
firmware:       brcm/brcmfmac-sdio.txt
firmware:       brcm/brcmfmac-sdio.bin
firmware:       brcm/brcmfmac43236b.bin
license:        Dual BSD/GPL
description:    Broadcom 802.11n wireless LAN fullmac usb driver.
author:         Broadcom Corporation

This patch cleans it up.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: make debug module parameter more clear
Arend van Spriel [Sun, 3 Mar 2013 11:45:22 +0000 (12:45 +0100)]
brcmfmac: make debug module parameter more clear

The module parameter definition for brcmf_msg_level has been
reworked to a named module parameter with description so
modinfo is a bit more informative:

parm:           debug:level of debug output (int)

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: introduce tracepoints for message logging
Arend van Spriel [Sun, 3 Mar 2013 11:45:21 +0000 (12:45 +0100)]
brcmfmac: introduce tracepoints for message logging

Inspired by tracing functionality added by Seth Forshee in the
brcmsmac driver, this patch adds similar functionality to brcmfmac.

Reviewed-by: Piotr Haber <phaber@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: radio on led support
Piotr Haber [Sun, 3 Mar 2013 11:45:20 +0000 (12:45 +0100)]
brcmsmac: radio on led support

Add support for radio on led indicator.
Control led via BCMA gpio driver.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Piotr Haber <phaber@broadcom.com>
[arend@broadcom.com: modify Makefile for conditional compile led.c]
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwl8k: Load 8764 firmware image
Nishant Sarmukadam [Fri, 1 Mar 2013 11:43:01 +0000 (17:13 +0530)]
mwl8k: Load 8764 firmware image

This differs from legacy chips i.e.
a 8764 loads firmware image without a helper image
b Check interrupt status register for download
  complete indication.

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwl8k: Adding support for 8764 4x4 AP
Nishant Sarmukadam [Fri, 1 Mar 2013 11:42:45 +0000 (17:12 +0530)]
mwl8k: Adding support for 8764 4x4 AP

The patch does the following:-

a Add entry in the PCIe table
b Add firmware support with API versioning
c Reuse most of the 8366 code
d Make 8764 specific changes where 8764 differs
  from 8366 e.g. structure definitions.

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath6kl: small cleanup in ath6kl_htc_pipe_rx_complete()
Dan Carpenter [Thu, 28 Feb 2013 04:45:47 +0000 (07:45 +0300)]
ath6kl: small cleanup in ath6kl_htc_pipe_rx_complete()

It's harmless, but Smatch complains if we use "htc_hdr->eid" before
doing the bounds check.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agodrivers/net/wireless/ath/wil6210: Makefile, only -Werror when no -W* in EXTRA_CFLAGS
Chen Gang [Wed, 27 Feb 2013 06:55:06 +0000 (14:55 +0800)]
drivers/net/wireless/ath/wil6210: Makefile, only -Werror when no -W* in EXTRA_CFLAGS

  When make with EXTRA_CFLAGS=-W, it will report error.
  so give a check in Makefile.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Acked-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: simplify ATH_EP_RND
Bob Copeland [Tue, 26 Feb 2013 18:41:52 +0000 (13:41 -0500)]
ath9k: simplify ATH_EP_RND

Remove the embedded branch to make the ATH_EP_RND macro a little
clearer.  The new version also generates better code, saving 24
bytes of text:

   text    data     bss     dec     hex filename
  87858    1641      24   89523   15db3 ath9k_orig.ko
  87834    1641      24   89499   15d9b ath9k_new.ko

Although neither version handles negative values particularly well,
the lone caller clamps all negative values to zero anyway.  I have
verified that the results are the same for the range of possible
positive rssi values.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoray_cs: read past the end of the array
Dan Carpenter [Tue, 26 Feb 2013 10:04:51 +0000 (13:04 +0300)]
ray_cs: read past the end of the array

"translate" should either be set or disabled.  We also use it an
offset into the framing[] array when we're generating the proc
file.  Framing looks like this:

static const char *framing[] = { "Encapsulation", "Translation" }

So when we're setting translate we need to restrict the values to
either 1 or 0 or it can an out of bounds read.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: define BCMA wireless specific PLLs
Rafał Miłecki [Tue, 26 Feb 2013 09:07:57 +0000 (10:07 +0100)]
b43: define BCMA wireless specific PLLs

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: implement disabling PLLs
Rafał Miłecki [Tue, 26 Feb 2013 09:02:23 +0000 (10:02 +0100)]
bcma: implement disabling PLLs

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowil6210: convert to use simple_open()
Wei Yongjun [Tue, 26 Feb 2013 02:29:34 +0000 (10:29 +0800)]
wil6210: convert to use simple_open()

This removes an open coded simple_open() function and
replaces file operations references to the function
with simple_open() instead.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath5k: cleanup channel to eprom_mode function
Jiri Slaby [Mon, 25 Feb 2013 14:36:48 +0000 (15:36 +0100)]
ath5k: cleanup channel to eprom_mode function

Stop returning negative values from ath5k_eeprom_mode_from_channel.
Yell loudly about that case in that function instead and return the
default/zero/mode A. This cleans up the callers, but needs to pass ah
down to ath5k_eeprom_mode_from_channel for ATH5K_WARN. For that
purpose we also need the declaration to be moved to ath5k.h.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agorndis_wlan: Remove redundant NULL check before kfree
Syam Sidhardhan [Sun, 24 Feb 2013 22:05:43 +0000 (03:35 +0530)]
rndis_wlan: Remove redundant NULL check before kfree

kfree on a NULL pointer is a no-op.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: export firmware version to ethtool
Hauke Mehrtens [Sun, 24 Feb 2013 15:41:34 +0000 (16:41 +0100)]
brcmsmac: export firmware version to ethtool

This exports the firmware version in use to userspace through ethtool.

root@OpenWrt:/# ethtool -i wlan0
firmware-version: 610.812

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agocarl9170: fix frame drop and WARN due to minstrel_ht change
Christian Lamparter [Fri, 22 Feb 2013 00:30:44 +0000 (01:30 +0100)]
carl9170: fix frame drop and WARN due to minstrel_ht change

With "mac80211/minstrel_ht: add support for using CCK rates"
minstrel_ht selects legacy CCK rates as viable rates for
outgoing frames which might be sent as part of an A-MPDU
[IEEE80211_TX_CTL_AMPDU is set].

This behavior triggered the following WARN_ON in the driver:
> WARNING: at carl9170/tx.c:995 carl9170_op_tx+0x1dd/0x6fd
The driver assumed that the rate control algorithm made a
mistake and dropped the frame.

This patch removes the noisy warning altogether and allows
said A-MPDU frames with CCK sample and/or fallback rates to
be transmitted seamlessly.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agob43: Fix 'me' -> 'be' typo in Kconfig
W. Trevor King [Thu, 21 Feb 2013 12:34:42 +0000 (07:34 -0500)]
b43: Fix 'me' -> 'be' typo in Kconfig

Also add a missing 'the' before 'runtime performance'.

Signed-off-by: W. Trevor King <wking@tremily.us>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobcma: ignore extra GMAC cores on BCM4706
Rafał Miłecki [Tue, 19 Feb 2013 18:41:42 +0000 (19:41 +0100)]
bcma: ignore extra GMAC cores on BCM4706

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agort2x00: rt2x00pci_regbusy_read() - only print register access failure once
Tim Gardner [Mon, 18 Feb 2013 19:56:28 +0000 (12:56 -0700)]
rt2x00: rt2x00pci_regbusy_read() - only print register access failure once

BugLink: http://bugs.launchpad.net/bugs/1128840
It appears that when this register read fails it never recovers, so
I think there is no need to repeat the same error message ad infinitum.

Cc: Ivo van Doorn <IvDoorn@gmail.com>
Cc: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: Helmut Schaa <helmut.schaa@googlemail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: users@rt2x00.serialmonkey.com
Cc: netdev@vger.kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: Convert ssb_printk to ssb_<level>
Joe Perches [Wed, 20 Feb 2013 20:16:13 +0000 (12:16 -0800)]
ssb: Convert ssb_printk to ssb_<level>

Use a more current logging style.

Convert ssb_dbprint to ssb_dbg too.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: pci: Standardize a function to get mac address
Joe Perches [Wed, 20 Feb 2013 20:11:05 +0000 (12:11 -0800)]
ssb: pci: Standardize a function to get mac address

Don't require alignment of mac addresses to u16.

Signed-off-by: Joe Perches <joe@perches.com>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: fix unaligned access to mac address
Hauke Mehrtens [Mon, 18 Feb 2013 20:47:45 +0000 (21:47 +0100)]
ssb: fix unaligned access to mac address

The mac address should be aligned to u16 to prevent an unaligned access
in drivers/ssb/pci.c where it is casted to __be16.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomac80211: init mesh timer for user authed STAs
Thomas Pedersen [Sat, 2 Mar 2013 06:02:52 +0000 (22:02 -0800)]
mac80211: init mesh timer for user authed STAs

There is a corner case which wasn't being covered:
userspace may authenticate and allocate stations,
but still leave the peering up to the kernel.

Initialize the peering timer if the MPM is not in
userspace, in a path which is taken by both the kernel and
userspace when allocating stations.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: disallow changing auto_open_plinks
Thomas Pedersen [Mon, 4 Mar 2013 21:06:14 +0000 (13:06 -0800)]
mac80211: disallow changing auto_open_plinks

while user MPM is running.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211: user_mpm overrides auto_open_plinks
Thomas Pedersen [Mon, 4 Mar 2013 21:06:13 +0000 (13:06 -0800)]
nl80211: user_mpm overrides auto_open_plinks

If the user requested a userspace MPM, automatically
disable auto_open_plinks to fully disable the kernel MPM.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: support userspace MPM
Thomas Pedersen [Mon, 4 Mar 2013 21:06:12 +0000 (13:06 -0800)]
mac80211: support userspace MPM

Earlier mac80211 would check whether some kind of mesh
security was enabled, when the real question was "is the
MPM in userspace"?

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: rename mesh station types
Thomas Pedersen [Mon, 4 Mar 2013 21:06:11 +0000 (13:06 -0800)]
cfg80211: rename mesh station types

The mesh station types used to refer to whether the
station was secure or nonsecure. Really the salient
information is whether it is managed by the kernel or
userspace

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211: explicit userspace MPM
Thomas Pedersen [Mon, 4 Mar 2013 21:06:10 +0000 (13:06 -0800)]
nl80211: explicit userspace MPM

Secure mesh had the implicit requirement that the Mesh
Peering Management entity be in userspace.  However
userspace might want to implement an open MPM as well, so
specify a mesh setup parameter to indicate this.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: improve minstrels rate sorting by means of throughput & probability
Thomas Huehn [Mon, 4 Mar 2013 22:30:07 +0000 (23:30 +0100)]
mac80211: improve minstrels rate sorting by means of throughput & probability

This patch improves the way minstrel sorts rates according to throughput
and success probability. 3 FOR-loops across the entire rate set in function
minstrel_update_stats() which where used to determine the fastest, second
fastest and most robust rate are reduced to 1 FOR-loop.

The sorted list of rates according throughput is extended to the best four
rates as we need them in upcoming joint rate and power control. The sorting
is done via the new function minstrel_sort_best_tp_rates().

The most robust rate selection is aligned with minstrel_ht's approach.
Once any success probability is above 95% the one with the highest
throughput is chosen as most robust rate. If success probabilities of all
rates are below 95%, the rate with the highest succ. prob. is elected as
most robust one

Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: treat minstrel success probabilities below 10% as implausible
Thomas Huehn [Mon, 4 Mar 2013 22:30:06 +0000 (23:30 +0100)]
mac80211: treat minstrel success probabilities below 10% as implausible

Based on minstrel_ht this patch treats success probabilities below 10% as
implausible values for throughput calculation in minstrel's statistics.
Current throughput per rate with such a low success probability is reset
to 0 MBit/s.

Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: add lowest rate into minstrel's random rate sampling table
Thomas Huehn [Mon, 4 Mar 2013 22:30:05 +0000 (23:30 +0100)]
mac80211: add lowest rate into minstrel's random rate sampling table

While minstrel bootstraps and fills the success probabilities of each
rate the lowest rate has typically a very high success probability
(often 100% in our tests).
Its statistics are never updated but considered to setup the mrr chain.
In our tests we see that especially the 3rd mrr stage (which is that
rate providing highest success probability) is filled with the lowest rate
because its initial high sucess probability is never updated. By design
the 4th mrr stage is filled with the lowest rate so often 3rd and 4th
mrr stage are equal.

This patch follows minstrels general approach of assuming as little
as possible about rate dependencies. Consequently we include the
lowest rate into the random sampling table to get balanced up-to-date
statistics of all rates and therefore balanced decisions.

Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: extend minstrel's rate sampling to avoid unsampled rates
Thomas Huehn [Mon, 4 Mar 2013 22:30:04 +0000 (23:30 +0100)]
mac80211: extend minstrel's rate sampling to avoid unsampled rates

Minstrel's decision which rate should be directly sampled within the
1st mrr stage is limited to such rates faster than the current max
throughput rate. All rates below the current max. throughput rate
are indirectly sampled via the 2nd mrr stage.
This approach leads to deprecated per rate statistics and therfore
a deprecated mrr chain setup.

This patch uses the sampling approach from minstrel_ht. A counter is
added to sum all indirect sample attempts per rate. After 20 indirect
sampling attempts the rate is directly sampled within the 1st mrr stage.
Therefore more up-to-date statistics for all rates are maintained and
used to setup the mrr chain.

Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: add documentation and verbose variable names in
Thomas Huehn [Mon, 4 Mar 2013 22:30:03 +0000 (23:30 +0100)]
mac80211: add documentation and verbose variable names in

Add documentation and more verbose variable names to minstrel's
multi-rate-retry setup within function minstrel_get_rate() to
increase the readability of the algorithm.

Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: merge value scaling macros of minstrel_ht and minstrel
Thomas Huehn [Mon, 4 Mar 2013 22:30:02 +0000 (23:30 +0100)]
mac80211: merge value scaling macros of minstrel_ht and minstrel

Both minstrel versions use individual ways to scale up integer values
to perform calculations. Merge minstrel_ht's scaling macros into
minstrels header file and use them in both minstrel versions.

Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: merge EWMA calculation of minstrel_ht and minstrel
Thomas Huehn [Mon, 4 Mar 2013 22:30:01 +0000 (23:30 +0100)]
mac80211: merge EWMA calculation of minstrel_ht and minstrel

Both rate control algorithms (minstrel and minstrel_ht) calculate
averages based on EWMA. Shift function minstrel_ewma() into
rc80211_minstrel.h and make use of it in both minstrel version.
Also shift the default EWMA level (75%) definition to the header file
and clean up variable usage.

Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211/minstrel_ht: disable multiple consecutive sample attempts
Felix Fietkau [Tue, 5 Mar 2013 13:20:19 +0000 (14:20 +0100)]
mac80211/minstrel_ht: disable multiple consecutive sample attempts

The last minstrel_ht changes increased the sampling frequency for
potentially useful rates to decrease the response time to rate
fluctuations. This caused an increase in sampling frequency that can
slightly reduce throughput, so this patch limits the sampling attempts
to one per rate instead of two.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoregulatory: allow VHT channels in world roaming
Johannes Berg [Mon, 3 Dec 2012 21:09:22 +0000 (22:09 +0100)]
regulatory: allow VHT channels in world roaming

For VHT, the wider bandwidths (up to 160 MHz) need
to be allowed. Since world roaming only covers the
case of connecting to an AP, it can be opened up
there, we will rely on the AP to know the local
regulations.

Acked-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: enable TDLS on P2P client interfaces
Johannes Berg [Mon, 4 Mar 2013 08:29:46 +0000 (09:29 +0100)]
cfg80211: enable TDLS on P2P client interfaces

There's no reason TDLS should be prevented on P2P client
interfaces, and most of the code already handles it, so
allow adding stations for it.

Reported-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: add VHT capabilities station debugfs file
Johannes Berg [Fri, 1 Mar 2013 12:36:24 +0000 (13:36 +0100)]
mac80211: add VHT capabilities station debugfs file

Add a new debugfs file to view a station's VHT capabilities.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: restrict peer's VHT capabilities to own
Johannes Berg [Fri, 1 Mar 2013 12:07:48 +0000 (13:07 +0100)]
mac80211: restrict peer's VHT capabilities to own

Implement restricting peer VHT capabilities to the device's own
capabilities. This is useful when a single driver supports more
than one device and the devices have different capabilities
(often they will differ in the number of spatial streams), but
in particular is also necessary for VHT capability overrides to
work correctly -- otherwise it'd be possible to e.g. advertise,
due to overrides, that TX-STBC is not supported, but then still
use it to TX to the AP because it supports RX-STBC.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix HT capability overrides for AP station
Johannes Berg [Fri, 1 Mar 2013 10:54:43 +0000 (11:54 +0100)]
mac80211: fix HT capability overrides for AP station

HT capabilites are asymmetric -- e.g. beamforming is both an
RX and TX capability. If, for example, we support RX but not
TX, the RX capability of the AP station is masked out (if it
supports it). This works correctly if it's really the driver
capability.

If, on the other hand, the reason for not supporting TX BF
is that it was removed by HT capability overrides then the
wrong thing happens: the AP's TX capability will be removed
rather than its RX capability, because the override function
works on own capabilities, not remote ones, and doesn't take
the asymmetry into account.

To fix this make a copy of our own capabilities, apply the
overrides to them (where needed) and then use that to set up
the peer's capabilities.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: don't apply HT overrides to TDLS peers
Johannes Berg [Fri, 1 Mar 2013 10:43:30 +0000 (11:43 +0100)]
mac80211: don't apply HT overrides to TDLS peers

The HT overrides are intended only for the connection
to the AP, not for any other purpose. Therefore, don't
apply them to TDLS peers that are also stations added
to a managed station interface.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: simplify AP interface stop
Johannes Berg [Sat, 23 Feb 2013 00:17:56 +0000 (01:17 +0100)]
mac80211: simplify AP interface stop

For AP interfaces, there's no need to flush stations
or keys again when the interface is stopped as already
happened when the BSS was stopped on the interface.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: flush keys when stopping AP
Johannes Berg [Sat, 23 Feb 2013 00:14:20 +0000 (01:14 +0100)]
mac80211: flush keys when stopping AP

Since hostapd will remove keys this isn't usually
an issue, but we shouldn't leak keys to the next
BSS started on the same interface. For VLANs this
also fixes a bug, keys that aren't removed would
otherwise be leaked.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: defer tailroom counter manipulation when roaming
Johannes Berg [Fri, 22 Feb 2013 23:59:03 +0000 (00:59 +0100)]
mac80211: defer tailroom counter manipulation when roaming

During roaming, the crypto_tx_tailroom_needed_cnt counter
will often take values 2,1,0,1,2 because first keys are
removed and then new keys are added. This is inefficient
because during the 0->1 transition, synchronize_net must
be called to avoid packet races, although typically no
packets would be flowing during that time.

To avoid that, defer the decrement (2->1, 1->0) when keys
are removed (by half a second). This means the counter
will really have the values 2,2,2,3,4 ... 2, thus never
reaching 0 and having to do the 0->1 transition.

Note that this patch entirely disregards the drivers for
which this optimisation was done to start with, for them
the key removal itself will be expensive because it has
to synchronize_net() after the counter is incremented to
remove the key from HW crypto. For them the sequence will
look like this: 0,1,0,1,0,1,0,1,0 (*) which is clearly a
lot more inefficient. This could be addressed separately,
during key removal the 0->1->0 sequence isn't necessary.

(*) it starts at 0 because HW crypto is on, then goes to
    1 when HW crypto is disabled for a key, then back to
    0 because the key is deleted; this happens for both
    keys in the example. When new keys are added, it goes
    to 1 first because they're added in software; when a
    key is moved to hardware it goes back to 0

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: remove IEEE80211_KEY_FLAG_WMM_STA
Johannes Berg [Fri, 22 Feb 2013 23:22:44 +0000 (00:22 +0100)]
mac80211: remove IEEE80211_KEY_FLAG_WMM_STA

There's no driver using this flag, so it seems
that all drivers support HW crypto with WMM or
don't support it at all. Remove the flag and
code setting it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: merge reconfig assign chanctx code
Stanislaw Gruszka [Thu, 28 Feb 2013 09:55:30 +0000 (10:55 +0100)]
mac80211: merge reconfig assign chanctx code

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: cleanup suspend/resume on mesh mode
Stanislaw Gruszka [Thu, 28 Feb 2013 09:55:29 +0000 (10:55 +0100)]
mac80211: cleanup suspend/resume on mesh mode

Remove not used any longer suspend/resume code.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: cleanup suspend/resume on ibss mode
Stanislaw Gruszka [Thu, 28 Feb 2013 09:55:28 +0000 (10:55 +0100)]
mac80211: cleanup suspend/resume on ibss mode

Remove not used any longer suspend/resume code.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: cleanup suspend/resume on managed mode
Stanislaw Gruszka [Thu, 28 Feb 2013 09:55:27 +0000 (10:55 +0100)]
mac80211: cleanup suspend/resume on managed mode

Remove not used any longer suspend/resume code.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: cleanup generic suspend/resume procedures
Stanislaw Gruszka [Thu, 28 Feb 2013 09:55:26 +0000 (10:55 +0100)]
mac80211: cleanup generic suspend/resume procedures

Since now we disconnect before suspend, various code which save
connection state can now be removed from suspend and resume
procedure. Cleanup on resume side is smaller as ieee80211_reconfig()
is also used for H/W restart.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211/mac80211: disconnect on suspend
Stanislaw Gruszka [Thu, 28 Feb 2013 09:55:25 +0000 (10:55 +0100)]
cfg80211/mac80211: disconnect on suspend

If possible that after suspend, cfg80211 will receive request to
disconnect what require action on interface that was removed during
suspend.

Problem can manifest itself by various warnings similar to below one:

WARNING: at net/mac80211/driver-ops.h:12 ieee80211_bss_info_change_notify+0x2f9/0x300 [mac80211]()
wlan0:  Failed check-sdata-in-driver check, flags: 0x4
Call Trace:
 [<c043e0b3>] warn_slowpath_fmt+0x33/0x40
 [<f83707c9>] ieee80211_bss_info_change_notify+0x2f9/0x300 [mac80211]
 [<f83a660a>] ieee80211_recalc_ps_vif+0x2a/0x30 [mac80211]
 [<f83a6706>] ieee80211_set_disassoc+0xf6/0x500 [mac80211]
 [<f83a9441>] ieee80211_mgd_deauth+0x1f1/0x280 [mac80211]
 [<f8381b36>] ieee80211_deauth+0x16/0x20 [mac80211]
 [<f8261e70>] cfg80211_mlme_down+0x70/0xc0 [cfg80211]
 [<f8264de1>] __cfg80211_disconnect+0x1b1/0x1d0 [cfg80211]

To fix the problem disconnect from any associated network before
suspend. User space is responsible to establish connection again
after resume. This basically need to be done by user space anyway,
because associated stations can go away during suspend (for example
NetworkManager disconnects on suspend and connect on resume by default).

Patch also handle situation when driver refuse to suspend with wowlan
configured and try to suspend again without it.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: remove napi
Stanislaw Gruszka [Thu, 28 Feb 2013 08:49:11 +0000 (09:49 +0100)]
mac80211: remove napi

Since two years no mac80211 driver implement support for NAPI. Looks
this feature is unneeded, so remove it from generic mac80211 code.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211/minstrel_ht: fix spacing between sample attempts
Felix Fietkau [Sun, 3 Mar 2013 11:49:52 +0000 (12:49 +0100)]
mac80211/minstrel_ht: fix spacing between sample attempts

A sample attempt should only count in mi->sample_tries if the sample
attempt wasn't skipped based on slower rate criteria.
This patch increases the sampling frequency for potentially desirable
rates and thus enables faster recovery from interference or collisions.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211/minstrel_ht: increase sampling frequency of some slower rates
Felix Fietkau [Sun, 3 Mar 2013 11:49:51 +0000 (12:49 +0100)]
mac80211/minstrel_ht: increase sampling frequency of some slower rates

If a rate is below the max_tp_rate, sample it frequently if:
- it is above max_tp_rate2, or
- it is above max_prob_rate and is a candidate for max_prob_rate
  (has fewer streams than max_tp_rate).
This helps the retry chain recover more quickly from bad statistics
caused by collisions or interference, and slightly reduces throughput
fluctuations with higher rates.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agominstrel_ht: increase sampling frequency
Felix Fietkau [Sat, 2 Mar 2013 20:20:14 +0000 (21:20 +0100)]
minstrel_ht: increase sampling frequency

Try to sample all available rates, as sample attempts do not cost much
airtime and are appropriately spaced based on the average A-MPDU length.
This helps with faster recovery on rate fluctuations.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211/minstrel_ht: improve max_prob_rate selection
Felix Fietkau [Sat, 2 Mar 2013 20:20:13 +0000 (21:20 +0100)]
mac80211/minstrel_ht: improve max_prob_rate selection

max_prob_rate should be selected to be very reliable, however limiting
it to single-stream on 3-stream devices is a bit much.
Allow max_prob_rate to use one stream less than the max_tp_rate.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211/minstrel_ht: improve accuracy of throughput metric at high data rates
Felix Fietkau [Sat, 2 Mar 2013 20:20:12 +0000 (21:20 +0100)]
mac80211/minstrel_ht: improve accuracy of throughput metric at high data rates

At high data rates the average frame transmission durations are small
enough for rounding errors to matter, sometimes causing minstrel to use
slightly lower transmit rates than necessary.
To fix this, change the unit of the duration value to nanoseconds
instead of microseconds, and reorder the multiplications/divisions when
calculating the throughput metric so that they don't overflow or
truncate prematurely.
At 2-stream HT40 this makes TCP throughput a bit more stable.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: Extend support for IEEE 802.11r Fast BSS Transition
Jouni Malinen [Wed, 27 Feb 2013 15:14:27 +0000 (17:14 +0200)]
cfg80211: Extend support for IEEE 802.11r Fast BSS Transition

Add NL80211_CMD_UPDATE_FT_IES to support update of FT IEs to the WLAN
driver and NL80211_CMD_FT_EVENT to send FT events from the WLAN driver.
This will carry the target AP's MAC address along with the relevant
Information Elements. This event is used to report received FT IEs
(MDIE, FTIE, RSN IE, TIE, RICIE). These changes allow FT to be supported
with drivers that use an internal SME instead of user space option (like
FT implementation in wpa_supplicant with mac80211-based drivers).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: prohibit zero keepalive interval
Johannes Berg [Tue, 26 Feb 2013 12:56:40 +0000 (13:56 +0100)]
cfg80211: prohibit zero keepalive interval

It's not useful to specify a 0 keepalive interval, this
would send too much data. Prohibit this to also avoid
device issues.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: Allow drivers to differentiate between ROC types
Ilan Peer [Tue, 12 Feb 2013 07:34:13 +0000 (09:34 +0200)]
mac80211: Allow drivers to differentiate between ROC types

Some devices can handle remain on channel requests differently
based on the request type/priority. Add support to
differentiate between different ROC types, i.e., indicate that
the ROC is required for sending managment frames.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: refactor association parameters
Johannes Berg [Thu, 21 Feb 2013 19:09:09 +0000 (20:09 +0100)]
cfg80211: refactor association parameters

cfg80211_mlme_assoc() has grown far too many arguments,
make the caller build almost all of the driver struct
and pass that to the function instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: support VHT capability overrides
Johannes Berg [Thu, 21 Feb 2013 16:40:19 +0000 (17:40 +0100)]
mac80211: support VHT capability overrides

Support the cfg80211 API to override VHT capabilities
on association.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: add ability to override VHT capabilities
Johannes Berg [Thu, 21 Feb 2013 16:36:01 +0000 (17:36 +0100)]
cfg80211: add ability to override VHT capabilities

For testing it's sometimes useful to be able to
override certain VHT capability advertisement,
add the ability to do that in cfg80211.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agowireless: remove unused VHT MCS defines
Johannes Berg [Thu, 21 Feb 2013 16:26:44 +0000 (17:26 +0100)]
wireless: remove unused VHT MCS defines

There's an enum with the same values (but slightly
different names except for NOT_SUPPORTED) that is
actually used, so remove the defines.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: move exported event functions into nl80211
Johannes Berg [Fri, 22 Feb 2013 21:05:20 +0000 (22:05 +0100)]
cfg80211: move exported event functions into nl80211

This is the sort of thing gcc's LTO could do, but since
we don't have that yet we can also do it manually. The
advantage is reduced code, both source and binary, e.g.
on x86-64

   text    data     bss     dec     hex filename
 442825   56230     776  499831   7a077 cfg80211.ko (before)
 441585   56230     776  498591   79b9f cfg80211.ko (after)

a reduction of ~1k.

But in order to not complicate the code move only those
functions that are simple wrappers, not those that have
functionality of their own.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211: re-add channel width and extended capa advertising
Johannes Berg [Wed, 27 Feb 2013 14:39:45 +0000 (15:39 +0100)]
nl80211: re-add channel width and extended capa advertising

Add back the channel width and extended capability data
to wiphy information if split information is supported.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoieee80211: mark 802.11 related structs as being 2-byte aligned
Felix Fietkau [Fri, 22 Feb 2013 16:28:49 +0000 (17:28 +0100)]
ieee80211: mark 802.11 related structs as being 2-byte aligned

Regardless of what header features they use, or if they align the IP
header or not, 802.11 packets from all drivers guarantee a 2-byte
alignment (and there's a debug WARN_ON in case they don't).

Annotate packet structs with __aligned(2) to allow the compiler to use
16-bit load/store operations on platforms with extremely inefficient
unaligned access (e.g. MIPS).

This reduces code size and improves performance on affected platforms
and causes no binary code change on others.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agowireless: move sequence number arithmetic to ieee80211.h
Johannes Berg [Fri, 15 Feb 2013 18:25:00 +0000 (19:25 +0100)]
wireless: move sequence number arithmetic to ieee80211.h

Move the sequence number arithmetic code from mac80211 to
ieee80211.h so others can use it. Also rename the functions
from _seq to _sn, they operate on the sequence number, not
the sequence_control field.

Also move macros to convert the sequence control to/from
the sequence number value from various drivers.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211: conditionally add back TCP WoWLAN information
Johannes Berg [Wed, 20 Feb 2013 00:02:38 +0000 (01:02 +0100)]
nl80211: conditionally add back TCP WoWLAN information

Add back the previously removed TCP WoWLAN information,
but only if userspace is prepared to deal with large
wiphy capability data dumps.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211: conditionally add back radar information
Johannes Berg [Mon, 18 Feb 2013 22:54:36 +0000 (23:54 +0100)]
nl80211: conditionally add back radar information

If userspace is updated to deal with large split wiphy
information dumps, add back the radar information that
could otherwise push the data over the limit of the
netlink dump messages.

Cc: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211: allow splitting wiphy information in dumps
Johannes Berg [Thu, 14 Feb 2013 15:19:38 +0000 (16:19 +0100)]
nl80211: allow splitting wiphy information in dumps

The per-wiphy information is getting large, to the point
where with more than the typical number of channels it's
too large and overflows, and userspace can't get any of
the information at all.

To address this (in a way that doesn't require making all
messages bigger) allow userspace to specify that it can
deal with wiphy information split across multiple parts
of the dump, and if it can split up the data. This also
splits up each channel separately so an arbitrary number
of channels can be supported.

Additionally, since GET_WIPHY has the same problem, add
support for filtering the wiphy dump and get information
for a single wiphy only, this allows userspace apps to
use dump in this case to retrieve all data from a single
device.

As userspace needs to know if all this this is supported,
add a global nl80211 feature set and include a bit for
this behaviour in it.

Cc: Dennis H Jensen <dennis.h.jensen@siemens.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: clarify alignment comment
Johannes Berg [Wed, 20 Feb 2013 20:44:12 +0000 (21:44 +0100)]
mac80211: clarify alignment comment

The comment says something about __skb_push(), but that
isn't even called in the code any more. Looking at the
git history, that comment never even made sense when it
was still called, so just replace that part to note it
still works even when align isn't 0 or 2.

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonet: rfkill: Fix sparse warning in rfkill-regulator.c
Sachin Kamat [Tue, 19 Feb 2013 09:57:48 +0000 (15:27 +0530)]
net: rfkill: Fix sparse warning in rfkill-regulator.c

'rfkill_regulator_ops' is used only in this file. Hence make it static.
Silences the following warning:
net/rfkill/rfkill-regulator.c:54:19: warning:
symbol 'rfkill_regulator_ops' was not declared. Should it be static?

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: comprehensively check station changes
Johannes Berg [Thu, 14 Feb 2013 23:48:33 +0000 (00:48 +0100)]
cfg80211: comprehensively check station changes

The station change API isn't being checked properly before
drivers are called, and as a result it is difficult to see
what should be allowed and what not.

In order to comprehensively check the API parameters parse
everything first, and then have the driver call a function
(cfg80211_check_station_change()) with the additionally
information about the kind of station that is being changed;
this allows the function to make better decisions than the
old code could.

While at it, also add a few checks, particularly in mesh
and clarify the TDLS station lifetime in documentation.

To be able to reduce a few checks, ignore any flag set bits
when the mask isn't set, they shouldn't be applied then.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: unify station WME parsing
Johannes Berg [Thu, 14 Feb 2013 23:09:01 +0000 (00:09 +0100)]
cfg80211: unify station WME parsing

Instead of copying the code, create a new function
to parse the station's WME information.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>