GitHub/moto-9609/android_kernel_motorola_exynos9610.git
9 years agoMerge commit 'c1e140bf79d817d4a7aa9932eb98b0359c87af33' from mac80211-next
Kalle Valo [Thu, 22 Jan 2015 12:49:44 +0000 (14:49 +0200)]
Merge commit 'c1e140bf79d817d4a7aa9932eb98b0359c87af33' from mac80211-next

Patch "ath9k: Fix no-ack frame status" needs these mac80211 patches:

commit 5cf16616e152dd5c274a65954c77f64892d025a8
Author: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Date:   Wed Dec 10 21:26:11 2014 +0530

    mac80211: Fix accounting of multicast frames

commit 6b127c71fbdd3daacfd8b9f80b8e6ebfb70a889e
Author: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Date:   Wed Dec 10 21:26:10 2014 +0530

    mac80211: Move IEEE80211_TX_CTL_PS_RESPONSE

Conflicts:
drivers/net/wireless/ath/wil6210/cfg80211.c
drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c

9 years agoMAINTAINERS: remove ath5k mailing list
Jiri Slaby [Sat, 10 Jan 2015 11:02:40 +0000 (12:02 +0100)]
MAINTAINERS: remove ath5k mailing list

The list is in the process of closing.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Nick Kossifidis <mickflemm@gmail.com>
Cc: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Cc: linux-wireless@vger.kernel.org
Cc: "Michael Renzmann" <mrenzmann@madwifi-project.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomac80211: delete the assoc/auth timer upon suspend
Emmanuel Grumbach [Mon, 19 Jan 2015 14:53:06 +0000 (16:53 +0200)]
mac80211: delete the assoc/auth timer upon suspend

While suspending, we destroy the authentication /
association that might be taking place. While doing so, we
forgot to delete the timer which can be firing after
local->suspended is already set, producing the warning below.

Fix that by deleting the timer.

[66722.825487] WARNING: CPU: 2 PID: 5612 at net/mac80211/util.c:755 ieee80211_can_queue_work.isra.18+0x32/0x40 [mac80211]()
[66722.825487] queueing ieee80211 work while going to suspend
[66722.825529] CPU: 2 PID: 5612 Comm: kworker/u16:69 Tainted: G        W  O  3.16.1+ #24
[66722.825537] Workqueue: events_unbound async_run_entry_fn
[66722.825545] Call Trace:
[66722.825552]  <IRQ>  [<ffffffff817edbb2>] dump_stack+0x4d/0x66
[66722.825556]  [<ffffffff81075cad>] warn_slowpath_common+0x7d/0xa0
[66722.825572]  [<ffffffffa06b5b90>] ? ieee80211_sta_bcn_mon_timer+0x50/0x50 [mac80211]
[66722.825573]  [<ffffffff81075d1c>] warn_slowpath_fmt+0x4c/0x50
[66722.825586]  [<ffffffffa06977a2>] ieee80211_can_queue_work.isra.18+0x32/0x40 [mac80211]
[66722.825598]  [<ffffffffa06977d5>] ieee80211_queue_work+0x25/0x50 [mac80211]
[66722.825611]  [<ffffffffa06b5bac>] ieee80211_sta_timer+0x1c/0x20 [mac80211]
[66722.825614]  [<ffffffff8108655a>] call_timer_fn+0x8a/0x300

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoRevert "wireless: Support of IFLA_INFO_KIND rtnl attribute"
Johannes Berg [Mon, 19 Jan 2015 17:49:50 +0000 (18:49 +0100)]
Revert "wireless: Support of IFLA_INFO_KIND rtnl attribute"

This reverts commit ba1debdfed974f25aa598c283567878657b292ee.

Oliver reported that it breaks network-manager, for some reason with
this patch NM decides that the device isn't wireless but "generic"
(ethernet), sees no carrier (as expected with wifi) and fails to do
anything else with it.

Revert this to unbreak userspace.

Reported-by: Oliver Hartkopp <socketcan@hartkopp.net>
Tested-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: fix checking nl80211_send_station() return value
Johannes Berg [Fri, 16 Jan 2015 20:05:02 +0000 (21:05 +0100)]
cfg80211: fix checking nl80211_send_station() return value

The return value from nl80211_send_station() is the length of the
skb, or a negative error, so abort sending the message only when
the return value was negative.

This fixes the ibss_rsn wpa_supplicant test case.

Reported-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: remove doubled semicolon
Johannes Berg [Fri, 16 Jan 2015 12:27:56 +0000 (13:27 +0100)]
mac80211: remove doubled semicolon

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: change bandwidth reporting to explicit field
Johannes Berg [Thu, 15 Jan 2015 15:14:02 +0000 (16:14 +0100)]
cfg80211: change bandwidth reporting to explicit field

For some reason, we made the bandwidth separate flags, which
is rather confusing - a single rate cannot have different
bandwidths at the same time.

Change this to no longer be flags but use a separate field
for the bandwidth ('bw') instead.

While at it, add support for 5 and 10 MHz rates - these are
reported as regular legacy rates with their real bitrate,
but tagged as 5/10 now to make it easier to distinguish them.

In the nl80211 API, the flags are preserved, but the code
now can also clearly only set a single one of the flags.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: remove 80+80 MHz rate reporting
Johannes Berg [Thu, 15 Jan 2015 15:05:21 +0000 (16:05 +0100)]
cfg80211: remove 80+80 MHz rate reporting

