History log of /drivers/net/wireless/ath/ath10k/mac.c
Revision Date Author Comments
b25f32cb02155d68c690255ba846796a1c248fd3 13-Sep-2014 Kalle Valo <kvalo@qca.qualcomm.com> ath10k: use ether_addr_copy()

As suggeested by checkpatch:

WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)

In wmi.c I had to change due to sparse warnings copying of struct wmi_mac_addr
from form &cmd->peer_macaddr.addr to cmd->peer_macaddr.addr. In
ath10k_wmi_set_ap_ps_param() I also added the missing ".addr" to the copy
command.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
d8bb26b964038a465a944a393e83d7fb9f0c5f28 13-Sep-2014 Kalle Valo <kvalo@qca.qualcomm.com> ath10k: else is not generally useful after a break or return

Fixes checkpatch warnings:

WARNING: else is not generally useful after a break or return

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
af762c0b0de586937409346d94d1f09035a5e64f 13-Sep-2014 Kalle Valo <kvalo@qca.qualcomm.com> ath10k: fix missing a blank line after declarations

Fixes checkpatch warnings:

WARNING: Missing a blank line after declarations

Please note that some of the cases I fixed by moving the variable declarations
to the beginning of the function, which is the preferred style in ath10k.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
c6e2e60e858efa8dd92d94f5d442068fb12b9967 13-Sep-2014 Kalle Valo <kvalo@qca.qualcomm.com> ath10k: fix use of multiple blank lines

Fixes checkpatch warnings:

CHECK: Please don't use multiple blank lines

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
5b07e07fd0a9432b6910badfdb084112be4390af 13-Sep-2014 Kalle Valo <kvalo@qca.qualcomm.com> ath10k: fix checkpatch warnings about parenthesis alignment

CHECK: Alignment should match open parenthesis

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
43d2a30fa80166243498fc6b8c841828ce52fcc1 10-Sep-2014 Kalle Valo <kvalo@qca.qualcomm.com> ath10k: add testmode

Add testmode interface for starting and using UTF firmware which is used to run
factory tests. This is implemented by adding new state ATH10K_STATE_UTF and user
space can enable this state with ATH10K_TM_CMD_UTF_START command. To go back to
normal mode user space can send ATH10K_TM_CMD_UTF_STOP.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
0d8614b4b926d0f657d15d7eb5125bcb24b9fd41 10-Sep-2014 Eliad Peller <eliad@wizery.com> mac80211: replace SMPS hw flags with wiphy feature bits

Use the new static_smps / dynamic_smps feature bits
instead of mac80211-internal hw flags.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2b37c2955204066d32566a50372da95ab734fc7e 02-Sep-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: don't access tx_info while overwriting it

Nothing important was being overwritten so it
didn't yield any bugs yet.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
e556f111847f94557ce7d5d9435e183783839f63 28-Aug-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: stop monitor vdev for sta assoc

This prevents some fw revisions from crashing in
many cases when user is trying to run a
promiscuous station interface (e.g. sniffing,
4addr bridge).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
1933747f5c29d38936cb53f35b4d8070f1cbefe2 28-Aug-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: fix monitor start/stop sequences

Fix some cases where monitor start failure left
the driver in a confused state.

This also makes the monitor code simpler.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
a4841eb6392e14a5070e633de30637342f6578d2 28-Aug-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: fix num_legacy_stations tracking

If a station was reassociated, i.e. due to change
of supported rates update via sta_rc_update() the
num_legacy_stations would be (incorrectly) bumped
up leading to unbalanced usage of the var. This in
turn could lock rtscts protection up as enabled.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7aa7a72a23679abf1cea9b3b65a8921244e769a7 25-Aug-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: improve logging to include dev id

This makes it a lot easier to log and debug
messages if there's more than 1 ath10k device on a
system.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
f2bc4d203edf2c5a6054134765ad5935454dc6ea 12-Aug-2014 Ben Greear <greearb@candelatech.com> ath10k: fix typo in error message

tranmist -> transmit

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
a9aefb3b3761a55117c6d1a526ac0305c3be5f46 12-Aug-2014 Ben Greear <greearb@candelatech.com> ath10k: improve vdev map handling

Check vdev map has space before calling ffs,
fix invalid cleanup in failure to create vdev
case.

Open-code the BIT() logic since BIT does not properly
handle 64-bit bitfields and future patches will make
use of larger bitfields.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
e7b541948b7ae542267257a6183341f6a92ed1b8 07-Aug-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: embed ar_pci inside ar

Use the common convention of embedding private
structures inside parent structures. This
reduces allocations and simplifies pci probing
code.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
5c81c7fd62004be13a3c9345ca25607d14862cc4 05-Aug-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: introduce a stricter scan state machine

This aims at fixing some rare scan bugs related to
firmware reporting unexpected scan event
sequences.

One such bug was if spectral scan phyerr reporting
prevented firmware from properly propagating scan
events to host. This led to scan timeout. After
that next scan would trigger scan completed event
first (before scan started event) leading to
ar->scan.in_progress and timeout timer states to
be overwritten incorrectly and making the very
next scan to hang forever.

Reported-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
855aed1220d2c94425ab01a85fe7a6f5c436940f 02-Aug-2014 Simon Wunderlich <sw@simonwunderlich.de> ath10k: add spectral scan feature

Adds the spectral scan feature for ath10k. The spectral scan is triggered by
configuring a mode through a debugfs control file. Samples can be gathered via
another relay debugfs file.

Essentially, to try it out:

ip link set dev wlan0 up
echo background > /sys/kernel/debug/ieee80211/phy0/ath10k/spectral_scan_ctl
echo trigger > /sys/kernel/debug/ieee80211/phy0/ath10k/spectral_scan_ctl
iw dev wlan0 scan
echo disable > /sys/kernel/debug/ieee80211/phy0/ath10k/spectral_scan_ctl
cat /sys/kernel/debug/ieee80211/phy0/ath10k/spectral_scan0 > samples

This feature is still experimental. Based on the original RFC patch of
Sven Eckelmann.

Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
dc55e3074ca150d5820fd4be5d4afd6cb5e876ad 28-Jul-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: improve channel switching

In some cases during heavy tx vdev stop-start
would timeout on vdev synchronization causing
traffic to stall for a few seconds.

Instead of stop-starting use a dedicated vdev
restart command and down vdevs explicitly before
doing so.

This gets rid of the synchronization
warnings/timeouts and makes channel switching
smoother during traffic.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
cf850d1d23942ad7fb3c22cb848decec86c101b0 24-Jul-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: don't advertise IBSS iftype for 10.x

The 10.x firmware does not support IBSS mode at
all. It can't beacon and it crashes when trying to
scan.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
aa5b4fbcff48234280359da84ac24e6f3057325b 23-Jul-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: fix Rx aggregation reordering

Firmware doesn't perform Rx reordering so it is
left to the host driver to do that.

Use mac80211 to perform reordering instead of
re-inventing the wheel.

