Commit c302b2c9 authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luciano Coelho

wl12xx: Use a single fw for both STA and AP roles

Firmware >= 6/7.3.0.0.75 (wl127x/wl128x) supports both
STA and AP roles.
Signed-off-by: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 7bb5d6ce
...@@ -1043,25 +1043,10 @@ static int wl1271_fetch_firmware(struct wl1271 *wl) ...@@ -1043,25 +1043,10 @@ static int wl1271_fetch_firmware(struct wl1271 *wl)
const char *fw_name; const char *fw_name;
int ret; int ret;
switch (wl->bss_type) { if (wl->chip.id == CHIP_ID_1283_PG20)
case BSS_TYPE_AP_BSS: fw_name = WL128X_FW_NAME;
if (wl->chip.id == CHIP_ID_1283_PG20) else
fw_name = WL128X_AP_FW_NAME; fw_name = WL127X_FW_NAME;
else
fw_name = WL127X_AP_FW_NAME;
break;
case BSS_TYPE_IBSS:
case BSS_TYPE_STA_BSS:
if (wl->chip.id == CHIP_ID_1283_PG20)
fw_name = WL128X_FW_NAME;
else
fw_name = WL1271_FW_NAME;
break;
default:
wl1271_error("no compatible firmware for bss_type %d",
wl->bss_type);
return -EINVAL;
}
wl1271_debug(DEBUG_BOOT, "booting firmware %s", fw_name); wl1271_debug(DEBUG_BOOT, "booting firmware %s", fw_name);
...@@ -1090,7 +1075,6 @@ static int wl1271_fetch_firmware(struct wl1271 *wl) ...@@ -1090,7 +1075,6 @@ static int wl1271_fetch_firmware(struct wl1271 *wl)
} }
memcpy(wl->fw, fw->data, wl->fw_len); memcpy(wl->fw, fw->data, wl->fw_len);
wl->fw_bss_type = wl->bss_type;
ret = 0; ret = 0;
out: out:
...@@ -1361,8 +1345,7 @@ static int wl1271_chip_wakeup(struct wl1271 *wl) ...@@ -1361,8 +1345,7 @@ static int wl1271_chip_wakeup(struct wl1271 *wl)
goto out; goto out;
} }
/* Make sure the firmware type matches the BSS type */ if (wl->fw == NULL) {
if (wl->fw == NULL || wl->fw_bss_type != wl->bss_type) {
ret = wl1271_fetch_firmware(wl); ret = wl1271_fetch_firmware(wl);
if (ret < 0) if (ret < 0)
goto out; goto out;
...@@ -1796,9 +1779,6 @@ static int wl1271_op_start(struct ieee80211_hw *hw) ...@@ -1796,9 +1779,6 @@ static int wl1271_op_start(struct ieee80211_hw *hw)
* *
* The MAC address is first known when the corresponding interface * The MAC address is first known when the corresponding interface
* is added. That is where we will initialize the hardware. * is added. That is where we will initialize the hardware.
*
* In addition, we currently have different firmwares for AP and managed
* operation. We will know which to boot according to interface type.
*/ */
return 0; return 0;
...@@ -4393,7 +4373,6 @@ struct ieee80211_hw *wl1271_alloc_hw(void) ...@@ -4393,7 +4373,6 @@ struct ieee80211_hw *wl1271_alloc_hw(void)
wl->hw_pg_ver = -1; wl->hw_pg_ver = -1;
wl->bss_type = MAX_BSS_TYPE; wl->bss_type = MAX_BSS_TYPE;
wl->set_bss_type = MAX_BSS_TYPE; wl->set_bss_type = MAX_BSS_TYPE;
wl->fw_bss_type = MAX_BSS_TYPE;
wl->last_tx_hlid = 0; wl->last_tx_hlid = 0;
wl->ap_ps_map = 0; wl->ap_ps_map = 0;
wl->ap_fw_ps_map = 0; wl->ap_fw_ps_map = 0;
......
...@@ -412,7 +412,5 @@ module_exit(wl1271_exit); ...@@ -412,7 +412,5 @@ module_exit(wl1271_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>"); MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");
MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>"); MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>");
MODULE_FIRMWARE(WL1271_FW_NAME); MODULE_FIRMWARE(WL127X_FW_NAME);
MODULE_FIRMWARE(WL128X_FW_NAME); MODULE_FIRMWARE(WL128X_FW_NAME);
MODULE_FIRMWARE(WL127X_AP_FW_NAME);
MODULE_FIRMWARE(WL128X_AP_FW_NAME);
...@@ -486,8 +486,6 @@ module_exit(wl1271_exit); ...@@ -486,8 +486,6 @@ module_exit(wl1271_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>"); MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");
MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>"); MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>");
MODULE_FIRMWARE(WL1271_FW_NAME); MODULE_FIRMWARE(WL127X_FW_NAME);
MODULE_FIRMWARE(WL128X_FW_NAME); MODULE_FIRMWARE(WL128X_FW_NAME);
MODULE_FIRMWARE(WL127X_AP_FW_NAME);
MODULE_FIRMWARE(WL128X_AP_FW_NAME);
MODULE_ALIAS("spi:wl1271"); MODULE_ALIAS("spi:wl1271");
...@@ -130,10 +130,8 @@ extern u32 wl12xx_debug_level; ...@@ -130,10 +130,8 @@ extern u32 wl12xx_debug_level;
#define WL1271_FW_NAME "ti-connectivity/wl1271-fw-2.bin" #define WL127X_FW_NAME "ti-connectivity/wl127x-fw-3.bin"
#define WL128X_FW_NAME "ti-connectivity/wl128x-fw.bin" #define WL128X_FW_NAME "ti-connectivity/wl128x-fw-3.bin"
#define WL127X_AP_FW_NAME "ti-connectivity/wl1271-fw-ap.bin"
#define WL128X_AP_FW_NAME "ti-connectivity/wl128x-fw-ap.bin"
/* /*
* wl127x and wl128x are using the same NVS file name. However, the * wl127x and wl128x are using the same NVS file name. However, the
...@@ -405,7 +403,6 @@ struct wl1271 { ...@@ -405,7 +403,6 @@ struct wl1271 {
u8 *fw; u8 *fw;
size_t fw_len; size_t fw_len;
u8 fw_bss_type;
void *nvs; void *nvs;
size_t nvs_len; size_t nvs_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment