• Home
  • Raw
  • Download

Lines Matching refs:ec_hdr

90 			     const struct ubi_ec_hdr *ec_hdr);
497 struct ubi_ec_hdr ec_hdr; in nor_erase_prepare() local
516 err = ubi_io_read_ec_hdr(ubi, pnum, &ec_hdr, 0); in nor_erase_prepare()
662 const struct ubi_ec_hdr *ec_hdr) in validate_ec_hdr() argument
667 ec = be64_to_cpu(ec_hdr->ec); in validate_ec_hdr()
668 vid_hdr_offset = be32_to_cpu(ec_hdr->vid_hdr_offset); in validate_ec_hdr()
669 leb_start = be32_to_cpu(ec_hdr->data_offset); in validate_ec_hdr()
671 if (ec_hdr->version != UBI_VERSION) { in validate_ec_hdr()
673 UBI_VERSION, (int)ec_hdr->version); in validate_ec_hdr()
698 ubi_dump_ec_hdr(ec_hdr); in validate_ec_hdr()
726 struct ubi_ec_hdr *ec_hdr, int verbose) in ubi_io_read_ec_hdr() argument
734 read_err = ubi_io_read(ubi, ec_hdr, pnum, 0, UBI_EC_HDR_SIZE); in ubi_io_read_ec_hdr()
750 magic = be32_to_cpu(ec_hdr->magic); in ubi_io_read_ec_hdr()
760 if (ubi_check_pattern(ec_hdr, 0xFF, UBI_EC_HDR_SIZE)) { in ubi_io_read_ec_hdr()
780 ubi_dump_ec_hdr(ec_hdr); in ubi_io_read_ec_hdr()
787 crc = crc32(UBI_CRC32_INIT, ec_hdr, UBI_EC_HDR_SIZE_CRC); in ubi_io_read_ec_hdr()
788 hdr_crc = be32_to_cpu(ec_hdr->hdr_crc); in ubi_io_read_ec_hdr()
794 ubi_dump_ec_hdr(ec_hdr); in ubi_io_read_ec_hdr()
806 err = validate_ec_hdr(ubi, ec_hdr); in ubi_io_read_ec_hdr()
835 struct ubi_ec_hdr *ec_hdr) in ubi_io_write_ec_hdr() argument
843 ec_hdr->magic = cpu_to_be32(UBI_EC_HDR_MAGIC); in ubi_io_write_ec_hdr()
844 ec_hdr->version = UBI_VERSION; in ubi_io_write_ec_hdr()
845 ec_hdr->vid_hdr_offset = cpu_to_be32(ubi->vid_hdr_offset); in ubi_io_write_ec_hdr()
846 ec_hdr->data_offset = cpu_to_be32(ubi->leb_start); in ubi_io_write_ec_hdr()
847 ec_hdr->image_seq = cpu_to_be32(ubi->image_seq); in ubi_io_write_ec_hdr()
848 crc = crc32(UBI_CRC32_INIT, ec_hdr, UBI_EC_HDR_SIZE_CRC); in ubi_io_write_ec_hdr()
849 ec_hdr->hdr_crc = cpu_to_be32(crc); in ubi_io_write_ec_hdr()
851 err = self_check_ec_hdr(ubi, pnum, ec_hdr); in ubi_io_write_ec_hdr()
858 err = ubi_io_write(ubi, ec_hdr, pnum, 0, ubi->ec_hdr_alsize); in ubi_io_write_ec_hdr()
1148 const struct ubi_ec_hdr *ec_hdr) in self_check_ec_hdr() argument
1156 magic = be32_to_cpu(ec_hdr->magic); in self_check_ec_hdr()
1163 err = validate_ec_hdr(ubi, ec_hdr); in self_check_ec_hdr()
1172 ubi_dump_ec_hdr(ec_hdr); in self_check_ec_hdr()
1189 struct ubi_ec_hdr *ec_hdr; in self_check_peb_ec_hdr() local
1194 ec_hdr = kzalloc(ubi->ec_hdr_alsize, GFP_NOFS); in self_check_peb_ec_hdr()
1195 if (!ec_hdr) in self_check_peb_ec_hdr()
1198 err = ubi_io_read(ubi, ec_hdr, pnum, 0, UBI_EC_HDR_SIZE); in self_check_peb_ec_hdr()
1202 crc = crc32(UBI_CRC32_INIT, ec_hdr, UBI_EC_HDR_SIZE_CRC); in self_check_peb_ec_hdr()
1203 hdr_crc = be32_to_cpu(ec_hdr->hdr_crc); in self_check_peb_ec_hdr()
1208 ubi_dump_ec_hdr(ec_hdr); in self_check_peb_ec_hdr()
1214 err = self_check_ec_hdr(ubi, pnum, ec_hdr); in self_check_peb_ec_hdr()
1217 kfree(ec_hdr); in self_check_peb_ec_hdr()