These rates are treated the same as 160 MHz in the spec, so
it makes no sense to distinguish them. As no driver uses them
yet, this is also not a problem, just remove them.

In the userspace API the field remains reserved to preserve
API and ABI.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: remove 80+80 MHz rate reporting
Johannes Berg [Thu, 15 Jan 2015 15:02:46 +0000 (16:02 +0100)]
mac80211: remove 80+80 MHz rate reporting

These rates are treated the same as 160 MHz in the spec,
so it makes no sense to distinguish them. As no driver
uses them yet, this is also not a problem, just remove
them.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agob43legacy: Remove unused b43legacy_radio_set_tx_iq()
Rickard Strandqvist [Tue, 6 Jan 2015 17:59:35 +0000 (18:59 +0100)]
b43legacy: Remove unused b43legacy_radio_set_tx_iq()

Remove the function b43legacy_radio_set_tx_iq() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: Rafa? Mi?ecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoorinoco/hermes: select CFG80211_WEXT
Johannes Berg [Tue, 6 Jan 2015 12:46:57 +0000 (13:46 +0100)]
orinoco/hermes: select CFG80211_WEXT

It makes no sense to require the user to find and enable
CFG80211_WEXT before the driver can be selected, make the
driver select the needed Kconfig symbol itself.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Update PCI IDs for AR9565
Sujith Manoharan [Mon, 5 Jan 2015 05:44:25 +0000 (11:14 +0530)]
ath9k: Update PCI IDs for AR9565

This patch adds several new PCI IDs for AR9565.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: enable per-packet TPC on AR9002 based chips
Lorenzo Bianconi [Tue, 30 Dec 2014 22:10:20 +0000 (23:10 +0100)]
ath9k: enable per-packet TPC on AR9002 based chips

Enable per-packet TPC on AR9002 based chips by default

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: add TPC to TX path for AR9002 based chips
Lorenzo Bianconi [Tue, 30 Dec 2014 22:10:19 +0000 (23:10 +0100)]
ath9k: add TPC to TX path for AR9002 based chips

Add TPC capability to TX descriptor path for AR9002 based chips. Scale
per-packet TX power according to eeprom power bias, power adjustments for
HT40 mode and open loop CCK rates. Cap per-packet TX power according to
TX power per-rate tables

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: add power per-rate tables for AR9002 chips
Lorenzo Bianconi [Tue, 30 Dec 2014 22:10:18 +0000 (23:10 +0100)]
ath9k: add power per-rate tables for AR9002 chips

Add TX power per-rate tables for MIMO/legacy modes for AR9002 based chips
in order to cap the maximum TX power value per-rate in the TX descriptor path.
Add TX power adjustments for HT40 mode, open loop CCK rates and eeprom power
bias for AR9280 and later chips

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoadm8211: fix error return code
Julia Lawall [Mon, 29 Dec 2014 17:04:41 +0000 (18:04 +0100)]
adm8211: fix error return code

Return a negative error code on failure.

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

// <smpl>
@@
identifier ret; expression e1,e2;
@@
(
if (\(ret < 0\|ret != 0\))
 { ... return ret; }
|
ret = 0
)
... when != ret = e1
    when != &ret
*if(...)
{
  ... when != ret = e2
      when forall
 return ret;
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: fix three coding style issues, more than 80 characters per line
Oscar Forner Martinez [Sat, 27 Dec 2014 19:24:28 +0000 (19:24 +0000)]
bcma: fix three coding style issues, more than 80 characters per line

Three lines with more than 80 characters per line have been split in several lines.

Signed-off-by: Oscar Forner Martinez <oscar.forner.martinez@gmail.com>
Acked-by: Rafa? Mi?ecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
Arend van Spriel [Sat, 27 Dec 2014 13:13:00 +0000 (14:13 +0100)]
ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries

Use the helper to get rid of the file operations per debugfs file. The
device driver data contains struct ieee80211_hw pointer and the
struct ath9k_softc pointer is assigned to ieee80211_hw::priv so it can
be accessed in the seq_file read operation.

Cc: ath9k-devel@lists.ath9k.org
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: relax spinlocks in rx reorder
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:24 +0000 (09:47 +0200)]
wil6210: relax spinlocks in rx reorder

In the Rx reorder mechanism, nothing is done in the interrupt
context, so there is no need to use 'irq' flavors of spinlock.
Rx done in NAPI context (tasklet), other manipulations - in the
thread context.

Having interrupts enabled makes it better for the OS in general.
Besides, if enslaved under bonding, bridge or team driver, Rx
won't work with interrupts disabled.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: workaround for BACK establishment race
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:23 +0000 (09:47 +0200)]
wil6210: workaround for BACK establishment race

When establishing BACK, WMI may be handled earlier then Rx, in this case
late Rx will be mis-handled.

Detect early Rx and pass it to the stack, bypass reordering

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: Tx/Rx descriptors documentation
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:22 +0000 (09:47 +0200)]
wil6210: Tx/Rx descriptors documentation

Sync documentation for the Tx/Rx descriptors with the
firmware/hardware documentation.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: fix reordering for MCAST
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:21 +0000 (09:47 +0200)]
wil6210: fix reordering for MCAST

