firefly-linux-kernel-4.4.55.git
9 years agoath10k: introduce basic tdls functionality
Marek Puzyniak [Mon, 30 Mar 2015 06:51:53 +0000 (09:51 +0300)]
ath10k: introduce basic tdls functionality

This patch introduces tdls without tdls peer uapsd and tdls channel switching.
Transmitting tdls data frames works only for ethernet type frames, that's why
data addressed to tdls sta is in ethernet format.

This patch depends on commit c23e31cf7b55 ("mac80211: initialize rate control
earlier for tdls station").

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com>
Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: add wmi support for tdls
Marek Puzyniak [Mon, 30 Mar 2015 06:51:53 +0000 (09:51 +0300)]
ath10k: add wmi support for tdls

As a part of tdls implementation introduce
tdls related wmi data structures, constant
values and functions.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: update station counting
Marek Puzyniak [Mon, 30 Mar 2015 06:51:52 +0000 (09:51 +0300)]
ath10k: update station counting

Currently station counting functions
(inc_num_stations/dec_num_stations) does not handle
tdls type of stations. Tdls station should be counted
because it consumes peer in firmware. Only not tdls
stations are excluded from this counting.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: store max tdls vdevs that fw can handle
Marek Puzyniak [Mon, 30 Mar 2015 06:51:52 +0000 (09:51 +0300)]
ath10k: store max tdls vdevs that fw can handle

Currently number of tdls vdevs supported by firmware
is hardcoded. For future usage it is stored in ath10k
structure based on defined value.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: make peer type configurable
Marek Puzyniak [Mon, 30 Mar 2015 06:51:52 +0000 (09:51 +0300)]
ath10k: make peer type configurable

Peer type was hardcoded to default value.
For future implementation it is required
to make is configurable.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: unify tx mode and dispatch
Michal Kazior [Mon, 30 Mar 2015 06:51:51 +0000 (09:51 +0300)]
ath10k: unify tx mode and dispatch

There are a few different tx paths depending on
firmware and frame itself.

Creating a uniform decision will make it possible
to switch between different txmode easier, both
for testing and for future features as well.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: clear htt.freq
Michal Kazior [Mon, 30 Mar 2015 06:51:51 +0000 (09:51 +0300)]
ath10k: clear htt.freq

If htt.freq isn't cleared and contains garbage fw
may discard tx packets. Prevent this from
happening by clearing htt.freq properly.

Possible manifestation of the problem could be not
being able to send auth request/response frames on
firmware with HTT >= 3.4 (when freq param was
introduced), e.g. on qca6174.

Fixes: 8d6d36243610 ("ath10k: fix offchan reliability")
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix HTT op backwards compatibility for QCA6174
Kalle Valo [Mon, 30 Mar 2015 11:14:28 +0000 (14:14 +0300)]
ath10k: fix HTT op backwards compatibility for QCA6174

Commit 8348db298496 ("ath10k: add ATH10K_FW_IE_HTT_OP_VERSION") broke QCA6174
receive side as the HTT ids from ATH10K_FW_HTT_OP_VERSION_MAIN don't have
HTT_TLV_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND set. Fix this by adding a backwards
compatibility code which sets HTT op version if it's not set by the firmware
image.

Fixes: 8348db298496 ("ath10k: add ATH10K_FW_IE_HTT_OP_VERSION")
Reported-by: Michal Kazior <michal.kazior@tieto.com>
Tested-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoMerge mac80211-next into ath-next
Kalle Valo [Mon, 30 Mar 2015 07:07:12 +0000 (10:07 +0300)]
Merge mac80211-next into ath-next

Patch "ath10k: introduce basic tdls functionality" depends on this mac80211
patch:

c23e31cf7b55 mac80211: initialize rate control earlier for tdls station

9 years agoath10k: bump up FW API to 5
Kalle Valo [Wed, 25 Mar 2015 11:12:42 +0000 (13:12 +0200)]
ath10k: bump up FW API to 5

Firmware 10.2.4.48-3 now supports management frames over HTT feature and has
ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX. But as 10.2.4 branch has conflicting HTT ids
patch "ath10k: add ATH10K_FW_IE_HTT_OP_VERSION" is needed to fix the issue.
Older ath10k versions don't have support that support and to maintain backwards
compatibility we need bump up the FW API to 5 not break older versions.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: add ATH10K_FW_IE_HTT_OP_VERSION
Rajkumar Manoharan [Wed, 25 Mar 2015 11:12:27 +0000 (13:12 +0200)]
ath10k: add ATH10K_FW_IE_HTT_OP_VERSION

Target to host HTT messages are conflicting between 10.x and other
firmware revisions. By maintaining separate HTT T2H tables for each
firmware revisions (main, 10x and tlv) similar to WMI abstraction,
solves the conflicts. Add ATH10K_FW_IE_HTT_OP_VERSION so that the firmware can
advertise the HTT interface to ath10k.

This fix is needed to get management frames over HTT (ie.
ATH10K_FW_FEATURE_HAS_WMI_MGMT_TX disabled) working with 10.2.4.48-2 firmware.
Otherwise there will be unknown htt events and nothing works:

[30087.438343] ath10k_pci 0000:02:00.0: htt event (19) not handled
[30087.448691] ath10k_pci 0000:02:00.0: htt event (19) not handled
[30149.032974] ath10k_pci 0000:02:00.0: htt event (19) not handled

If the firmware does not have ATH10K_FW_IE_HTT_OP_VERSION use the main HTT
interface. That way old firmware images will still work.

Cc: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: add WOW patterns support
Janusz Dziedzic [Mon, 23 Mar 2015 15:32:54 +0000 (17:32 +0200)]
ath10k: add WOW patterns support

Add patterns support for WOW.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: add WMI support for WOW patterns
Janusz Dziedzic [Mon, 23 Mar 2015 15:32:54 +0000 (17:32 +0200)]
ath10k: add WMI support for WOW patterns

Add WMI support for WOW patterns.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: add WOW disconnect/magic-packet support
Janusz Dziedzic [Mon, 23 Mar 2015 15:32:53 +0000 (17:32 +0200)]
ath10k: add WOW disconnect/magic-packet support

Add support for WOW disconnect and magic-packet.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: add WMI support for WOW
Janusz Dziedzic [Mon, 23 Mar 2015 15:32:53 +0000 (17:32 +0200)]
ath10k: add WMI support for WOW

Add WMI support for WOW like enable,
wakeup events and host wakeup indication.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: allow user to toggle ani_enable via debugfs
Ashok Raj Nagarajan [Thu, 19 Mar 2015 11:08:00 +0000 (16:38 +0530)]
ath10k: allow user to toggle ani_enable via debugfs

Now that ANI is enabled by default, allow user to disable or enable ANI feature
from debugfs

echo 0|1 > /sys/kernel/debug/ieee80211/phyX/ath10k/ani_enable

Signed-off-by: Ashok Raj Nagarajan <arnagara@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: enable Adaptive Noise Immunity (ANI) by default
Ashok Raj Nagarajan [Thu, 19 Mar 2015 11:07:59 +0000 (16:37 +0530)]
ath10k: enable Adaptive Noise Immunity (ANI) by default

ANI helps to improve connectvity and performance in a noisy environment.
Enabling this feature would help the user experience a better and stable
wireless connection in a noisy environmnet. This feature is currently not
enabled for ath10k. Enable this feature by default.

Signed-off-by: Ashok Raj Nagarajan <arnagara@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: enable channel 144 on 5GHz band
Peter Oh [Wed, 18 Mar 2015 18:39:18 +0000 (11:39 -0700)]
ath10k: enable channel 144 on 5GHz band

Enable channel 144 on 5GHz band since 802.11ac introduced it.

Signed-off-by: Peter Oh <poh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: move driver state check before setting throttle
Rajkumar Manoharan [Sun, 15 Mar 2015 15:06:25 +0000 (20:36 +0530)]
ath10k: move driver state check before setting throttle

Since thermal daemon is unaware of the device state, it might
try to adjust the throttle state when the device is powered down.
So the driver caches the value and will configure it while
powering up the target. The cached value will be programed later
once the device is brought up. In such case, returning error
status is confusing and misleading the user application. Hence
moving the driver state check before sending wmi command to target.

Reported-by: Matthias Kaehlcke <mka@google.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: cache throttle state when device is down
Rajkumar Manoharan [Sun, 15 Mar 2015 15:06:24 +0000 (20:36 +0530)]
ath10k: cache throttle state when device is down

Allow driver to cache the throttle state when the devie is not
yet started. Configure the cached throttle state while powering
up the device. Since thermal daemon is unaware of the up/down cycle,
it assumes that device is throttled.

Reported-by: Matthias Kaehlcke <mka@google.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: do not restrict thermal throttling to ap mode
Rajkumar Manoharan [Sun, 15 Mar 2015 15:06:23 +0000 (20:36 +0530)]
ath10k: do not restrict thermal throttling to ap mode

Recently thermal mitigation is validated in station mode as well.
Hence allowing thermal throttling for all interfaces. This enables
user to validate thermal mitigation with different modes.

Reported-by: Matthias Kaehlcke <mka@google.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: configure thermal throttle while powering up
Rajkumar Manoharan [Sun, 15 Mar 2015 15:06:22 +0000 (20:36 +0530)]
ath10k: configure thermal throttle while powering up

Thermal throttling is not handled in software restart and device
bootup. Also it needs to be configured whenever quiet period got
updated. Fix that.

Reported-by: Matthias Kaehlcke <mka@google.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix interpretation of cooling device state
Rajkumar Manoharan [Sun, 15 Mar 2015 15:06:21 +0000 (20:36 +0530)]
ath10k: fix interpretation of cooling device state

Setting the sysfs attribute ends up configuring the duty cycle,
but the interface through which the attribute is exposed
(cooling_device) is for setting the throttle/cooling state. This
is confusing the user. Hence renaming the cooling device interfaces
for better readability.

Cc: Matthias Kaehlcke <mka@google.com>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: add debugfs entry to configure quiet period
Rajkumar Manoharan [Sun, 15 Mar 2015 15:06:20 +0000 (20:36 +0530)]
ath10k: add debugfs entry to configure quiet period

Add support to configure quiet period (in milliseconds) via debugfs.
This is useful to experiment different quiet period values along with
different throttle ratio.

echo 100 > /sys/kernel/debug/ieee80211/phyX/ath10k/quiet_period

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: increase station kickout threshold
Rajkumar Manoharan [Thu, 19 Mar 2015 14:03:29 +0000 (16:03 +0200)]
ath10k: increase station kickout threshold

Since the station kickout threshold is also counting software
reries (Default sw count in firmware is 16), increasing the threshold
to try with atleast 20 data frames before kicking out the station.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix rts profile for second rate series
Rajkumar Manoharan [Thu, 19 Mar 2015 14:03:29 +0000 (16:03 +0200)]
ath10k: fix rts profile for second rate series

By default rts protection is enabled in firmware for the second
rateset. Currently ath10k selects RTS profile (only for software
retries), when legacy stations are associated or asked by mac80211.
On congested environment, when AP is running in HT/VHT mode and
there are no legacy clients associated, this will impact the
robustness. Also enabling RTS protection only for second rateset will
not impact performance on clear environment. Fix that.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agocfg80211: add vlan to station add/change tracing
Johannes Berg [Fri, 20 Mar 2015 18:56:41 +0000 (19:56 +0100)]
cfg80211: add vlan to station add/change tracing

This helps debug issues with VLAN modifications that are otherwise
not really visible in any tracing/debugging.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: avoid duplicate TX path station lookup
Johannes Berg [Fri, 20 Mar 2015 13:18:27 +0000 (14:18 +0100)]
mac80211: avoid duplicate TX path station lookup

Instead of looking up the destination station twice in the TX path
(first to build the header, and then for control processing), save
it when building the header and use it later in the TX path.

To avoid having to look up the station in the many callers, allow
those to pass %NULL which keeps the existing lookup.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: mesh: avoid pointless station lookup
Johannes Berg [Fri, 20 Mar 2015 15:01:52 +0000 (16:01 +0100)]
mac80211: mesh: avoid pointless station lookup

In ieee80211_build_hdr(), the station is looked up to build the
header correctly (QoS field) and to check for authorization. For
mesh, authorization isn't checked here, and QoS capability is
mandatory, so the station lookup can be avoided.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: drop 4-addr VLAN frames earlier if not connected
Johannes Berg [Fri, 20 Mar 2015 13:05:02 +0000 (14:05 +0100)]
mac80211: drop 4-addr VLAN frames earlier if not connected

If there's no station on the 4-addr VLAN interface, then frames
cannot be transmitted. Drop such frames earlier, before setting
up all the information for them.

We should keep the old check though since that code might be used
for other internally-generated frames.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: don't look up destination station twice
Johannes Berg [Fri, 20 Mar 2015 12:29:29 +0000 (13:29 +0100)]
mac80211: don't look up destination station twice

There's no need to look up the destination station twice while
building the 802.11 header for a given frame if the frame will
actually be transmitted to the station we initially looked up.

This happens for 4-addr VLAN interfaces and TDLS connections, which
both directly send the frame to the station they looked up, though
in the case of TDLS some station conditions need to be checked.

To avoid that, add a variable indicating that we've looked up the
station that the frame is going to be transmitted to, and avoid the
lookup/flag checking if it already has been done.

In the TDLS case, also move the authorized/wme_sta flag assignment
to the correct place, i.e. only when that station is really used.
Before this change, the new lookup should always have succeeded so
that the potentially erroneous data would be overwritten.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: remove drop_unencrypted code
Johannes Berg [Fri, 20 Mar 2015 10:37:36 +0000 (11:37 +0100)]
mac80211: remove drop_unencrypted code

This mechanism was historic, and only ever used by IBSS, which
also doesn't need to have it as it properly manages station's
802.1X PAE state (or, with WEP, always has a key.)

Remove the mechanism to clean up the code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoath10k: setup maximum number of supported stations
Janusz.Dziedzic@tieto.com [Thu, 12 Mar 2015 12:11:41 +0000 (13:11 +0100)]
ath10k: setup maximum number of supported stations

Setup maximum number of associated stations supported in
AP/P2P_GO mode.

This allow hostapd/wpa_supplicant to play with that limit
and set more information (eg. P2P group limit bit for P2P_GO).

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: protect driver from unsolicited htc ep0 events
Michal Kazior [Wed, 11 Mar 2015 13:37:11 +0000 (14:37 +0100)]
ath10k: protect driver from unsolicited htc ep0 events

Some firmware revisions (tested with qca6174
rm2.0-00088) deliver unsolicited unknown (kind of
garbled) HTC ep0 event to host in some cases.

This issue was mainly observed with both qca988x
and qca6174 being installed on a single host
system. During driver probing if qca6174 booting
sequences were somehow deferred (e.g. by qca988x
implicitly making some resources busy presumably)
the unsolicited event would came around 1s after
ATH10K_HTC_MSG_READY_ID was delivered to host for
qca6174.

The unsolicited event would confuse driver and
cause HTT initialization (and subsequently
driver probing) to fail.

Make the ep0 event processing more robust. The
event will still be caught but instead will
only generate a warning now.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix wrong symlink name on error path
Rajkumar Manoharan [Thu, 12 Mar 2015 17:32:00 +0000 (19:32 +0200)]
ath10k: fix wrong symlink name on error path

Wrong symlink name is used on error path of thermal registration
and also correcting the error message.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: strip qos data bit always
Michal Kazior [Wed, 11 Mar 2015 13:25:26 +0000 (14:25 +0100)]
ath10k: strip qos data bit always

NativeWifi tx mode expects QoS Data frames to be
delivered as Data frames with QoS part (e.g. tid)
being delievered out-of-band in fw tx command.

The QoS bit wasn't stripped before submitting to
firmware.

Stripping fixes two known problems:

 * qca6174 IOT with some APs, e.g.
   Cisco AIR-AP 1252 (which would crash after
   ath10k association). Some ath9k APs would
   crash as well.

 * sniffing own tx frames via radiotap because,
   e.g. wireshark was seeing QoS bit set but
   since QoS Control was stripped in ath10k it
   would parse beginning of LLC/SNAP

>From debugability point of view this removes the
ability to distinguish QoS from non-QoS frames
when sniffing own tx via radiotap. On the other
hand frames can be now parsed correctly without
special software modification.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agomac80211: Get IV len from key conf and not cipher scheme
Cedric Izoard [Tue, 17 Mar 2015 10:47:33 +0000 (10:47 +0000)]
mac80211: Get IV len from key conf and not cipher scheme

When a key is installed using a cipher scheme, set a new
internal key flag (KEY_FLAG_CIPHER_SCHEME) on it, to allow
distinguishing such keys more easily.

In particular, use this flag on the TX path instead of
testing the sta->cipher_scheme pointer, as the station is
NULL for broad-/multicast message, and use the key's iv_len
instead of the cipher scheme information.

Signed-off-by: Cedric Izoard <cedric.izoard@ceva-dsp.com>
[add missing documentation, rewrite commit message]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: IBSS: refactor ieee80211_rx_bss_info
Janusz.Dziedzic@tieto.com [Mon, 9 Mar 2015 06:58:15 +0000 (07:58 +0100)]
mac80211: IBSS: refactor ieee80211_rx_bss_info

Put station specific code in ieee80211_update_sta_info
function.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: minstrel_ht: fix rounding issue in MCS duration calculation
Felix Fietkau [Fri, 13 Mar 2015 09:54:44 +0000 (10:54 +0100)]
mac80211: minstrel_ht: fix rounding issue in MCS duration calculation

On very high MCS bitrates, the calculated duration of rates that are
next to each other can be very imprecise, due to the small packet size
used as reference (1200 bytes).
This is most visible in VHT80 nss=2 MCS8/9, for which minstrel shows the
same throughput when the probability is also the same. This leads to a
bad rate selection for such rates.

Fix this issue by introducing an average A-MPDU size factor into the
calculation.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: Process all pending regulatory requests/hints
Ben [Thu, 12 Mar 2015 13:37:34 +0000 (09:37 -0400)]
cfg80211: Process all pending regulatory requests/hints

It is possible that there are several regulatory requests
pending, but the processing of the last one does not call
CRDA, and thus the other requests are not handled.

Fix this by rescheduling the work until all requests have
been processed.

Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: initialize rate control earlier for tdls station
Marek Puzyniak [Sun, 8 Mar 2015 16:04:22 +0000 (18:04 +0200)]
mac80211: initialize rate control earlier for tdls station

Currently when TDLS station in driver goes from authenticated
to associated state it can not use rate control parameters
because rate control is not initialized yet. Some drivers
require parameters already initialized by rate control when
entering associated state. It can be done by initializing
rate control after station transition to associated state but
before notifying driver about that.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
[fix comment to say 'associated' instead of 'authorized']
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: refactor drop connection/unlock in CSA processing
Johannes Berg [Thu, 12 Mar 2015 06:53:25 +0000 (08:53 +0200)]
mac80211: refactor drop connection/unlock in CSA processing

The schedule_work()/mutex unlocking code is duplicated many times,
refactor that to a common place in the function.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: allow to get wireless_dev structure from ieee80211_vif
Emmanuel Grumbach [Thu, 12 Mar 2015 06:53:24 +0000 (08:53 +0200)]
mac80211: allow to get wireless_dev structure from ieee80211_vif

This will allow mac80211 drivers to call cfg80211 APIs with
the right handle.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: add comment for rx_path_lock
Johannes Berg [Mon, 16 Mar 2015 08:08:20 +0000 (09:08 +0100)]
mac80211: add comment for rx_path_lock

Add a comment explaining how the RX path lock is used.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: move netdev stats to common function
Johannes Berg [Mon, 16 Mar 2015 08:05:23 +0000 (09:05 +0100)]
mac80211: move netdev stats to common function

Move the netdev stats accounting into the common function
ieee80211_deliver_skb() that is called in both places.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoath10k: fix PMF by using AES-CMAC/IGTK software crypto
Bartosz Markowski [Tue, 10 Mar 2015 13:32:19 +0000 (14:32 +0100)]
ath10k: fix PMF by using AES-CMAC/IGTK software crypto

While testing with older supplicant, .drv_set_key() was failing due to
higher than ath10k firmware could handle key_index (WMI_MAX_KEY_INDEX == 3).

--
wpa_driver_nl80211_set_key: ifindex=15 alg=4 addr=0x7f02b129fbe3 key_idx=4 set_tx=0 seq_len=6 key_len=16
    broadcast key
nl80211: set_key failed; err=-22 Invalid argument)
wlan0: WPA: Failed to configure IGTK to the driver
wlan0: RSN: Failed to configure IGTK
--

