Root/target/linux/brcm47xx/patches-3.3/009-bcma_reorder_sprom_fill.patch

1--- a/arch/mips/bcm47xx/setup.c
2+++ b/arch/mips/bcm47xx/setup.c
3@@ -90,6 +90,7 @@ static int bcm47xx_get_sprom_ssb(struct
4     char prefix[10];
5 
6     if (bus->bustype == SSB_BUSTYPE_PCI) {
7+ memset(out, 0, sizeof(struct ssb_sprom));
8         snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
9              bus->host_pci->bus->number + 1,
10              PCI_SLOT(bus->host_pci->devfn));
11@@ -111,6 +112,7 @@ static int bcm47xx_get_invariants(struct
12 
13     bcm47xx_fill_ssb_boardinfo(&iv->boardinfo, NULL);
14 
15+ memset(&iv->sprom, 0, sizeof(struct ssb_sprom));
16     bcm47xx_fill_sprom(&iv->sprom, NULL);
17 
18     if (nvram_getenv("cardbus", buf, sizeof(buf)) >= 0)
19@@ -159,12 +161,14 @@ static int bcm47xx_get_sprom_bcma(struct
20 
21     switch (bus->hosttype) {
22     case BCMA_HOSTTYPE_PCI:
23+ memset(out, 0, sizeof(struct ssb_sprom));
24         snprintf(prefix, sizeof(prefix), "pci/%u/%u/",
25              bus->host_pci->bus->number + 1,
26              PCI_SLOT(bus->host_pci->devfn));
27         bcm47xx_fill_sprom(out, prefix);
28         return 0;
29     case BCMA_HOSTTYPE_SOC:
30+ memset(out, 0, sizeof(struct ssb_sprom));
31         bcm47xx_fill_sprom_ethernet(out, NULL);
32         core = bcma_find_core(bus, BCMA_CORE_80211);
33         if (core) {
34--- a/arch/mips/bcm47xx/sprom.c
35+++ b/arch/mips/bcm47xx/sprom.c
36@@ -557,8 +557,6 @@ void bcm47xx_fill_sprom_ethernet(struct
37 
38 void bcm47xx_fill_sprom(struct ssb_sprom *sprom, const char *prefix)
39 {
40- memset(sprom, 0, sizeof(struct ssb_sprom));
41-
42     bcm47xx_fill_sprom_ethernet(sprom, prefix);
43 
44     nvram_read_u8(prefix, NULL, "sromrev", &sprom->revision, 0);
45

Archive Download this file



interactive