This fixes TCP throughput issues in some
environments.

Reported-by: Denton Gentry <denton.gentry@gmail.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
c21c64d145e64d92a6c8f8e13c9b6b5b711832eb 21-Jul-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: workaround qos nullfunc bug

Apparently fw/hw generates a corrupted QoS Control
Field in Qos NullFunc frames. The only way to
workaround this is to downgrade frames to
NullFunc. This should be okay since powersave is
done by fw/hw and these frames are only used for
CQM purposes (e.g. from hostapd to check if
station is still connected).

This doesn't fix any user visible bug that I know
of. It just prevents from sending out funky frames
on the air.

Reported-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
4b6045586f31c7cc49b641a7ad5298b0c379a1c7 21-Jul-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: simplify tx helpers

It always bugged me how tid is computed and stored
in a temporary var before written to the control
buffer. It was confusing and it made it difficult
to work with tx helpers.

While at it rename the qos workaround function as
it was misleading - it's not a workaround but
preparation for nwifi tx mode.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
c56ef6725068c0ce499e517409c0da226ef51b08 05-Feb-2014 David Spinadel <david.spinadel@intel.com> mac80211: support more than one band in scan request

Some drivers (such as iwlmvm) can handle multiple bands in a single
HW scan request. Add a HW flag to indicate that the driver support
this. To hold the required data, create a separate structure for
HW scan request that holds cfg scan request and data about
different parts of the scan IEs.

As this changes the mac80211 API, update all drivers using it to
use the correct new function type/argument.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7b161a7034378d7b5b19a5333b584781dc6ab727 25-May-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: dont configure bssid for ap mode

FW creates self-peer for AP internally.

This prevents ath10k from trying to create
explicit self-peer during hw recovery and thus
prevents a timeout and a warning during teardown:

ath10k: removing stale peer $AP_BSSID from vdev_id 0

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
911e6c0d8deeeaf526e67bde47bb6a40f0fd46aa 25-May-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: protect wep tx key setup

All configuration sequences should be protected
with conf_mutex to avoid concurrent/conflicting
requests.

This should make sure that wep tx key setup is not
performed while hw is restarted (at least).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
bca7bafbe2b75ed31cc6943b81218ea0f8a13686 25-May-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: drain tx before restarting hw

This makes sure no further tx requests are
submitted to HTT before driver teardown.

This should prevent invalid pointer/NULL
dereference on htt tx pool in ath10k_htt_tx() in
some cases of heavy traffic.

kvalo: remove the WARN_ON() if conf_mutex is held

Reported-By: Ben Greear <greearb@candelatech.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
c5058f5b82f226b236dc5a65015152ed3c23efff 25-May-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: perform hw restart lazily

This reduces risk of races and prepares for more
hw restart fixes.

It also makes sense to perform teardown after
mac80211 starts its restart routine as it
guarantees it has stopped itself by then
(including tx queues).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ae254433a8dfaaf7983b39d87ce695a616d36163 25-May-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: clean up start() callback

This fixes failpath when override AC pdev param
setup fails and makes other pdev params setting
fail as well.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
aecdc89fb4664c76baa4bbd46008f220532309ff 23-May-2014 Luciano Coelho <luciano.coelho@intel.com> ath9k/ath10k: remove unnecessary channel_switch_beacon callbacks

The channel_switch_beacon callback is optional, so it doesn't have to
be defined if it's not going to do anything useful with it. Both
ath9k and ath10k define the callback and just returns. This commit
removes them.

Cc: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
46acf7bb9b61289ea3353561142e3bf41119bd3e 16-May-2014 Ben Greear <greearb@candelatech.com> ath10k: support get/set antenna configurations.

Verified that target's tx/rx chain register is set appropriately,
and that the tx rate goes down as number of chains
decrease, but I did not actually try to verify antenna
ceased to transmit when disabled.

kvalo: move ar->supp_*_chainmask initialisation to ath10k_mac_register()

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
eeab266c0f3c9c85ef649ba737e2d553742a2532 14-May-2014 Marek Kwaczynski <marek.kwaczynski@tieto.com> ath10k: fix pmf for action frames

Fix sending and receiveing protected managment frames.
Lack of protected flag for received protected action frames
causes report these frames as unprotected robust action frames.
If the driver in AP mode sent frame with protected flag and
CCMP header using IEEE80211_KEY_FLAG_SW_MGMT_TX flag,
the FW encrypted frames once again. From user side all
received SA Query Requests and Responses were skipped and
all protected action frames were sent as malformed packets.

Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
d9bc4b9b693d52dc14dc1de5dfec760634067d8c 23-Apr-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: fix firmware recovery with ap interface

Beacon data wasn't properly cleared during early
phase of recovery. This in turn caused firmware to
crash because the beacon data was submitted before
vdevs were fully re-configured. Ultimately the
device was considered wedged and nothing worked
until driver was reloaded.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ec6bc5523b40008448bad5eadcdcf4cdbf9c7054 23-Apr-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: make sure to not leak beacon dma mapping

If for some reason mac80211 wouldn't stop
beaconing gracefully and just removed interface of
a running AP/IBSS interface it was possible to
leak pending beacon DMA mapping. It's very
unlikely but better safe than sorry.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
d650097bfadab387dfb762bf46b8598cbedf50b3 08-Apr-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: refactor radar detection code

If 20MHz CAC completed successfully then
subsequent CAC with wider bandwidth (40Mhz, 80Mhz)
with identical control frequency did not start
monitor vdev making it impossible to detect any
radar pulses during intended CAC.

It also was incorrect to assume ath10k_config() will
be called after CAC is finished. Theoretically for
non-HT channels nothing changes between CAC and
start_ap() (albeit in practice this can be
different). The incorrect assumption led to CAC
not being stopped on non-HT chandefs leading to
all Rx being drooped making it impossible for
clients to associate.

While at it clean up the code a bit.

kvalo: separate WARN_ON() from the if statement

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
72654fa7b52861ec91579e4801412fe2d6ba23a1 08-Apr-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: reorder functions

This is done to avoid forward declarations with
upcomming patches.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
77be2c54c5bd26279abc13807398771d80cda37a 27-Mar-2014 Emmanuel Grumbach <emmanuel.grumbach@intel.com> mac80211: add vif to flush call

This will allow the low level driver to make decision based
on the vif such as queues etc...
Since the vif might be NULL, we can't add it to the tracing
functions.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
[fix staging rtl8821ae driver]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1bbc09752d3fdbfc2f768da60f7c67f128e5bc1f 08-Apr-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: refactor monitor code

It was possible to create/delete/start/stop
monitor vdev from a few places that were not
exclusively protected against each other. This
resulted in monitor vdev being stopped/removed by
one call origin while another one was expecting it
to continue running.

For example if CAC was started and interface's
promiscuous mode was toggled monitor vdev was
removed from the driver meaning no radar would be
detected. In additional a warning would be printed
upon CAC completion complaining it tried to stop
non-running monitor vdev.

