Lines Matching refs:header

130     erase_unit_header_t	header;  member
153 erase_unit_header_t header; in scan_header() local
157 part->header.FormattedSize = 0; in scan_header()
161 (offset + sizeof(header)) < max_offset; in scan_header()
164 err = mtd_read(part->mbd.mtd, offset, sizeof(header), &ret, in scan_header()
165 (unsigned char *)&header); in scan_header()
170 if (strcmp(header.DataOrgTuple+3, "FTL100") == 0) break; in scan_header()
177 if (header.BlockSize != 9 || in scan_header()
178 (header.EraseUnitSize < 10) || (header.EraseUnitSize > 31) || in scan_header()
179 (header.NumTransferUnits >= le16_to_cpu(header.NumEraseUnits))) { in scan_header()
183 if ((1 << header.EraseUnitSize) != part->mbd.mtd->erasesize) { in scan_header()
185 1 << header.EraseUnitSize,part->mbd.mtd->erasesize); in scan_header()
188 part->header = header; in scan_header()
194 erase_unit_header_t header; in build_maps() local
202 part->DataUnits = le16_to_cpu(part->header.NumEraseUnits) - in build_maps()
203 part->header.NumTransferUnits; in build_maps()
211 kmalloc_array(part->header.NumTransferUnits, in build_maps()
218 for (i = 0; i < le16_to_cpu(part->header.NumEraseUnits); i++) { in build_maps()
219 offset = ((i + le16_to_cpu(part->header.FirstPhysicalEUN)) in build_maps()
220 << part->header.EraseUnitSize); in build_maps()
221 ret = mtd_read(part->mbd.mtd, offset, sizeof(header), &retval, in build_maps()
222 (unsigned char *)&header); in build_maps()
229 hdr_ok = (strcmp(header.DataOrgTuple+3, "FTL100") == 0); in build_maps()
230 if (hdr_ok && (le16_to_cpu(header.LogicalEUN) < part->DataUnits) && in build_maps()
231 (part->EUNInfo[le16_to_cpu(header.LogicalEUN)].Offset == 0xffffffff)) { in build_maps()
232 part->EUNInfo[le16_to_cpu(header.LogicalEUN)].Offset = offset; in build_maps()
233 part->EUNInfo[le16_to_cpu(header.LogicalEUN)].EraseCount = in build_maps()
234 le32_to_cpu(header.EraseCount); in build_maps()
237 if (xtrans == part->header.NumTransferUnits) { in build_maps()
242 if (hdr_ok && (le16_to_cpu(header.LogicalEUN) == 0xffff)) { in build_maps()
244 part->XferInfo[xtrans].EraseCount = le32_to_cpu(header.EraseCount); in build_maps()
249 le32_to_cpu(part->header.EraseCount); in build_maps()
256 header = part->header; in build_maps()
257 if ((xtrans != header.NumTransferUnits) || in build_maps()
258 (xvalid+xtrans != le16_to_cpu(header.NumEraseUnits))) { in build_maps()
265 blocks = le32_to_cpu(header.FormattedSize) >> header.BlockSize; in build_maps()
271 part->BlocksPerUnit = (1 << header.EraseUnitSize) >> header.BlockSize; in build_maps()
284 offset = part->EUNInfo[i].Offset + le32_to_cpu(header.BAMOffset); in build_maps()
300 (i << header.EraseUnitSize) + (j << header.BlockSize); in build_maps()
347 erase->len = 1 << part->header.EraseUnitSize; in erase_xfer()
372 erase_unit_header_t header; in prepare_xfer() local
385 header = part->header; in prepare_xfer()
386 header.LogicalEUN = cpu_to_le16(0xffff); in prepare_xfer()
387 header.EraseCount = cpu_to_le32(xfer->EraseCount); in prepare_xfer()
389 ret = mtd_write(part->mbd.mtd, xfer->Offset, sizeof(header), &retlen, in prepare_xfer()
390 (u_char *)&header); in prepare_xfer()
398 le32_to_cpu(part->header.BAMOffset), SECTOR_SIZE); in prepare_xfer()
400 offset = xfer->Offset + le32_to_cpu(part->header.BAMOffset); in prepare_xfer()
450 offset = eun->Offset + le32_to_cpu(part->header.BAMOffset); in copy_erase_unit()
518 xfer->Offset + le32_to_cpu(part->header.BAMOffset), in copy_erase_unit()
575 pr_debug("NumTransferUnits == %x\n", part->header.NumTransferUnits); in reclaim_block()
580 for (i = 0; i < part->header.NumTransferUnits; i++) { in reclaim_block()
682 part->EUNInfo[i].Offset >> part->header.EraseUnitSize, in dump_lists()
712 part->EUNInfo[eun].Offset + le32_to_cpu(part->header.BAMOffset), in find_free()
762 bsize = 1 << part->header.EraseUnitSize; in ftl_read()
765 if (((sector+i) * SECTOR_SIZE) >= le32_to_cpu(part->header.FormattedSize)) { in ftl_read()
807 bsize = 1 << part->header.EraseUnitSize; in set_bam_entry()
811 le32_to_cpu(part->header.BAMOffset)); in set_bam_entry()
883 bsize = 1 << part->header.EraseUnitSize; in ftl_write()
887 if (virt_addr >= le32_to_cpu(part->header.FormattedSize)) { in ftl_write()
948 sect = le32_to_cpu(part->header.FormattedSize)/SECTOR_SIZE; in ftl_getgeo()
973 uint32_t bsize = 1 << part->header.EraseUnitSize; in ftl_discardsect()
1026 le32_to_cpu(partition->header.FormattedSize) >> 10); in ftl_add_mtd()
1028 partition->mbd.size = le32_to_cpu(partition->header.FormattedSize) >> 9; in ftl_add_mtd()