diff options
author | Luciano Coelho <coelho@ti.com> | 2012-11-27 08:52:00 -0500 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-12-04 09:36:12 -0500 |
commit | 8675f9abdf5b67a3f621fa99e1f0e0c8d8ae2531 (patch) | |
tree | de74d34ec5a539ef4e281d20281fc648c8bdd745 /drivers/net/wireless | |
parent | b3ec9cf2052981171364c4f354f53a64089ecc75 (diff) |
wlcore/wl12xx/wl18xx: verify multi-role and single-role fw versions
Previously we were only checking the single-role firmware version.
Now add code to check for the firmware versions separately for each
firmware type.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ti/wl12xx/main.c | 24 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl12xx/wl12xx.h | 32 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/boot.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/ti/wlcore/wlcore.h | 29 |
5 files changed, 64 insertions, 32 deletions
diff --git a/drivers/net/wireless/ti/wl12xx/main.c b/drivers/net/wireless/ti/wl12xx/main.c index 07f7f76a0783..37e577ff17cb 100644 --- a/drivers/net/wireless/ti/wl12xx/main.c +++ b/drivers/net/wireless/ti/wl12xx/main.c | |||
@@ -653,9 +653,11 @@ static int wl12xx_identify_chip(struct wl1271 *wl) | |||
653 | /* read data preparation is only needed by wl127x */ | 653 | /* read data preparation is only needed by wl127x */ |
654 | wl->ops->prepare_read = wl127x_prepare_read; | 654 | wl->ops->prepare_read = wl127x_prepare_read; |
655 | 655 | ||
656 | wlcore_set_min_fw_ver(wl, WL127X_CHIP_VER, WL127X_IFTYPE_VER, | 656 | wlcore_set_min_fw_ver(wl, WL127X_CHIP_VER, |
657 | WL127X_MAJOR_VER, WL127X_SUBTYPE_VER, | 657 | WL127X_IFTYPE_SR_VER, WL127X_MAJOR_SR_VER, |
658 | WL127X_MINOR_VER); | 658 | WL127X_SUBTYPE_SR_VER, WL127X_MINOR_SR_VER, |
659 | WL127X_IFTYPE_MR_VER, WL127X_MAJOR_MR_VER, | ||
660 | WL127X_SUBTYPE_MR_VER, WL127X_MINOR_MR_VER); | ||
659 | break; | 661 | break; |
660 | 662 | ||
661 | case CHIP_ID_127X_PG20: | 663 | case CHIP_ID_127X_PG20: |
@@ -675,9 +677,11 @@ static int wl12xx_identify_chip(struct wl1271 *wl) | |||
675 | /* read data preparation is only needed by wl127x */ | 677 | /* read data preparation is only needed by wl127x */ |
676 | wl->ops->prepare_read = wl127x_prepare_read; | 678 | wl->ops->prepare_read = wl127x_prepare_read; |
677 | 679 | ||
678 | wlcore_set_min_fw_ver(wl, WL127X_CHIP_VER, WL127X_IFTYPE_VER, | 680 | wlcore_set_min_fw_ver(wl, WL127X_CHIP_VER, |
679 | WL127X_MAJOR_VER, WL127X_SUBTYPE_VER, | 681 | WL127X_IFTYPE_SR_VER, WL127X_MAJOR_SR_VER, |
680 | WL127X_MINOR_VER); | 682 | WL127X_SUBTYPE_SR_VER, WL127X_MINOR_SR_VER, |
683 | WL127X_IFTYPE_MR_VER, WL127X_MAJOR_MR_VER, | ||
684 | WL127X_SUBTYPE_MR_VER, WL127X_MINOR_MR_VER); | ||
681 | break; | 685 | break; |
682 | 686 | ||
683 | case CHIP_ID_128X_PG20: | 687 | case CHIP_ID_128X_PG20: |
@@ -693,9 +697,11 @@ static int wl12xx_identify_chip(struct wl1271 *wl) | |||
693 | WLCORE_QUIRK_TKIP_HEADER_SPACE | | 697 | WLCORE_QUIRK_TKIP_HEADER_SPACE | |
694 | WLCORE_QUIRK_START_STA_FAILS; | 698 | WLCORE_QUIRK_START_STA_FAILS; |
695 | 699 | ||
696 | wlcore_set_min_fw_ver(wl, WL128X_CHIP_VER, WL128X_IFTYPE_VER, | 700 | wlcore_set_min_fw_ver(wl, WL128X_CHIP_VER, |
697 | WL128X_MAJOR_VER, WL128X_SUBTYPE_VER, | 701 | WL128X_IFTYPE_SR_VER, WL128X_MAJOR_SR_VER, |
698 | WL128X_MINOR_VER); | 702 | WL128X_SUBTYPE_SR_VER, WL128X_MINOR_SR_VER, |
703 | WL128X_IFTYPE_MR_VER, WL128X_MAJOR_MR_VER, | ||
704 | WL128X_SUBTYPE_MR_VER, WL128X_MINOR_MR_VER); | ||
699 | break; | 705 | break; |
700 | case CHIP_ID_128X_PG10: | 706 | case CHIP_ID_128X_PG10: |
701 | default: | 707 | default: |
diff --git a/drivers/net/wireless/ti/wl12xx/wl12xx.h b/drivers/net/wireless/ti/wl12xx/wl12xx.h index 310df5200c26..a07be5e022fb 100644 --- a/drivers/net/wireless/ti/wl12xx/wl12xx.h +++ b/drivers/net/wireless/ti/wl12xx/wl12xx.h | |||
@@ -30,19 +30,31 @@ | |||
30 | #define CHIP_ID_128X_PG10 (0x05030101) | 30 | #define CHIP_ID_128X_PG10 (0x05030101) |
31 | #define CHIP_ID_128X_PG20 (0x05030111) | 31 | #define CHIP_ID_128X_PG20 (0x05030111) |
32 | 32 | ||
33 | /* minimum FW required for driver for wl127x */ | 33 | /* FW chip version for wl127x */ |
34 | #define WL127X_CHIP_VER 6 | 34 | #define WL127X_CHIP_VER 6 |
35 | #define WL127X_IFTYPE_VER WLCORE_FW_VER_IGNORE | 35 | /* minimum single-role FW version for wl127x */ |
36 | #define WL127X_MAJOR_VER 10 | 36 | #define WL127X_IFTYPE_SR_VER 3 |
37 | #define WL127X_SUBTYPE_VER WLCORE_FW_VER_IGNORE | 37 | #define WL127X_MAJOR_SR_VER 10 |
38 | #define WL127X_MINOR_VER 115 | 38 | #define WL127X_SUBTYPE_SR_VER WLCORE_FW_VER_IGNORE |
39 | #define WL127X_MINOR_SR_VER 115 | ||
40 | /* minimum multi-role FW version for wl127x */ | ||
41 | #define WL127X_IFTYPE_MR_VER 5 | ||
42 | #define WL127X_MAJOR_MR_VER 7 | ||
43 | #define WL127X_SUBTYPE_MR_VER WLCORE_FW_VER_IGNORE | ||
44 | #define WL127X_MINOR_MR_VER 115 | ||
39 | 45 | ||
40 | /* minimum FW required for driver for wl128x */ | 46 | /* FW chip version for wl128x */ |
41 | #define WL128X_CHIP_VER 7 | 47 | #define WL128X_CHIP_VER 7 |
42 | #define WL128X_IFTYPE_VER WLCORE_FW_VER_IGNORE | 48 | /* minimum single-role FW version for wl128x */ |
43 | #define WL128X_MAJOR_VER 10 | 49 | #define WL128X_IFTYPE_SR_VER 3 |
44 | #define WL128X_SUBTYPE_VER WLCORE_FW_VER_IGNORE | 50 | #define WL128X_MAJOR_SR_VER 10 |
45 | #define WL128X_MINOR_VER 115 | 51 | #define WL128X_SUBTYPE_SR_VER WLCORE_FW_VER_IGNORE |
52 | #define WL128X_MINOR_SR_VER 115 | ||
53 | /* minimum multi-role FW version for wl128x */ | ||
54 | #define WL128X_IFTYPE_MR_VER 5 | ||
55 | #define WL128X_MAJOR_MR_VER 7 | ||
56 | #define WL128X_SUBTYPE_MR_VER WLCORE_FW_VER_IGNORE | ||
57 | #define WL128X_MINOR_MR_VER 42 | ||
46 | 58 | ||
47 | #define WL12XX_AGGR_BUFFER_SIZE (4 * PAGE_SIZE) | 59 | #define WL12XX_AGGR_BUFFER_SIZE (4 * PAGE_SIZE) |
48 | 60 | ||
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index 98d034b4530d..08c3a2fc427e 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c | |||
@@ -623,9 +623,11 @@ static int wl18xx_identify_chip(struct wl1271 *wl) | |||
623 | WLCORE_QUIRK_REGDOMAIN_CONF | | 623 | WLCORE_QUIRK_REGDOMAIN_CONF | |
624 | WLCORE_QUIRK_DUAL_PROBE_TMPL; | 624 | WLCORE_QUIRK_DUAL_PROBE_TMPL; |
625 | 625 | ||
626 | wlcore_set_min_fw_ver(wl, WL18XX_CHIP_VER, WL18XX_IFTYPE_VER, | 626 | wlcore_set_min_fw_ver(wl, WL18XX_CHIP_VER, |
627 | WL18XX_MAJOR_VER, WL18XX_SUBTYPE_VER, | 627 | WL18XX_IFTYPE_VER, WL18XX_MAJOR_VER, |
628 | WL18XX_MINOR_VER); | 628 | WL18XX_SUBTYPE_VER, WL18XX_MINOR_VER, |
629 | /* there's no separate multi-role FW */ | ||
630 | 0, 0, 0, 0); | ||
629 | break; | 631 | break; |
630 | case CHIP_ID_185x_PG10: | 632 | case CHIP_ID_185x_PG10: |
631 | wl1271_warning("chip id 0x%x (185x PG10) is deprecated", | 633 | wl1271_warning("chip id 0x%x (185x PG10) is deprecated", |
diff --git a/drivers/net/wireless/ti/wlcore/boot.c b/drivers/net/wireless/ti/wlcore/boot.c index 2c57246b6a85..b58ae5fc1487 100644 --- a/drivers/net/wireless/ti/wlcore/boot.c +++ b/drivers/net/wireless/ti/wlcore/boot.c | |||
@@ -84,7 +84,8 @@ out: | |||
84 | static int wlcore_validate_fw_ver(struct wl1271 *wl) | 84 | static int wlcore_validate_fw_ver(struct wl1271 *wl) |
85 | { | 85 | { |
86 | unsigned int *fw_ver = wl->chip.fw_ver; | 86 | unsigned int *fw_ver = wl->chip.fw_ver; |
87 | unsigned int *min_ver = wl->min_fw_ver; | 87 | unsigned int *min_ver = (wl->fw_type == WL12XX_FW_TYPE_NORMAL) ? |
88 | wl->min_sr_fw_ver : wl->min_mr_fw_ver; | ||
88 | char min_fw_str[32] = ""; | 89 | char min_fw_str[32] = ""; |
89 | int i; | 90 | int i; |
90 | 91 | ||
diff --git a/drivers/net/wireless/ti/wlcore/wlcore.h b/drivers/net/wireless/ti/wlcore/wlcore.h index 66b8306883d2..32987d0a5f73 100644 --- a/drivers/net/wireless/ti/wlcore/wlcore.h +++ b/drivers/net/wireless/ti/wlcore/wlcore.h | |||
@@ -439,8 +439,11 @@ struct wl1271 { | |||
439 | /* the number of allocated MAC addresses in this chip */ | 439 | /* the number of allocated MAC addresses in this chip */ |
440 | int num_mac_addr; | 440 | int num_mac_addr; |
441 | 441 | ||
442 | /* the minimum FW version required for the driver to work */ | 442 | /* minimum FW version required for the driver to work in single-role */ |
443 | unsigned int min_fw_ver[NUM_FW_VER]; | 443 | unsigned int min_sr_fw_ver[NUM_FW_VER]; |
444 | |||
445 | /* minimum FW version required for the driver to work in multi-role */ | ||
446 | unsigned int min_mr_fw_ver[NUM_FW_VER]; | ||
444 | 447 | ||
445 | struct completion nvs_loading_complete; | 448 | struct completion nvs_loading_complete; |
446 | 449 | ||
@@ -471,14 +474,22 @@ wlcore_set_ht_cap(struct wl1271 *wl, enum ieee80211_band band, | |||
471 | 474 | ||
472 | static inline void | 475 | static inline void |
473 | wlcore_set_min_fw_ver(struct wl1271 *wl, unsigned int chip, | 476 | wlcore_set_min_fw_ver(struct wl1271 *wl, unsigned int chip, |
474 | unsigned int iftype, unsigned int major, | 477 | unsigned int iftype_sr, unsigned int major_sr, |
475 | unsigned int subtype, unsigned int minor) | 478 | unsigned int subtype_sr, unsigned int minor_sr, |
479 | unsigned int iftype_mr, unsigned int major_mr, | ||
480 | unsigned int subtype_mr, unsigned int minor_mr) | ||
476 | { | 481 | { |
477 | wl->min_fw_ver[FW_VER_CHIP] = chip; | 482 | wl->min_sr_fw_ver[FW_VER_CHIP] = chip; |
478 | wl->min_fw_ver[FW_VER_IF_TYPE] = iftype; | 483 | wl->min_sr_fw_ver[FW_VER_IF_TYPE] = iftype_sr; |
479 | wl->min_fw_ver[FW_VER_MAJOR] = major; | 484 | wl->min_sr_fw_ver[FW_VER_MAJOR] = major_sr; |
480 | wl->min_fw_ver[FW_VER_SUBTYPE] = subtype; | 485 | wl->min_sr_fw_ver[FW_VER_SUBTYPE] = subtype_sr; |
481 | wl->min_fw_ver[FW_VER_MINOR] = minor; | 486 | wl->min_sr_fw_ver[FW_VER_MINOR] = minor_sr; |
487 | |||
488 | wl->min_mr_fw_ver[FW_VER_CHIP] = chip; | ||
489 | wl->min_mr_fw_ver[FW_VER_IF_TYPE] = iftype_mr; | ||
490 | wl->min_mr_fw_ver[FW_VER_MAJOR] = major_mr; | ||
491 | wl->min_mr_fw_ver[FW_VER_SUBTYPE] = subtype_mr; | ||
492 | wl->min_mr_fw_ver[FW_VER_MINOR] = minor_mr; | ||
482 | } | 493 | } |
483 | 494 | ||
484 | /* Firmware image load chunk size */ | 495 | /* Firmware image load chunk size */ |