In the reordering block, Ethernet DA was checked for MCAST, this is wrong.
Check instead MCAST indication from 802.11 MAC header. Hardware saves
this into Rx descriptor.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: RX high threshold interrupt configuration
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:20 +0000 (09:47 +0200)]
wil6210: RX high threshold interrupt configuration

Rx high threshold interrupt is reported by the hardware in case
when number of not utilized by the HW descriptors in the Rx ring
becomes low.
Introduce module parameter for RX high threshold.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: add advanced interrupt moderation
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:19 +0000 (09:47 +0200)]
wil6210: add advanced interrupt moderation

Add advanced interrupt moderation support available since "Sparrow B0".
Legacy interrupt moderation used only one counter to moderate tx, rx,
and misc interrupts.
Advanced interrupt moderation bypasses misc, and handles separately tx
and rx interrupts. In addition it has two timers for each interrupt type.
Max burst duration timer which defines how long to postpone interrupt after
first event (receive event for rx and tx complete event for tx), and
interframe timeout which defines how to determine the end of the burst and
issue interrupt even if the first timer still pending.
Capabilities flags in wil_priv is set on initialization according to
HW. The rest of the code checks for advanced interrupt capability bit
in capabilities flags field.
Debugfs is split accordingly: "legacy" interrupt moderation remains
unchanged, new debugs files added for advanced interrupt moderation
support.
Module params are aligned to support advanced interrupt moderation
(tx & rx). When not available (for legacy interrupt moderation) will
use only rx configuration; Tx configuration will be ignored in this
case.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: use HW capabilities mask in reset
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:18 +0000 (09:47 +0200)]
wil6210: use HW capabilities mask in reset

Use the proper reset follow based on HW capabilities
detection instead of chip ID.
Remove old hw ID mechanism which was used only for reset flow.
Remove support for Marlon A0.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: detect HW capabilities
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:17 +0000 (09:47 +0200)]
wil6210: detect HW capabilities

Read relevant information (HW ID for now) once on init
and set capabilities accordingly.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: rework debugfs for BACK
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:16 +0000 (09:47 +0200)]
wil6210: rework debugfs for BACK

Enable more flexible control over block ack:
- allow addba for any Tx vring
- allow to specify block ack timeout
- allow to delba for Tx or Rx side of any agreement; with reason

Renamed "addba" entry to "back"; it prints short help when read;
write:
 - "add <ringid> <agg_size> <timeout>" to trigger ADDBA
If missing, <timeout> defaults to 0
 - "del_tx <ringid> <reason>" to trigger DELBA for Tx side
 - "del_rx <CID> <TID> <reason>" to trigger DELBA for Rx side
If missing, <reason> set to "STA_LEAVING" (36)

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: fix Tx VRING for STA mode
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:15 +0000 (09:47 +0200)]
wil6210: fix Tx VRING for STA mode

In STA mode, all Tx should be directed to the same VRING towards the AP.
Thus, look up for the 1-st eligible VRING and use it.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: use bitmap API for "status"
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:14 +0000 (09:47 +0200)]
wil6210: use bitmap API for "status"

wil->status used as bitmap; use DECLARE_BITMAP for it.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: Increase number of associated stations
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:13 +0000 (09:47 +0200)]
wil6210: Increase number of associated stations

Change default to support maximum number of associated
stations to an AP

Signed-off-by: Hamad Kadmany <qca_hkadmany@qca.qualcomm.com>
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: consider SNAP header in MTU calculations
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:12 +0000 (09:47 +0200)]
wil6210: consider SNAP header in MTU calculations

When encapsulating 802.3 frames into the 802.11 ones,
8-byte SNAP header added to save ethtype. SNAP is part of
the frame body, thus should be counted in MSDU. So,
MTU = MSDU - SNAP

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: fix max. MPDU size
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:11 +0000 (09:47 +0200)]
wil6210: fix max. MPDU size

When configuring Tx/Rx VRING's, driver need to specify max. MPDU size
It should take into account all overhead introduced by 802.3->208.11
transformation.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: delba for responder
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:10 +0000 (09:47 +0200)]
wil6210: delba for responder

Implement delba flow for the responder (Rx) side

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: control AMSDU on Tx side of Block Ack
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:09 +0000 (09:47 +0200)]
wil6210: control AMSDU on Tx side of Block Ack

When establishing Block Ack as originator (Tx), control
AMSDU flag when sending ADDBA and update status upon
establishment flow completion. To be used in AMSDU flows

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: improve debugfs for VRING
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:08 +0000 (09:47 +0200)]
wil6210: improve debugfs for VRING

When printing VRING on debugfs (file "vrings"),
software head & tail indexes were printed in decimal format
while hardware tail in hexadecimal only.

It is not comfortable to compare indexes in different formats;
on the other hand, hexadecimal output useful to see hardware
glitches.

To serve all purposes, print hardware tail in both decimal and
hexadecimal formats.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: fix disconnect 1 STA in AP
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:07 +0000 (09:47 +0200)]
wil6210: fix disconnect 1 STA in AP

When disconnecting single STA in AP, it might be that STA
in question is already disconnected. In this case, need to do nothing.
Previously, it was mis-interpreted as "disconnect all"

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: improve debugfs for reorder buffer
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:06 +0000 (09:47 +0200)]
wil6210: improve debugfs for reorder buffer