The patch simplifies monitor code by removing
IEEE80211_HW_WANT_MONITOR_VIF (which wasn't really
ever needed) and improves state tracking. It also
unifies prints.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
be6546fcc2774640953ee56612343660f6ff26cf 25-Mar-2014 Kalle Valo <kvalo@qca.qualcomm.com> ath10k: unify warning messages in mac.c

Currently there are different styles used for warning messages, unify them to
look similar. The style basically is:

1) start with a verb (if possible)

2) lower case letters

3) use plain english as much as possible

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
821af6ae26bcd024d73a1aa7f47e45c0a3814dc1 21-Mar-2014 Marek Puzyniak <marek.puzyniak@tieto.com> ath10k: update regulatory domain settings for 10.x firmware

Regulatory domain settings for firmware 10.x has more options
than main firmware, so handle regulatory domain setup separately
for both supported firmwares. Fill in additional dfs domain
parameter according to current regulatory.
This patch does not solve any known bug. Not handled parameter
for firmware 10.x was found during code review.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
e81bd104822482124923ec6c823abcca8df32451 10-Mar-2014 Marek Kwaczynski <marek.kwaczynski@tieto.com> ath10k: add recalc RTS/CTS protection method

Add recalculation of RTS/CTS protection when one or more legacy
stations are connected to ath10k. In this case enable RTS/CTS
protection and set sw retry profile are needed in the FW.
Without this change legacy station is starved and has very low
throughput.

Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
44d6fa90a8fddee49b5749cadbd0add22b1f5559 07-Mar-2014 Chun-Yeow Yeoh <yeohchunyeow@gmail.com> ath10k: allow the supported rate change by reassociate peer

IBSS mode requires the changing of supported rate. Do this
by reassociate the peer. The investigation shows that if move
from legacy to HT, the rate control won't work after changing
the supported rate. But once changing the supported rate to HT,
user can assign the TxRate in HT mode.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
69244e5656b9d78964f11158680140e7994789d5 27-Feb-2014 Ben Greear <greearb@candelatech.com> ath10k: add vdev-id, return code to error codes

When using multiple vdevs (stations, aps, etc), it is
nice to be able to associate log messages with specific
interfaces. So, add vdev-id to most logging messages.
Add return code as well, where it was missing.

kvalo: unify some of the messages to follow the same style

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
767d34fc67af3939b8ec09804e2b60a1daf94945 27-Feb-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: remove DMA mapping wrappers

There's no real benefit from using them. DMA-API
already provides debugging. Some skbuffs are
already mapped directly with DMA-API since wrapper
arguments were insufficient and extending them
would be pointless.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9f81f72556107a38ebf523ea1d38ef85dfa35d09 17-Jan-2014 Janusz Dziedzic <janusz.dziedzic@tieto.com> ath10k: bitrate_mask add force_sgi support

Add force SGI support.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2f0f112111f5d635699026d1d6a2fe144eabb489 26-Feb-2014 Janusz Dziedzic <janusz.dziedzic@tieto.com> ath10k: enable spectrum management support

Indicate spectrum management support in hardware
flags, while we already handle power set
(IEEE80211_CONF_CHANGE_POWER) in the ath10k driver.
This enable 802.11h support for station mode.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
76f900244f084ae684c282f7aac938419d6afb2e 25-Feb-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: fix sta_rc_update for non-ap iftype

The arsta structure wasn't initialized for
non-ap interfaces. This should fix related
warnings/crashes.

Reported-By: Ben Greear <greearb@candelatech.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9ba4c787aac4923855fac596cebb2b8c42e488fb 25-Feb-2014 Ben Greear <greearb@candelatech.com> ath10k: add more details to some debug messages

Makes it easier to determine why some failures
happened.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
26ebbccfb73f59edd67a41b18706f36f1b1edae1 25-Feb-2014 Chun-Yeow Yeoh <yeohchunyeow@gmail.com> ath10k: implement drv_get_tsf for ibss merging

Implement the get TSF by simply returning 0 so that IBSS
merging is happening. Otherwise, IBSS nodes that have similar
SSID naming won't merge. This is simply fooling the mac80211
that the TSF in the received beacon is higher than the local TSF.

Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9797febc4cc112869b19a110f70e0dedb1bb63d6 14-Feb-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: implement sta_rc_update()

This allows dynamic changes of bandwidth/nss/smps,
e.g. via ht/vht operation mode change
notification.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
90046f509dca8e754b75aacb6ef7afa68b102c63 14-Feb-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: fix SMPS support

Firmware ignores SMPS flags in peer assoc command.

For SMPS to work it is necessary to set peer
parameter after peer assoc command so that tx
chainmask is setup properly.

This should fix packet loss and improve throughput
with stations that have SMPS enabled upon
association.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
75459e3338928bdbe9618b626a6471764e2e53f0 13-Feb-2014 Kalle Valo <kvalo@qca.qualcomm.com> ath10k: release conf_mutex if vdev_start() fails

I modified Michal's commit c930f744bdb0 ("ath10k: implement channel switching") to return
when vdev_start() fails, but forgot to release conf_mutex.

Found by coccinelle:

>> drivers/net/wireless/ath/ath10k/mac.c:2745:5-11: preceding lock on line 2663

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ef8c00174a8738ea334197c0164143354644cb16 13-Feb-2014 Kalle Valo <kvalo@qca.qualcomm.com> ath: remove camel case from struct reg_dmn_pair_mapping

Fixes a checkpatch warning in ath10k:

drivers/net/wireless/ath/ath10k/mac.c:1636: WARNING: Avoid CamelCase: <regpair->regDmnEnum>

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
fd71f807376437756bfab0ee21d5978a7b05a0f5 10-Feb-2014 Bartosz Markowski <bartosz.markowski@tieto.com> ath10k: AP: handle HT station which does not have HT RX MCS

This is a workaround for HT-enabled STAs which break the spec
and have no HT capabilities RX mask (no HT RX MCS map).

As per spec, in section 20.3.5 Modulation and coding scheme (MCS),
MCS 0 through 7 are mandatory in 20MHz with 800 ns GI at all STAs.

Firmware asserts if such situation occurs.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
00f5482bcd940c11b9b81e7c399fd5f4f6667bd0 10-Feb-2014 Marek Puzyniak <marek.puzyniak@tieto.com> ath10k: suspend hardware before reset

In case of warm reset target need to be suspended.
Suspend function is extented to handle both cases
with disabling interrupts and without disabling interrupts.
Warm target reset requires suspend with all interrupts
disabled.

This patch depends on
ath10k: fix device initialization routine

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9042e17df8340247ebed9c67f4b64228f16b4c36 10-Feb-2014 Marek Puzyniak <marek.puzyniak@tieto.com> ath10k: refactor suspend/resume functions

