diff options
author | Luciano Coelho <coelho@ti.com> | 2011-03-10 08:24:57 -0500 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2011-04-19 09:49:03 -0400 |
commit | e7ddf549f3f2da156f5c12921e6699024e80a3f4 (patch) | |
tree | df8f0e4d2ac9e23ec96117ffca35517a3cd94ac6 /drivers/net/wireless/wl12xx/main.c | |
parent | 0830ceedbfde20c9110c59597fdffbf51886565a (diff) |
wl12xx: use 1 spare TX block instead of two
All the new firmware versions (>=6.1.3.50.58 for STA and >=6.2.0.0.47
for AP) use 1 spare TX block. We still want to support older
firmwares that require 2 spare blocks, so added a quirk to handle the
difference.
Also implemented a generic way of setting quirks that depend on the
firmware revision.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/main.c')
-rw-r--r-- | drivers/net/wireless/wl12xx/main.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index 0b9d41f14b28..db7ab856363e 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c | |||
@@ -1040,6 +1040,24 @@ out: | |||
1040 | return ret; | 1040 | return ret; |
1041 | } | 1041 | } |
1042 | 1042 | ||
1043 | static unsigned int wl1271_get_fw_ver_quirks(struct wl1271 *wl) | ||
1044 | { | ||
1045 | unsigned int quirks = 0; | ||
1046 | unsigned int *fw_ver = wl->chip.fw_ver; | ||
1047 | |||
1048 | /* Only for wl127x */ | ||
1049 | if ((fw_ver[FW_VER_CHIP] == FW_VER_CHIP_WL127X) && | ||
1050 | /* Check STA version */ | ||
1051 | (((fw_ver[FW_VER_IF_TYPE] == FW_VER_IF_TYPE_STA) && | ||
1052 | (fw_ver[FW_VER_MINOR] < FW_VER_MINOR_1_SPARE_STA_MIN)) || | ||
1053 | /* Check AP version */ | ||
1054 | ((fw_ver[FW_VER_IF_TYPE] == FW_VER_IF_TYPE_AP) && | ||
1055 | (fw_ver[FW_VER_MINOR] < FW_VER_MINOR_1_SPARE_AP_MIN)))) | ||
1056 | quirks |= WL12XX_QUIRK_USE_2_SPARE_BLOCKS; | ||
1057 | |||
1058 | return quirks; | ||
1059 | } | ||
1060 | |||
1043 | int wl1271_plt_start(struct wl1271 *wl) | 1061 | int wl1271_plt_start(struct wl1271 *wl) |
1044 | { | 1062 | { |
1045 | int retries = WL1271_BOOT_RETRIES; | 1063 | int retries = WL1271_BOOT_RETRIES; |
@@ -1075,6 +1093,9 @@ int wl1271_plt_start(struct wl1271 *wl) | |||
1075 | wl->state = WL1271_STATE_PLT; | 1093 | wl->state = WL1271_STATE_PLT; |
1076 | wl1271_notice("firmware booted in PLT mode (%s)", | 1094 | wl1271_notice("firmware booted in PLT mode (%s)", |
1077 | wl->chip.fw_ver_str); | 1095 | wl->chip.fw_ver_str); |
1096 | |||
1097 | /* Check if any quirks are needed with older fw versions */ | ||
1098 | wl->quirks |= wl1271_get_fw_ver_quirks(wl); | ||
1078 | goto out; | 1099 | goto out; |
1079 | 1100 | ||
1080 | irq_disable: | 1101 | irq_disable: |
@@ -1353,6 +1374,9 @@ power_off: | |||
1353 | strncpy(wiphy->fw_version, wl->chip.fw_ver_str, | 1374 | strncpy(wiphy->fw_version, wl->chip.fw_ver_str, |
1354 | sizeof(wiphy->fw_version)); | 1375 | sizeof(wiphy->fw_version)); |
1355 | 1376 | ||
1377 | /* Check if any quirks are needed with older fw versions */ | ||
1378 | wl->quirks |= wl1271_get_fw_ver_quirks(wl); | ||
1379 | |||
1356 | /* | 1380 | /* |
1357 | * Now we know if 11a is supported (info from the NVS), so disable | 1381 | * Now we know if 11a is supported (info from the NVS), so disable |
1358 | * 11a channels if not supported | 1382 | * 11a channels if not supported |