platform/adaptation/renesas_rcar/renesas_kernel.git
10 years agobrcmfmac: remove some unused definitions
Arend van Spriel [Fri, 29 Nov 2013 11:25:22 +0000 (12:25 +0100)]
brcmfmac: remove some unused definitions

Removing WLC_PHY_TYPE and some BRCMF_E_.* definitions as these
are not used in the driver sources.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: Use consistent naming for BCDC.
Hante Meuleman [Fri, 29 Nov 2013 11:25:21 +0000 (12:25 +0100)]
brcmfmac: Use consistent naming for BCDC.

The BCDC protocol layer is using a mix of naming of CDC, BDC and
BCDC. Use the name BCDC consistenly over all functions, defines
and variables. This patch does not change code functionality.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: move firmware command code definitions
Arend van Spriel [Fri, 29 Nov 2013 11:25:20 +0000 (12:25 +0100)]
brcmfmac: move firmware command code definitions

Move the command codes to the firmware interface module as
that makes a bit more sense.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: move firmware related structures to fwil_types.h
Arend van Spriel [Fri, 29 Nov 2013 11:25:19 +0000 (12:25 +0100)]
brcmfmac: move firmware related structures to fwil_types.h

The firmware control interface is provided by fwil source file, but
a number of structures used to communicate with the firmware still
resided in dhd.h. The patch moves them to fwil_types.h.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: remove unnecessary EXPORT_SYMBOL() usage
Arend van Spriel [Fri, 29 Nov 2013 11:25:18 +0000 (12:25 +0100)]
brcmfmac: remove unnecessary EXPORT_SYMBOL() usage

In bcmsdh.c the functions brcmf_sdio_probe() and brcmf_sdio_remove()
were exported, but that is not needed. The functions are linked into
the driver module, which is the only one needing to call these.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: provide firmware version in ethtool driver info
Arend van Spriel [Fri, 29 Nov 2013 11:25:17 +0000 (12:25 +0100)]
brcmfmac: provide firmware version in ethtool driver info

Knowing the firmware version is pretty useful information when
looking at issues. It is retrieved during initialization so
store it in driver data structure to fill the ethtool driver
info when requested.

Reviewed-by: Hante Meuleman <meuleman@brodcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: Dynamically register a protocol layer.
Hante Meuleman [Fri, 29 Nov 2013 11:25:16 +0000 (12:25 +0100)]
brcmfmac: Dynamically register a protocol layer.

BCDC is the default protocol layer and being called directly. This
patch installs the functions for this layer dynamically. This allows
new protocols to be added and selected dynamically depending on the
hw capabilties. As currently only BCDC is supported this is always
the installed protocol.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: remove redundant ioctl handlers
Arend van Spriel [Fri, 29 Nov 2013 11:25:15 +0000 (12:25 +0100)]
brcmfmac: remove redundant ioctl handlers

The ioctl() entry points were empty except for handling SIOC_ETHTOOL
but that has been obsoleted in favor of struct ethtool_ops. Cleaning
up removing the ioctl() handlers.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: use platform specific alignment in SDIO
Arend van Spriel [Fri, 29 Nov 2013 11:25:14 +0000 (12:25 +0100)]
brcmfmac: use platform specific alignment in SDIO

The SDIO part of the brcmfmac driver uses a static define BRCMF_SDALIGN
to align buffers used for SDIO transfers. This patch replaces it by
using alignment derived from the platform specific data.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: determine alignment values during probe
Arend van Spriel [Fri, 29 Nov 2013 11:25:13 +0000 (12:25 +0100)]
brcmfmac: determine alignment values during probe

The alignment values were being determined for each transmit
and receive depending on platform data. Instead determine
these once during the probe.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: removed dhd_proto.h.
Hante Meuleman [Fri, 29 Nov 2013 11:25:12 +0000 (12:25 +0100)]
brcmfmac: removed dhd_proto.h.

dhd_proto.h was cleaned up and prototypes were moved to dhd.h.
dhd_proto.h was removed. This is a step in cleaning and
restucturing protocol 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: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: rename dhd_cdc to bcdc
Hante Meuleman [Fri, 29 Nov 2013 11:46:29 +0000 (12:46 +0100)]
brcmfmac: rename dhd_cdc to bcdc

dhd_cdc is renamed to bcdc. This is a step in cleaning and
restructuring protocol layer. This is done so new protocols can
be added in the future. This step only renames the source files.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
[arend@broadcom.com: use 'git mv' to do the rename]
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: add host tx glomming support
Franky Lin [Fri, 29 Nov 2013 11:25:10 +0000 (12:25 +0100)]
brcmfmac: add host tx glomming support

New WiFi full dongle supports receiving chained packets in one command
through the SDIO bus. This patch adds the support on the host side to
send chained packets.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: add firmware and nvram file name for bcm4339
Franky Lin [Fri, 29 Nov 2013 11:25:09 +0000 (12:25 +0100)]
brcmfmac: add firmware and nvram file name for bcm4339