In order to fix this case (PMF: AES-CMAC/IGTK) force the AES_CMAC cipher to
be handled by software.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: add hw connection monitor support
Michal Kazior [Tue, 10 Mar 2015 14:22:01 +0000 (16:22 +0200)]
ath10k: add hw connection monitor support

Some firmware revisions (e.g. qca6174 with fw73)
don't deliver beacons to host reliably. This
causes random disconnects even in perfect
conditions. This is most visible with
multi-channel operation.

All available firmware revisions seem to support
beacon miss offloading so there shouldn't be any
problems.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: implement wmi roam event
Michal Kazior [Tue, 10 Mar 2015 14:21:54 +0000 (16:21 +0200)]
ath10k: implement wmi roam event

This can be used to implement offloaded rssi
threshold, beacon miss or even automatic
in-firmware BSS roaming in the future.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix WPA crypto
Michal Kazior [Mon, 9 Mar 2015 13:24:17 +0000 (14:24 +0100)]
ath10k: fix WPA crypto

Commit 370e567363e6 ("ath10k: fix broken traffic for 802.1x in client mode")
introduced a regression on WPA crypto. All keys were treated as if they were
WEP which resulted in WPA being incorrectly installed to fw/hw and subsequently
no traffic.

Reported-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix CAC regression
Michal Kazior [Mon, 9 Mar 2015 13:20:55 +0000 (14:20 +0100)]
ath10k: fix CAC regression

