wl12xx: start reworking the init sequence
Split the init sequence into common commands (non role-specific)
and role-specific commands.
We still need to call the common commands only on add_interface()
(rather than on start()) as the fw must get the mac address
when uploading the nvs.
Future patches will refactor the init sequence further more.
Signed-off-by: Eliad Peller <eliad@wizery.com>
[fixed a couple of sparse warnings]
Signed-off-by: Luciano Coelho <coelho@ti.com>
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index 652471e..901e43a 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -676,7 +676,7 @@
if (ret < 0)
return ret;
- ret = wl1271_sta_init_templates_config(wl);
+ ret = wl1271_init_templates_config(wl);
if (ret < 0)
return ret;
@@ -1919,6 +1919,10 @@
if (ret < 0)
goto power_off;
+ ret = wl1271_hw_init(wl);
+ if (ret < 0)
+ goto irq_disable;
+
if (wl->bss_type == BSS_TYPE_STA_BSS ||
wl->bss_type == BSS_TYPE_IBSS) {
/*
@@ -1939,7 +1943,7 @@
if (ret < 0)
goto irq_disable;
- ret = wl1271_hw_init(wl, vif);
+ ret = wl1271_init_vif_specific(wl, vif);
if (ret < 0)
goto irq_disable;