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>
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>
ath10k: implement ath10k_debug_start/stop()

Needed for the HTT stats implementation.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: add htt_stats_enable debugfs file

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
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>
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>
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>
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>
ath10k: add BMI log level

Also clean BMI log messages and add few more.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
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>
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>
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>
ath10k: add boot debug messages to htc.c

To unify the boot debug level.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: add boot messages to htt.c

To unify the boot debug level.

Signed-off-by: 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>
ath10k: print phymode as a string

Makes it easier to read debug logs.

Signed-off-by: Kalle Valo <kvalo@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>
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>
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>
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>