Commit 548462133d98 ("ath10k: fix interrupt storm") introduced a
regression. The condition responsible for bringing up monitor vdev was broken
and it was never started for CAC so effectivelly CAC would not detect radar
pulses.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix patching mistake for AP/IBSS CSA
Michal Kazior [Mon, 9 Mar 2015 13:19:24 +0000 (14:19 +0100)]
ath10k: fix patching mistake for AP/IBSS CSA

Mistakenly v1 of `ath10k: fix AP/IBSS CSA with
template based fw`
(81a9a17db5d766d2872c4ab8a77b8666d22031ec) was
applied.

This patch applies the missing bits from v2:
 * remove unnecessary locking
 * add some (sanity) checks

There are no practical functionality differences
between v1 and v2.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: save/restore pci config space properly
Michal Kazior [Mon, 2 Mar 2015 12:22:14 +0000 (13:22 +0100)]
ath10k: save/restore pci config space properly

The check was't really necessary and couldn't even
work to begin with because pci_restore_state()
restores only first 64 bytes of PCI configuration
space.

Actually the PCI subsystem takes care of this so
there's no need for explicit calls to save PCI
state in ath10k.

This is necessary for future WoWLAN support.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix some pci wake/sleep issues
Michal Kazior [Mon, 2 Mar 2015 12:22:13 +0000 (13:22 +0100)]
ath10k: fix some pci wake/sleep issues

