Searched refs:ssfdc (Results 1 - 3 of 3) sorted by relevance
/linux-4.4.14/drivers/mtd/ |
H A D | ssfdc.c | 243 static int build_logical_block_map(struct ssfdcr_record *ssfdc) build_logical_block_map() argument 248 struct mtd_info *mtd = ssfdc->mbd.mtd; build_logical_block_map() 251 ssfdc->map_len, build_logical_block_map() 252 (unsigned long)ssfdc->map_len * ssfdc->erase_size / 1024); build_logical_block_map() 255 for (phys_block = ssfdc->cis_block + 1; phys_block < ssfdc->map_len; build_logical_block_map() 257 offset = (unsigned long)phys_block * ssfdc->erase_size; build_logical_block_map() 276 ssfdc->logic_block_map[block_address] = build_logical_block_map() 289 struct ssfdcr_record *ssfdc; ssfdcr_add_mtd() local 302 ssfdc = kzalloc(sizeof(struct ssfdcr_record), GFP_KERNEL); ssfdcr_add_mtd() 303 if (!ssfdc) ssfdcr_add_mtd() 306 ssfdc->mbd.mtd = mtd; ssfdcr_add_mtd() 307 ssfdc->mbd.devnum = -1; ssfdcr_add_mtd() 308 ssfdc->mbd.tr = tr; ssfdcr_add_mtd() 309 ssfdc->mbd.readonly = 1; ssfdcr_add_mtd() 311 ssfdc->cis_block = cis_sector / (mtd->erasesize >> SECTOR_SHIFT); ssfdcr_add_mtd() 312 ssfdc->erase_size = mtd->erasesize; ssfdcr_add_mtd() 313 ssfdc->map_len = (u32)mtd->size / mtd->erasesize; ssfdcr_add_mtd() 316 ssfdc->cis_block, ssfdc->erase_size, ssfdc->map_len, ssfdcr_add_mtd() 317 DIV_ROUND_UP(ssfdc->map_len, MAX_PHYS_BLK_PER_ZONE)); ssfdcr_add_mtd() 320 ssfdc->heads = 16; ssfdcr_add_mtd() 321 ssfdc->sectors = 32; ssfdcr_add_mtd() 322 get_chs(mtd->size, NULL, &ssfdc->heads, &ssfdc->sectors); ssfdcr_add_mtd() 323 ssfdc->cylinders = (unsigned short)(((u32)mtd->size >> SECTOR_SHIFT) / ssfdcr_add_mtd() 324 ((long)ssfdc->sectors * (long)ssfdc->heads)); ssfdcr_add_mtd() 327 ssfdc->cylinders, ssfdc->heads , ssfdc->sectors, ssfdcr_add_mtd() 328 (long)ssfdc->cylinders * (long)ssfdc->heads * ssfdcr_add_mtd() 329 (long)ssfdc->sectors); ssfdcr_add_mtd() 331 ssfdc->mbd.size = (long)ssfdc->heads * (long)ssfdc->cylinders * ssfdcr_add_mtd() 332 (long)ssfdc->sectors; ssfdcr_add_mtd() 335 ssfdc->logic_block_map = kmalloc(sizeof(ssfdc->logic_block_map[0]) * ssfdcr_add_mtd() 336 ssfdc->map_len, GFP_KERNEL); ssfdcr_add_mtd() 337 if (!ssfdc->logic_block_map) ssfdcr_add_mtd() 339 memset(ssfdc->logic_block_map, 0xff, sizeof(ssfdc->logic_block_map[0]) * ssfdcr_add_mtd() 340 ssfdc->map_len); ssfdcr_add_mtd() 343 if (build_logical_block_map(ssfdc) < 0) ssfdcr_add_mtd() 347 if (add_mtd_blktrans_dev(&ssfdc->mbd)) ssfdcr_add_mtd() 350 printk(KERN_INFO "SSFDC_RO: Found ssfdc%c on mtd%d (%s)\n", ssfdcr_add_mtd() 351 ssfdc->mbd.devnum + 'a', mtd->index, mtd->name); ssfdcr_add_mtd() 355 kfree(ssfdc->logic_block_map); ssfdcr_add_mtd() 356 kfree(ssfdc); ssfdcr_add_mtd() 361 struct ssfdcr_record *ssfdc = (struct ssfdcr_record *)dev; ssfdcr_remove_dev() local 366 kfree(ssfdc->logic_block_map); ssfdcr_remove_dev() 372 struct ssfdcr_record *ssfdc = (struct ssfdcr_record *)dev; ssfdcr_readsect() local 375 sectors_per_block = ssfdc->erase_size >> SECTOR_SHIFT; ssfdcr_readsect() 383 if (block_address >= ssfdc->map_len) ssfdcr_readsect() 386 block_address = ssfdc->logic_block_map[block_address]; ssfdcr_readsect() 400 if (read_physical_sector(ssfdc->mbd.mtd, buf, sect_no) < 0) ssfdcr_readsect() 411 struct ssfdcr_record *ssfdc = (struct ssfdcr_record *)dev; ssfdcr_getgeo() local 414 ssfdc->cylinders, ssfdc->heads, ssfdc->sectors); ssfdcr_getgeo() 416 geo->heads = ssfdc->heads; ssfdcr_getgeo() 417 geo->sectors = ssfdc->sectors; ssfdcr_getgeo() 418 geo->cylinders = ssfdc->cylinders; ssfdcr_getgeo() 430 .name = "ssfdc",
|
H A D | Makefile | 25 obj-$(CONFIG_SSFDC) += ssfdc.o
|
H A D | sm_ftl.h | 5 * Based loosly on ssfdc.c which is
|
Completed in 352 milliseconds