Lines Matching refs:header
84 u_int32_t *offset, struct nvram_header **header, u_int32_t *emb_size);
309 /* Probe for NVRAM header */
313 struct nvram_header *header;
327 header = (struct nvram_header *)ram_nvram_buf;
328 if (header->magic == NVRAM_MAGIC) {
329 if (nvram_calc_crc(header) == (uint8)header->crc_ver_init) {
346 header = (struct nvram_header *)(flash_base + off);
347 if (header->magic != NVRAM_MAGIC)
351 if ((header = nand_find_nvram(nfl_info, off)) == NULL)
353 if (nvram_calc_crc(header) == (uint8)header->crc_ver_init)
376 header = (struct nvram_header *)(flash_base + off - nvram_space);
377 if (header->magic == NVRAM_MAGIC)
378 if (nvram_calc_crc(header) == (uint8)header->crc_ver_init) {
390 header = (struct nvram_header *)(flash_base + 4 KB);
391 if (header->magic == NVRAM_MAGIC)
392 if (nvram_calc_crc(header) == (uint8)header->crc_ver_init) {
396 header = (struct nvram_header *)(flash_base + 1 KB);
397 if (header->magic == NVRAM_MAGIC)
398 if (nvram_calc_crc(header) == (uint8)header->crc_ver_init) {
405 src = (u32 *)header;
409 for (; i < header->len && i < MAX_NVRAM_SPACE; i += 4)
489 extern int _nvram_commit(struct nvram_header *header);
504 struct nvram_header *header = (struct nvram_header *) buf;
519 header->magic != NVRAM_MAGIC) {
582 struct nvram_header *header;
614 if ((header = kmalloc(nvram_space, GFP_ATOMIC))) {
615 if (_nvram_commit(header) == 0)
617 kfree(header);
685 struct nvram_header *header;
697 header = (struct nvram_header *)buf;
698 header->magic = NVRAM_MAGIC;
704 ret = _nvram_commit(header);
710 i = header->len;
732 struct nvram_header *header;
772 header = (struct nvram_header *)(buf + i);
773 magic_offset = i + ((void *)&header->magic - (void *)header);
776 magic_offset = ((void *)&header->magic - (void *)header);
777 header = (struct nvram_header *)buf;
783 header->magic = NVRAM_CLEAR_MAGIC; /* All zeros magic */
787 ret = nvram_mtd->write(nvram_mtd, offset + magic_offset, sizeof(header->magic),
788 &magic_len, (char *)&header->magic);
789 if (ret || magic_len != sizeof(header->magic)) {
795 header->magic = NVRAM_MAGIC;
801 ret = _nvram_commit(header);
808 for (; offset < nvram_mtd->size - nvram_space + header->len;
837 header->magic = NVRAM_INVALID_MAGIC; /* All ones magic */
839 i = erasesize - nvram_space + header->len;
851 header->magic = NVRAM_MAGIC;
852 ret = nvram_mtd->write(nvram_mtd, offset + magic_offset, sizeof(header->magic),
853 &magic_len, (char *)&header->magic);
854 if (ret || magic_len != sizeof(header->magic)) {
1239 u_int32_t *offset, struct nvram_header **header, u_int32_t *emb_size)
1252 /* find nvram header */
1256 *header = nvh;
1268 /* find nvram header */
1272 *header = nvh;
1278 *header = nvh;
1348 struct nvram_header *header;
1361 header = cfe_nvram_header;
1363 printk("cfe_update: before %x %x\n", header->len, cfe_nvram_header->crc_ver_init&0xff);
1364 str = (char *) &header[1];
1365 end = (char *) header + cfe_embedded_size - 2;
1408 memset(str, 0, cfe_embedded_size+(char *)header - str);
1410 header->len = ROUNDUP(str - (char *) header, 4);
1412 crc = nvram_calc_crc(header);
1413 header->crc_ver_init = (header->crc_ver_init & NVRAM_CRC_VER_MASK)|crc;