In some cases the device ends up sleeping while
ath10k didn't expect it to leading to reading
garbage from registers, e.g. when shared irqs are
used and the driver is in powered down state.

This effectively makes the device remain awake all
the time even when all interfaces are down.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix interrupt storm
Vasanthakumar Thiagarajan [Mon, 2 Mar 2015 12:15:28 +0000 (17:45 +0530)]
ath10k: fix interrupt storm

Promiscuous mode is enabled when wlan interface is added to
bridge. ath10k creates a monitor mode when promiscuous mode
is enabled. When monitor vdev is running along with other
vdev(s) there is a huge number of interrupts generated
especially in noisy condition. Fix this by not enabling
promiscuous(monitor) mode when already a vdev is running.
As disabling promiscuous mode may have issues with 4-address
bridging in STA mode, the change is done specific to non-sta/ibss
mode types. This does not change the support of virtual interface of
type monitor along with other vdevs of any type.

This could fix management frame drop in fw due to unavailable
buffers because in monitor mode device receives everything seen
on the air. In noisy condition, disabling monitor mode helps assoc
go through without any issue.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: move ath10k_vdev_stop() up before ath10k_vdev_start_restart()
Vasanthakumar Thiagarajan [Mon, 2 Mar 2015 12:15:27 +0000 (17:45 +0530)]
ath10k: move ath10k_vdev_stop() up before ath10k_vdev_start_restart()