Add firmware/nvram file name for bcm4339 so fmac can actually be functional with
the chip.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: fix driver build issue when CONFIG_BRCMDBG is not set
Arend van Spriel [Fri, 29 Nov 2013 11:25:08 +0000 (12:25 +0100)]
brcmfmac: fix driver build issue when CONFIG_BRCMDBG is not set

When CONFIG_BRCMDBG is not set we get the following build issue:
  CC [M]  drivers/net/wireless/brcm80211/brcmfmac/fwsignal.o
drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c:
    In function ‘brcmf_fws_hdrpush’:
drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c:852:18:
error: ‘BRCMF_FWS_TYPE_SEQ_LEN’ undeclared

The define BRCMF_FWS_TYPE_SEQ_LEN was introduced by:

    commit 6918f38e4ed4e0493a90a4331e0033bdfc806e00
    Author: Hante Meuleman <meuleman@broadcom.com>
    Date:   Wed Oct 23 14:58:51 2013 +0200

        brcmfmac: Update fwsignal to fix out of order tx.

Unfortunately, it was put in conditional part of the source
file under #ifdef DEBUG.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: determine sd host controller related variable earlier
Arend van Spriel [Fri, 29 Nov 2013 11:25:07 +0000 (12:25 +0100)]
brcmfmac: determine sd host controller related variable earlier

The commit "eb9c174 brcmfmac: determine host controller related
variables during probe" was not implemented correctly as the
information is already needed in brcmf_sdbrcm_probe(). This patch
moves it to brcmf_sdioh_attach() instead.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: support hardware extension header in trace_brcmf_sdpcm_hdr()
Arend van Spriel [Fri, 29 Nov 2013 11:25:06 +0000 (12:25 +0100)]
brcmfmac: support hardware extension header in trace_brcmf_sdpcm_hdr()

The SDPCM header can be traced, but it used a fixed header size. With
txglom feature the SDPCM header will have additional 8 bytes of hardware
extension header so SDIO core can properly handle the txglom packet.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmsmac: select CONFIG_BCMA when possible
Arend van Spriel [Fri, 29 Nov 2013 10:48:19 +0000 (11:48 +0100)]
brcmsmac: select CONFIG_BCMA when possible

The brcmsmac relies BCMA functionality to access the device. This
patch selects CONFIG_BCMA when CONFIG_BCMA_POSSIBLE is set. This
way the user does not need to be select BCMA to make the brcmsmac
driver show up in his menuconfig.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: reduce logging noise accessing SDIO SleepCSR register
Arend van Spriel [Fri, 29 Nov 2013 10:48:18 +0000 (11:48 +0100)]
brcmfmac: reduce logging noise accessing SDIO SleepCSR register

The SleepCSR register is accessed to wakeup the device from the
host side. Depending on the state of the device this may take
multiple attempts. The failed attempt are not real failures so
reduce the log level specifically for this register. The calling
function will scream when the multiple attempts all failed.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: remove empty brcmf_proto_stop
Franky Lin [Fri, 29 Nov 2013 10:48:17 +0000 (11:48 +0100)]
brcmfmac: remove empty brcmf_proto_stop

remove empty brcmf_proto_stop from protocol layer

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: start netif queues only when setup is completed successful
Arend van Spriel [Fri, 29 Nov 2013 10:48:16 +0000 (11:48 +0100)]
brcmfmac: start netif queues only when setup is completed successful

Moving the call to netif_start_queue() after brcmf_cfg80211_up() is
completed successful. If not return -EIO instead of -1 as that results
in 'Operation not permitted' which can put user on wrong track.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: replace dongle command list with .preinit() callback
Arend van Spriel [Fri, 29 Nov 2013 10:48:15 +0000 (11:48 +0100)]
brcmfmac: replace dongle command list with .preinit() callback

The bus-specific interface allowed a list of dongle commands to be
provided to the common driver part. However, upcoming functionality
requires a more dynamic behaviour. Hence the list is replaced
by a new callback function so the bus-specific driver part can
implement this behaviour.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: add separate function for passing bus tx overhead
Arend van Spriel [Fri, 29 Nov 2013 10:48:14 +0000 (11:48 +0100)]
brcmfmac: add separate function for passing bus tx overhead

The common driver needs the packet overhead for the bus in order
to reserve headroom for sk_buffs. For the SDIO driver this depends
on firmware features so it is not possible to provide it in the
brcmf_attach() call.

Reviewed-by: Franky Lin <frankyl@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>
10 years agobrcmfmac: Update fwsignal to fix out of order tx.
Hante Meuleman [Fri, 29 Nov 2013 10:48:13 +0000 (11:48 +0100)]
brcmfmac: Update fwsignal to fix out of order tx.

When using fwsignal it is possible that tx packets get delivered out
of order. This patch fixes that by reordering suppressed packets and
tracking generation bit and sequence number per packet.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix initvals for freq 2484
Sujith Manoharan [Mon, 2 Dec 2013 04:26:31 +0000 (09:56 +0530)]
ath9k: Fix initvals for freq 2484

This is missing for AR9300, AR9580 and AR9340.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Update AR9340 initvals
Sujith Manoharan [Mon, 2 Dec 2013 03:57:24 +0000 (09:27 +0530)]
ath9k: Update AR9340 initvals

