Lines Matching refs:sprom
64 bus->sprom.revision); in bcma_fill_sprom_with_fallback()
75 static void bcma_sprom_read(struct bcma_bus *bus, u16 offset, u16 *sprom, in bcma_sprom_read() argument
80 sprom[i] = bcma_read16(bus->drv_cc.core, offset + (i * 2)); in bcma_sprom_read()
127 static u8 bcma_sprom_crc(const u16 *sprom, size_t words) in bcma_sprom_crc() argument
133 crc = bcma_crc8(crc, sprom[word] & 0x00FF); in bcma_sprom_crc()
134 crc = bcma_crc8(crc, (sprom[word] & 0xFF00) >> 8); in bcma_sprom_crc()
136 crc = bcma_crc8(crc, sprom[words - 1] & 0x00FF); in bcma_sprom_crc()
142 static int bcma_sprom_check_crc(const u16 *sprom, size_t words) in bcma_sprom_check_crc() argument
148 crc = bcma_sprom_crc(sprom, words); in bcma_sprom_check_crc()
149 tmp = sprom[words - 1] & SSB_SPROM_REVISION_CRC; in bcma_sprom_check_crc()
157 static int bcma_sprom_valid(struct bcma_bus *bus, const u16 *sprom, in bcma_sprom_valid() argument
163 err = bcma_sprom_check_crc(sprom, words); in bcma_sprom_valid()
167 revision = sprom[words - 1] & SSB_SPROM_REVISION_REV; in bcma_sprom_valid()
173 bus->sprom.revision = revision; in bcma_sprom_valid()
186 bus->sprom._field = ((sprom[SPOFF(_offset)] & (_mask)) >> (_shift))
189 bus->sprom._field = ((((u32)sprom[SPOFF((_offset)+2)] << 16 | \
190 sprom[SPOFF(_offset)]) & (_mask)) >> (_shift))
221 static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom) in bcma_sprom_extract_r8() argument
230 ARRAY_SIZE(bus->sprom.core_pwr_info)); in bcma_sprom_extract_r8()
233 v = sprom[SPOFF(SSB_SPROM8_IL0MAC) + i]; in bcma_sprom_extract_r8()
234 *(((__be16 *)bus->sprom.il0mac) + i) = cpu_to_be16(v); in bcma_sprom_extract_r8()
401 bus->sprom.antenna_gain.a0 = sprom_extract_antgain(sprom, in bcma_sprom_extract_r8()
405 bus->sprom.antenna_gain.a1 = sprom_extract_antgain(sprom, in bcma_sprom_extract_r8()
409 bus->sprom.antenna_gain.a2 = sprom_extract_antgain(sprom, in bcma_sprom_extract_r8()
413 bus->sprom.antenna_gain.a3 = sprom_extract_antgain(sprom, in bcma_sprom_extract_r8()
580 u16 *sprom; in bcma_sprom_get() local
610 err = bcma_fill_sprom_with_fallback(bus, &bus->sprom); in bcma_sprom_get()
623 sprom = kcalloc(words, sizeof(u16), GFP_KERNEL); in bcma_sprom_get()
624 if (!sprom) in bcma_sprom_get()
627 bcma_sprom_read(bus, offset, sprom, words); in bcma_sprom_get()
628 err = bcma_sprom_valid(bus, sprom, words); in bcma_sprom_get()
632 kfree(sprom); in bcma_sprom_get()
641 err = bcma_fill_sprom_with_fallback(bus, &bus->sprom); in bcma_sprom_get()
643 bcma_sprom_extract_r8(bus, sprom); in bcma_sprom_get()
644 kfree(sprom); in bcma_sprom_get()