This patches does not modify any functionality. Just a code move
so that ath10k_vdev_stop() can be used in ath10k_vdev_start_restart()
for any failure cases which involves vdev_stop().

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: improve 11b coex
Michal Kazior [Mon, 2 Mar 2015 10:21:17 +0000 (11:21 +0100)]
ath10k: improve 11b coex

This improves coexistance with 11b legacy devices
on wmi-tlv and qca6174.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: implement handling of p2p noa event
Michal Kazior [Thu, 26 Feb 2015 12:23:18 +0000 (13:23 +0100)]
ath10k: implement handling of p2p noa event

Since new wmi-tlv firmware doesn't have SWBA event
the only way to deliver P2P NoA information is
through a new dedicated event.

This fixes P2P GO Probe Responses to include P2P
NoA when appropriate on the new firmware.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: refactor p2p noa code
Michal Kazior [Thu, 26 Feb 2015 12:23:17 +0000 (13:23 +0100)]
ath10k: refactor p2p noa code

Some files are getting bloated and it makes sense
to split some of the code into separate files. Do
so with the P2P NoA code and prepare it for reuse.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix TxBF VHT capabilities for 2+ RF-chain devices
Michal Kazior [Thu, 26 Feb 2015 10:11:22 +0000 (11:11 +0100)]
ath10k: fix TxBF VHT capabilities for 2+ RF-chain devices

Firmware doesn't report a complete and
ready-to-use vht cap. Instead the driver is
supposed to fill in the missing bits related to
number of chains.

This effectively increases Compressed Steering
Number and Number of Sounding Dimensions in
AssocReq frames for devices with more than one RF
chain and should improve TxBF performance.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix ap u-apsd cmd on qca6174 w/ wmi-tlv
Michal Kazior [Wed, 25 Feb 2015 10:39:36 +0000 (11:39 +0100)]
ath10k: fix ap u-apsd cmd on qca6174 w/ wmi-tlv

The command was truncated so the parameter value
was seen in fw as 0. This caused U-APSD enabled
stations to be misconfigured and mistreated by AP.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: increase duty cycle maximum limit
Rajkumar Manoharan [Thu, 19 Feb 2015 17:55:05 +0000 (23:25 +0530)]
ath10k: increase duty cycle maximum limit

Allow user to configure the duty cycle upto 100%. Since thermal
mitigation algorithm is running in user space, remove the driver
level limitation and let the user to control the temperature.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix broken traffic for static WEP in IBSS
Michal Kazior [Wed, 18 Feb 2015 13:02:27 +0000 (14:02 +0100)]
ath10k: fix broken traffic for static WEP in IBSS

When WEP keys are uploaded it's possible that
there are stations associated already (e.g. when
merging) without any keys. Static WEP needs an
explicit per-peer key upload.

Make sure to re-upload wep keys if necessary.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix broken traffic for 802.1x in client mode
Michal Kazior [Wed, 18 Feb 2015 13:02:26 +0000 (14:02 +0100)]
ath10k: fix broken traffic for 802.1x in client mode

When running 802.1x WEP keys must be installed
without pairwise-groupwise swap (which is
necessary for static WEP).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: update MODULE_FIRMWARE definitions for QCA6174
Bartosz Markowski [Wed, 18 Feb 2015 12:16:37 +0000 (13:16 +0100)]
ath10k: update MODULE_FIRMWARE definitions for QCA6174

This has been missed while adding the QCA6174 support.
As in the last time, without advertising the firmware files
as needed (or optional) for ath10k, these won't be built into
ram disk for instance.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix AP/IBSS CSA with template based fw
Michal Kazior [Thu, 5 Mar 2015 14:02:17 +0000 (16:02 +0200)]
ath10k: fix AP/IBSS CSA with template based fw

qca6174 with wmi-tlv firmware uses offloaded
beaconing scheme (i.e. templates). This requires a
little different approach when implementing CSA.

Add missing code to update CS count and report CSA
completion to mac80211. Without it channel switch
was never finished.

To avoid races during interface teardown data_lock
has been used to protect is_up and is_started so
they can be compared against before scheduling
count down work.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agocfg80211: Schedule timeout for all CRDA calls
Ilan peer [Wed, 4 Mar 2015 05:32:07 +0000 (00:32 -0500)]
cfg80211: Schedule timeout for all CRDA calls

Timeout was scheduled only in case CRDA was called due to user hints,
but was not scheduled for other cases. This can result in regulatory
hint processing getting stuck in case that there is no CRDA configured.

Change this by scheduling a timeout every time CRDA is called. In
addition, in restore_regulatory_settings() all pending requests are
restored (and not only the user ones).

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Acked-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: Add API to change the indoor regulatory setting
Ilan peer [Wed, 4 Mar 2015 05:32:06 +0000 (00:32 -0500)]
cfg80211: Add API to change the indoor regulatory setting

Previously, the indoor setting configuration assumed that as
long as a station interface is connected, the indoor environment
setting does not change. However, this assumption is problematic
as:

- It is possible that a station interface is connected to a mobile
  AP, e.g., softAP or a P2P GO, where it is possible that both the
  station and the mobile AP move out of the indoor environment making
  the indoor setting invalid. In such a case, user space has no way to
  invalidate the setting.