* Baseband updates
* Remove ar9340Common_rx_gain_table_1p0 since it is a duplicate.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Update initvals for AR9580 v1.0
Sujith Manoharan [Tue, 26 Nov 2013 16:30:29 +0000 (22:00 +0530)]
ath9k: Update initvals for AR9580 v1.0

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Update initvals for AR9300 v2.2
Sujith Manoharan [Wed, 27 Nov 2013 07:40:46 +0000 (13:10 +0530)]
ath9k: Update initvals for AR9300 v2.2

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Remove duplicate initvals for AR9462 v2.1
Sujith Manoharan [Tue, 26 Nov 2013 09:34:55 +0000 (15:04 +0530)]
ath9k: Remove duplicate initvals for AR9462 v2.1

The initvals for AR9462 v2.1 are very similar to v2.0.
Identify duplicate arrays and reuse the values from v2.0
to reduce module size.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Attach INI arrays for AR9565 v1.1
Sujith Manoharan [Tue, 19 Nov 2013 06:41:13 +0000 (12:11 +0530)]
ath9k: Attach INI arrays for AR9565 v1.1

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add version macros for AR9565 1.1
Sujith Manoharan [Tue, 19 Nov 2013 06:36:08 +0000 (12:06 +0530)]
ath9k: Add version macros for AR9565 1.1

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add initvals for AR9565 1.1
Sujith Manoharan [Tue, 19 Nov 2013 06:31:09 +0000 (12:01 +0530)]
ath9k: Add initvals for AR9565 1.1

The initialization arrays for v1.1 AR9565
are mostly the same as v1.0/v1.0.1 except for
radio_postamble.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Cleanup IQ calibration for PCOEM chips
Sujith Manoharan [Tue, 19 Nov 2013 03:45:01 +0000 (09:15 +0530)]
ath9k: Cleanup IQ calibration for PCOEM chips

Since IQ calibration is done as part of AGC calibration for
AR9485 and above, remove the seperate IQ calibration code.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_hw: allow fast channel change when only CHANNEL_HT changes
Felix Fietkau [Mon, 18 Nov 2013 19:14:44 +0000 (20:14 +0100)]
ath9k_hw: allow fast channel change when only CHANNEL_HT changes

The CHANNEL_HT flag is insignificant for fast channel change conditions,
since it does not affect any important part of the hardware reset /
channel setup.
Scanning usually runs with HT disabled, so this change will slightly
improve scan time on many chipsets.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_hw: fix TSF save/restore around chip reset
Felix Fietkau [Mon, 18 Nov 2013 19:14:43 +0000 (20:14 +0100)]
ath9k_hw: fix TSF save/restore around chip reset

A cold reset can be triggered because of DMA stop issues, and this leads
to TSF being cleared on all chipsets. To properly deal with this, always
save the TSF.
Additionally, account for the time it takes to do the actual chip reset,
which can be quite significant. On AR9344 it takes around 4.5 ms.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: optimize ath9k_flush
Felix Fietkau [Mon, 11 Nov 2013 21:23:35 +0000 (22:23 +0100)]
ath9k: optimize ath9k_flush

Instead of checking the queues in a loop with hardcoded sleep times
inbetween, use a wait queue to trigger queue checks after the tx
processing tasklet has run.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: optimize ath_drain_all_txq
Felix Fietkau [Mon, 11 Nov 2013 21:23:34 +0000 (22:23 +0100)]
ath9k: optimize ath_drain_all_txq

If the software has processed all packets, checking the hardware queue
is unnecessary.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: use a timer to put hardware into full sleep
Felix Fietkau [Mon, 11 Nov 2013 21:23:33 +0000 (22:23 +0100)]
ath9k: use a timer to put hardware into full sleep

When operating in client mode, the short period of time between scanning
and associating is often enough to put the hardware through several
FULL-SLEEP <-> AWAKE transitions, each wakeup requiring a reset to fully
recover the hardware.
This is completely unnecessary and can easily be avoided by deferring
the switch to full sleep.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix TX IQ calibration for SoC chips
Sujith Manoharan [Fri, 15 Nov 2013 09:19:32 +0000 (14:49 +0530)]
ath9k: Fix TX IQ calibration for SoC chips

Since calibration data reuse is not enabled in
SoC chips, simplify the IQ calibration code.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix Carrier Leak calibration for SoC chips
Sujith Manoharan [Fri, 15 Nov 2013 07:35:18 +0000 (13:05 +0530)]
ath9k: Fix Carrier Leak calibration for SoC chips

CL calibration is applicable for all chips and the
enable/disable knob comes via the INI file. For PCOEM
chips, the calibration data is reused when Fast Channel Change
is used. Caldata reuse is not enabled for SoC chips, so remove
the CL post processing code.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Remove unnecessary check
Sujith Manoharan [Fri, 15 Nov 2013 05:35:38 +0000 (11:05 +0530)]
ath9k: Remove unnecessary check

TX IQ calibration is always enabled for SoC chips.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Remove RTT/MCI code from SoC calibration
Sujith Manoharan [Fri, 15 Nov 2013 05:20:58 +0000 (10:50 +0530)]
ath9k: Remove RTT/MCI code from SoC calibration

