Lines Matching refs:header
83 /* Probe for NVRAM header */
87 struct nvram_header *header;
99 header = (struct nvram_header *)ram_nvram_buf;
100 if (header->magic == NVRAM_MAGIC) {
101 if (nvram_calc_crc(header) == (uint8) header->crc_ver_init) {
154 header = (struct nvram_header *) KSEG1ADDR(base + off);
155 if (header->magic == NVRAM_MAGIC)
156 if (nvram_calc_crc(header) == (uint8) header->crc_ver_init) {
167 header = (struct nvram_header *) KSEG1ADDR(base + off - NVRAM_SPACE);
168 if (header->magic == NVRAM_MAGIC)
169 if (nvram_calc_crc(header) == (uint8) header->crc_ver_init) {
177 header = (struct nvram_header *) KSEG1ADDR(base + 4 KB);
178 if (header->magic == NVRAM_MAGIC)
179 if (nvram_calc_crc(header) == (uint8) header->crc_ver_init) {
183 header = (struct nvram_header *) KSEG1ADDR(base + 1 KB);
184 if (header->magic == NVRAM_MAGIC)
185 if (nvram_calc_crc(header) == (uint8) header->crc_ver_init) {
192 src = (u32 *) header;
196 for (; i < header->len && i < NVRAM_SPACE; i += 4)
272 extern int _nvram_commit(struct nvram_header *header);
287 struct nvram_header *header = (struct nvram_header *) buf;
302 header->magic != NVRAM_MAGIC) {
365 struct nvram_header *header;
371 if ((header = kmalloc(NVRAM_SPACE, GFP_ATOMIC))) {
372 if (_nvram_commit(header) == 0)
374 kfree(header);
432 struct nvram_header *header;
444 header = (struct nvram_header *)buf;
445 header->magic = NVRAM_MAGIC;
451 ret = _nvram_commit(header);
457 i = header->len;
479 struct nvram_header *header;
519 header = (struct nvram_header *)(buf + i);
520 magic_offset = i + ((void *)&header->magic - (void *)header);
523 magic_offset = ((void *)&header->magic - (void *)header);
524 header = (struct nvram_header *)buf;
530 header->magic = NVRAM_CLEAR_MAGIC; /* All zeros magic */
534 ret = nvram_mtd->write(nvram_mtd, offset + magic_offset, sizeof(header->magic),
535 &magic_len, (char *)&header->magic);
536 if (ret || magic_len != sizeof(header->magic)) {
542 header->magic = NVRAM_MAGIC;
548 ret = _nvram_commit(header);
555 for (; offset < nvram_mtd->size - NVRAM_SPACE + header->len;
584 header->magic = NVRAM_INVALID_MAGIC; /* All ones magic */
586 i = erasesize - NVRAM_SPACE + header->len;
597 header->magic = NVRAM_MAGIC;
598 ret = nvram_mtd->write(nvram_mtd, offset + magic_offset, sizeof(header->magic),
599 &magic_len, (char *)&header->magic);
600 if (ret || magic_len != sizeof(header->magic)) {