Suspend/resume callbacks are not protected by configuration mutex
so adding such protection. Also in order to simplify implemetation
of suspend function wait queue is replaced by completion.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
36786024df993f0fb5e7d1b56058c4f48f24d5e8 10-Feb-2014 Marek Kwaczynski <marek.kwaczynski@tieto.com> ath10k: Set proper nss value for the peer

It was found during testing the nss calculation does not
cover all corner cases. Station could request eq. only MCS8
and MCS9 (nss=2 specific). Next num_rates=2 so the driver
sets nss=(max((2+7)/8, 1))=1. Which is wrong. The in-driver
calculation was introduced prior (commit ddcc347b70
mac80211: fix rx_nss calculation for drivers with hw rc).
Since it's fixed, use mac80211 provided value from now.
End user will experience lower throuhputs than expected
if the nss is wrongly calculated.

Signed-off-by: Marek Kwaczynski <marek.kwaczynski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ab6258edb4e15af016bb9c64fb521211a3f22b36 29-Jan-2014 Marek Puzyniak <marek.puzyniak@tieto.com> ath10k: configure access category for arp

ARP frames exchange does not work properly for UAPSD enabled AP.
ARP requests which arrives with access category 0 are processed
by network stack and send back with access category 0. FW changes
access category to 6. This is causing problems when UAPSD associated
STA is sleeping after has sent ARP request. Configure ARP access
category in FW to best effort (0) solves this problem. ARP frames
will be send with access category 0.

Simplify arp ac override functionality by removing redundant entry in
pdev param maping table. There should be only one entry in pdev param
map but enum has different name for different FW.

kvalo: change the warning message

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
c60bdd8334804720e9d236c543612c998baaee0d 29-Jan-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: properly return err from start()

If recovery failed ath10k returned 0 (success) and
mac80211 continued to call other driver callbacks.
This caused null dereference.

This is how the failure looked like:

ath10k: ctl_resp never came in (-110)
ath10k: failed to connect to HTC: -110
ath10k: could not init core (-110)
BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [<ffffffffa0b355c1>] ath10k_ce_send+0x1d/0x15d [ath10k_pci]
PGD 0
Oops: 0000 [#1] PREEMPT SMP
Modules linked in: ath10k_pci ath10k_core ath5k ath9k ath9k_common ath9k_hw ath mac80211 cfg80211 nf_nat_ipv4 ]
CPU: 1 PID: 36 Comm: kworker/1:1 Tainted: G WC 3.13.0-rc8-wl-ath+ #8
Hardware name: To be filled by O.E.M. To be filled by O.E.M./HURONRIVER, BIOS 4.6.5 05/02/2012
Workqueue: events ieee80211_restart_work [mac80211]
task: ffff880215b521c0 ti: ffff880215e18000 task.ti: ffff880215e18000
RIP: 0010:[<ffffffffa0b355c1>] [<ffffffffa0b355c1>] ath10k_ce_send+0x1d/0x15d [ath10k_pci]
RSP: 0018:ffff880215e19af8 EFLAGS: 00010292
RAX: ffff880215e19b10 RBX: 0000000000000000 RCX: 0000000000000018
RDX: 00000000d9ccf800 RSI: ffff8800c965ad00 RDI: 0000000000000000
RBP: ffff880215e19b58 R08: 0000000000000002 R09: 0000000000000000
R10: ffffffff812e1a23 R11: 0000000000000292 R12: 0000000000000018
R13: 0000000000000000 R14: 0000000000000002 R15: ffff88021562d700
FS: 0000000000000000(0000) GS:ffff88021fa80000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 0000000001a0d000 CR4: 00000000000407e0
Stack:
d9ccf8000d47df40 ffffffffa0b367a0 ffff880215e19b10 0000000000000010
ffff880215e19b68 ffff880215e19b28 0000000000000018 ffff8800c965ad00
0000000000000018 0000000000000000 0000000000000002 ffff88021562d700
Call Trace:
[<ffffffffa0b3251d>] ath10k_pci_hif_send_head+0xa7/0xcb [ath10k_pci]
[<ffffffffa0b16cbe>] ath10k_htc_send+0x23d/0x2d0 [ath10k_core]
[<ffffffffa0b1a169>] ath10k_wmi_cmd_send_nowait+0x5d/0x85 [ath10k_core]
[<ffffffffa0b1aaef>] ath10k_wmi_cmd_send+0x62/0x115 [ath10k_core]
[<ffffffff814e8abd>] ? __netdev_alloc_skb+0x4b/0x9b
[<ffffffffa0b1c438>] ath10k_wmi_vdev_set_param+0x91/0xa3 [ath10k_core]
[<ffffffffa0b0e0d5>] ath10k_mac_set_rts+0x3e/0x40 [ath10k_core]
[<ffffffffa0b0e1d0>] ath10k_set_frag_threshold+0x5e/0x9c [ath10k_core]
[<ffffffffa09d60eb>] ieee80211_reconfig+0x12a/0x7b3 [mac80211]
[<ffffffff815a8069>] ? mutex_unlock+0x9/0xb
[<ffffffffa09b3a40>] ieee80211_restart_work+0x5e/0x68 [mac80211]
[<ffffffff810c01d0>] process_one_work+0x1d7/0x2fc
[<ffffffff810c0166>] ? process_one_work+0x16d/0x2fc
[<ffffffff810c06c8>] worker_thread+0x12e/0x1fb
[<ffffffff810c059a>] ? rescuer_thread+0x27b/0x27b
[<ffffffff810c5aee>] kthread+0xb5/0xbd
[<ffffffff815a9220>] ? _raw_spin_unlock_irq+0x28/0x42
[<ffffffff810c5a39>] ? __kthread_parkme+0x5c/0x5c
[<ffffffff815ae04c>] ret_from_fork+0x7c/0xb0
[<ffffffff810c5a39>] ? __kthread_parkme+0x5c/0x5c
Code: df ff d0 48 83 c4 18 5b 41 5c 41 5d 5d c3 55 48 89 e5 41 57 41 56 45 89 c6 41 55 41 54 41 89 cc 53 48 89
RIP [<ffffffffa0b355c1>] ath10k_ce_send+0x1d/0x15d [ath10k_pci]
RSP <ffff880215e19af8>
CR2: 0000000000000000

Reported-By: Ben Greear <greearb@candelatech.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
748afc4735361e21ad655c0dc021ea3aaeeb3efd 23-Jan-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: implement and use new beacon method

Until now ath10k used a copy-by-value beacon
submission.

The new method passes a DMA address via WMI
command only. This command contains additional
metadata that fixes AP behaviour with regard
to powersave buffering.

This also fixes strange bug when multicast traffic
would freeze TX indefinitely.

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>
c2df44b39b31a730a89b13f7be90860d93d1f9d8 23-Jan-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: implement AP CSA

Most channel switching logic has been implemented
already so this patch is pretty small. The patch
makes use of mac80211's vif->csa_active for AP CSA
handling.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
c930f744bdb0774ccf7c00e23637f54b8e71f0b6 23-Jan-2014 Michal Kazior <michal.kazior@tieto.com> ath10k: implement channel switching

