Commit Graph

40797 Commits

Author SHA1 Message Date
Bartosz Markowski
ce42870efb ath10k: introduce dynamic WMI structures
This is the initial framework to implement dynamic
WMI API in order to support new firmware (from so
called 10.X branch)

The realization is to have a static WMI cmd map for
each of the firmwares, registered upom wmi init.

This patch creates such map for MAIN FW, updates
wmi_cmd_send() calls to take as a parameter
the map value instead of direct WMI enum.

As soon as complete 10.X API will be on place,
we will introduce the FW IE mechanics to dynamicaly
identify which FW is being used and based on that
we will use correct map, API, structures, etc.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-27 14:58:13 +03:00
Marek Puzyniak
52fa019155 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>
2013-09-26 17:30:24 +03:00
Michal Kazior
6e712d427c ath10k: replenish HTT RX buffers in a tasklet
This starves FW RX ring buffer in case of
excessive RX. This prevents from CPU being
overwhelmed by RX indications/completions by
naturally forbiddin FW to submit more RX.

This fixes RX starvation on slow machines when
under heavy RX traffic.

kvalo: remove extra newline

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-26 17:22:54 +03:00
Michal Kazior
4d316c79a5 ath10k: align RX frames properly
Ethernet-like decapping mode leaves IP protocol
frame not aligned to 4-byte boundaries. This leads
to re-aligning in mac80211 which in turn leads to
poor CPU cache behaviour on some machines.

Since HW doesn't allow to change payload offset
properly the solution is to force HW to decap in
Native Wifi mode which always has 24-bytes long
802.11 header (even for QoS frames). This means IP
frame is properly aligned in this decap mode.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-26 10:12:24 +03:00
Michal Kazior
784f69d31b ath10k: fix Native Wifi decap mode RX
NWifi decap mode always reports 802.11 Data
Frames, even when QoS Data Frames are actually
received.

This made mac80211 not report frame priority
properly (since there was no QoS Control field).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-26 10:12:23 +03:00
Michal Kazior
e3fbf8d22a ath10k: cleanup RX decap handling
Simplify decapping code and make it easier to
understand.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-26 10:12:23 +03:00
Michal Kazior
26d1e9c261 ath10k: document decap modes
Clarify how each decap mode works in one place.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-26 10:12:23 +03:00
Michal Kazior
f6dc2095a0 ath10k: report A-MSDU subframes individually
HW reports each A-MSDU subframe as a separate
sk_buff. It is impossible to configure it to
behave differently.

Until now ath10k was reconstructing A-MSDUs from
subframes which involved a lot of memory
operations. This proved to be a significant
contributor to degraded RX performance.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-26 10:12:22 +03:00
Michal Kazior
1f8bb1518e 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>
2013-09-20 08:18:10 +03:00
Michal Kazior
2f3773bcaf ath10k: cleanup HTT TX functions
Use a saner goto scheme for failure handling. Also
group operations more sensibly.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-20 08:18:10 +03:00
Michal Kazior
0a89f8a01d 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>
2013-09-20 08:18:09 +03:00
Michal Kazior
27bb178dae 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>
2013-09-20 08:18:09 +03:00
Michal Kazior
0945baf7d4 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>
2013-09-20 08:18:09 +03:00
Michal Kazior
1073ab2e9b ath10k: fix num_sends_allowed replenishing
Commit e9bb0aa39 ("ath10k: delete struct ce_sendlist") broke
num_sends_allowed incrementing. num_sends_allowed
exceeded initial values and could overflow.

This code was supposed to replenish
num_sends_allowed for partial sendlist items (i.e.
before final sendlist item from a sendlist was
completed and could be processed by completion
handlers).

