smd: add do while loops to init and prepare macros

Now callers are forced to use semicolon in the end.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
smd: add HAL debug messages

Easier to follow what's wcn36xx is doing.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
debug: use printk() instead pr_debug()

If CONFIG_DYNAMIC_DEBUG is enabled user would need
to use both debug_mask and /sys/kernel/debug/dynamic_debug/
to get debug logs. That's just confusing, it should be
enough to use debug_mask module parameter.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
smd: print what hal response had an error

Also introduce wcn36xx_warn() and use that to print
the warning.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Cleanup TX debugging

Also simplify wcn36xx_tx() in the process.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Improve rx debugging

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
dxe: move some debug logs from RX to DXE level

And make the log messages more compact as well.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Revert "debug: use printk() instead pr_debug()"

This reverts commit 113f8ef1a26f9033fbfc13de83886ae68dea20cb.

There's not concensus how to handle dynamic debugging, so
revert this change until we find a good solution.
Merge pull request #16 from kvalo/wcn36xx-smd-debug-1

Wcn36xx smd debug 1
Merge pull request #18 from pof2/master

remove unimplemented ops.
Remove ENTER() macro

It spams the log way too much and no way to disable it.
Better to add proper debug messages instead.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
main: improve mac80211 related debug messages

The debug messages in main.c used wcn36xx_info() too much which was spamming
the log. Use the wcn36xx_dbg() macro instead.

Add new debug levels HAL_DUMP and MAC. The former is just consistency, the
actual debug messages dumping hal messages will be added later.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Use warn() if mac address file is not found

It's not that serious if mac address is not found so use
just warn() which doesn't look so serious in the logs.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
main: remove "No handling for change" message

It isn't that useful so it can easily go away to keep logs clean.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
smd: provide wcn to response handlers

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
hal: store firmware wlan and crm version

Store firmware wlan and crm versions, we will need those
in the future. 

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
smd: print and store firmware API version as well as supported stations and bssids

Helps with debugging in the future.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Merge pull request #19 from kvalo/wcn36xx-mac-debug-1

wcn36xx main.c debug improvements.
hal: remove unused v1 structs

It's unclear with what firmware version we should use these. Just to keep
things simple remove them. Also remove related unneeded unions from few
structs.

No functional changes.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
hal: add support for config sta v1 command

Mako firmware interface (1.3.1.0) needs a bit different
config sta command. To handle that, create struct
wcn36xx_hal_config_sta_req_msg_v1 which is to be used with mako firmware.
wcn36xx will dynamically detect from firmware API version if older (_v1) or
newer version of the command structure needs to be used.

I implemented it so that we always populate the new structure first and then if
we detect that older structure is needed we just copy the values from the
original structure to the v1 structure. That way structure needs to be
populated only once.

Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>