Until now channel change wasn't propagating to FW
directly because operational channel is abstracted
by VDEVs and it wasn't really necessary since
ath10k implements hwscan and hwroc.

This effectively fixes STA CSA and allows for
future AP-like CSA as well.

kvalo: change error handling in ath10k_bss_info_changed()

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
d3d3ff42d9b3a8b90b381ebb398deb5c87ec1692 21-Jan-2014 Janusz Dziedzic <janusz.dziedzic@tieto.com> ath10k: AP mode, set UAPSD params correctly

ath10k handles UAPSD completly in the firmware.
When works in AP mode we have to configure
UAPSD params for each station. Without this
patch we configure UAPSD params before we
send peer assoc command to the FW, which was
wrong. Next FW didn't know what should be trigger
frame, couse UAPSD didn't work correctly in AP mode.
To configure UAPSD params correctly we have to
send them after peer assoc command.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
5a13e76eca17212c0a4ad3c1fb97df8a9e9921d8 20-Jan-2014 Kalle Valo <kvalo@qca.qualcomm.com> ath10k: enable firmware STA quick kickout

Firmware has a feature to track if the associated STA is not acking the frames.
When that happens, the firmware sends WMI_PEER_STA_KICKOUT_EVENTID event to the
host. Enable that to faster detect when a STA has left BSS without sending a
deauth frame.

Also set huge keepalive timeouts to avoid using the keepalive functionality in
the firmware.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
51ab1a0a09a894442e8b091d57222c5425b6d700 08-Jan-2014 Janusz Dziedzic <janusz.dziedzic@tieto.com> ath10k: add set_bitrate_mask callback

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

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

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

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

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

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

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
0e759f363e9f2f1b1a7a640b15ca613e5e27dfc0 02-Jan-2014 Bartosz Markowski <bartosz.markowski@tieto.com> ath10k: track number of existing peers

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

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

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
cdf074099babdda9dccae7d421bd5566d70e75e3 30-Dec-2013 Marek Puzyniak <marek.puzyniak@tieto.com> ath10k: disable STA kickout in FW

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

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
685328b296acc810541d2532957912690273c64a 06-Jan-2014 Johannes Berg <johannes.berg@intel.com> mac80211: remove channel_change_time

This value is no longer used by mac80211, and practically no
driver ever set it to a correct value anyway, so remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
d354181f4d9a4b91ddbc90327cba6692ef3779a1 10-Dec-2013 Bartosz Markowski <bartosz.markowski@tieto.com> ath10k: introduce NO_P2P fw feature flag

Not each ath10k FW track supports P2P (10.X for instance does not)
This new firmware feature flag allows to turn off P2P interface type.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
f259509baafcf180c6146bc5bcc0ae7688e5017a 10-Dec-2013 Bartosz Markowski <bartosz.markowski@tieto.com> ath10k: split the if_limits and if_comb

Split the interface limits and inteface combination,
to reflect the 10.X capabilites (no P2P, no STA and 8 VAP).

kvalo: reverse order of ATH10K_FW_FEATURE_WMI_10X test, fix
checkpath warnings

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
cfb27d29b61cc32c0bb75f741aeabb9c6e6af742 02-Dec-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: fix multi BSSID with WPA on FW 10.1

FW 10.1 seems to require the default key index to
be updated to point to group key after it is
installed. Otherwise Txed frames are corrupted.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8fe02e167efa8ed4a4503a5eedc0f49fcb7e3eb9 21-Oct-2013 Luis R. Rodriguez <mcgrof@do-not-panic.com> cfg80211: consolidate passive-scan and no-ibss flags

These two flags are used for the same purpose, just
combine them into a no-ir flag to annotate no initiating
radiation is allowed.

Old userspace sending either flag will have it treated as
the no-ir flag. To be considerate to older userspace we
also send both the no-ir flag and the old no-ibss flags.
Newer userspace will have to be aware of older kernels.

Update all places in the tree using these flags with the
following semantic patch:

@@
@@
-NL80211_RRF_PASSIVE_SCAN
+NL80211_RRF_NO_IR
@@
@@
-NL80211_RRF_NO_IBSS
+NL80211_RRF_NO_IR
@@
@@
-IEEE80211_CHAN_PASSIVE_SCAN
+IEEE80211_CHAN_NO_IR
@@
@@
-IEEE80211_CHAN_NO_IBSS
+IEEE80211_CHAN_NO_IR
@@
@@
-NL80211_RRF_NO_IR | NL80211_RRF_NO_IR
+NL80211_RRF_NO_IR
@@
@@
-IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_IR
+IEEE80211_CHAN_NO_IR
@@
@@
-(NL80211_RRF_NO_IR)
+NL80211_RRF_NO_IR
@@
@@
-(IEEE80211_CHAN_NO_IR)
+IEEE80211_CHAN_NO_IR

Along with some hand-optimisations in documentation, to
remove duplicates and to fix some indentation.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
[do all the driver updates in one go]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
e8a50f8ba44b6933b2a39b6a65528b9a4e8ba5f3 20-Nov-2013 Marek Puzyniak <marek.puzyniak@tieto.com> ath10k: introduce DFS implementation

Configure interface combination for AP running on channels
where radar detection is required. It allows only one type
of interface - AP on DFS channel and limits number of AP
interfaces to 8. Setup WMI channel flags accordingly to mac
channel configuration. CAC based on additional monitor vdev
is started if required for current channel.

kvalo: dropped ATH10K_DFS_CERTIFIED config option as this
the DFS still depends on few mac80211 and cfg80211 patches
which are on mac80211-next.git right now. The config option
will be added later once all dependencies are available.

Signed-off-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>
9702c686081240bff1f05150c78335152d37ac8d 20-Nov-2013 Janusz Dziedzic <janusz.dziedzic@tieto.com> ath10k: add phyerr/dfs handling

Handle phyerr, dfs event, radar_report and fft_report.
Add also debugfs dfs_simulate_radar and dfs_stats files.
Use ath dfs pattern detector.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
c4dd0d01da8979bd5c7f4367661115617bc389ea 13-Nov-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: allow dynamic bandwidth in hw rate control

Frames were never retransmitted with
different/lower bandwidths, e.g. only 80MHz
bandwidth was used when dealing with a VHT80
peer.

Allow HW rate control to try out different
bandwidths when retransmitting. This increases
robustness.

Also, document the parameter properly.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
16735d022f72b20ddbb2274b8e109f69575e9b2b 14-Nov-2013 Wolfram Sang <wsa@the-dreams.de> tree-wide: use reinit_completion instead of INIT_COMPLETION

Use this new function to make code more comprehensible, since we are
reinitialzing the completion, not initializing.

[akpm@linux-foundation.org: linux-next resyncs]
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13)
Cc: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
479398b07048342c7fdca89fd3a6cdb739e48a86 04-Nov-2013 Ben Greear <greearb@candelatech.com> ath10k: add logging to better determine some VIF/STA creation failures