RTT is enabled only for AR9462 and MCI for AR9462/AR9565.
Also, manual peak calibration is not done for any of the
SoC chips.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Separate routines for PCOEM and SoC calibration
Sujith Manoharan [Fri, 15 Nov 2013 05:16:21 +0000 (10:46 +0530)]
ath9k: Separate routines for PCOEM and SoC calibration

Though there is some overlap between the calibration mechanisms
of PC-OEM cards and SoC chip families, dumping both of them
into a single function makes things hard to understand.

ar9003_hw_init_cal() is unreadable with chip-specific segments
scattered around. To make the logic understandable, use
different functions for client cards and SoC chips. Some
code is duplicated, but in the long run, it makes the code
more maintanable.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: fix SC_OP_INVALID test in ath9k_tx99_init()
Dan Carpenter [Thu, 14 Nov 2013 10:01:18 +0000 (15:31 +0530)]
ath9k: fix SC_OP_INVALID test in ath9k_tx99_init()

SC_OP_INVALID is zero so the test is always false.  We're supposed to be
testing the lowest bit instead.

Fixes: 89f927af7f33 ('ath9k: add TX99 support')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Update MAINTAINERS
Sujith Manoharan [Wed, 6 Nov 2013 05:13:27 +0000 (10:43 +0530)]
ath9k: Update MAINTAINERS

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Apply CUS227 specific TX gain values
Sujith Manoharan [Tue, 5 Nov 2013 00:24:59 +0000 (05:54 +0530)]
ath9k: Apply CUS227 specific TX gain values

CUS227, which is an AR9340 based card used in Qualcomm's
Allplay platforms requires a custom TX gain array, based
on the index 7. Add suport for this.

Cc: Michael Larson <mlarson@qce.qualcomm.com>
Cc: Stephen Collmeyer <scollmey@qce.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Remove pcieSerDesWrite
Sujith Manoharan [Tue, 29 Oct 2013 06:22:06 +0000 (11:52 +0530)]
ath9k: Remove pcieSerDesWrite

This HW config option is always set to true and is not needed.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Remove unused AR9462 2.0 initvals
Sujith Manoharan [Tue, 29 Oct 2013 06:10:06 +0000 (11:40 +0530)]
ath9k: Remove unused AR9462 2.0 initvals

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add SERDES initvals for AR9462 2.1
Sujith Manoharan [Tue, 29 Oct 2013 06:05:31 +0000 (11:35 +0530)]
ath9k: Add SERDES initvals for AR9462 2.1

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add an initialization routine for WoW
Sujith Manoharan [Mon, 28 Oct 2013 07:31:28 +0000 (13:01 +0530)]
ath9k: Add an initialization routine for WoW

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Use CONFIG_ATH9K_WOW
Sujith Manoharan [Mon, 28 Oct 2013 06:52:04 +0000 (12:22 +0530)]
ath9k: Use CONFIG_ATH9K_WOW

Move the WoW code to wow.c and compile it conditionally
based on CONFIG_ATH9K_WOW.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add a config option for WoW
Sujith Manoharan [Mon, 28 Oct 2013 06:03:19 +0000 (11:33 +0530)]
ath9k: Add a config option for WoW

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix wow.c compilation
Sujith Manoharan [Mon, 28 Oct 2013 06:17:43 +0000 (11:47 +0530)]
ath9k: Fix wow.c compilation

The HW routines to set various WoW registers are present
in wow.c. For some reason, it has been compiled as part
of the main ath9k.ko module all this time, when it should
really be part of ath9k_hw.ko. This patch renames the file to
ar9003_wow.ko and adds it to ath9k_hw.ko.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix TX99 config option usage
Sujith Manoharan [Thu, 24 Oct 2013 06:34:39 +0000 (12:04 +0530)]
ath9k: Fix TX99 config option usage

Use CONFIG_ATH9K_TX99 to properly enclose the tx99 code
and make sure that it is not compiled as part of the driver
when it is not selected. Move the tx99 code to a new file tx99.c
and also add ATH9K_DEBUGFS as a dependency in Kconfig.

This reduces the module size on platforms like OpenWrt where
ATH9K_DEBUGFS is selected, but TX99 might be disabled.

