OpenWrt – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
1 | --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c |
1 | --- a/arch/mips/bcm63xx/boards/board_bcm963xx.c |
|
2 | +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c |
2 | +++ b/arch/mips/bcm63xx/boards/board_bcm963xx.c |
|
3 | @@ -707,10 +707,20 @@ void __init board_prom_init(void) |
3 | @@ -723,10 +723,20 @@ void __init board_prom_init(void) |
|
4 | |
4 | |
|
5 | /* dump cfe version */ |
5 | /* dump cfe version */ |
|
6 | cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET; |
6 | cfe = boot_addr + BCM963XX_CFE_VERSION_OFFSET; |
|
7 | - if (!memcmp(cfe, "cfe-v", 5)) |
7 | - if (!memcmp(cfe, "cfe-v", 5)) |
|
8 | - snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u", |
8 | - snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u", |
|
9 | - cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]); |
9 | - cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]); |
|
10 | - else |
10 | - else |
|
11 | + if (strstarts(cfe, "cfe-")) { |
11 | + if (strstarts(cfe, "cfe-")) { |
|
12 | + if(cfe[4] == 'v') { |
12 | + if(cfe[4] == 'v') { |
|
13 | + if(cfe[5] == 'd') |
13 | + if(cfe[5] == 'd') |
|
14 | + snprintf(cfe_version, 11, "%s", (char *) &cfe[5]); |
14 | + snprintf(cfe_version, 11, "%s", (char *) &cfe[5]); |
|
15 | + else if (cfe[10] > 0) |
15 | + else if (cfe[10] > 0) |
|
16 | + snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u-%u", |
16 | + snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u-%u", |
|
17 | + cfe[5], cfe[6], cfe[7], cfe[8], cfe[9], cfe[10]); |
17 | + cfe[5], cfe[6], cfe[7], cfe[8], cfe[9], cfe[10]); |
|
18 | + else |
18 | + else |
|
19 | + snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u", |
19 | + snprintf(cfe_version, sizeof(cfe_version), "%u.%u.%u-%u.%u", |
|
20 | + cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]); |
20 | + cfe[5], cfe[6], cfe[7], cfe[8], cfe[9]); |
|
21 | + } else { |
21 | + } else { |
|
22 | + snprintf(cfe_version, 12, "%s", (char *) &cfe[4]); |
22 | + snprintf(cfe_version, 12, "%s", (char *) &cfe[4]); |
|
23 | + } |
23 | + } |
|
24 | + } else |
24 | + } else |
|
25 | strcpy(cfe_version, "unknown"); |
25 | strcpy(cfe_version, "unknown"); |
|
26 | pr_info("CFE version: %s\n", cfe_version); |
26 | pr_info("CFE version: %s\n", cfe_version); |
|
27 | |
27 | |
|
28 | |
28 | |