When printing debugfs for the reorder buffer, include BACK
parameters: window size and timeout

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: allow to configure ADDBA request
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:05 +0000 (09:47 +0200)]
wil6210: allow to configure ADDBA request

For manual ADDBA configuration, allow to set desired window size or
disable automatic mechanism.

Introduce module parameter (int) agg_wsize. It can be changed on run time,
will be taken into account on the next connect. Interpretation:
- <0 - disable automatic ADDBA; intended for manual testing through debugfs
- 0 - use automatically calculated window size
- >0 - use this for window size. Clipped by maximum supported by the hardware
with current environment.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: simple ADDBA on originator (Tx) side
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:04 +0000 (09:47 +0200)]
wil6210: simple ADDBA on originator (Tx) side

Upon Tx vring creation, initiate BACK establishment
with maximum possible window size.

When establishing secure connection, there is EAPOL data exchange
between connection itself and "data port open", where security
is done and non-EAPOL data may be transferred. It is better to
send EAPOL frames using normal ACK because of firmware considerations.

send ADDBA only is 2 conditions met:
- data port open for the corresponded STA
- vring created

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowil6210: ADDBA/DELBA flows
Vladimir Kondratiev [Tue, 23 Dec 2014 07:47:03 +0000 (09:47 +0200)]
wil6210: ADDBA/DELBA flows

Introduce BACK establishment procedures; decision logic is not implemented
yet; debugfs entry 'addba' used to manually trigger addba/delba for ringid 0.

debugfs usage:
to establish BACK with agg_wsize 16:
  echo 16 > /sys/kernel/debug/ieee80211/phy0/wil6210/addba
to delete BACK:
  echo 0 > /sys/kernel/debug/ieee80211/phy0/wil6210/addba
to change agg_wsize, one need to delete BACK and establish it anew

ADDBA flow for:

- originator

Tx side (initiator) sends WMI_VRING_BA_EN_CMDID providing
agg_wsize and timeout parameters.
Eventually, it gets event confirming BACK agreement - WMI_BA_STATUS_EVENTID
with negotiated parameters. On this event, update Tx vring data
(struct vring_tx_data) and display BACK parameters on debugfs

- recipient

Rx side (recipient) firmware informs driver about ADDBA with
WMI_RCP_ADDBA_REQ_EVENTID, driver process it in service work
queue wq_service. It adjusts parameters and sends response
with WMI_RCP_ADDBA_RESP_CMDID, and final confirmation provided
by firmware with WMI_ADDBA_RESP_SENT_EVENTID. In case of success,
driver updates Rx BACK reorder buffer.

policy for BACK parameters:
- aggregation size (agg_wsize * MPDUsize)) to not exceed 64Kbytes

DELBA flow for:

- originator

driver decides to terminate BACK, it sends WMI_VRING_BA_DIS_CMDID
and updates struct vring_tx_data associated with vring; ignore
WMI_DELBA_EVENTID.

- recipient

firmware informs driver with WMI_DELBA_EVENTID,
driver deletes correspondent reorder buffer

ADDBA request processing requires sending WMI command, therefore
it is processed in work queue context. Same work queue used as for
connect, it get renamed to wq_service

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Add QCA956x HW support
Miaoqing Pan [Fri, 19 Dec 2014 01:03:59 +0000 (06:33 +0530)]
ath9k: Add QCA956x HW support

Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Fix register definitions for QCA956x
Miaoqing Pan [Fri, 19 Dec 2014 01:03:58 +0000 (06:33 +0530)]
ath9k: Fix register definitions for QCA956x

Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Add initvals for QCA956x
Miaoqing Pan [Fri, 19 Dec 2014 01:03:57 +0000 (06:33 +0530)]
ath9k: Add initvals for QCA956x

Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoath9k: Add HW IDs for QCA956x
Miaoqing Pan [Fri, 19 Dec 2014 01:03:56 +0000 (06:33 +0530)]
ath9k: Add HW IDs for QCA956x

Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agocfg80211: docs: remove station_info_flags
Johannes Berg [Wed, 14 Jan 2015 12:57:36 +0000 (13:57 +0100)]
cfg80211: docs: remove station_info_flags

I removed the enum earlier, but forgot to remove it from the
documentation - do that now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agonl80211: send netdetect configuration info in NL80211_CMD_GET_WOWLAN
Luciano Coelho [Fri, 9 Jan 2015 12:06:37 +0000 (14:06 +0200)]
nl80211: send netdetect configuration info in NL80211_CMD_GET_WOWLAN

Send the netdetect configuration information in the response to
NL8021_CMD_GET_WOWLAN commands.  This includes the scan interval,
SSIDs to match and frequencies to scan.

Additionally, add the NL80211_WOWLAN_TRIG_NET_DETECT with
NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: avoid reg-hints in self-managed only systems
Arik Nemtsov [Wed, 7 Jan 2015 14:47:20 +0000 (16:47 +0200)]
cfg80211: avoid reg-hints in self-managed only systems

When a system contains only self-managed regulatory devices all hints
from the regulatory core are ignored. Stop hint processing early in this
case. These systems usually don't have CRDA deployed, which results in
endless (irrelevent) logs of the form:
cfg80211: Calling CRDA to update world regulatory domain