Not all errors were properly notified, fix that.

kvalo: use ath10k_warn() for all messages, cosmetic changes to some of the messages

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
5fb5e41f424ad970f3bda645b8234dc71fcc8e59 28-Oct-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: plug memory leak in wmi mgmt tx worker

sk_buff was not freed in some cases. The patch
unifies the msdu freeing.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
5474efe802faf84b1db1ae172f1754cca390ee45 23-Oct-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: respect power_level values

This allows txpower limits other than regulatory
to be applied (e.g. user txpower limit provided
via iw/nl80211).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
02256930d9b80c3c8ada90ea36fd0488a91735d0 23-Oct-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: use proper tx power unit

It was previously thought that FW expects tx power
in quarters of dBm.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
89c5c843110b7faee9d132826d574924c4f4c056 23-Oct-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: setup min channel power to a reasonable value

This will be needed for proper support of (user)
configurable tx power level.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
e63b33f3d059bda08ab7634a435024a6e7b82e1f 22-Oct-2013 Ben Greear <greearb@candelatech.com> ath10k: Initialize list-head on vif creation.

If the creation fails, this keeps us from crashing later when
trying to do a list_del(arvif->list).

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
0ed00eea0961db3a007cbca727e3dd54e4bfd05f 16-Oct-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: add sanity checks for monitor management

Add a few checks and warnings to make it easier to
track any kind of monitor vdev mismanagement.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
afd0922e7478ce3e4ea5812835164fe4e2a12896 16-Oct-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: prevent starting monitor without a vdev

This fixes issue with interface bridging.

Linux bridging sets promiscuous mode for all
interfaces that are in a bridge. This translates
to configure_filter() being called in a mac80211
driver.

Before the patch operational interface would be
started and upped again when promiscuous mode was
enabled causing all sorts of strange issues:

* no HTT RX happening (i.e. no traffic)
* FW crash upon driver reload/unload

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
b9ada65d97be58d82941f23dce5adde0d0eec61a 16-Oct-2013 Kalle Valo <kvalo@qca.qualcomm.com> ath10k: fix ath10k_bss_assoc() to not sleep in atomic context

ath10k_bss_assoc() was calling ath10k_peer_assoc(), which can sleep, under
atomic rcu_read_lock() and causing scheduing while atomic errors. Workaround
that by delaying the call to ath10k_wmi_peer_assoc().

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
588490cf65063ce5f307116163af0bcfb69d7f56 16-Oct-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: remove unnecessary checks

mac80211 interface iteration functions that were
used originally iterated over interfaces that
weren't re-added to the driver during recovery.

Since internal vif list is now used it's safe to
remove the safe-guard as internal vif list is
based on add/remove_interface function which
guarantees that vdev is created in FW before it is
iterated over.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ad088bfa1e3d05670734839e1a22a69ce4b193fb 16-Oct-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: fix scheduling while atomic config bug

Recent HTC/WMI changes introduced the bug. ath10k
was using _atomic iteration function with
sleepable functions.

mac80211 provides another iteration function but
it cannot be safely called in hw_config() callback
due to local->iflist_mtx being possibly acquired
already.

The patch uses internal vif list for iteration
purposes and removes/refactors no longer necessary
_iter functions.

Reported-By: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
0579119f7deab9bb112a432a0e8acbc6fc91ea14 16-Oct-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: track vif list internally

mac80211 interface interations functions have
peculiar locking issues. This patch introduces
internal (to ath10k) vif list that will be used
for vif iteration purposes.

kvalo: remove extra INIT_LIST_HEAD()

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
9dad14ae289ec676b9f8a2ee00a3fa18c51c683a 16-Oct-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: fix add_interface failure handling

If something failed along add_interface() setup it
was possible to leak a vdev id, vdev and peer.

This could end up with leaked FW state or FW crash
(assuming add_interface() failure wasn't a result of
a crash).

kvalo: rebased, whitespace fixes

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
cc4827b97b0a5fec66689c0e511a94e3dad490fc 16-Oct-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: use workqueue to set WEP TX key

Recent WMI/HTC changes made it possible for WMI
commands to sleep (if there's not enough HTC TX
credits to submit a command). TX path is in an
atomic context so calling WMI commands in it is
wrong.

This simply moves WEP key index update to a worker
and fixes the 'scheduling while atomic' bug.

This still leaves multiple WEP key handling laggy,
i.e. some frames may be TXed with an old/different
key (although recipient should still be able to RX
them).

kvalo: changed the title

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ebc9abddfb6b930ec54087997570967f062eba4c 15-Oct-2013 Bartosz Markowski <bartosz.markowski@tieto.com> ath10k: do not warn about unsupported vdev param

10.X firmware does not support WMI_VDEV_PARAM_TX_ENCAP_TYPE.
It's a known limitation and we should not warn about this.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
a24b88b56074424a413acc2d2a517fb82f5e7c2f 08-Oct-2013 Sujith Manoharan <c_manoha@qca.qualcomm.com> ath10k: Fix bug in max. VHT A-MPDU size

For VHT peers, the maximum A-MPDU size has to be calculated
from the VHT capabilities element and not the HT-cap. The formula
is the same, but a higher value is used in VHT, allowing larger
aggregates to be transmitted.

The patch contains a workaround for some Netgear/Linksys APs that
report Rx A-MPDU factor incorrectly.

Tested-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ddb6ad77b4ecfb832982be69f2169165e6a43f0b 02-Oct-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: split vdev_id calculation from tx function

Tidy up ath10k_tx().

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
42c3aa6f6ae7de082b7413321e67e3424cc0c002 02-Oct-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: split tid calculation from tx function

Tidy up ath10k_tx().

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
226a339ba8f3c53914e640d250feaf4321cfcd04 26-Sep-2013 Bartosz Markowski <bartosz.markowski@tieto.com> ath10k: introduce dynamic pdev parameters

This is done exactly the same way as for vdev.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
6d1506e788ecf3c423f275036d37a40d1416db42 26-Sep-2013 Bartosz Markowski <bartosz.markowski@tieto.com> ath10k: introduce dynamic vdev parameters

Both firmwares (main and 10.x) have different set of vdev
parameters. To stay in sync with FW API, this patch introduces
a dynamic registering method.

ath10k_wmi_vdev_set_param() takes now indirect u32 value
to identify the Vdev parameter it want's to set.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
5e00d31a0fb74c36f3b174ff0d4914cf09016e6f 26-Sep-2013 Bartosz Markowski <bartosz.markowski@tieto.com> ath10k: bring back the WMI path for mgmt frames

This is still the only way to submit mgmt frames in case
of 10.X firmware.