- A station interface disconnection does not necessarily imply that
  the device is no longer operating in an indoor environment, e.g.,
  it is possible that the station interface is roaming but is still
  stays indoor.

To handle the above, extend the indoor configuration API to allow
user space to indicate a change of indoor settings, and allow it to
indicate weather it controls the indoor setting, such that:

1. If the user space process explicitly indicates that it is going
   to control the indoor setting, do not clear the indoor setting
   internally, unless the socket is released. The user space process
   should use the NL80211_ATTR_SOCKET_OWNER attribute in the command
   to state that it is going to control the indoor setting.
2. Reset the indoor setting when restoring the regulatory settings in
   case it is not owned by a user space process.

Based on the above, a user space tool that continuously monitors the
indoor settings, i.e., tracking power setting, location etc., can
indicate environment changes to the regulatory core.

It should be noted that currently user space is the only provided mechanism
used to hint to the regulatory core over the indoor/outdoor environment --
while the country IEs do have an environment setting this has been completely
ignored by the regulatory core by design for a while now since country IEs
typically can contain bogus data.

Acked-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: ArikX Nemtsov <arik@wizery.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: Simplify the handling of regulatory indoor setting
Ilan peer [Wed, 4 Mar 2015 05:32:05 +0000 (00:32 -0500)]
cfg80211: Simplify the handling of regulatory indoor setting

Directly update the indoor setting without wrapping it as
a regulatory request, to simplify the processing.

Acked-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoath10k: increase AST table SKID length limit
SenthilKumar Jegadeesan [Wed, 4 Mar 2015 13:43:45 +0000 (15:43 +0200)]
ath10k: increase AST table SKID length limit

The current SKID length configuration causes firmware
to reject peer creation for not able to allocate
AST entries for peers. This issue is observed when
least significant 3 bytes are used ramdomly to create
client MAC addresses.

AST table SKID length configuration is increased to
maximum value to fix this issue.

Signed-off-by: SenthilKumar Jegadeesan <sjegadee@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath: enhance radar detection by looking up chirp
Peter Oh [Wed, 4 Mar 2015 13:43:46 +0000 (15:43 +0200)]
ath: enhance radar detection by looking up chirp

Certain radar types such as FCC radar type 5 are using chirp
in their pulses, hence looking up the chirp status will enhance
to avoid false radar detection.

Signed-off-by: Peter Oh <poh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: update chirp value in pulse event
Peter Oh [Wed, 4 Mar 2015 13:43:46 +0000 (15:43 +0200)]
ath10k: update chirp value in pulse event

Firmware reports chirp status in phy error event if it's detected
and the chirp status is valuable to distinguish radar types.
So save it to use for DFS parttern detector.

Signed-off-by: Peter Oh <poh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath: introduce chirp parameter used by DFS
Peter Oh [Wed, 4 Mar 2015 13:43:45 +0000 (15:43 +0200)]
ath: introduce chirp parameter used by DFS

Some of radar types such as FCC radar type 5 require
to look up chirp in pulse to detect genuine radar and
it will prevent DFS channels from false radar detection.

Signed-off-by: Peter Oh <poh@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: increase copy engine entries for rx wmi
Rajkumar Manoharan [Wed, 4 Mar 2015 13:43:44 +0000 (15:43 +0200)]
ath10k: increase copy engine entries for rx wmi

Having lower number of copy engine entries for target to host
WMI ring is causing drops in receiving management frames. This
issue is observed during max clients (128 clients) stress testing.
While bursting deauthentication frames from simulated clients,
approx. 70% of frames are getting dropped due to lower ring entries.

Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agobcma: prepare Kconfig symbol for PCI driver
Rafał Miłecki [Wed, 4 Mar 2015 22:07:05 +0000 (23:07 +0100)]
bcma: prepare Kconfig symbol for PCI driver

Driver for PCIe core requires PCI to be enabled, however we shouldn't
require it for the whole bus. Someone may be not interested in extra
PCI devices and what's more there are SoCs without any PCI at all (like
BCM5356C0, BCM5357*, BCM47186B0). For more details see Kconfig "help".
Please note this patch doesn't allow disabling PCI drivers yet, as it
requires more work on calls to bcma_core_pci_* functions.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: move internal function declarations to private header
Rafał Miłecki [Wed, 4 Mar 2015 13:24:52 +0000 (14:24 +0100)]
bcma: move internal function declarations to private header

These functions are not exported nor used anywhere, so there is no
reason to put them in public headers.
Also drop unused bcma_chipco_(suspend|resume).

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: make bcma_host_pci_(up|down) calls safe for every config
Rafał Miłecki [Wed, 4 Mar 2015 11:14:41 +0000 (12:14 +0100)]
bcma: make bcma_host_pci_(up|down) calls safe for every config

We were providing declarations but actual code was compiled only with
CONFIG_BCMA_HOST_PCI set. This could result in:
ERROR: "bcma_host_pci_down" [drivers/net/wireless/brcm80211/brcmsmac/brcmsmac.ko] undefined!
ERROR: "bcma_host_pci_up" [drivers/net/wireless/brcm80211/brcmsmac/brcmsmac.ko] undefined!
ERROR: "bcma_host_pci_down" [drivers/net/wireless/b43/b43.ko] undefined!
ERROR: "bcma_host_pci_up" [drivers/net/wireless/b43/b43.ko] undefined!

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agobcma: Kconfig: Let it depend on PCI
Chen Gang [Tue, 3 Mar 2015 21:16:18 +0000 (05:16 +0800)]
bcma: Kconfig: Let it depend on PCI

bcma also needs PCI, just like IOMEM and DMA, so let it depend on PCI,
or will cause building break for allmodconfig under c6x:

    CC [M]  drivers/bcma/driver_pcie2.o
  drivers/bcma/driver_pcie2.c: In function 'bcma_core_pcie2_up':
  drivers/bcma/driver_pcie2.c:196:8: error: implicit declaration of function 'pcie_set_readrq' [-Werror=implicit-function-declaration]
    err = pcie_set_readrq(dev, pcie2->reqsize);
          ^

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
9 years agoMerge ath-next from ath.git
Kalle Valo [Thu, 5 Mar 2015 09:01:38 +0000 (11:01 +0200)]
Merge ath-next from ath.git