Make sure there's at least one self-managed device before discarding a
hint, in order to prevent initial hints from disappearing on CRDA
managed systems.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: introduce sync regdom set API for self-managed
Arik Nemtsov [Wed, 7 Jan 2015 14:47:19 +0000 (16:47 +0200)]
cfg80211: introduce sync regdom set API for self-managed

A self-managed device will sometimes need to set its regdomain synchronously.
Notably it should be set before usermode has a chance to query it. Expose
a new API to accomplish this which requires the RTNL.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: don't defer scans in case of radar detection
Eliad Peller [Wed, 7 Jan 2015 15:50:11 +0000 (17:50 +0200)]
mac80211: don't defer scans in case of radar detection

Radar detection can last indefinite time. There is no
point in deferring a scan request in this case - simply
return -EBUSY.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: consider only relevant vifs for radar_required calculation
Eliad Peller [Wed, 7 Jan 2015 15:50:10 +0000 (17:50 +0200)]
mac80211: consider only relevant vifs for radar_required calculation

ctx->conf.radar_enabled should reflect whether radar
detection is enabled for the channel context.

When calculating it, make it consider only the vifs
that have this context assigned (instead of all the
vifs).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: remove local->radar_detect_enabled
Eliad Peller [Wed, 7 Jan 2015 15:50:09 +0000 (17:50 +0200)]
mac80211: remove local->radar_detect_enabled

local->radar_detect_enabled should tell whether
radar_detect is enabled on any interface belonging
to local.

However, it's not getting updated correctly
in many cases (actually, when testing with hwsim
it's never been set, even when the dfs master
is beaconing).

Instead of handling all the corner cases
(e.g. channel switch), simply check whether
radar detection is enabled only when needed,
instead of caching the result.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add TDLS supported channels correctly
Arik Nemtsov [Wed, 7 Jan 2015 14:45:07 +0000 (16:45 +0200)]
mac80211: add TDLS supported channels correctly

The function adding the supported channels IE during a TDLS connection had
several issues:
1. If the entire subband is usable, the function exitted the loop without
   adding it
2. The function only checked chandef_usable, ignoring flags like RADAR
   which would prevent TDLS off-channel communcation.
3. HT20 was explicitly required in the chandef, while not a requirement
   for TDLS off-channel.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: let flush() drop packets when possible
Emmanuel Grumbach [Wed, 7 Jan 2015 13:42:39 +0000 (15:42 +0200)]
mac80211: let flush() drop packets when possible

When roaming / suspending, it makes no sense to wait until
the transmit queues of the device are empty. In extreme
condition they can be starved (VO saturating the air), but
even in regular cases, it is pointless to delay the roaming
because the low level driver is trying to send packets to
an AP which is far away. We'd rather drop these packets and
let TCP retransmit if needed. This will allow to speed up
the roaming.

For suspend, the explanation is even more trivial.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agorfkill: document rfkill module parameters
Andrew Clausen [Fri, 9 Jan 2015 20:24:55 +0000 (20:24 +0000)]
rfkill: document rfkill module parameters

Document the rfkill module parameters default_state and
master_switch_mode.