This patch introduces wmi_mgmt_tx queue, because of the
fact WMI command can block. This is a problem for
ath10k_tx_htt(), since it's called from atomic context.
The skb queue and worker are introduced to move the mgmt
frame handling out of .tx callback context and not block.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
52fa019155329898f564f9f0264159728d263271 24-Sep-2013 Marek Puzyniak <marek.puzyniak@tieto.com> ath10k: make monitor vdev down before stoping it

Following sequence causes FW crash:
-monitor vdev up,
-monitor vdev stop,
-monitor vdev delete.
Making monitor vdev down before stoping it works ok:
-monitor vdev up,
-monitor vdev down,
-monitor vdev stop,
-monitor vdev delete.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
1f8bb1518eee321d94477ca7bcbb153c47d43ba4 18-Sep-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: use msdu headroom to store txfrag

Instead of allocating sk_buff for a mere 16-byte
tx fragment list buffer use headroom of the
original msdu sk_buff.

This decreases CPU cache pressure and improves
performance.

Measured improvement on AP135 is 560mbps ->
590mbps of UDP TX briding traffic.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
0a89f8a01d0b28ca646f3aae9ffe1a7fc9d5b266 18-Sep-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: decouple HTT TX completions

Until now the all MSDU transfer related structures
were freed when all resources were unreferenced.

Now HTC transfer is freed independently and HTT
transfer is so too.

This yields a way more simpler ath10k_skb_cb and
should possibly enable parallel pipe processing
(which is now serialized in
ath10k_pci_process_ce routine).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
27bb178dae7b8165ffe7028fbd6f616fb7157c6d 18-Sep-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: avoid needless memset on TX path

This reduces number of memory accesses and
hopefully contributes to better performance in the
future.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
0945baf7d4245b79e01c2a790186c41fb4b27dd2 18-Sep-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: use num_pending_tx instead of msdu id bitmap

It's more efficient to simply check num_pending_tx
value instead of traversing whole bitmap of
msdu ids.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7cc23016366e183dcaf23afa4a0dca61ff7f787a 13-Sep-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: remove wmi pending count limit

It is no longer used nor necessary since WMI
commands can block.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ed54388a38d817dce7fe22e7dc80fc13b1a6838e 13-Sep-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: improve beacon submission latency

The patch prevents beacon misses in some case of
heavy load on a system.

If a beacon can't be transmitted directly from an
SWBA event it will be left in arvif->beacon and
transmission will be retried once TX credits
become available.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7cc45e98e539ad98d8af57e4126aaac3e6b8f341 08-Sep-2013 Sujith Manoharan <c_manoha@qca.qualcomm.com> ath10k: Calculate correct peer PHY mode for VHT

The peer PHY mode for 11ac operation needs to be determined
properly based on the channel bandwidth being used. Fix
this so that the proper mode is given to the firmware.

kvalo: earlier we used 11na-ht20 in STA mode for 11ac AP peer, this
patch changes that to 11ac-vht80. I didn't notice any change in
throughput in my tests, but nevertheless it's the right thing
to do.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
38a1d47ed5cf4b55f494be44940a1fda3281feab 08-Sep-2013 Kalle Valo <kvalo@qca.qualcomm.com> ath10k: print phymode as a string

Makes it easier to read debug logs.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
60c3daa88873df9c90465c09fba0b7985f9db939 08-Sep-2013 Kalle Valo <kvalo@qca.qualcomm.com> ath10k: clean mac.c debug messages

Just to unify with the rest of debug messages. Minimal functional changes,
only major ones are removal of the awkward "else" style in debug
messages.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
961d4c38961a0f61e43edbb1fb579f28475a88bd 09-Aug-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: add support for HTT 3.0

New firmware comes with new HTT protocol version.
In 3.0 the separate mgmt tx command has been
removed. All traffic is to be pushed through data
tx (tx_frm) command with a twist - FW seems to not
be able (yet?) to access tx fragment table so for
manamgement frames frame pointer is passed
directly.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
68c8a9b22eeec0b57ba261eec5b642ec1cc5fa16 13-Aug-2013 Marek Puzyniak <marek.puzyniak@tieto.com> ath10k: fix WEP in AP and IBSS mode

WEP encoding was not working properly for AP and IBSS mode.
TX frames were encrypted with default WEP tx key index set
always to zero, what sometimes was wrong when different
key index should be used. This patch allows to update
WEP key index also for AP and IBSS mode.
Problem detected during automated WEP tests.

Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7a53f3f38ad4746c82496293bfb48fae69d71c64 13-Aug-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: clean up monitor start code

Remove useless code that was causing WARN_ON when
a 80MHz+ vif entered promiscuous mode or monitor
interface was started.

The channel mode is already computed by
chan_to_phymode().

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
c69029b179592b5bb6da3c356236b362055284a4 07-Aug-2013 Janusz Dziedzic <janusz.dziedzic@tieto.com> ath10k: setup peer UAPSD flag correctly

Setup UAPSD peer/peer rate flags correctly.
WMI_RC_UAPSD_FLAG is a peer rate capabilities flag
and should not be set as a peer flag.
Found during code review, doesn't fix a known
issues.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
0dbd09e6284dc7c3de1470e2f1a3c83e0a0fc591 31-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: zero arvif memory on add_interface()

The private memory area in vif provided by
mac80211 isn't guaranteed to be zeroed.

This patch should fix issues when switching
between STA and AP interface types.

