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>
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>
Michal Kazior [Tue, 3 Sep 2013 13:09:58 +0000 (15:09 +0200)]
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>
Kalle Valo [Sun, 1 Sep 2013 08:22:14 +0000 (11:22 +0300)]
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>
Kalle Valo [Sun, 1 Sep 2013 07:02:15 +0000 (10:02 +0300)]
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>
ath10k_debug_read_target_stats is properly
protected by data_lock (spinlock). Remove
the unwanted mutex_unlock(&ar->conf_mutex)
[ BUG: bad unlock balance detected! ]
-------------------------------------
kworker/u4:0/12459 is trying to release lock
(&ar->conf_mutex) at:
[<c16a170d>] mutex_unlock+0xd/0x10
but there are no more locks to release!
Michal Kazior [Fri, 9 Aug 2013 08:13:34 +0000 (10:13 +0200)]
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>
Michal Kazior [Fri, 9 Aug 2013 08:13:33 +0000 (10:13 +0200)]
ath10k: add support for firmware newer than 636
The mgmt_rx event structure has been expanded.
Since the structure header is expanded the payload
(i.e. mgmt frame) is shifted by a few bytes. This
needs to be taken into account in order to support
both old and new firmware.
This introduces a fw_features to keep track of any
FW-related ABI/behaviour changes.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Marek Puzyniak [Tue, 13 Aug 2013 09:45:22 +0000 (11:45 +0200)]
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>
Michal Kazior [Tue, 13 Aug 2013 05:59:37 +0000 (07:59 +0200)]
ath10k: implement 802.3 SNAP rx decap type A-MSDU handling
This enables driver to rx another decapped a-msdu
frames. It should possibly help with throughputs
in some cases and reduce (or eliminate) number of
messages like this:
ath10k: error processing msdus -524
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Janusz Dziedzic [Wed, 7 Aug 2013 10:10:49 +0000 (12:10 +0200)]
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>
ath6kl: Fix invalid pointer access on fuzz testing with AP mode
In our Fuz testing, reference client corrupts the dest mac to "00:00:00:00:00:00"
in the WPA2 handshake no 2. During driver init the sta_list entries mac
addresses are by default "00:00:00:00:00:00". Driver returns an invalid
pointer (conn) and the drver shall crash, if rxtids (aggr_conn)
skb queues are accessed, since they would not be initialized.
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Make sure to cancel heart beat timer before
freeing wmi to avoid potential NULL pointer
dereference.
Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: add SoC power save option to PCI features map
Unify the PCI options location.
By default the SoC PS option is disabled to boost the
performance and due to poor stability on early HW revisions.
In future we can remove the module parameter and turn on/off
the PS for given hardware.
This change also makes the pci module parameter for SoC PS static.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Fri, 2 Aug 2013 07:15:47 +0000 (09:15 +0200)]
ath10k: fix device teardown
This fixes interrupt-related issue when no
interfaces were running thus the device was
considered powered down.
The power_down() function isn't really powering
down the device. It simply assumed it won't
interrupt. This wasn't true in some cases and
could lead to paging failures upon FW indication
interrupt (i.e. FW crash) because some structures
aren't allocated in that device state.
One reason for that was that ar_pci->started
wasn't reset. The other is interrupts should've
been masked when teardown starts.
The patch reorganized interrupt setup and makes
sure ar_pci->started is reset accordingly.
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>
Michal Kazior [Wed, 31 Jul 2013 08:55:14 +0000 (10:55 +0200)]
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>
Michal Kazior [Wed, 31 Jul 2013 08:55:13 +0000 (10:55 +0200)]
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>
Michal Kazior [Wed, 31 Jul 2013 08:55:11 +0000 (10:55 +0200)]
ath10k: prevent using invalid ringbuffer indexes
If the device is removed and hotplug fails
ioread32() will return 0xFFFFFFFF. In that case
reading ringbuffer during device bringup led to
out-of-bounds addressing of a ringbuffer array
that in turn led to a paging failure.
This could be reproduced by the following:
* boot without acpi/prevent hotplug from working
* insert and manually detect (pci rescan) the device
* remove the device physically
* load ath10k driver
* kernel crashed
Ringbuffer index reading is now protected by using
an appropriate mask to prevent addressing an
invalid array index.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Mon, 22 Jul 2013 12:25:28 +0000 (14:25 +0200)]
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>
Michal Kazior [Tue, 16 Jul 2013 07:54:35 +0000 (09:54 +0200)]
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>
Michal Kazior [Tue, 16 Jul 2013 07:38:59 +0000 (09:38 +0200)]
ath10k: skip fw stats debugfs interface if device is down
If the device is not running then there may be no
FW at all to send the query to. If the FW is
already there it might still trigger a crash if
the command is sent before the device is fully
initialized.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Michal Kazior [Tue, 16 Jul 2013 07:38:54 +0000 (09:38 +0200)]
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>
mwifiex_fw_dpc() asynchronously takes care of firmware download
and initialization. Currently the error paths in mwifiex_fw_dpc()
are not handled. So if wrong firmware is downloaded, required
cleanup work is not performed. memory is leaked and workqueue
remains unterminated in this case.
mwifiex_terminate_workqueue() is moved to avoid forward
declaration.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>