Signed-off-by: Andrew Clausen <andrew.p.clausen@gmail.com>
[rewrite commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoMerge ath-next from ath.git
Kalle Valo [Fri, 9 Jan 2015 16:38:46 +0000 (18:38 +0200)]
Merge ath-next from ath.git

Major changes in ath10k:

* Device tree support

* Major restructuring how to handle different WMI interface versions

* Add WMI TLV interface in preparation for new firmware interface support

* Support new firmware branch 10.2.4

* Add thermal cooling interface

* Add hwmon interface to read temparture from the device

And of course lots of small fixes and cleanups.

9 years agoath10k: fix build error when hwmon is off
Kalle Valo [Wed, 7 Jan 2015 15:04:10 +0000 (17:04 +0200)]
ath10k: fix build error when hwmon is off

kbuild reported a linking error:

ERROR: "devm_hwmon_device_register_with_groups"
[drivers/net/wireless/ath/ath10k/ath10k_core.ko] undefined!

Fix it by returning early and letting the compiler to optimise out the function
call.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agortlwifi: Move macro definitions to core
Larry Finger [Tue, 6 Jan 2015 15:58:12 +0000 (09:58 -0600)]
rtlwifi: Move macro definitions to core

Several of the drivers still were defining their own copies of various
macros. These are all moved into the core.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8821ae: Convert driver to use common DM table initialization
Larry Finger [Tue, 6 Jan 2015 15:58:11 +0000 (09:58 -0600)]
rtlwifi: rtl8821ae: Convert driver to use common DM table initialization

Convert driver to use routine rtl_dm_diginit().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8723be: Convert driver to use common DM table initialization
Larry Finger [Tue, 6 Jan 2015 15:58:10 +0000 (09:58 -0600)]
rtlwifi: rtl8723be: Convert driver to use common DM table initialization

Convert driver rtl8723be to use routine rtl_dm_diginit().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8723ae: Convert driver to use common DM table initialization
Larry Finger [Tue, 6 Jan 2015 15:58:09 +0000 (09:58 -0600)]
rtlwifi: rtl8723ae: Convert driver to use common DM table initialization

Convert driver rtl8723ae to use common routine rtl_dm_diginit().

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8192ee: Convert driver to use common DM table initialization
Larry Finger [Tue, 6 Jan 2015 15:58:08 +0000 (09:58 -0600)]
rtlwifi: rtl8192ee: Convert driver to use common DM table initialization

Convert driver rtl8192ee to use the common routine to initialize
dm_digtable.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8192de: Convert driver to use common DM table initialization
Larry Finger [Tue, 6 Jan 2015 15:58:07 +0000 (09:58 -0600)]
rtlwifi: rtl8192de: Convert driver to use common DM table initialization

This patch converts driver rtl8192de to use the common routine to
initialize dm_digtable.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8192c-common: Convert driver to use common DM table initialization
Larry Finger [Tue, 6 Jan 2015 15:58:06 +0000 (09:58 -0600)]
rtlwifi: rtl8192c-common: Convert driver to use common DM table initialization

These changes convert both rtl8192ce and rtl8192cu to use the new routine.
Some additional definitions are needed in the core, thus several of the
headers for other drivers are affected, but no other executable code is
changed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8188ee: Convert driver to use the common DM table init routine
Larry Finger [Tue, 6 Jan 2015 15:58:05 +0000 (09:58 -0600)]
rtlwifi: rtl8188ee: Convert driver to use the common DM table init routine

The previous patch created a routine in rtlwifi to initialize dm_digtable.
Driver rtl8188ee is converted to use that routine.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: Create new routine to initialize the DM tables
Larry Finger [Tue, 6 Jan 2015 15:58:04 +0000 (09:58 -0600)]
rtlwifi: Create new routine to initialize the DM tables

Each of the drivers contains a routine that initializes the dm_digtable
member of the driver's private area. As a first step toward reducing the
size of the drivers, a copy of this driver is created in rtlwifi, and the
definitions of the parameters are moved there.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: rtl8723be: Improve modinfo output
Larry Finger [Tue, 6 Jan 2015 15:58:03 +0000 (09:58 -0600)]
rtlwifi: rtl8723be: Improve modinfo output

The description of the power-save variables for this driver is not as
clear as for the others. The wording is changed to match the others.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agortlwifi: Unify variable naming for all drivers
Larry Finger [Tue, 6 Jan 2015 15:58:02 +0000 (09:58 -0600)]
rtlwifi: Unify variable naming for all drivers

Some drivers refer to a particular quantity in the driver's private
are by one name, while others use a different name. These differences
are removed.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobrcmfmac: get rid of duplicate SDIO device identifiers
Arend van Spriel [Tue, 6 Jan 2015 22:02:54 +0000 (23:02 +0100)]
brcmfmac: get rid of duplicate SDIO device identifiers

Instead of defining SDIO device identifier in brcm80211 code use
the defintions in linux/mmc/sdio_ids.h directly.

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: Kalle Valo <kvalo@codeaurora.org>
9 years agowl18xx: declare radar_detect_widths support for ap interfaces
Eliad Peller [Mon, 29 Dec 2014 06:24:13 +0000 (08:24 +0200)]
wl18xx: declare radar_detect_widths support for ap interfaces

After having all the dfs infrastructure in place, declare
radar_detect_widths support for the ap interfaces combination.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowlcore: add dfs region to reg domain update cmd
Guy Mishol [Mon, 29 Dec 2014 06:24:12 +0000 (08:24 +0200)]
wlcore: add dfs region to reg domain update cmd

Add dfs region to the reg domain channel update command.

Signed-off-by: Guy Mishol <guym@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowlcore: allow using dfs channels
Eliad Peller [Mon, 29 Dec 2014 06:24:11 +0000 (08:24 +0200)]
wlcore: allow using dfs channels

Since we are going to support dfs channels, there
is no reason to mark them as NO_IR (having
the DFS flag is enough anyway).

Additionally, when setting the regdomain configuration,
enable usable dfs channels.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowlcore: add dfs master restart calls
Eliad Peller [Mon, 29 Dec 2014 06:24:10 +0000 (08:24 +0200)]
wlcore: add dfs master restart calls

call wlcore_cmd_dfs_master_restart when starting
the ap on a new channel (after csa is done).

Add a new WLVIF_FLAG_BEACON_DISABLED flag to
indicate that dfs_master_restart command
is required.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowlcore: add support for ap csa
Eliad Peller [Mon, 29 Dec 2014 06:24:09 +0000 (08:24 +0200)]
wlcore: add support for ap csa

Support ap csa support by implementing the channel_switch_beacon()
mac80211 op.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowl18xx: add debugfs file to emulate radar event
Eliad Peller [Mon, 29 Dec 2014 06:24:08 +0000 (08:24 +0200)]
wl18xx: add debugfs file to emulate radar event

Add debugfs file to emulate radar detection through
a special fw cmd (which in turn will generate radar
event)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowl18xx: add radar detection implementation
Eliad Peller [Mon, 29 Dec 2014 06:24:07 +0000 (08:24 +0200)]
wl18xx: add radar detection implementation

Add support for CAC start/stop commands, and pass
radar detection events from the fw to mac80211.

Bump fw name (to wl18xx-fw-4.bin) and min fw version
(to 8.9.*.*.11), and align event mailbox accordingly.

Signed-off-by: Guy Mishol <guym@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowlcore: enable sleep during AP mode operation
Kobi L [Mon, 29 Dec 2014 06:24:06 +0000 (08:24 +0200)]
wlcore: enable sleep during AP mode operation

Enable ELP authorization in AP mode and enable the use
of the wakeup bit in the ELP register.

Introduce AP role sleep configuration which is disabled
by default. When configured, it allows the AP to sleep
when ELP is authorized for it.

Signed-off-by: Kobi Leibovitch <kobi.lev100@gmail.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowlcore: enable AP wowlan
Eliad Peller [Mon, 29 Dec 2014 06:24:05 +0000 (08:24 +0200)]
wlcore: enable AP wowlan

configure wowlan when host is suspended in AP mode,
since the FW can now wake the host up on Rx.

Signed-off-by: Kobi Leibovitch <kobi.lev100@gmail.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowlcore: add ability to reduce FW interrupts during suspend
Ram Amrani [Mon, 29 Dec 2014 06:24:04 +0000 (08:24 +0200)]
wlcore: add ability to reduce FW interrupts during suspend

Add the ability to mask FW interrupts on RX BA activity, PSM
entry/exit and fast-link notifications. This is used when the host
is suspended in order to decrease redundant wake ups.

Signed-off-by: Ram Amrani <ramrani@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowlcore/wl18xx: handle rc updates in a separate work
Eliad Peller [Mon, 29 Dec 2014 06:24:03 +0000 (08:24 +0200)]
wlcore/wl18xx: handle rc updates in a separate work

sta_rc_update runs in atomic context. thus, a new work
should be scheduled in order to configure the fw
with the required configuration.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowlcore: fix sparse warning
Eliad Peller [Mon, 29 Dec 2014 06:24:02 +0000 (08:24 +0200)]
wlcore: fix sparse warning

Use kstrtoul_from_user() for reading the user value,
and fix the following sparse warning:

drivers/net/wireless/ti/wlcore/debugfs.c:937:15: error: incompatible
types in comparison expression (different type sizes)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agowlcore: fix WLCORE_VENDOR_ATTR_GROUP_KEY policy
Eliad Peller [Mon, 29 Dec 2014 06:24:01 +0000 (08:24 +0200)]
wlcore: fix WLCORE_VENDOR_ATTR_GROUP_KEY policy

The attribute type is binary data (with max length).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomac80211: fix handling TIM IE when stations disconnect
Johannes Berg [Fri, 9 Jan 2015 10:40:39 +0000 (11:40 +0100)]
mac80211: fix handling TIM IE when stations disconnect

When a station disconnects with frames still pending, we clear
the TIM bit, but too late - it's only cleared when the station
is already removed from the driver, and thus the driver can get
confused (and hwsim will loudly complain.)

Fix this by clearing the TIM bit earlier, when the station has
been unlinked but not removed from the driver yet. To do this,
refactor the TIM recalculation to in that case ignore traffic
and simply assume no pending traffic - this is correct for the
disconnected station even though the frames haven't been freed
yet at that point.

This patch isn't needed for current drivers though as they don't
check the station argument to the set_tim() operation and thus
don't really run into the possible confusion.

Reported-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211_hwsim: fix PS debugfs file locking
Johannes Berg [Fri, 9 Jan 2015 10:29:50 +0000 (11:29 +0100)]
mac80211_hwsim: fix PS debugfs file locking

The functions called within the iterators must be called with
tasklets disabled, so use atomic iteration like the rest of
the code and disable tasklets around the whole operation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: provide per-TID RX/TX MSDU counters
Johannes Berg [Fri, 21 Nov 2014 13:26:31 +0000 (14:26 +0100)]
mac80211: provide per-TID RX/TX MSDU counters

Implement the new counters cfg80211 can now advertise to userspace.
The TX code is in the sequence number handler, which is a bit odd,
but that place already knows the TID and frame type, so it was
easiest and least impact there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agonl80211: support per-TID station statistics
Johannes Berg [Fri, 19 Dec 2014 11:34:00 +0000 (12:34 +0100)]
nl80211: support per-TID station statistics

The base for the current statistics is pretty mixed up, support
exporting RX/TX statistics for MSDUs per TID. This (currently)
covers received MSDUs, transmitted MSDUs and retries/failures
thereof.

Doing it per TID for MSDUs makes more sense than say only per AC
because it's symmetric - we could export per-AC statistics for all
frames (which AC we used for transmission can be determined also
for management frames) but per TID is better and usually data
frames are really the ones we care about. Also, on RX we can't
determine the AC - but we do know the TID for any QoS MPDU we
received.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agonl80211: clarify packet statistics descriptions
Johannes Berg [Fri, 21 Nov 2014 11:40:05 +0000 (12:40 +0100)]
nl80211: clarify packet statistics descriptions

The current statistics we keep aren't very clear, some are on
MPDUs and some on MSDUs/MMPDUs. Clarify the descriptions based
on the counters mac80211 keeps.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: add nl80211 beacon-only statistics
Johannes Berg [Mon, 17 Nov 2014 13:12:22 +0000 (14:12 +0100)]
cfg80211: add nl80211 beacon-only statistics

Add these two values:
 * BEACON_RX: number of beacons received from this peer
 * BEACON_SIGNAL_AVG: signal strength average for beacons only

These can then be used for Android Lollipop's statistics request.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: remove enum station_info_flags
Johannes Berg [Mon, 17 Nov 2014 13:08:11 +0000 (14:08 +0100)]
cfg80211: remove enum station_info_flags

This is really just duplicating the list of information that's
already available in the nl80211 attribute, so remove the list.
Two small changes are needed:
 * remove STATION_INFO_ASSOC_REQ_IES complete, but the length
   (assoc_req_ies_len) can be used instead
 * add NL80211_STA_INFO_RX_DROP_MISC which exists internally
   but not in nl80211 yet

This gets rid of the duplicate maintenance of the two lists.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: allow drivers to provide most station statistics
Johannes Berg [Mon, 17 Nov 2014 10:35:23 +0000 (11:35 +0100)]
mac80211: allow drivers to provide most station statistics

In many cases, drivers can filter things like beacons that will
skew statistics reported by mac80211. To get correct statistics
in these cases, call drivers to obtain statistics and let them
override all values, filling values from mac80211 if the driver
didn't provide them. Not all of them make sense for the driver
to fill, so some are still always done by mac80211.

Note that this doesn't currently allow a driver to say "I know
this value is wrong, don't report it at all", or to sum it up
with a mac80211 value (as could be useful for "dropped misc"),
that can be added if it turns out to be needed.

This also gets rid of the get_rssi() method as is can now be
implemented using sta_statistics().

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: send statistics with delete station event
Johannes Berg [Fri, 14 Nov 2014 19:32:57 +0000 (20:32 +0100)]
mac80211: send statistics with delete station event

Use the new cfg80211_del_sta_sinfo() function to send the
statistics about the deleted station with the delete event.
This lets userspace see how much traffic etc. the deleted
station used.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: allow including station info in delete event
Johannes Berg [Fri, 14 Nov 2014 16:14:00 +0000 (17:14 +0100)]
cfg80211: allow including station info in delete event

When a station is removed, its statistics may be interesting to
userspace, for example for further aggregation of statistics of
all stations that ever connected to an AP.

Introduce a new cfg80211_del_sta_sinfo() function (and make the
cfg80211_del_sta() a static inline calling it) to allow passing
a struct station_info along with this, and send the data in the
nl80211 event message.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: add scan time to survey data
Johannes Berg [Fri, 14 Nov 2014 15:44:11 +0000 (16:44 +0100)]
cfg80211: add scan time to survey data

Add the time spent scanning to the survey data so it can be
reported by drivers that collect such information.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: allow survey data to return global data
Johannes Berg [Fri, 14 Nov 2014 15:43:50 +0000 (16:43 +0100)]
cfg80211: allow survey data to return global data

Not all devices are able to report survey data (particularly
time spent for various operations) per channel. As all these
statistics already exist in survey data, allow such devices
to report them (if userspace requested it)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: remove "channel" from survey names
Johannes Berg [Fri, 14 Nov 2014 15:35:34 +0000 (16:35 +0100)]
cfg80211: remove "channel" from survey names

All of the survey data is (currently) per channel anyway,
so having the word "channel" in the name does nothing. In
the next patch I'll introduce global data to the survey,
where the word "channel" is actually confusing.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: Re-fix accounting of the tailroom-needed counter
Ido Yariv [Tue, 6 Jan 2015 13:39:02 +0000 (08:39 -0500)]
mac80211: Re-fix accounting of the tailroom-needed counter

When hw acceleration is enabled, the GENERATE_IV or PUT_IV_SPACE flags
only require headroom space. Therefore, the tailroom-needed counter can
safely be decremented for most drivers.

The older incarnation of this patch (ca34e3b5) assumed that the above
holds true for all drivers. As reported by Christopher Chavez and
researched by Christian Lamparter and Larry Finger, this isn't a valid
assumption for p54 and cw1200.

Drivers that still require tailroom for ICV/MIC even when HW encryption
is enabled can use IEEE80211_KEY_FLAG_RESERVE_TAILROOM to indicate it.

Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Cc: Christopher Chavez <chrischavez@gmx.us>
Cc: Christian Lamparter <chunkeey@googlemail.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Solomon Peachy <pizza@shaftnet.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoMerge branch 'mac80211' into mac80211-next
Johannes Berg [Wed, 7 Jan 2015 13:39:02 +0000 (14:39 +0100)]
Merge branch 'mac80211' into mac80211-next

Merge mac80211.git to get some changes that would otherwise
cause conflicts with new changes coming here.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomwifiex: tdls: Use setup_timer
Julia Lawall [Fri, 26 Dec 2014 14:35:58 +0000 (15:35 +0100)]
mwifiex: tdls: Use setup_timer

Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.function = f;
-t.data = d;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: 11n_rxreorder: Use setup_timer
Julia Lawall [Fri, 26 Dec 2014 14:35:57 +0000 (15:35 +0100)]
mwifiex: 11n_rxreorder: Use setup_timer

Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.function = f;
-t.data = d;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agomwifiex: main: Use setup_timer
Julia Lawall [Fri, 26 Dec 2014 14:35:56 +0000 (15:35 +0100)]
mwifiex: main: Use setup_timer

Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.function = f;
-t.data = d;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoorinoco_usb: Use setup_timer
Julia Lawall [Fri, 26 Dec 2014 14:35:55 +0000 (15:35 +0100)]
orinoco_usb: Use setup_timer

Convert a call to init_timer and accompanying intializations of
the timer's data and function fields to a call to setup_timer.

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

// <smpl>
@@
expression t,f,d;
@@

-init_timer(&t);
+setup_timer(&t,f,d);
-t.function = f;
-t.data = d;
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>