Cc: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Identify Killer Wireless cards
Sujith Manoharan [Wed, 23 Oct 2013 08:56:04 +0000 (14:26 +0530)]
ath9k: Identify Killer Wireless cards

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add WB335 PCI IDs
Sujith Manoharan [Wed, 23 Oct 2013 08:23:28 +0000 (13:53 +0530)]
ath9k: Add WB335 PCI IDs

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
John W. Linville [Mon, 2 Dec 2013 18:20:03 +0000 (13:20 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/jberg/mac80211

10 years agobrcmfmac: fix uninitialized warning
Arend van Spriel [Fri, 29 Nov 2013 22:00:31 +0000 (23:00 +0100)]
brcmfmac: fix uninitialized warning

Building brcmfmac for sparc64 gave the following warning:

  CC [M]  drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.o
    bcmsdh_sdmmc.c: In function 'brcmf_sdioh_request_byte':
     bcmsdh_sdmmc.c:89:6: warning: 'err_ret' may be used uninitialized
                          in this function [-Wuninitialized]

Inspecting the code it indeed had a path of execution in
which the return value was used uninitialized. This patch
fixes that code path.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agonet: wireless: wcn36xx: fix potential NULL pointer dereference
Michal Nazarewicz [Mon, 2 Dec 2013 13:09:34 +0000 (14:09 +0100)]
net: wireless: wcn36xx: fix potential NULL pointer dereference

If kmalloc fails wcn36xx_smd_rsp_process will attempt to dereference
a NULL pointer.  There might be a better error recovery then just
printing an error, but printing an error message is better then the
current behaviour.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agonet: wireless: ath9k: avoid possible NULL pointer dereference
Michal Nazarewicz [Fri, 29 Nov 2013 17:06:46 +0000 (18:06 +0100)]
net: wireless: ath9k: avoid possible NULL pointer dereference

Code in ath9k_hw_set_clockrate function indicates that ah->curchan
(and thus chan local variable) may be NULL.  If that is indeed the
case, IS_CHAN_HT40(chan) check has to be performed only in branch
where chan is not NULL.  Moving the code under already existing
if condition fixes this issue.

Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix XLNA bias strength
Sujith Manoharan [Tue, 26 Nov 2013 01:51:39 +0000 (07:21 +0530)]
ath9k: Fix XLNA bias strength

The EEPROM parameter to determine whether the bias
strength values for XLNA have to be applied is part
of the miscConfiguration field and not featureEnable.

Cc: stable@vger.kernel.org
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix QuickDrop usage
Sujith Manoharan [Tue, 26 Nov 2013 01:51:08 +0000 (07:21 +0530)]
ath9k: Fix QuickDrop usage

Bit 5 in the miscConfiguration field of the base EEPROM
header denotes whether QuickDrop is enabled or not. Fix
the incorrect usage of BIT(1) and also make sure that
this is done only for the required chips.

Cc: stable@vger.kernel.org
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwif...
John W. Linville [Mon, 2 Dec 2013 17:57:23 +0000 (12:57 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/iwlwifi/iwlwifi-fixes

10 years agomac80211: fix rx_nss calculation for drivers with hw rc
Michal Kazior [Mon, 2 Dec 2013 10:54:07 +0000 (11:54 +0100)]
mac80211: fix rx_nss calculation for drivers with hw rc

Drivers with hardware rate control were given
sta->rx_nss set to 0. This was because rx_nss
calculation procedure was protected by hw/sw rate
control check.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: check csa wiphy flag in ibss before switching
Simon Wunderlich [Tue, 26 Nov 2013 15:45:18 +0000 (16:45 +0100)]
mac80211: check csa wiphy flag in ibss before switching

When external CSA IEs are received (beacons or action messages), a
channel switch is triggered as well. This should only be allowed on
devices which actually support channel switches, otherwise disconnect.
(For the corresponding userspace invocation, the wiphy flag is checked
in nl80211).

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: disable CSA for all drivers
Simon Wunderlich [Tue, 26 Nov 2013 15:07:26 +0000 (16:07 +0100)]
cfg80211: disable CSA for all drivers

The channel switch announcement code has some major locking problems
which can cause a deadlock in worst case. A series of fixes has been
proposed, but these are non-trivial and need to be tested first.
Therefore disable CSA completely for 3.13.

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: don't leak next beacon when csa is aborted
Simon Wunderlich [Thu, 21 Nov 2013 17:19:53 +0000 (18:19 +0100)]
mac80211: don't leak next beacon when csa is aborted

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: don't cancel csa finalize work within stop_ap
Simon Wunderlich [Thu, 21 Nov 2013 17:19:52 +0000 (18:19 +0100)]
mac80211: don't cancel csa finalize work within stop_ap

The current channel switch code has a potential deadlock:
1) * cfg80211_stop_ap acquires wdev-lock
   * ieee80211_stop_ap calls cancel_work_sync for the csa_finalize_work,
     which acquires the associated worker-lock
2) * ieee80211_csa_finalize_work holds the worker-lock when run
   * it calls cfg80211_ch_switch_notify which will claim the wdev-lock,
     and also needs to claim the sdata-lock (which is the same as the
     wdev-lock) to modify the beacons.

It is sufficient to just set the channel switch active to false. If the
worker is running later, it will find the channel switch to not be
active anymore and returns immediately without changing anything.

Canceling the worker is done anyway when the interface goes down
(ieee80211_do_stop).

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211/mac80211/ath6kl: acquire wdev lock outside ch_switch_notify
Simon Wunderlich [Thu, 21 Nov 2013 17:19:51 +0000 (18:19 +0100)]
cfg80211/mac80211/ath6kl: acquire wdev lock outside ch_switch_notify

The channel switch notification should be sent under the
wdev/sdata-lock, preferably in the same moment as the channel change
happens, to avoid races by other callers (e.g. start/stop_ap).
This also adds the previously missing sdata_lock protection in
csa_finalize_work.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: modify beacon using sdata/wdev-lock, not rtnl lock
Simon Wunderlich [Thu, 21 Nov 2013 17:19:50 +0000 (18:19 +0100)]
mac80211: modify beacon using sdata/wdev-lock, not rtnl lock

The csa finalize worker needs to change the beacon information (for
different modes). These are normally protected under rtnl lock, but the
csa finalize worker is called by drivers and should not acquire the RTNL
lock. Therefore change access protection for beacons to sdata/wdev lock.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
[fix sdata_dereference]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: protect beacon changing functions with wdev-lock
Simon Wunderlich [Thu, 21 Nov 2013 17:19:49 +0000 (18:19 +0100)]
cfg80211: protect beacon changing functions with wdev-lock

To avoid race conditions in functions which modify the beacon
information, lock these using the wdev lock. This is especially required
to avoid problems for csa handling functions which modify beacons but
can not be called under rtnl lock.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: mesh: only get tsf if we need it
Bob Copeland [Mon, 18 Nov 2013 22:25:28 +0000 (17:25 -0500)]
mac80211: mesh: only get tsf if we need it

The local TSF timer is used to compute the timing offset between
mesh peers on beacon reception.  However, asking the device for
the TSF is not very accurate, so we prefer to use rx->mactime
if available.  In the latter case, calling drv_get_tsf() just
adds more delay into the RX path, so skip it if we can.

Signed-off-by: Bob Copeland <bob@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: aggregate mgmt_tx parameters into a struct
Andrei Otcheretianski [Mon, 18 Nov 2013 17:06:49 +0000 (19:06 +0200)]
cfg80211: aggregate mgmt_tx parameters into a struct

Change cfg80211 and mac80211 to use cfg80211_mgmt_tx_params
struct to aggregate parameters for mgmt_tx functions.
This makes the functions' signatures less clumsy and allows
less painful parameters extension.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
[fix all other drivers]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: update ht flag if bss configuration changed
Avri Altman [Mon, 18 Nov 2013 17:06:48 +0000 (19:06 +0200)]
mac80211: update ht flag if bss configuration changed

There's a bug in tracking HT opmode changes in mac80211, it
fails to update the driver when the channel parameters don't
change.

Move the code to do the HT opmode checking independently of
the channel/bandwidth tracking.

Signed-off-by: Avri Altman <avri.altman@intel.com>
[edit commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: remove sta_info_flush() from interface teardown
Johannes Berg [Mon, 18 Nov 2013 17:06:47 +0000 (19:06 +0200)]
mac80211: remove sta_info_flush() from interface teardown

All interface types now properly clean up their stations
using some form of sta_info_flush() themselves, so there's
no need to try it again at teardown. Remove the call to
get rid of the extra delay from the synchronize_net() and
rcu_barrier() calls.

Reported-by: Moshe Benji <moshe.benji@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: Tx frame latency statistics
Matti Gottlieb [Mon, 18 Nov 2013 17:06:45 +0000 (19:06 +0200)]
mac80211: Tx frame latency statistics

Measure TX latency and jitter statistics per station per TID.
These Measurements are disabled by default and can be enabled
via debugfs.

Features included for each station's TID:

1. Keep count of the maximum and average latency of Tx frames.
2. Keep track of many frames arrived in a specific time range
   (need to enable through debugfs and configure the bins ranges)

Signed-off-by: Matti Gottlieb <matti.gottlieb@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: use CLOCK_MONOTONIC_RAW
Johannes Berg [Mon, 18 Nov 2013 16:23:26 +0000 (17:23 +0100)]
mac80211_hwsim: use CLOCK_MONOTONIC_RAW

The beacon timers really shouldn't use any clock that is
subject to adjustments from userspace, particularly not
CLOCK_REALTIME. Use CLOCK_MONOTONIC_RAW instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: fix reporting 5/10 MHz support to user space
Felix Fietkau [Sat, 9 Nov 2013 13:57:54 +0000 (14:57 +0100)]
cfg80211: fix reporting 5/10 MHz support to user space

nla_put_flag needs a real nl80211 attribute id, not a wiphy flag bit.
While at it, split 5 and 10 MHz capability flags in case we ever need
to support hardware that can only do one of the two.

Also move the flag settings to the split-only information so we don't
increase the space needed for old userspace.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
[change location of flag setting]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: use a cast to calculate the last seqno from the next one
Luciano Coelho [Tue, 19 Nov 2013 14:05:56 +0000 (16:05 +0200)]
iwlwifi: mvm: use a cast to calculate the last seqno from the next one

If the next seqno returned by the firmware is 0, we return an error
(-16) in the iwl_mvm_get_last_nonqos_seq() function.  This is because
we return an integer and don't use any casting when calculating the
last seqno from the one we received.  Fix this by using a cast to u16
when doing the calculation, so we return 0xfff0, as we should.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: set seqno also when no keys are set
Luciano Coelho [Tue, 19 Nov 2013 13:38:55 +0000 (15:38 +0200)]
iwlwifi: mvm: set seqno also when no keys are set

In an open BSS, after suspend/resume, we don't set the last seqno
because the iwl_mvm_setup_connection_keep() returns too early.  This
happens because the check to see if we have any keys was returning
immediately, without setting seqno and seqno_valid.  Fix this.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: stop sending commands to dead firmware
Alexander Bondar [Tue, 5 Nov 2013 15:35:14 +0000 (17:35 +0200)]
iwlwifi: pcie: stop sending commands to dead firmware

If we call ieee80211_hw_restart, it means that the
firmware is in bad condition and will be reset soon.
Since the firmware will be reset, there is no good
reason to keep sending host commands.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: bump required firmware API version for 3160/7260
Emmanuel Grumbach [Tue, 19 Nov 2013 20:23:13 +0000 (22:23 +0200)]
iwlwifi: bump required firmware API version for 3160/7260

A new firmware is coming out soon with new APIs.
To make sure that this new firmware won't be loaded on old
driver that don't support it, it's API version has been
updated to 8. In order to be able to load it, bump the API
version to 8.
API version 7 is still supported and will be for another
year or so.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: don't WARN about unsuccessful time event
Emmanuel Grumbach [Tue, 5 Nov 2013 14:27:59 +0000 (16:27 +0200)]
iwlwifi: mvm: don't WARN about unsuccessful time event

Time event notification can have a failure status even if
the time event was scheduled:
* in START notification, this can happen if the time event
  was scheduled later than the requested apply time.
* in STOP notification, this can happen if the time event
  is truncated.

Even if both happened, the offchannel packets sent during
the remain on channel are very likely to have been sent.
Hence, don't WARN when this happens, but rather print a
discrete line in the kernel log.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: BT Coex fix another NULL pointer dereference
Emmanuel Grumbach [Mon, 21 Oct 2013 08:03:53 +0000 (11:03 +0300)]
iwlwifi: mvm: BT Coex fix another NULL pointer dereference

This patch is very similar to a previous fix: 22cba0c0852f

When we disassociate, mac80211 removes the station and
then, it sets the bss it unsets the assoc bool in bss_info.

Since the firwmware wants it the opposite (first set the
MAC context as unassoc, and only then, remove the STA of
the API), we have a small period of time in which the STA
in firmware doesn't have a valid ieee80211_sta pointer.
During that time, iwl_mvm_vif->ap_sta_id, is still set
to the STA in firmware that represent the AP.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: BT Coex - don't enable MULTI_PRIO_LUT
Emmanuel Grumbach [Wed, 13 Nov 2013 12:57:36 +0000 (14:57 +0200)]
iwlwifi: mvm: BT Coex - don't enable MULTI_PRIO_LUT

This feature isn't supported by the firmware (yet).
Note that settingt he values to BT_CFG_CMD is harmless if
the validity bit is clear - so keep the configuration
values in BT_CFG_CMD, but clear the validity bit until thes
feature is enabled in the firmware.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: add new HW - 7265 series
Oren Givon [Tue, 19 Nov 2013 01:48:19 +0000 (03:48 +0200)]
iwlwifi: add new HW - 7265 series

Add new HW IDs and configurations for 7265 series.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: fix interrupt coalescing for 7260 / 3160
Emmanuel Grumbach [Mon, 11 Nov 2013 13:23:01 +0000 (15:23 +0200)]
iwlwifi: pcie: fix interrupt coalescing for 7260 / 3160

We changed the timeout for the interrupt coealescing for
calibration, but that wasn't effective since we changed
that value back before loading the firmware. Since
calibrations are notification from firmware and not Rx
packets, this doesn't change anyway - the firmware will
fire an interrupt straight away regardless of the interrupt
coalescing value.
Also, a HW issue has been discovered in 7000 devices series.
The work around is to disable the new interrupt coalescing
timeout feature - do this by setting bit 31 in
CSR_INT_COALESCING.
This has been fixed in 7265 which means that we can't rely
on the device family and must have a hint in the iwl_cfg
structure.

Cc: stable@vger.kernel.org [3.10+]
Fixes: 99cd47142399 ("iwlwifi: add 7000 series device configuration")
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: check sta_id/drain values in debugfs
Johannes Berg [Fri, 25 Oct 2013 11:06:06 +0000 (13:06 +0200)]
iwlwifi: mvm: check sta_id/drain values in debugfs

The station ID must be valid, if it's out of range then
the array access may crash. Validate the station ID to
the array length, and also validate the drain value even
if that doesn't matter all that much.

Cc: stable@vger.kernel.org
Fixes: 8ca151b568b6 ("iwlwifi: add the MVM driver")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
John W. Linville [Mon, 25 Nov 2013 20:47:18 +0000 (15:47 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/jberg/mac80211

10 years agomwifiex: fix memory leak issue for ibss join
Ujjal Roy [Thu, 21 Nov 2013 19:08:56 +0000 (11:08 -0800)]
mwifiex: fix memory leak issue for ibss join

For IBSS join if the requested SSID matches current SSID,
it returns without freeing the allocated beacon IE buffer.

Cc: <stable@vger.kernel.org> # 3.10+
Signed-off-by: Ujjal Roy <royujjal@gmail.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmsmac: Fix build dep on LEDS_CLASS
Borislav Petkov [Tue, 19 Nov 2013 10:36:42 +0000 (11:36 +0100)]
brcmsmac: Fix build dep on LEDS_CLASS

When building randconfigs with CONFIG_BCMA_DRIVER_GPIO=y, I get

drivers/built-in.o: In function `brcms_led_unregister':
(.text+0x351aca): undefined reference to `led_classdev_unregister'
drivers/built-in.o: In function `brcms_led_register':
(.text+0x351c65): undefined reference to `led_classdev_register'

during final linking stage because brcmsmac/led.c needs LEDS_CLASS for
registering/deregistering the led device. Select the required symbols.

Cc: Arend van Spriel <arend@broadcom.com>
Cc: "Rafał Miłecki" <zajec5@gmail.com>
Cc: <linux-wireless@vger.kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomac80211: minstrel_ht: do not sample unsupported rates
Karl Beldan [Mon, 11 Nov 2013 12:10:49 +0000 (13:10 +0100)]
mac80211: minstrel_ht: do not sample unsupported rates

ATM minstrel_ht does not check whether a sampling rate is supported.
Unsupported rates attempts can trigger when there are holes in bitfields
of supported MCSes belonging to the same group (e.g many devices are
MCS32 capable without MCS33->39 capable, also we systematically have a
hole for CCK rates).
Drop any attempts to sample unsupported rates, as suggested by Felix.

This is not a problem in minstrel which fills a per STA sample table
with only supported rates (though only at init).

Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: replace print_dfs_region() with reg_dfs_region_str() helper
Luis R. Rodriguez [Wed, 13 Nov 2013 17:54:05 +0000 (18:54 +0100)]
cfg80211: replace print_dfs_region() with reg_dfs_region_str() helper

This lets us later reuse the more generic reg_dfs_region_str().

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: distinguish unset DFS region from unknown
Luis R. Rodriguez [Wed, 13 Nov 2013 17:54:04 +0000 (18:54 +0100)]
cfg80211: distinguish unset DFS region from unknown

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: intersection dfs regions when intersecting regdomains
Luis R. Rodriguez [Wed, 13 Nov 2013 17:54:03 +0000 (18:54 +0100)]
cfg80211: intersection dfs regions when intersecting regdomains

Only allow DFS to be set if the DFS regions agree.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: use enum nl80211_dfs_regions for dfs_region everywhere
Luis R. Rodriguez [Wed, 13 Nov 2013 17:54:02 +0000 (18:54 +0100)]
cfg80211: use enum nl80211_dfs_regions for dfs_region everywhere

u8 was used in some other places, just stick to the enum,
this forces us to express the values that are expected.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: minstrels: spare numerous useless calls to get_random_bytes
Karl Beldan [Wed, 13 Nov 2013 09:54:19 +0000 (10:54 +0100)]
mac80211: minstrels: spare numerous useless calls to get_random_bytes

ATM, only the first array value returned by get_random_bytes is used.
This change moves the call to get_random_bytes from the nested loop it
is in to its parent.
While at it, replace get_random_bytes with prandom_bytes since PRNs are
way enough for the selection process.
After this, minstrel_ht reclaims 80 PR-bytes instead of 640 R-bytes.

minstrels use sample tables to probe different rates in a randomized
manner.
minstrel_ht inits one single sample table upon registration (during
subsys_initcalls) and minstrel uses one per STA addition in minstrel.

Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: minstrel_ht: replace some occurences of MCS_GROUP_RATES
Karl Beldan [Mon, 11 Nov 2013 12:12:55 +0000 (13:12 +0100)]
mac80211: minstrel_ht: replace some occurences of MCS_GROUP_RATES

Consecutive MCSes in [8*(NSS-1)->8*NSS[ have the same number NSS of
streams (except for MCS32 which is mishandled ATM).
ATM minstrel_ht uses MCS_GROUP_RATES in place of this 8 modulus.
This change replaces such occurences and by doing so allows for different
values of MCS_GROUP_RATES (e.g to cope with VHT MCS8,9).

Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: add min required channel definition field
Eliad Peller [Mon, 11 Nov 2013 18:14:01 +0000 (20:14 +0200)]
mac80211: add min required channel definition field

Add a new field to ieee80211_chanctx_conf to indicate
the min required channel configuration.

Tuning to a narrower channel might help reducing
the noise level and saving some power.

The min required channel definition is the max of
all min required channel definitions of the interfaces
bound to this channel context.

In AP mode, use 20MHz when there are no connected station.
When a new station is added/removed, calculate the new max
bandwidth supported by any of the stations (e.g. 80MHz when
80MHz and 40MHz stations are connected).

In other cases, simply use bss_conf.chandef as the
min required chandef.

Notify drivers about changes to this field by calling
drv_change_chanctx with a new CHANGE_MIN_WIDTH notification.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: enable easier manipulation of VHT beamforming caps
Eyal Shapira [Mon, 11 Nov 2013 18:14:00 +0000 (20:14 +0200)]
mac80211: enable easier manipulation of VHT beamforming caps

Introduce shift and mask defines for beamformee STS cap and number
of sounding dimensions cap as these can take any 3 bit value.
While at it also cleanup an unrequired parenthesis.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>