ath10k: improve FW QoS workaround

This fixes two things:

 * recently broken AP mode,
 * a scenario when mac80211 requests us to send a
   non-QoS Data.

The latter is done by upgrading non-QoS Data frame
to QoS Data (we modify the frame_control). This
is the only way we can work around this FW issue
for now.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: fix double-prefixed functions

A few functions have been double-prefixed 'ath10k_ath10k_'.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: drop dead code

HTC RX could never be aborted.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: make HTC cancellation a generic thing

With this the HIF layer (e.g. PCI) can tell the
upper layers that a packet was aborted and all
related resources must be freed ASAP.

This makes sense for HTT TX in particular. FW
requires us to allocate additional resources for
each transmitted frame and we must not free those
resources until after the whole thing is
considered completed.

This is required to fix a possible memory leak in
PCI CE teardown path.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: fix HTC tx flushing

There was a very slight chance we'd pass a single
frame while stopping HTC.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: reorder pci shutdown sequences

If a tx completion happened right before a CE
pipe was stopped we'd free the completion related
skbuff. If the skbuff was a part of HTT TX we'd
leak memory and iommu mapping.

This shouldn't happen normally but if FW hangs or
stalls and we unload the driver then we could
memleak.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: fix memory leak during PCI teardown

If we force-complete a tx skbuff we must mark it
as aborted.

If we don't do that we might free a HTT TX skbuff
that was not HTT TX completed.

This was easily triggered with:

 * run iperf
 * eject the device
 * (if necessary) force remove it with sysfs

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: remove obsolete function prototype

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: fix typo in ath10k Kconfig

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: use if statement instead of cond. operator

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: remove pointless goto label

There's nothing more than return call inside the label.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: rename PCI target PS contol functions

* TARGET_ACCESS_BEGIN() -> ath10k_pci_wake()
* TARGET_ACCESS_END() -> ath10k_pci_sleep()

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: remove fw event chain for target dump notification

We throw the FW dump registers straight from the bottom layers,
there's no recovery or any logic up, so get rid of the callbacks
chain for now.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>