4 #include <sbsdpcmdev.h>
8 +#include <linux/ssb/ssb.h>
14 @@ -2058,6 +2062,11 @@ BCMATTACHFN(initvars_srom_pci)(si_t *sih
19 + struct ssb_sprom *fbrom;
24 * Apply CRC over SROM content regardless SROM is present or not,
25 * and use variable <devpath>sromrev's existance in flash to decide
26 @@ -2120,6 +2129,62 @@ BCMATTACHFN(initvars_srom_pci)(si_t *sih
31 + base = vp = MALLOC(osh, MAXSZ_NVRAM_VARS);
35 + varbuf_init(&b, base, MAXSZ_NVRAM_VARS);
37 + /* Try to load ssb fallback sprom */
38 + if ((fbrom = ssb_get_fallback_sprom()) != NULL)
40 + printk("Got version %i SPROM from SSB\n", fbrom->revision);
42 + varbuf_append(&b, vstr_sromrev, fbrom->revision);
43 + varbuf_append(&b, vstr_boardrev, fbrom->board_rev);
45 + /* ToDo: map fbrom->country_code */
46 + varbuf_append(&b, vstr_noccode);
48 + varbuf_append(&b, vstr_aa2g, fbrom->ant_available_bg);
50 + varbuf_append(&b, vstr_pa0b[0], fbrom->pa0b0);
51 + varbuf_append(&b, vstr_pa1b[0], fbrom->pa1b0);
52 + varbuf_append(&b, vstr_pa0b[1], fbrom->pa0b1);
53 + varbuf_append(&b, vstr_pa1b[1], fbrom->pa1b1);
54 + varbuf_append(&b, vstr_pa0b[2], fbrom->pa0b2);
55 + varbuf_append(&b, vstr_pa1b[2], fbrom->pa1b2);
57 + varbuf_append(&b, vstr_pa0maxpwr, fbrom->maxpwr_bg);
58 + varbuf_append(&b, vstr_pa0itssit, fbrom->itssi_bg);
60 + varbuf_append(&b, vstr_boardflags, (fbrom->boardflags_hi << 16) | fbrom->boardflags_lo);
61 + varbuf_append(&b, vstr_boardflags2, (fbrom->boardflags2_hi << 16) | fbrom->boardflags2_lo);
63 + snprintf(eabuf, sizeof(eabuf), "%02x:%02x:%02x:%02x:%02x:%02x",
64 + fbrom->il0mac[0], fbrom->il0mac[1], fbrom->il0mac[2],
65 + fbrom->il0mac[3], fbrom->il0mac[4], fbrom->il0mac[5]
68 + varbuf_append(&b, vstr_macaddr, eabuf);
71 + /* final nullbyte terminator */
72 + ASSERT(b.size >= 1);
76 + ASSERT((vp - base) <= MAXSZ_NVRAM_VARS);
86 BS_ERROR(("SROM CRC Error\n"));