Lines Matching defs:ssfdc
245 static int build_logical_block_map(struct ssfdcr_record *ssfdc)
250 struct mtd_info *mtd = ssfdc->mbd.mtd;
253 ssfdc->map_len,
254 (unsigned long)ssfdc->map_len * ssfdc->erase_size / 1024);
257 for (phys_block = ssfdc->cis_block + 1; phys_block < ssfdc->map_len;
259 offset = (unsigned long)phys_block * ssfdc->erase_size;
279 ssfdc->logic_block_map[block_address] =
293 struct ssfdcr_record *ssfdc;
306 ssfdc = kzalloc(sizeof(struct ssfdcr_record), GFP_KERNEL);
307 if (!ssfdc) {
313 ssfdc->mbd.mtd = mtd;
314 ssfdc->mbd.devnum = -1;
315 ssfdc->mbd.tr = tr;
316 ssfdc->mbd.readonly = 1;
318 ssfdc->cis_block = cis_sector / (mtd->erasesize >> SECTOR_SHIFT);
319 ssfdc->erase_size = mtd->erasesize;
320 ssfdc->map_len = (u32)mtd->size / mtd->erasesize;
324 ssfdc->cis_block, ssfdc->erase_size, ssfdc->map_len,
325 DIV_ROUND_UP(ssfdc->map_len, MAX_PHYS_BLK_PER_ZONE));
328 ssfdc->heads = 16;
329 ssfdc->sectors = 32;
330 get_chs(mtd->size, NULL, &ssfdc->heads, &ssfdc->sectors);
331 ssfdc->cylinders = (unsigned short)(((u32)mtd->size >> SECTOR_SHIFT) /
332 ((long)ssfdc->sectors * (long)ssfdc->heads));
335 ssfdc->cylinders, ssfdc->heads , ssfdc->sectors,
336 (long)ssfdc->cylinders * (long)ssfdc->heads *
337 (long)ssfdc->sectors);
339 ssfdc->mbd.size = (long)ssfdc->heads * (long)ssfdc->cylinders *
340 (long)ssfdc->sectors;
343 ssfdc->logic_block_map = kmalloc(sizeof(ssfdc->logic_block_map[0]) *
344 ssfdc->map_len, GFP_KERNEL);
345 if (!ssfdc->logic_block_map) {
350 memset(ssfdc->logic_block_map, 0xff, sizeof(ssfdc->logic_block_map[0]) *
351 ssfdc->map_len);
354 if (build_logical_block_map(ssfdc) < 0)
358 if (add_mtd_blktrans_dev(&ssfdc->mbd))
361 printk(KERN_INFO "SSFDC_RO: Found ssfdc%c on mtd%d (%s)\n",
362 ssfdc->mbd.devnum + 'a', mtd->index, mtd->name);
366 kfree(ssfdc->logic_block_map);
367 kfree(ssfdc);
372 struct ssfdcr_record *ssfdc = (struct ssfdcr_record *)dev;
377 kfree(ssfdc->logic_block_map);
383 struct ssfdcr_record *ssfdc = (struct ssfdcr_record *)dev;
386 sectors_per_block = ssfdc->erase_size >> SECTOR_SHIFT;
395 if (block_address >= ssfdc->map_len)
398 block_address = ssfdc->logic_block_map[block_address];
414 if (read_physical_sector(ssfdc->mbd.mtd, buf, sect_no) < 0)
425 struct ssfdcr_record *ssfdc = (struct ssfdcr_record *)dev;
428 ssfdc->cylinders, ssfdc->heads, ssfdc->sectors);
430 geo->heads = ssfdc->heads;
431 geo->sectors = ssfdc->sectors;
432 geo->cylinders = ssfdc->cylinders;
444 .name = "ssfdc",