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>
ath10k: add wmi_10x_<cmd/event> definitions

Introduce the cmd and events definitions for 10.X FW API
and make up the wmi_10x_cmd_map. This is the core of
host-firmware WMI interface for 10.X FW branch.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: warn if give WMI command is not supported

This will show and make it easier to track the API
differences in the new AP firmware.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: implement WMI events handling frame for both firmwares

We still use the same function handlers for both main and 10.X
paths. Next step is to track down and make the split needed.

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

Since the both firmwares we are going to support,
have significantly different APIs (WMI and shared
structures), it's easier to actually split the whole
event handling functions, instead cutting them inside.

The fork starts now on ath10k_wmi_process_rx().

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: drop the fw versioning sanity check

It was corrupted and leading to compilation warning
core.c: In function 'ath10k_check_fw_version':
core.c:79: warning: comparison is always true due to limited range of data type

Since we are going to support new FW track in the driver,
the sanity check for fw version number would be an overkill
then. This is just for information purposes anyway.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: implement host memory chunks

10.X firmware can request a memory pool from host to offload
it's own resources. This is a feature designed especially
for AP mode where the target has to deal with large number
of peers.

So we allocate and map a consistent DMA memory which FW can
use to store e.g. peer rate contol maps.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.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>
ath10k: split wmi_cmd_init path

Due to API differences in initialization structures for
main and 10.x firmwares we need to split the wmi_init_cmd
and wmi_resource_config  structures.

This will be usefull also when setting the correct TARGET values,
like: number of peers, vdevs, pdevs etc.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
ath10k: add TARGET values for 10.x firmware

Introduce all TARGET specific values for 10.x firmware.
Some of them are common for both firmwares we will support,
but to avoid confusion, define everything with prefix 10X_.

Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.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>
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>
ath10k: handle FW API differences for scan structures

The wmi_start_scan_cmd has an extra filed in our main
firmware track, reflact that to not have a mismatch in
case of 10.x track.

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