linux-drm-fsl-dcu.git
10 years agoath9k: Fix RX interrupt mitigation
Sujith Manoharan [Thu, 23 Jan 2014 02:50:30 +0000 (08:20 +0530)]
ath9k: Fix RX interrupt mitigation

The threshold values for RX interrupt mitigation
are different for AR9003 and AR9002 families.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800usb: mark D-Link DWA-137 as supported
Roman Dubtsov [Tue, 21 Jan 2014 07:49:18 +0000 (14:49 +0700)]
rt2x00: rt2800usb: mark D-Link DWA-137 as supported

Signed-off-by: Roman Dubtsov <dubtsov@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix code mistake
Sujith Manoharan [Mon, 20 Jan 2014 07:55:28 +0000 (13:25 +0530)]
ath9k: Fix code mistake

The commit "ath9k: Process GTT interrupts" accidentally
had a line that was commented out.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agob43: fix the wrong assignment of status.freq in b43_rx()
ZHAO Gang [Fri, 17 Jan 2014 16:17:38 +0000 (00:17 +0800)]
b43: fix the wrong assignment of status.freq in b43_rx()

Use the right function to update frequency value.

If rx skb is probe response or beacon, the wrong frequency value can
cause problem that bss info can't be updated when it should be.

Cc: <stable@vger.kernel.org>
Fixes: 8318d78a44d4 ("cfg80211 API for channels/bitrates, mac80211
and driver conversion")
Signed-off-by: ZHAO Gang <gamerh2o@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: fix wakeup on magic packet
Andreas Fenkart [Fri, 17 Jan 2014 14:26:20 +0000 (15:26 +0100)]
mwifiex: fix wakeup on magic packet

 8 bytes preamble
14 bytes src/dst/eth_type
 6 bytes 0xff:0xff..

http://en.wikipedia.org/wiki/Wake-on-LAN#Magic_packet
http://en.wikipedia.org/wiki/EtherType

This will fail if we VLAN or the magic packet is encapsulated
as a UDP packet...

Signed-off-by: Andreas Fenkart <afenkart@gmail.com>
Acked-by: Bing Zhao <bzhao@marvell.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/iwlwifi...
John W. Linville [Thu, 23 Jan 2014 19:00:51 +0000 (14:00 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

10 years agoiwlwifi: pcie: don't panic on host commands in iwldvm
Emmanuel Grumbach [Mon, 20 Jan 2014 07:50:29 +0000 (09:50 +0200)]
iwlwifi: pcie: don't panic on host commands in iwldvm

None of the devices supported by iwldvm have support for
shadow registers. This means that we wake the NIC
when we increment the write pointer on Tx ring.
This happened even before my bad commit mentionned below.
Since my commit below, we wake up the NIC when we put a
host command on the ring regardless of shadow register
support. This means that in iwldvm (when the NIC doesn't
support shadow register), we wake up the NIC twice:

pcie_enqueue_hcmd:
wake up the NIC
iwl_pcie_txq_inc_wr_ptr:
wake up the NIC - no shadow reg support

Since waking up the NIC means that we need to acquire a
spinlock, this obviously leads to a recursive spinlock
and hence a freeze.

Fixes: b9439491055a ("iwlwifi: pcie: keep the NIC awake when commands are in flight")
Reported-by: Janusz Dziedzic <janusz.dziedzic@gmail.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agocarl9170: use ath_is_mybeacon
Oleksij Rempel [Wed, 15 Jan 2014 16:11:39 +0000 (17:11 +0100)]
carl9170: use ath_is_mybeacon

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath5k: use ath_is_mybeacon
Oleksij Rempel [Wed, 15 Jan 2014 16:11:15 +0000 (17:11 +0100)]
ath5k: use ath_is_mybeacon

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_htc: use ath_is_mybeacon
Oleksij Rempel [Wed, 15 Jan 2014 16:07:16 +0000 (17:07 +0100)]
ath9k_htc: use ath_is_mybeacon

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: use ath_is_mybeacon
Oleksij Rempel [Wed, 15 Jan 2014 16:07:15 +0000 (17:07 +0100)]
ath9k: use ath_is_mybeacon

This patch will also change behavior of rx_beacons statistic.
Instead of collecting all received beacons, it will collect only
ours. This, IMO make more sense, since for troubleshooting we will
need to know count of our beacons, or both.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath: add common function ath_is_mybeacon
Oleksij Rempel [Wed, 15 Jan 2014 16:37:42 +0000 (17:37 +0100)]
ath: add common function ath_is_mybeacon

this function is used by most ath driver, so it can be moved here.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: export threshold value and retry limit to cfg80211
Ujjal Roy [Wed, 15 Jan 2014 03:22:22 +0000 (19:22 -0800)]
mwifiex: export threshold value and retry limit to cfg80211

While registering the driver with cfg80211, update the threshold
value and retry limit to cfg80211.

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 agomwifiex: fix wrong 11ac bits setting in fw_cap_info
Bing Zhao [Wed, 15 Jan 2014 03:16:34 +0000 (19:16 -0800)]
mwifiex: fix wrong 11ac bits setting in fw_cap_info

bit 14 is actually reserved and bit 12 & 13 should be used for
11ac capability in fw_cap_info.

Cc: <stable@vger.kernel.org> # 3.9+
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowil6210: correct #include for prefetch()
Vladimir Kondratiev [Tue, 14 Jan 2014 18:31:26 +0000 (20:31 +0200)]
wil6210: correct #include for prefetch()

This fixes bug found by the kbuild test robot:

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git master
head:   1e2f9295f4c657500111514f92a3d3894d0e05b4
commit: 1cbbcb08c786964a16773c39f2536f1923c73c58 [135/140] wil6210: prefetch head of packet
config: make ARCH=microblaze allyesconfig

All error/warnings:

   drivers/net/wireless/ath/wil6210/txrx.c: In function 'wil_vring_reap_rx':
>> drivers/net/wireless/ath/wil6210/txrx.c:381:2: error: implicit declaration of function 'prefetch' [-Werror=implicit-function-declaration]
     prefetch(skb->data);
     ^
   cc1: some warnings being treated as errors

vim +/prefetch +381 drivers/net/wireless/ath/wil6210/txrx.c

   375                  wil_err(wil, "Rx size too large: %d bytes!\n", dmalen);
   376                  kfree_skb(skb);
   377                  return NULL;
   378          }
   379          skb_trim(skb, dmalen);
   380
 > 381          prefetch(skb->data);
   382
   383          wil_hex_dump_txrx("Rx ", DUMP_PREFIX_OFFSET, 16, 1,
   384                            skb->data, skb_headlen(skb), false);

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix possible overflow condition
Sujith Manoharan [Tue, 14 Jan 2014 08:11:17 +0000 (13:41 +0530)]
ath9k: Fix possible overflow condition

Prevent a possible overflow condition which results in occasional
bad IQ coefficients and EVM numbers.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix IQ calibration
Sujith Manoharan [Tue, 14 Jan 2014 07:55:17 +0000 (13:25 +0530)]
ath9k: Fix IQ calibration

This patch fixes a bug in the TX IQ calibration post
processing routine because of which the driver disables
TX IQ correction even though the calibration results
are valid. This fix is applicable for all chips in the
AR9003 family.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix error reported by smatch
Sujith Manoharan [Tue, 14 Jan 2014 03:52:36 +0000 (09:22 +0530)]
ath9k: Fix error reported by smatch

debug_sta.c: ath_debug_rate_stats() error: buffer overflow 'rstats->ht_stats' 24 <= 24

Cc: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: handle SDIO card removal
Arend van Spriel [Mon, 13 Jan 2014 21:20:29 +0000 (22:20 +0100)]
brcmfmac: handle SDIO card removal

When removing the card the driver still tries to access registers
in the device. This patch adds another state for the bus that
indicates the device is no longer reachable. This avoids errors
accessing it while cleaning up the driver.

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: initialize escan function pointer during scheduled scan
Arend van Spriel [Mon, 13 Jan 2014 21:20:28 +0000 (22:20 +0100)]
brcmfmac: initialize escan function pointer during scheduled scan

For scheduled scan results the driver does a escan to obtain BSS
details from the firmware. However, the escan uses a dynamically
determined function. This needs to be set appropriately when handling
scheduled scan results to avoid NULL pointer access.

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: rename chip and core related structures
Arend van Spriel [Mon, 13 Jan 2014 21:20:27 +0000 (22:20 +0100)]
brcmfmac: rename chip and core related structures

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: restructure brcmf_sdio_chip_recognition()
Arend van Spriel [Mon, 13 Jan 2014 21:20:26 +0000 (22:20 +0100)]
brcmfmac: restructure brcmf_sdio_chip_recognition()

Rework function to allow only bcm4329 in case of chip backplane
type being sonics sillicon backplane.

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: rework firmware download code
Arend van Spriel [Mon, 13 Jan 2014 21:20:25 +0000 (22:20 +0100)]
brcmfmac: rework firmware download code

The firmware download code has been restructured so the reset vector
does not need to be stored in a structure, but keep it on the stack
to be passed to exit download function.

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: update core reset and disable routines.
Hante Meuleman [Mon, 13 Jan 2014 21:20:23 +0000 (22:20 +0100)]
brcmfmac: update core reset and disable routines.

The original core reset and disable routines do not work always
on running system. These routines were updated to properly reset
a core. When module is unloaded the device is put into download
state where all necessary cores have been reset. This will make
sure the device is in idle mode after module unload.

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 agobrcmfmac: Create common nvram parsing routines.
Hante Meuleman [Mon, 13 Jan 2014 21:20:22 +0000 (22:20 +0100)]
brcmfmac: Create common nvram parsing routines.

New bus layers like pcie require nvram parsing routines which are
the same routines as being used by sdio. Make these routines common
in the new file nvram.c. Update sdio to use these routines and
simplify the nvram upload process. Also add memory validation check
for downloaded firmware and nvram in debug mode.

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 agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Thu, 16 Jan 2014 17:54:17 +0000 (12:54 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

10 years agoiwlwifi: mvm: don't use highest rate in VHT MCS Set
Eyal Shapira [Sun, 5 Jan 2014 17:27:24 +0000 (19:27 +0200)]
iwlwifi: mvm: don't use highest rate in VHT MCS Set

Keeping this as 0 is ok according to spec section 9.7.11
as this means the limits are according to the Tx/Rx
supported MCS x NSS bitmap. Initially we've set these as
there were concerns of interop issues but these turned out
to be false.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: add REPLY_SF_CFG_CMD to cmd strings
David Spinadel [Thu, 9 Jan 2014 07:55:38 +0000 (09:55 +0200)]
iwlwifi: mvm: add REPLY_SF_CFG_CMD to cmd strings

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix theoretical uninitialized function return value
Eytan Lifshitz [Tue, 7 Jan 2014 10:50:45 +0000 (12:50 +0200)]
iwlwifi: mvm: fix theoretical uninitialized function return value

If we try to write NVM that do not exist, the function will return
uninitialized value. fixed.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: add inline helper for packet lengths
Johannes Berg [Wed, 8 Jan 2014 12:16:33 +0000 (13:16 +0100)]
iwlwifi: add inline helper for packet lengths

Add an inline helper function for getting an RX packet's
length or payload length and use it throughout the code
(most of which I did using an spatch.)

While at it, adjust some code, and remove a bogus comment
from the dvm calibration code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Eran Harary <eran.harary@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: change beamformee STS cap
Eyal Shapira [Mon, 6 Jan 2014 18:16:48 +0000 (20:16 +0200)]
iwlwifi: change beamformee STS cap

All beamformee supporting chips have the ability to support
VHT NDP in up to 4 STSs. So change the published beamformee
STS cap accordingly to 3 as it should be Nsts-1.

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: reset Thermal Throttling's SMPS request upon disassociation
Emmanuel Grumbach [Mon, 6 Jan 2014 11:38:55 +0000 (13:38 +0200)]
iwlwifi: mvm: reset Thermal Throttling's SMPS request upon disassociation

The request of SMPS issued by the Thermal Throttling code
was not reset when we disassociated - fix that.

Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: remove unused flags from add station command
Emmanuel Grumbach [Wed, 1 Jan 2014 08:05:55 +0000 (10:05 +0200)]
iwlwifi: mvm: remove unused flags from add station command

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: use array indexing instead of treating it as a pointer
Johannes Berg [Mon, 6 Jan 2014 08:29:40 +0000 (09:29 +0100)]
iwlwifi: mvm: use array indexing instead of treating it as a pointer

It's a bit strange to treat an array as a pointer, so use proper
array indexing instead.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix SRAM dump debugfs handler
Emmanuel Grumbach [Mon, 6 Jan 2014 07:05:54 +0000 (09:05 +0200)]
iwlwifi: mvm: fix SRAM dump debugfs handler

If the length isn't set it means we want all the SRAM.
Also - this is perfectly valid to partially dump starting
at offset 0.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: rs: fix a theoretical out of bounds access
Eyal Shapira [Sun, 5 Jan 2014 19:04:19 +0000 (21:04 +0200)]
iwlwifi: mvm: rs: fix a theoretical out of bounds access

Discovered by klocwork

Array 'iwl_rate_mcs' of size 15 may use index value(s) -1
  * rs.c:2562: index = iwl_hwrate_to_plcp_idx(rate)
    * rs.c:2562: Result of function call 'iwl_hwrate_to_plcp_idx(rate)' is '[-1,14]'
  * rs.c:2565: Array 'iwl_rate_mcs' size is 15.
  * rs.c:2565: Possible attempt to access element -1 of array 'iwl_rate_mcs'.

While at it stop using index = -1 and always use IWL_RATE_INVALID

Signed-off-by: Eyal Shapira <eyalx.shapira@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: send all the NVM sections to the NIC
Emmanuel Grumbach [Sun, 5 Jan 2014 13:09:44 +0000 (15:09 +0200)]
iwlwifi: mvm: send all the NVM sections to the NIC

Some NIC comes with more than the 4 NVM (non volative
memory) sections described in the nvm_to_read array.
These NICs usually get their NVM from an external file
fetched from userland during init.
We already parsed the file, but sent to the NIC only 4 NVM
sections whereas there could be more sections in the file.
Fix this.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix tx seq_ctrl debug print
Eliad Peller [Tue, 31 Dec 2013 16:54:06 +0000 (18:54 +0200)]
iwlwifi: mvm: fix tx seq_ctrl debug print

Since seq_number is incremented right after using
it, so printed seq_ctrl was actually the next
one to be used.

Fix it by incrementing the seq_number only later,
before saving it.

Additionally, use the IEEE80211_SEQ_TO_SN macro
in order to print the actual sequence number.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: pcie: enable oscillator for L1 exit
Emmanuel Grumbach [Tue, 24 Dec 2013 12:15:41 +0000 (14:15 +0200)]
iwlwifi: pcie: enable oscillator for L1 exit

Enabling the oscillator consumes slightly more power (100uA)
but allows to make sure that we exit from L1 on time.

Not doing so might lead to a PCIe specification violation
since we might wake up from L1 at the wrong time.
This issue has been identified on 3160 and 7260 only.
On older NICs L1 off is not enabled, on newer NICs (7265),
the issue is fixed.

When the bug occurs the user sees that the NIC has
disappeared from the PCI bridge, any access to the device
returns 0xff.

This fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=64541

and has been extensively discussed here:
http://markmail.org/thread/mfmpzqt3r333n4bo

Cc: stable@vger.kernel.org [3.10+]
Fixes: 99cd47142399 ("iwlwifi: add 7000 series device configuration")
Reported-and-tested-by: wzyboy <wzyboy@wzyboy.org>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agop54: clamp properly instead of just truncating
Dan Carpenter [Mon, 13 Jan 2014 19:05:23 +0000 (22:05 +0300)]
p54: clamp properly instead of just truncating

The call to clamp_t() first truncates the variable signed 8 bit and as a
result, the actual clamp is a no-op.

Fixes: 0d78156eef1d ('p54: improve site survey')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmsmac: delete useless variable
Julia Lawall [Mon, 13 Jan 2014 16:17:26 +0000 (17:17 +0100)]
brcmsmac: delete useless variable

Delete a variable that is at most only assigned to a constant, but never
used otherwise.

A simplified version of the semantic patch that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
identifier i;
constant c;
@@

-T i;
<... when != i
-i = c;
...>
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Process GTT interrupts
Sujith Manoharan [Mon, 13 Jan 2014 08:25:11 +0000 (13:55 +0530)]
ath9k: Process GTT interrupts

Global Transmission Timeout interrupts are generated by
the HW when transmission of a frame fails - this is done
based on the threshold programmed in the AR_GTXTO register.

Currently, even though the interrupt is enabled for all chips,
it is not handled in the driver. This patch handles GTT events
for AR9003 and above chips, checking if the MAC/BB has hung
after successive GTT interrupts crosses a threshold (5).

This can be enabled for the older chips in the AR9002 family once
appropriate HW hang checks are implemented for them.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Remove debug print in ISR
Sujith Manoharan [Mon, 13 Jan 2014 02:10:56 +0000 (07:40 +0530)]
ath9k: Remove debug print in ISR

There is no need to do this and we can avoid
an unused variable warning when CONFIG_ATH9K_WOW is
not selected.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add a debugfs file "node_recv"
Sujith Manoharan [Mon, 13 Jan 2014 01:59:30 +0000 (07:29 +0530)]
ath9k: Add a debugfs file "node_recv"

This would be useful when debugging RX performance issues.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Use a separate debugfs file for PHY errors
Sujith Manoharan [Mon, 13 Jan 2014 01:59:29 +0000 (07:29 +0530)]
ath9k: Use a separate debugfs file for PHY errors

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Show only active TIDs in node_aggr
Sujith Manoharan [Mon, 13 Jan 2014 01:59:28 +0000 (07:29 +0530)]
ath9k: Show only active TIDs in node_aggr

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add an option for station statistics
Sujith Manoharan [Mon, 13 Jan 2014 01:59:27 +0000 (07:29 +0530)]
ath9k: Add an option for station statistics

Also, rename node_stat to node_aggr.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agob43legacy: Fix unload oops if firmware is not available
Larry Finger [Sun, 12 Jan 2014 21:11:39 +0000 (15:11 -0600)]
b43legacy: Fix unload oops if firmware is not available

The asyncronous firmware load uses a completion struct to hold firmware
processing until the user-space routines are up and running. There is.
however, a problem in that the waiter is nevered canceled during teardown.
As a result, unloading the driver when firmware is not available causes an oops.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agob43: Fix unload oops if firmware is not available
Larry Finger [Sun, 12 Jan 2014 21:11:38 +0000 (15:11 -0600)]
b43: Fix unload oops if firmware is not available

The asyncronous firmware load uses a completion struct to hold firmware
processing until the user-space routines are up and running. There is.
however, a problem in that the waiter is nevered canceled during teardown.
As a result, unloading the driver when firmware is not available causes an oops.

To be able to access the completion structure at teardown, it had to be moved
into the b43_wldev structure.

This patch also fixes a typo in a comment.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agob43: Fix lockdep splat
Larry Finger [Sun, 12 Jan 2014 21:11:37 +0000 (15:11 -0600)]
b43: Fix lockdep splat

In https://bugzilla.kernel.org/show_bug.cgi?id=67561, a locking dependency is reported
when b43 is used with hostapd, and rfkill is used to kill the radio output.

The lockdep splat (in part) is as follows:

======================================================
[ INFO: possible circular locking dependency detected ]
3.12.0 #1 Not tainted
-------------------------------------------------------
rfkill/10040 is trying to acquire lock:
 (rtnl_mutex){+.+.+.}, at: [<ffffffff8146f282>] rtnl_lock+0x12/0x20

but task is already holding lock:
 (rfkill_global_mutex){+.+.+.}, at: [<ffffffffa04832ca>] rfkill_fop_write+0x6a/0x170 [rfkill]

--snip--

Chain exists of:
  rtnl_mutex --> misc_mtx --> rfkill_global_mutex

The fix is to move the initialization of the hardware random number generator
outside the code range covered by the rtnl_mutex.

Reported-by: yury <urykhy@gmail.com>
Tested-by: yury <urykhy@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: add missing endian conversion for fw_tsf
Amitkumar Karwar [Fri, 10 Jan 2014 22:30:41 +0000 (14:30 -0800)]
mwifiex: add missing endian conversion for fw_tsf

It is u64 data received from firmware. Little endian to cpu
conversion is required here.

Cc: <stable@vger.kernel.org> # 3.5+
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>
10 years agowl12xx: fix tx power setting
Alex Gal [Fri, 10 Jan 2014 20:21:13 +0000 (15:21 -0500)]
wl12xx: fix tx power setting

The driver ignores BSS_CHANGED_TXPOWER changes.
Fix this by calling ACX_TX_POWER when appropriate.

Signed-off-by: Alex Gal <a.gal@motsai.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: add USB8897 support
Yogesh Ashok Powar [Fri, 10 Jan 2014 03:36:55 +0000 (19:36 -0800)]
mwifiex: add USB8897 support

Adding new device IDs and assigning generic function/variable
names instead of using device-id specific names.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Frank Huang <frankh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agortlwifi: rtl8192cu: Add new device ID
Larry Finger [Thu, 9 Jan 2014 16:27:27 +0000 (10:27 -0600)]
rtlwifi: rtl8192cu: Add new device ID

Reported-by: Jan Prinsloo <janroot@gmail.com>
Tested-by: Jan Prinsloo <janroot@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agocfg80211: make regulatory_hint() remove REGULATORY_CUSTOM_REG
Luis R. Rodriguez [Sat, 14 Dec 2013 19:09:06 +0000 (20:09 +0100)]
cfg80211: make regulatory_hint() remove REGULATORY_CUSTOM_REG

The REGULATORY_CUSTOM_REG can be used during early init with
the goal of overriding the wiphy's default regulatory settings
in case the alpha2 of the device is not known. In the case that
the alpha2 becomes known lets avoid having drivers having to
clear the REGULATORY_CUSTOM_REG flag by doing it for them
when regulatory_hint() is used.

Cc: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath: fix warning on usage of REGULATORY_CUSTOM_REG
Luis R. Rodriguez [Sat, 14 Dec 2013 19:09:05 +0000 (20:09 +0100)]
ath: fix warning on usage of REGULATORY_CUSTOM_REG

ath wants to first apply the custom regd and only later
will it revert to not using it if an alpha2 regulatory
domain is found. Since the wireless core now enforces
usage of the REGULATORY_CUSTOM_REG strictly when
wiphy_apply_custom_regulatory() is used this makes
ath adhere to the expected behaviour but also updates
the wiphy after its done with the custom usage.

This fixes this warning:

[    5.488733] ath: phy0: ASPM enabled: 0x43
[    5.488735] ath: EEPROM regdomain: 0x0
[    5.488736] ath: EEPROM indicates default country code should be used
[    5.488736] ath: doing EEPROM country->regdmn map search
[    5.488737] ath: country maps to regdmn code: 0x3a
[    5.488737] ath: Country alpha2 being used: US
[    5.488738] ath: Regpair used: 0x3a
[    5.488738] ------------[ cut here ]------------
[    5.488745] WARNING: CPU: 0 PID: 161 at
/home/sujith/dev/wireless-testing/net/wireless/reg.c:1361
wiphy_apply_custom_regulatory+0x17a/0x1b0 [cfg80211]()
[    5.488746] wiphy should have REGULATORY_CUSTOM_REG

The wireless core can *later* lift this flag for us for when
using the regulatory_hint() to make this fix more generic.

Reported-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.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/mac802...
John W. Linville [Mon, 13 Jan 2014 19:40:59 +0000 (14:40 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/jberg/mac80211-next

10 years agoMerge branch 'for-linville' of git://github.com/kvalo/ath
John W. Linville [Mon, 13 Jan 2014 19:40:03 +0000 (14:40 -0500)]
Merge branch 'for-linville' of git://github.com/kvalo/ath

10 years agoMerge tag 'nfc-next-3.14-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Mon, 13 Jan 2014 19:36:42 +0000 (14:36 -0500)]
Merge tag 'nfc-next-3.14-1' of git://git./linux/kernel/git/sameo/nfc-next

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

"This is the first NFC pull request for 3.14

It includes:

* A new NFC driver for Marvell's 8897, and a few NCI fixes and
  improvements needed to support this chipset.

* An LLCP fix for how we were setting the default MIU on a p2p link. If
  there is no explicit MIU extension announced at connection time, we
  must use the default one and not the one announced at LLCP link
  establishement time.

* A pn544 EEPROM config update. Some of the currently EEPROM configured
  values are overwriting the firmware ones while other should not be set
  by the driver itself.

* Some NFC digital stack fixes and improvements. Asynchronous functions
  are better documented, RF technologies and CRC functions are set upon
  PSL_REQ reception, and a few minor bugs are fixed.

* Minor and miscelaneous pn533, mei_phy and port100 fixes."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoiwlwifi: mvm: don't set the drain bit when we flush the AP station
Emmanuel Grumbach [Thu, 2 Jan 2014 08:01:46 +0000 (10:01 +0200)]
iwlwifi: mvm: don't set the drain bit when we flush the AP station

When we disassociate in managed mode, we flush the queues
after mac80211 has already removed the station.
During that time, the pointer to ieee80211_sta to the
fw_id_to_mac_id map is -EINVAL. In that case we should not
set the station as being drained when the last Tx of this
station has exited the shared Tx queue since we are
flushing all the queues anyway.
The draining logic is meant to be used in GO / AP mode only.
In GO / AP mode, we set -EBUSY in the fw_id_to_mac_id map.

This is why testing the ieee80211_sta pointer in the
fw_id_to_mac_id map with IS_ERR isn't enough to set the
station as draining, we need to check that it is -EBUSY.

The only impact of the bug was a print:

Drained sta 1, but it is internal?

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: rs: fix handling of column switch error
Eyal Shapira [Tue, 7 Jan 2014 16:19:35 +0000 (18:19 +0200)]
iwlwifi: mvm: rs: fix handling of column switch error

If we can't switch to a column because no rates are supported
in that column this led to a state where the search cycle
got stuck and never ended. This in turn also led to aggregation
not being turned on. Fix this by marking a column as
visited if we can't switch to it.

Reported-and-tested-by: Karl Beldan <karl.beldan@gmail.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: fix missing cleanup in .start() error path
Eliad Peller [Sun, 5 Jan 2014 10:41:12 +0000 (12:41 +0200)]
iwlwifi: mvm: fix missing cleanup in .start() error path

Cleanup of iwl_mvm_leds was missing in case of error,
resulting in the following warning:

WARNING: at lib/kobject.c:196 kobject_add_internal+0x1f4/0x210()
kobject_add_internal failed for phy0-led with -EEXIST, don't try to register things with the same name in the same directory.

which prevents further reloads of the driver.

Cc: stable@vger.kernel.org [3.10+]
Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: update power after binding in start_ap_ibss()
Ilan Peer [Tue, 31 Dec 2013 19:19:55 +0000 (21:19 +0200)]
iwlwifi: mvm: update power after binding in start_ap_ibss()

The power settings need to be updated after a binding flow is done
and before quota calculations. This was missing in the start_ap_ibss()
flow. Fix it.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agoiwlwifi: mvm: clear ap_ibss_active in case of failure
Ilan Peer [Tue, 31 Dec 2013 19:05:50 +0000 (21:05 +0200)]
iwlwifi: mvm: clear ap_ibss_active in case of failure

The state variable was not set to false in case of a failure to
complete the start_ap_ibss() flow.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
10 years agomac80211_hwsim: restore regulatory testing functionality
Johannes Berg [Fri, 10 Jan 2014 12:37:38 +0000 (13:37 +0100)]
mac80211_hwsim: restore regulatory testing functionality

Restore the original regulatory testing functionality and also
make it more flexible by allowing the parameters to be specified
when creating a dynamic radio.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: allow creating/destroying radios on the fly
Johannes Berg [Mon, 6 Jan 2014 22:29:20 +0000 (23:29 +0100)]
mac80211_hwsim: allow creating/destroying radios on the fly

Add new commands to the hwsim generic netlink family to allow
creating and destroying radios on the fly. The number of channels
a radio supports can be specified when it's created, if it isn't
the module parameter will be used as default.

This should be extended in the future to allow other parameters
to be specified, e.g.
 * list of channels
 * interface combinations, particularly P2P_DEVICE support
 * regtest
 * and pretty much all other hardware capabilities

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: register netlink even with multi-channel
Johannes Berg [Tue, 7 Jan 2014 22:28:08 +0000 (23:28 +0100)]
mac80211_hwsim: register netlink even with multi-channel

Reject wmediumd registrations when any devices have multi-channel
capability, but register the generic netlink family unconditionally
to make it possible to add new commands that shouldn't depend on
the number of (default) channels.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: verify wmediumd socket
Johannes Berg [Tue, 7 Jan 2014 22:21:34 +0000 (23:21 +0100)]
mac80211_hwsim: verify wmediumd socket

There can't be two wmediumd instances controlling hwsim,
so reject registration from a second one and verify in
the commands that it's the correct instance calling.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: shuffle code to prepare for dynamic radios
Johannes Berg [Mon, 6 Jan 2014 22:12:12 +0000 (23:12 +0100)]
mac80211_hwsim: shuffle code to prepare for dynamic radios

This will make the next patch, adding support for netlink,
smaller and more readable. The code is not modified here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: minor netlink cleanups
Johannes Berg [Mon, 6 Jan 2014 22:03:02 +0000 (23:03 +0100)]
mac80211_hwsim: minor netlink cleanups

Use u8 pointer instead of the struct mac_address and do
some other small cleanups.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: assign index from separate counter
Johannes Berg [Mon, 6 Jan 2014 21:56:30 +0000 (22:56 +0100)]
mac80211_hwsim: assign index from separate counter

To later allow dynamic registration, assign the index for the
struct device and MAC address from a new free-running counter.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: minimize rctbl module parameter usage
Johannes Berg [Mon, 6 Jan 2014 21:53:42 +0000 (22:53 +0100)]
mac80211_hwsim: minimize rctbl module parameter usage

Check the flag that the module parameter sets instead, so
later radios can use different parameters.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: refactor radio cleanup
Johannes Berg [Mon, 6 Jan 2014 21:43:11 +0000 (22:43 +0100)]
mac80211_hwsim: refactor radio cleanup

Refactor the radio cleanup into a new function to later
allow deleting a single radio from the list.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: refactor radio registration
Johannes Berg [Mon, 6 Jan 2014 21:39:27 +0000 (22:39 +0100)]
mac80211_hwsim: refactor radio registration

In order to support dynamic radio registration in the future,
refactor the actual registration into a new function with only
minor cleanups. Since it had to change anyway, also clean up
the init error paths.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: remove regtest for now
Johannes Berg [Mon, 6 Jan 2014 21:26:23 +0000 (22:26 +0100)]
mac80211_hwsim: remove regtest for now

The regtest thing worked based on the radio loop, but with
more dynamic radio registration that loop won't really exist
as is. We can add it back later with proper dynamic code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: prepare for different channel support
Johannes Berg [Mon, 6 Jan 2014 21:11:06 +0000 (22:11 +0100)]
mac80211_hwsim: prepare for different channel support

Prepare the code to support, in theory, different devices
with a different number of channels supported. Right now
this doesn't really change anything, but will allow for
dynamic device registration in the future.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211_hwsim: clean up netlink exit code
Johannes Berg [Mon, 6 Jan 2014 20:55:14 +0000 (21:55 +0100)]
mac80211_hwsim: clean up netlink exit code

There's no need to print a message, and genl_unregister_family()
can't really fail so remove the error message there as well.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoieee80211: add definition for SMS4 key len
Avinash Patil [Fri, 10 Jan 2014 19:08:55 +0000 (11:08 -0800)]
ieee80211: add definition for SMS4 key len

Add SMS4 key length definition to ieee80211_key_len enum.
It's used by WAPI.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoath10k: add set_bitrate_mask callback
Janusz Dziedzic [Wed, 8 Jan 2014 08:08:33 +0000 (09:08 +0100)]
ath10k: add set_bitrate_mask callback

Add set_bitrate_mask callback. Currently
ath10k HW is limited to handle only single
fixed rate setting or limit number of used
spatial streams.

Example:
iw wlanX set bitrates legacy-5 ht-mcs-5 vht-mcs-5 2:9
will setup VHT, nss=2, mcs=9

iw wlanX set bitrates legacy-5 18 ht-mcs-5 vht-mcs-5
will setup legacy, 18Mbps

iw wlanX set bitrates legacy-5 ht-mcs-5 3 vht-mcs-5
will setup HT, nss=1, mcs=3

iw wlanX set bitrate legacy-5 ht-mcs-5 vht-mcs-5 1:0-9
will setup nss=1

iw wlanX set bitrate legacy-5 ht-mcs-5 vht-mcs-5 1:0-9 2:0-9
will setup nss=2

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: add debugfs file to control firmware dbglog
Kalle Valo [Fri, 3 Jan 2014 10:59:31 +0000 (12:59 +0200)]
ath10k: add debugfs file to control firmware dbglog

Firmware dbglogs can be now enabled through fw_dbglog file. To enable all
possible log messages run:

echo 0xffffffff > /sys/kernel/debug/ieee80211/phy0/ath10k/fw_dbglog

And to put back firmare defaults use 0x0:

echo 0x0 > /sys/kernel/debug/ieee80211/phy0/ath10k/fw_dbglog

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: add trace event for WMI_DEBUG_MESG_EVENTID
Kalle Valo [Fri, 3 Jan 2014 10:59:26 +0000 (12:59 +0200)]
ath10k: add trace event for WMI_DEBUG_MESG_EVENTID

Send firmware WMI debug logs to user space for further processing.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: handle WMI debug print events
Kalle Valo [Fri, 3 Jan 2014 10:59:20 +0000 (12:59 +0200)]
ath10k: handle WMI debug print events

Firmware can send simple ascii strings as debug messages using
WMI_DEBUG_PRINT_EVENTID, print those with ATH10K_DBG_WMI log level.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: track number of existing peers
Bartosz Markowski [Thu, 2 Jan 2014 13:38:33 +0000 (14:38 +0100)]
ath10k: track number of existing peers

To not exceed number of allowed clients (AP mode), make sure to
check how many of them are already on the peers list.

10.X firmware support up to 127 peers, non-AP centric firmwares 16.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: disable STA kickout in FW
Marek Puzyniak [Mon, 30 Dec 2013 08:07:51 +0000 (09:07 +0100)]
ath10k: disable STA kickout in FW

Currently ath10k is not using STA KICKOUT firmware functionality.
In order to avoid unwanted WMI_PEER_STA_KICKOUT_EVENT event this functionality
should be disabled when not used.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: add DFS_CERTIFIED option
Janusz Dziedzic [Mon, 23 Dec 2013 06:38:27 +0000 (08:38 +0200)]
ath10k: add DFS_CERTIFIED option

Add Kconfig option that allow DFS functionality.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agomac80211: handle MMPDUs at EOSP correctly
Johannes Berg [Wed, 8 Jan 2014 23:00:38 +0000 (00:00 +0100)]
mac80211: handle MMPDUs at EOSP correctly

If a uAPSD service period ends with an MMPDU, we currently just
send that MMPDU, but it obviously won't get the EOSP bit set as
it doesn't have a QoS header. This contradicts the standard, so
add a QoS-nulldata frame after the MMPDU to properly terminate
the service period with a frame that has EOSP set.

Also fix a bug wrt. the TID for the MMPDU, it shouldn't be set
to 0 unconditionally but use the actual TID that was assigned.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: reset TX info flags when frame will be reprocessed
Johannes Berg [Thu, 9 Jan 2014 00:45:28 +0000 (01:45 +0100)]
mac80211: reset TX info flags when frame will be reprocessed

The temporary TX info flags need to be cleared if the frame will
be processed through the TX handlers again, otherwise it can get
messed up. This fixes a bug that happened when an aggregation
session was stopped while the station was sleeping - some frames
might get transmitted marked as aggregation erroneously without
this fix.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: release multiple ACs in uAPSD, fix more-data bug
Johannes Berg [Wed, 8 Jan 2014 16:45:07 +0000 (17:45 +0100)]
mac80211: release multiple ACs in uAPSD, fix more-data bug

When a response for PS-Poll or a uAPSD trigger frame is sent, the
more-data bit should be set according to 802.11-2012 11.2.1.5 h),
meaning that it should indicate more data on the relevant ACs
(delivery-enabled or nondelivery-enabled for uAPSD or PS-Poll.)

In, for example, the following scenario:
 * 1 frame on VO queue (either in driver or in mac80211)
 * at least 1 frame on VI queue (in the driver)
 * both VO/VI are delivery-enabled
 * uAPSD trigger frame received

The more-data flag to the driver would not be set, even though
it should be.

While fixing this, I noticed that we should really release frames
from multiple ACs where there's data buffered in the driver for
the corresponding TIDs.

To address all this, restructure the code a bit to consider all
ACs if we only release driver frames or only buffered frames.
This also addresses the more-data bug described above as now the
TIDs will all be marked as released, so the driver will have to
check the number of frames.

While at it, clarify some code and comments and remove the found
variable, replacing it with the appropriate sw/hw release check.

Reported-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: fix PS-Poll driver release TID
Johannes Berg [Thu, 9 Jan 2014 10:05:31 +0000 (11:05 +0100)]
mac80211: fix PS-Poll driver release TID

Using ffs() for the PS-Poll release TID is wrong, it will cause
frames to be released in order 0 1 2 3 4 5 6 7 instead of the
correct 7 6 5 4 3 0 2 1. Fix this by adding a new function that
implements "highest priority TID" properly.

Reported-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoieee80211: add definition for TDLS wide band extended capability
Avinash Patil [Thu, 9 Jan 2014 23:22:57 +0000 (15:22 -0800)]
ieee80211: add definition for TDLS wide band extended capability

Seventh bit of 8th byte of extended capabilities specifies wide
bandwidth support for TDLS links. Add this definition to ieee80211.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: add sanity check for retry limit in wext-compat
Ujjal Roy [Thu, 9 Jan 2014 15:46:14 +0000 (21:16 +0530)]
cfg80211: add sanity check for retry limit in wext-compat

Block setting the wrong values through iwconfig retry
command. Add sanity checking before sending the retry
limit to the driver.

Signed-off-by: Ujjal Roy <royujjal@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoath9k: Disable cross-band FCC
Sujith Manoharan [Thu, 9 Jan 2014 03:21:15 +0000 (08:51 +0530)]
ath9k: Disable cross-band FCC

Fast Channel Change across bands was enabled for
AR9462 recently, but this is causing baseband issues.
Disable it until this feature is tested well. Also,
remove the feature bit for AR9565 since it is
a single-band card and doesn't support this feature.

Cc: stable@vger.kernel.org
Reported-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Use correct channel for RX packets
Sujith Manoharan [Thu, 9 Jan 2014 03:21:14 +0000 (08:51 +0530)]
ath9k: Use correct channel for RX packets

Accessing the current channel definition in mac80211
when processing RX packets is problematic because it
could have been updated when a scan is issued. Since a
channel change involves flushing the existing packets
in the RX queue before a chip-reset is done, they would
be processed using the wrong band/channel information.

To avoid this, use the current channel information
maintained in the driver.

Cc: stable@vger.kernel.org
Reported-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Update WB335 PCI IDs
Sujith Manoharan [Thu, 9 Jan 2014 03:21:13 +0000 (08:51 +0530)]
ath9k: Update WB335 PCI IDs

* Add new AR9565 1.0/1.0.1/1.1 IDs
* Change Dell/Lenovo/Samsung cards to 2-Antenna with diversity.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: use a function to replace two copies of a code fragment
Bing Zhao [Wed, 8 Jan 2014 23:45:57 +0000 (15:45 -0800)]
mwifiex: use a function to replace two copies of a code fragment

Instead of having two copies of the code for device tree cfgdata
downloading, add a function to improve the code.

Reviewed-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: fix potential buffer overflow in dt configuration
Bing Zhao [Wed, 8 Jan 2014 23:45:56 +0000 (15:45 -0800)]
mwifiex: fix potential buffer overflow in dt configuration

If cfgdata length exceeds the command buffer size we will end up
getting buffer overflow problem. Fix it by checking the buffer
size less the command header length.

Reviewed-by: Paul Stewart <pstew@chromium.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowil6210: prefetch head of packet
Vladimir Kondratiev [Wed, 8 Jan 2014 09:50:49 +0000 (11:50 +0200)]
wil6210: prefetch head of packet

As soon as skb is ready to be reaped, prefetch 1-st cache line.
This accelerates data access that is performed later, during the
packet classification by the driver and IP stack.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowil6210: Fix IP version indication for Tx csum offload
Vladimir Kondratiev [Wed, 8 Jan 2014 09:50:48 +0000 (11:50 +0200)]
wil6210: Fix IP version indication for Tx csum offload

Bit DMA_CFG_DESC_TX_OFFLOAD_CFG_L3T_IPV4_POS should be set for IPv4
only. Don't set it for IPv6

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowil6210: interrupt moderation
Vladimir Kondratiev [Wed, 8 Jan 2014 09:50:47 +0000 (11:50 +0200)]
wil6210: interrupt moderation

Use hardware capabilities to limit IRQ generation to about 15 per msec
It corresponds to about 7 packets/IRQ when running iperf with default
parameters at 1.3Gbps

Do not enable this feature in the sniffer (monitor)  mode, because
interrupt moderation cause timestamp accuracy deterioration.
For the sniffer flow, it is important to get precise timestamp.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: add support for bcm43362 device
Arend van Spriel [Wed, 8 Jan 2014 09:49:33 +0000 (10:49 +0100)]
brcmfmac: add support for bcm43362 device

This patch adds support for the bcm43362 1x1 11n chipset. This
chipset is used in AP6210 wifi module found on Cubieboard [1].

[1] http://cubieboard.org/

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>