Lines Matching refs:header
39 int _nvram_commit(struct nvram_header *header);
114 BCMINITFN(nvram_rehash)(struct nvram_header *header)
130 name = (char *) &header[1];
131 end = (char *) header + nvram_space - 2;
151 sprintf(buf, "0x%04X", (uint16)(header->crc_ver_init >> 16));
155 sprintf(buf, "0x%04X", (uint16)(header->config_refresh & 0xffff));
159 sprintf(buf, "0x%04X", (uint16)((header->config_refresh >> 16) & 0xffff));
163 sprintf(buf, "0x%08X", header->config_ncdl);
280 BCMINITFN(_nvram_commit)(struct nvram_header *header)
295 /* Regenerate header */
296 header->magic = NVRAM_MAGIC;
297 header->crc_ver_init = (NVRAM_VERSION << 8);
302 header->crc_ver_init |= SDRAM_INIT << 16;
303 header->config_refresh = SDRAM_CONFIG;
304 header->config_refresh |= SDRAM_REFRESH << 16;
305 header->config_ncdl = 0;
307 header->crc_ver_init |= (bcm_strtoul(init, NULL, 0) & 0xffff) << 16;
308 header->config_refresh = bcm_strtoul(config, NULL, 0) & 0xffff;
309 header->config_refresh |= (bcm_strtoul(refresh, NULL, 0) & 0xffff) << 16;
310 header->config_ncdl = bcm_strtoul(ncdl, NULL, 0);
314 ptr = (char *) header + sizeof(struct nvram_header);
318 end = (char *) header + nvram_space - 2;
333 header->len = ROUNDUP(ptr - (char *) header, 4);
336 header->crc_ver_init |= nvram_calc_crc(header);
339 return nvram_rehash(header);
346 struct nvram_header *header;
350 if (!(header = (struct nvram_header *) MALLOC(si_osh(sih), MAX_NVRAM_SPACE))) {
355 if ((ret = _nvram_read(header, idx)) == 0 &&
356 header->magic == NVRAM_MAGIC)
357 nvram_rehash(header);
359 MFREE(si_osh(sih), header, MAX_NVRAM_SPACE);
384 /* Little-endian CRC8 over the last 11 bytes of the header */