Major changes in ath10k:

* qca6174: enable STA transmit beamforming (TxBF) support
* disable multi-vif power save by default

9 years agoath10k: disable multi-vif ps by default
Michal Kazior [Fri, 13 Feb 2015 12:30:16 +0000 (13:30 +0100)]
ath10k: disable multi-vif ps by default

Not all firmware revisions have a proper
multi-interface client powersaving implementation,
e.g. qca6174 WLAN.RM.2.0-00073.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: workaround qca6174 sta powersave issue
Michal Kazior [Fri, 13 Feb 2015 12:30:15 +0000 (13:30 +0100)]
ath10k: workaround qca6174 sta powersave issue

qca6184 WLAN.RM.2.0-00073 has a bug in sta
powersave state machine and requires peer param to
be poked to enable the powersave.

Calling this unconditionally should be safe for
other chips/firmwares.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: fix wmm params per vdev
Marek Puzyniak [Tue, 10 Feb 2015 11:38:15 +0000 (12:38 +0100)]
ath10k: fix wmm params per vdev

During wmm tests changing wmm parameters did not change anything.
This was because of mismatch in WMM params per vdev command.
WMM params per vdev uses different command structure than wmm params
per pdev command.

Patch concerns qca6174.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: workaround corrupted htt rx events
Michal Kazior [Mon, 9 Feb 2015 14:04:55 +0000 (15:04 +0100)]
ath10k: workaround corrupted htt rx events

qca6174 WLAN.RM.2.0-00073 firmware uses full rx
reordering offload and delivers Rx via a new HTT
event. The event however is incorrectly generated
in firmware and becomes overly long (with trailing
garbage). This was hitting defined CE buffer limit
that was programmed to the device and caused
device to crash upon busier Rx traffic.

Increasing the CE buffer limit for HTT Rx pipe to
2KBytes seems to be enough to workaround this
problem.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agoath10k: delete unnecessary checks before the function call "release_firmware"
Markus Elfring [Wed, 4 Feb 2015 18:30:23 +0000 (19:30 +0100)]
ath10k: delete unnecessary checks before the function call "release_firmware"

The release_firmware() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9 years agomac80211_hwsim: fix beacon timers
Johannes Berg [Tue, 3 Mar 2015 21:09:05 +0000 (22:09 +0100)]
mac80211_hwsim: fix beacon timers

Jouni reported that certain combinations of hwsim test cases failed,
and we found that beaconing was erroneously enabled too early on any
channel switch, which lead to the BI of 2000 TU from the first test
case to leak into the second one, which then didn't beacon properly.

To fix this, set data->beacon_int to zero when all stop beaconing so
that beaconing cannot be started (which was intended as 'restarted')
elsewhere.

Additionally, Jouni found that due to this 'restart' and the beacon
interval handling station interfaces would also have a needlessly
running beacon timer all the time, of course not doing anything.

To also fix the latter case only use the beacon interval when it's
actually needed, i.e. when beaconing gets enabled.

Reported-by: Jouni Malinen <j@w1.fi>
Tested-by: Jouni Malinen <j@w1.fi>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomesh_plink: fixup type of timeout to match usage
Nicholas Mc Guire [Mon, 2 Mar 2015 09:54:14 +0000 (04:54 -0500)]
mesh_plink: fixup type of timeout to match usage

timeout was being passed as int but assigned from u32/u16 values and used
as unsigned type. This is really only for better readability.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomesh_plink: use msecs_to_jiffies for proper time conversion
Nicholas Mc Guire [Mon, 2 Mar 2015 09:54:13 +0000 (04:54 -0500)]
mesh_plink: use msecs_to_jiffies for proper time conversion

This is primarily an API consolidation and should make things more readable
it replaces var * HZ / 1000 by msecs_to_jiffies(var) which also handles
corner cases correctly.

There is a change of behavior as e.g. for HZ 100, t * HZ / 1000 will
return 0 for t < 10 but msecs_to_jiffies will return at least 1 always.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: provide station PMF configuration to driver
SenthilKumar Jegadeesan [Mon, 2 Mar 2015 07:59:40 +0000 (13:29 +0530)]
mac80211: provide station PMF configuration to driver

Some device drivers offload part of aggregation including AddBA/DelBA
negotiations to firmware. In such scenario, the PMF configuration of
the station needs to be provided to driver to enable encryption of
AddBA/DelBA action frames.

Signed-off-by: SenthilKumar Jegadeesan <sjegadee@qti.qualcomm.com>
[fix commit log, documentation]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: allow iterating inactive interfaces
Arik Nemtsov [Sun, 1 Mar 2015 07:10:15 +0000 (09:10 +0200)]
mac80211: allow iterating inactive interfaces

Sometimes the driver might want to modify private data in interfaces
that are down. One possible use-case is cleaning up interface state
after HW recovery. Some interfaces that were up before the recovery took
place might be down now, but they might still be "dirty".

Introduce a new iterate_interfaces() API and a new ACTIVE iterator flag.
This way the internal implementation of the both active and inactive
APIs remains the same.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agonl80211: prohibit mixing 'any' and regular wowlan triggers
Johannes Berg [Sun, 1 Mar 2015 07:10:13 +0000 (09:10 +0200)]
nl80211: prohibit mixing 'any' and regular wowlan triggers

If the device supports waking up on 'any' signal - i.e. it continues
operating as usual and wakes up the host on pretty much anything that
happens, then it makes no sense to also configure the more restricted
WoWLAN mode where the device operates more autonomously but also in a
more restricted fashion.

Currently only cw2100 supports both 'any' and other triggers, but it
seems to be broken as it doesn't configure anything to the device, so
we can't currently get into a situation where both even can correctly
be configured. This is about to change (Intel devices are going to
support both and have different behaviour depending on configuration)
so make sure the conflicting modes cannot be configured.

