Lines Matching refs:bpb
70 struct fat_bpb bpb;
79 /* Read bpb */
80 if (! devread (0, 0, sizeof (bpb), (char *) &bpb))
85 if (bpb.sects_per_clust == 0)
88 FAT_SUPER->sectsize_bits = log2 (FAT_CVT_U16 (bpb.bytes_per_sect));
90 = FAT_SUPER->sectsize_bits + log2 (bpb.sects_per_clust);
93 FAT_SUPER->num_sectors = FAT_CVT_U16 (bpb.short_sectors)
94 ? FAT_CVT_U16 (bpb.short_sectors) : bpb.long_sectors;
97 FAT_SUPER->fat_offset = FAT_CVT_U16 (bpb.reserved_sects);
99 bpb.fat_length ? bpb.fat_length : bpb.fat32_length;
103 FAT_SUPER->fat_offset + bpb.num_fats * FAT_SUPER->fat_length;
104 FAT_SUPER->root_max = FAT_DIRENTRY_LENGTH * FAT_CVT_U16(bpb.dir_entries);
112 / bpb.sects_per_clust);
113 FAT_SUPER->sects_per_clust = bpb.sects_per_clust;
115 if (!bpb.fat_length)
118 if (FAT_CVT_U16(bpb.dir_entries))
121 if (bpb.flags & 0x0080)
124 int active_fat = bpb.flags & 0x000f;
125 if (active_fat >= bpb.num_fats)
131 FAT_SUPER->root_cluster = bpb.root_cluster;
156 if (FAT_CVT_U16(bpb.bytes_per_sect) != (1 << FAT_SUPER->sectsize_bits)
157 || FAT_CVT_U16(bpb.bytes_per_sect) != SECTOR_SIZE
158 || bpb.sects_per_clust != (1 << (FAT_SUPER->clustsize_bits
191 if ((first_fat | 0x8) != (magic | bpb.media | 0x8))