The tim_bitmap could become polluted by STA bssid
field (since it's a union), wep_keys array
could also become polluted with invalid pointers
and probably much more.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
d531cb85d538d4a445e3bb3c669af794ea32e558 31-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: advertise more conservative intf combinations

Apparently the available firmware has a limit of
handling 7 APs, 3 GOs or 8 STAs. This is based on
empirical tests and it is still possible some
combinations may crash the firmware.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
dcd4a561215b46d2d7c57b855a7da6a3e6e80c0e 31-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: make sure to use passive scan when n_ssids is 0

Normally user specifies broadcast ssid for
scanning. If the user wants to do a passive scan
it does not pass any ssids.

The patch makes sure we ath10k tells firmware to
not send anything at all in case it decides no
ssids equals broadcast ssid.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2e1dea40512d7e99a7e91ac88a6f434a5d7c6fde 31-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: implement get_survey()

This implements a limited subset of what can be
reported in the survey dump.

This can be used for assessing approximate channel
load, e.g. for automatic channel selection.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7c199997ded6c90fd45a50f49e9ac63adaacb95e 31-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: implement tx checksum offloading

HW supports L3/L4 tx checksum offloading.

This should reduce CPU load and improve
performance on slow host machines.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8865bee4835441d9b3220d779d254d5856a68af0 24-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: detect the number of spatial streams supported by hw

Until now ath10k assumed 3 spatial streams.
However some devices support only 2 spatial
streams.

This patch improves performance on devices that
don't support 3 spatial streams.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ba0ccd7affd777cb90ad7279de4143663ae4d485 22-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: improve tx throughput on slow machines

It is more efficient to move just the 802.11
header instead of the whole payload in most cases.

This has no measurable effect on modern hardware.
It should improve performance by a few percent on
hardware such as an Access Point that have a slow
CPU compared to a typical desktop CPU.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
424121c365aed6ec93bbc8b515548df79c5af61c 22-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: fix rts/fragmentation threshold setup

If RTS and fragmentation threshold values are
0xFFFFFFFF they should be considered disabled and
no min/max limits must be applied.

This fixes some issues with throughput issues,
especially with VHT.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
d6015b27f7dd6e167cd90b590dc9ed5dfbc68086 22-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: fix memleak in mac setup

In some cases channel arrays were never freed.

The patch also unifies error handling in the mac
setup function.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
cf84bd4defe22c7359bd3e4d6978bd88af1f8f90 16-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: fix NULL dereference for injected packets

Tx processing functions dereference vif and caused
NULL to be dereferenced for injected frames.

Don't call these functions at all for injected
frames. It doesn't make much sense to do so
anyway.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
affd321733eebc92b12cd329505f63e94ae80c93 16-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: implement device recovery

Restart the hardware if FW crashes.

If FW crashes during recovery we leave the
hardware in a "wedged" state to avoid recursive
recoveries.

When in "wedged" state userspace may bring
interfaces down (to issue stop()) and then bring
one interface (to issue start()) to reload
hardware manually.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
818bdd16b229919cfd07447d261154a1343871e1 16-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: defer hw setup to start/stop mac80211 hooks

This fixes suspend-to-disk. The hardware is now
re-initialized upon freeze/thaw properly.

This also makes suspend/resume re-initialize the
hardware as WoWLAN support is not done yet.

With some little work it should be possible to
support hw reconfiguration for hw/fw recovery.

HW must be initialized once before registering to
mac80211 because FW determinates what hw
capabilities can be advertised.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
a96d7745592274077e517173ec2cdac2a22d5b79 16-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: make sure all resources are freed upon ath10k_stop()

This is necessary for proper hw reconfiguration
and to avoid memory leaks.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
8cd13cad1caf94ba66f626a94887b795fe23f939 16-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: decouple suspend code

Split up fw-related and hw-related suspension code.

Although we don't advertise WoW support to
mac80211 yet it's useful to keep the code in
suspend/resume hooks.

At this point there's no need to keep pci pm ops.
In case of WoW mac80211 calls ath10k_suspend()
which should take care of entering low-power mode.
In case WoW is not available mac80211 will go
through regular interface teradown and use start/stop.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
f7843d7f1ac57fb388d5814cdcbd309fa18214be 16-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: allow deferred regd update

Regulatory domain notification hook can be called
regardless of the hw state (i.e. before start
mac80211 callback).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
adb8c9b77cd182b1b3f2b145b8db4043623e3745 05-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: abort scan properly if wmi_scan_stop fails

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
548db54cc1890b161e87d4ca1028cf77f51fd16c 05-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: improve locking

Add more lockdep asserts and a few conf_mutex
locks. It's better to be on the safe side.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
edb8236df4d0429d973e093062a4806471f5efa2 05-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: embed HTT struct inside ath10k

This reduces number of allocations and simplifies
memory managemnt.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
671b96db55c3ef372a5b01dfeb6b445b5c7cc3d1 05-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: do not setup rts/frag thresholds for suspended interfaces

mac80211 calls for rts/frag threshold hooks before
any interface is brought back up again when
resuming.

We would set vdev parameters before given vdev is
created lading to a FW crash.

rts/frag thresholds will be re-set accordingly in
add_interface() hook anyway.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
679c54a67141fb12fd579c6097ebfab4cecf0043 05-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: setup rts/frag thresholds upon vdev creation

mac80211 configures rts/frag thresholds per-hw not
per-vif. ath10k FW expects those values to be set
per-vdev (i.e. per-vif).

ath10k should now respect rts/frag thresholds set
before a given interface was brought up.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
80c78c67e6660db46f0a6e60941386ce22863e24 05-Jul-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: fix possible deadlock

It was possible to have a deadlock due to inverted
locking of local->iflist_mtx and
ath10k->conf_mutex.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
0f817ed52d07873cd39c9d3f6d87fae962dc742f 27-Jun-2013 John W. Linville <linville@tuxdriver.com> ath10k: minimally handle new channel width enumeration values

CC drivers/net/wireless/ath/ath10k/mac.o
drivers/net/wireless/ath/ath10k/mac.c: In function ‘chan_to_phymode’:
drivers/net/wireless/ath/ath10k/mac.c:229:3: warning: enumeration value ‘NL80211_CHAN_WIDTH_5’ not handled in switch [-Wswitch]
drivers/net/wireless/ath/ath10k/mac.c:229:3: warning: enumeration value ‘NL80211_CHAN_WIDTH_10’ not handled in switch [-Wswitch]
drivers/net/wireless/ath/ath10k/mac.c:247:3: warning: enumeration value ‘NL80211_CHAN_WIDTH_5’ not handled in switch [-Wswitch]
drivers/net/wireless/ath/ath10k/mac.c:247:3: warning: enumeration value ‘NL80211_CHAN_WIDTH_10’ not handled in switch [-Wswitch]

Signed-off-by: John W. Linville <linville@tuxdriver.com>
d847e3e2e4d9d0c2902122a474d7fe62e08d6309 26-Jun-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: leave MMIC generation to the HW

Apparently HW doesn't require us to generate MMIC
for TKIP suite.

Each frame was 8 bytes longer than it should be
and some APs would drop frames that exceed 1520
bytes of 802.11 payload. This could be observed
during throughput tests or fragmented IP traffic.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
429ff56a4ad5d9568a319f9368cc06c9f4f571af 26-Jun-2013 Michal Kazior <michal.kazior@tieto.com> ath10k: fix 5ghz channel definitions

Nonsense channel flags were being set.

Although it doesn't seem this was visible to the
user the patch makes sure that channel
availability won't be crippled in the future if
ath_common behaviour changes.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5e3dd157d7e70f0e3cea3f2573ed69fb156a19d5 12-Jun-2013 Kalle Valo <kvalo@qca.qualcomm.com> ath10k: mac80211 driver for Qualcomm Atheros 802.11ac CQA98xx devices

Here's a new mac80211 driver for Qualcomm Atheros 802.11ac QCA98xx devices.
A major difference from ath9k is that there's now a firmware and
that's why we had to implement a new driver.

The wiki page for the driver is:

http://wireless.kernel.org/en/users/Drivers/ath10k

The driver has had many authors, they are listed here alphabetically:

Bartosz Markowski <bartosz.markowski@tieto.com>
Janusz Dziedzic <janusz.dziedzic@tieto.com>
Kalle Valo <kvalo@qca.qualcomm.com>
Marek Kwaczynski <marek.kwaczynski@tieto.com>
Marek Puzyniak <marek.puzyniak@tieto.com>
Michal Kazior <michal.kazior@tieto.com>
Sujith Manoharan <c_manoha@qca.qualcomm.com>

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>