(It seems that cw2100 advertises 'any' and 'disconnect' as a means of
saying that's what it will always do, but that isn't really the way
this API was meant to be used nor does it actually mean anything as
'any' always implies 'disconnect' already, and the driver doesn't
change device configuration in any way depending on the settings.)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: check and dequeue skb in ieee80211_tx_prepare_skb()
Johannes Berg [Sun, 1 Mar 2015 07:10:12 +0000 (09:10 +0200)]
mac80211: check and dequeue skb in ieee80211_tx_prepare_skb()

The ieee80211_tx_prepare_skb() function currently entirely ignores
the fact that the SKB that is passed in might be split into more
than one due to fragmentation and doesn't check the list of skbs
that the TX handlers may create. In case this happens, it would
leak them.

Fix this and also don't leave the skb next/prev pointers dangling
pointing to the on-stack sk_buff_head.

Reported-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: remove duplicate check for quiescing when queueing work
Luciano Coelho [Sun, 1 Mar 2015 07:10:10 +0000 (09:10 +0200)]
mac80211: remove duplicate check for quiescing when queueing work

In ieee80211_queue_work() we check if we're quiescing or suspended, so
it's not necessary to check for quiescing before calling this
function.  Remove duplicate checks.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: allow TDLS setup code to take wdev lock
Arik Nemtsov [Sun, 1 Mar 2015 07:10:09 +0000 (09:10 +0200)]
mac80211: allow TDLS setup code to take wdev lock

TDLS off-channel can be allowed in channels marked with GO_CONCURRENT,
provided the device is connected to an AP on the same UNII.
When relaxing the NO-IR requirements for TDLS, we might hit flows in
cfg80211_reg_can_beacon that acquire the wdev lock. Take some measures
to allow this during TDLS setup.
Acquire the RCU read lock later in the flow that invokes
cfg80211_reg_can_beacon.
Avoid taking local->mtx when preparing the setup packet to avoid
circular deadlocks with mac80211 code that is invoked with wdev-mtx
held.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: start queues if driver rejected wowlan
Johannes Berg [Sun, 1 Mar 2015 07:10:08 +0000 (09:10 +0200)]
mac80211: start queues if driver rejected wowlan

If the driver rejects WoWLAN, restart the queues before returning
to cfg80211. cfg80211 will return to mac80211, but not before it
disconnects all interfaces. If we don't start the queues, any of
the packets needed for disconnecting won't be transmitted, which
is strange. Fix that.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: remove useless double check for open_count in __ieee80211_suspend()
Luciano Coelho [Sun, 1 Mar 2015 07:10:07 +0000 (09:10 +0200)]
mac80211: remove useless double check for open_count in __ieee80211_suspend()

We check local->open_count at the top of the __ieee80211_suspend(), so
there's no need to check for it again.  open_count is protected by the
rtnl, so there's no chance for it to have change between the two
calls.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: don't do driver suspend with auth/assoc in progress
Johannes Berg [Sun, 1 Mar 2015 07:10:06 +0000 (09:10 +0200)]
mac80211: don't do driver suspend with auth/assoc in progress

Drivers can't really be expected to suspend properly while auth
or assoc is in progress since then they don't have any state
they could keep with WoWLAN, nor can they actually finish the
authentication or association. In fact, keeping this can cause
subtle issues with drivers like iwlwifi that refuse WoWLAN if
not associated, but have trouble figuring out what's going on
in the middle of association.

In any case, regardless of possible driver issues in this area,
it doesn't make sense for mac80211 to try to WoWLAN-suspend in
the middle of such operations, so stop them before.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: handle drv_add_interface failures properly during reconfig
Luciano Coelho [Sun, 1 Mar 2015 07:10:04 +0000 (09:10 +0200)]
mac80211: handle drv_add_interface failures properly during reconfig

If any interface fails to be added to the driver in during reconfig,
we should remove all the successfully added interfaces and report
reconfig failure, so things can be cleaned up properly.  Failing to do
so can lead to subsequent failures and leave the drivers in a messed
up state.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: fix another suspend vs. association race
Johannes Berg [Sun, 1 Mar 2015 07:10:03 +0000 (09:10 +0200)]
mac80211: fix another suspend vs. association race

Since cfg80211 disconnects, but has no insight into the association
process, it can happen that it disconnects while association is in
progress. We then try to abort association in mac80211, but this is
only later so the association can complete between the two.

This results in removing an interface from the driver while bound
to the channel context, obviously causing confusion and issues.

Solve this by also checking if we're associated during quiesce and
if so deauthenticating. The frame will no longer go out to the AP
which is a bit unfortunate, but it'll resolve the crash (and before
we would have suspended without telling the AP as well.)

I'm working on a better, but more complex solution as well, which
should avoid that problem.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: TDLS: support VHT between peers
Arik Nemtsov [Sun, 1 Mar 2015 07:10:02 +0000 (09:10 +0200)]
mac80211: TDLS: support VHT between peers

Add the AID and VHT-cap/operation IEs during TDLS setup. Remove the
block of TDLS peers when setting HT-caps of the peer station.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agocfg80211: add operating classes 128-130
Eliad Peller [Sun, 1 Mar 2015 07:10:01 +0000 (09:10 +0200)]
cfg80211: add operating classes 128-130

Operating classes 128-130 are defined in the 11ac
spec for the 5GHz band.

Update ieee80211_operating_class_to_band() to support them.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agomac80211: Update beacon's timing and DTIM count on every beacon
Alexander Bondar [Sun, 1 Mar 2015 07:10:00 +0000 (09:10 +0200)]
mac80211: Update beacon's timing and DTIM count on every beacon

Beacon's timestamp, device system time associated with this beacon and
DTIM count parameters are not updated in the associated vif context
if the latest beacon's content is identical to the previously received.
It make sense to update these changing parameters on every beacon so the
driver can get most updated values. This may be necessary, for example,
to avoid either beacons' drift effect or device time stamp overrun.
IMPORTANT: Three sync_* parameters - sync_ts, sync_device_ts and
sync_dtim_count would possibly be out of sync by the time the driver will
use them. The synchronized view is currently guaranteed only in certain
callbacks.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>