Fortunately it seems it did not cause any major breakage,
yet.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-20 08:04:31 +03:00
Michal Kazior
9e84f653ac ath10k: fix tracing build for ath10k_wmi_cmd
Commit be8b394390 ("ath10k: make WMI commands block by design") broke
the build if CONFIG_ATH10K_TRACING was enabled.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-20 07:59:29 +03:00
Michal Kazior
5c6c82df6b ath10k: remove wmi event worker thread
It's not really necessary to have this processed
in a worker. There are no sleepable calls (and
actually shouldn't be).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-16 19:47:46 +03:00
Michal Kazior
7cc2301636 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>
2013-09-16 19:47:46 +03:00
Michal Kazior
ed54388a38 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>
2013-09-16 19:47:46 +03:00
Michal Kazior
12acbc43c1 ath10k: simplify HTC command submitting
The patch removes HTC endpoint tx workers in
favour of direct command submission. This makes a
lot more sense for data path.

mac80211 queues are effectively stopped/woken up
in a more timely fashion preventing build up of
frames. It's possible to push more traffic than
the device/system is able to handle and have no
hiccups or performance degradation with UDP
traffic.

WMI commands will now report errors properly and
possibly block as they actively can wait for tx
credits to become available.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-16 19:47:46 +03:00
Michal Kazior
be8b394390 ath10k: make WMI commands block by design
This will be necessary for further changes in
command submission scheme.

Once HTC is cleaned up WMI commands will finally
block.

This requires for SWBA to be processed in a
non-atomic context for now. Once other necessary
changes are in this will be reverted.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-16 19:47:46 +03:00
Michal Kazior
88e65fc337 ath10k: add HTC TX credits replenishing notification
This will allow higher layers to anticipate and
act upon TX credits renewal. This will be
important for some future rework of WMI command
submission.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-16 19:47:46 +03:00
Michal Kazior
eeed3765f3 ath10k: simplify HTC credits calculation
Credit calculation was overly complex
unnecessarily. Now skb dequeing is more unified.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-16 19:47:45 +03:00
Jingoo Han
3699ddc55f wireless: ath10k: remove unnecessary pci_set_drvdata()
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-12 19:22:08 +03:00
Kalle Valo
e9bb0aa39b ath10k: delete struct ce_sendlist
struct ce_sendlist is useless as we always add just one buffer onto it.
And most importantly, it's ugly as it doesn't use skb properly.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-12 19:20:30 +03:00
Sujith Manoharan
7cc45e98e5 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>
2013-09-12 19:12:52 +03:00
Kalle Valo
38a1d47ed5 ath10k: print phymode as a string
Makes it easier to read debug logs.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-12 18:21:37 +03:00
Kalle Valo
60c3daa888 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>
2013-09-12 18:21:37 +03:00
Kalle Valo
aad0b65f5c ath10k: add boot messages to htt.c
To unify the boot debug level.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-12 18:21:37 +03:00
Kalle Valo
42a2efbc57 ath10k: add boot debug messages to htc.c
To unify the boot debug level.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-12 18:21:37 +03:00
Kalle Valo
24cfade11e ath10k: add boot debug messages to pci.c and ce.c
To unify all boot related debug messages into one debug
level.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-12 18:21:37 +03:00
Kalle Valo
effea9688d ath10k: cleanup debug messages in core.c
Fix them to follow the general logging style in ath10k.

While at it, add print id chip_id to the debug log.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-12 18:21:37 +03:00
Kalle Valo
b52b7688ac ath10k: rename ATH10K_DBG_CORE to BOOT
core.c mostly deals with driver and firmware starting related
actions. And we can use the boot level also in other components,
like PCI and HTT.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-12 18:21:36 +03:00
Kalle Valo
f0bbea9981 ath10k: add BMI log level
Also clean BMI log messages and add few more.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-12 18:21:36 +03:00
Bartosz Markowski
4ed998dcbf ath10k: define ath10k_debug_start/_stop as static inline
Otherwise if CONFIG_ATH10K_DEBUGFS won't be set we will
end up with multiple definitions and compilation failure
in each place the header is included.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-10 01:28:29 +03:00
Michal Kazior
5440ce2537 ath10k: prevent CE from looping indefinitely
The double while() could end up running forever.
Inner while() would complete very fast. However
the completion processing could take enough time
for more completions to flow in. In that case the
outer while() would not terminate and run again,
and again. This could happen especially on a slow
host system.

This could lead to a system freeze during heavy
traffic. Note: this doesn't solve all known
starvation issues yet.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-08 17:59:32 +03:00
Bartosz Markowski
b8a1e00f1a ath10k: remove obsolete INIT STATUS definitions
There's no functional changes. Just a small cleanup.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-06 12:50:46 +03:00
Bartosz Markowski
03fc137b50 ath10k: set the UART baud rate to 19200
When configuring the host_interests over BMI, set the UART
baud rate to 19200. This is valid for QCA988X_2.0 devices.

kvalo: found during code review, there should not be any functionality
changes

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-06 12:49:17 +03:00
Kalle Valo
a3d135e566 ath10k: add htt_stats_enable debugfs file
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-06 12:42:26 +03:00
Kalle Valo
db66ea0442 ath10k: implement ath10k_debug_start/stop()
Needed for the HTT stats implementation.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-06 12:42:26 +03:00
Kalle Valo
a9bf05062d ath10k: add trace event ath10k_htt_stats
For analysing various data path statistics in user space.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-06 12:42:25 +03:00
Dave Jones
55d761b878 ath10k: add missing braces to ath10k_pci_tx_pipe_cleanup
The indentation here implies this was meant to be
a multi-statement if, but it lacks the braces.

kvalo: add "ath10k: " prefix

Signed-off-by: Dave Jones <davej@fedoraproject.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-06 12:31:10 +03:00
Kalle Valo
763b8cd314 ath10k: add chip_id file to debugfs
So that's it's possible to query chip id from ath10k anytime.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-03 09:59:53 +03:00
Kalle Valo
e01ae68c5d ath10k: check chip id from the soc register during probe
ath10k doesn't support qca988x hw1.0 boards anymore. Unfortunately
the PCI id is the same in hw1.0 and hw2.0 so ath10k tries to use
hw1.0 boards anyway. But without hw1.0 workarounds in place
ath10k just crashes horribly.

To avoid using hw1.0 boards at all add a chip id detection
and fail the probe if hw1.0 is detected:

[ 5265.786408] ath10k: ERROR: qca988x hw1.0 is not supported
[ 5265.786497] ath10k: Unsupported chip id 0x043200ff
[ 5265.786574] ath10k: could not register driver core (-95)
[ 5265.793191] ath10k_pci: probe of 0000:02:00.0 failed with error -95

Also add a warning if there's an unknown chip id but continue
the boot process normally anyway.

Reported-by: Zaki Bakar <zaki.bm@gmail.com>
Tested-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-03 09:54:16 +03:00
Kalle Valo
e9780367b0 ath10k: simplify ath10k_ce_init() wake up handling
ath10k_ce_init() and the functions it calls wakeup
the chip multiple times. Simplify that to call
ath10k_pci_wake() only once. This also makes it
easier to add error handling when wakeup fails.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-03 09:49:08 +03:00
Kalle Valo
3aebe54b1c ath10k: convert ath10k_pci_wake() to return
We should not try to access hw if wakeup fails so add
proper error checking for that. Also add the timeout lenght
to the warning message.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-03 09:49:08 +03:00
Kalle Valo
a40d3e420d ath10k: clean up ath10k_ce_completed_send_next_nolock()
The error handling was just weird, simplify it.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-03 09:49:07 +03:00
Kalle Valo
e479ed437b ath10k: convert ath10k_pci_reg_read/write32() to take struct ath10k
This is consistent with all other functions.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-03 09:49:07 +03:00
Kalle Valo
aa5c1db445 ath10k: remove void pointer from struct ath10k_pci_compl
Void pointers are bad, mmkay.

No functional changes.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-03 09:49:07 +03:00
Kalle Valo
d88effbaa6 ath10k: make target_ce_config_wlan more readable
It's easier to read t if the field names are visible.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-03 09:49:07 +03:00
Kalle Valo
48e9c225ab ath10k: pci: make host_ce_config_wlan[] more readable
It's much more readable if struct entries in host_ce_config_wlan
are explicitly set.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2013-09-03 09:49:07 +03:00