• Home
  • Raw
  • Download

Lines Matching full:dev

24 int compute_lba_geom_from_tot_sectors(struct device *dev)  in compute_lba_geom_from_tot_sectors()  argument
30 if(dev->heads && dev->sectors && dev->tracks) in compute_lba_geom_from_tot_sectors()
36 if(dev->tot_sectors == 0) { in compute_lba_geom_from_tot_sectors()
42 if(dev->tot_sectors && in compute_lba_geom_from_tot_sectors()
43 dev->tot_sectors <= 8640 && dev->tot_sectors % 40 == 0) { in compute_lba_geom_from_tot_sectors()
44 if(dev->tot_sectors <= 540) { in compute_lba_geom_from_tot_sectors()
46 dev->tracks = 40; in compute_lba_geom_from_tot_sectors()
47 dev->heads = 1; in compute_lba_geom_from_tot_sectors()
48 } else if(dev->tot_sectors <= 1080) { in compute_lba_geom_from_tot_sectors()
52 if(dev->heads == 1) in compute_lba_geom_from_tot_sectors()
53 dev->tracks = 80; in compute_lba_geom_from_tot_sectors()
55 dev->tracks = 40; in compute_lba_geom_from_tot_sectors()
56 dev->heads = 2; in compute_lba_geom_from_tot_sectors()
61 dev->tracks = 80; in compute_lba_geom_from_tot_sectors()
62 dev->heads = 2; in compute_lba_geom_from_tot_sectors()
64 dev->sectors = in compute_lba_geom_from_tot_sectors()
65 (uint16_t)(dev->tot_sectors / dev->heads / dev->tracks); in compute_lba_geom_from_tot_sectors()
70 if(!dev->sectors || !dev->heads) { in compute_lba_geom_from_tot_sectors()
71 dev->sectors = 63; in compute_lba_geom_from_tot_sectors()
73 if (dev->tot_sectors < 16u*dev->sectors*1024) in compute_lba_geom_from_tot_sectors()
74 dev->heads = 16; in compute_lba_geom_from_tot_sectors()
75 else if (dev->tot_sectors < 32u*dev->sectors*1024) in compute_lba_geom_from_tot_sectors()
76 dev->heads = 32; in compute_lba_geom_from_tot_sectors()
77 else if (dev->tot_sectors < 64u*dev->sectors*1024) in compute_lba_geom_from_tot_sectors()
78 dev->heads = 64; in compute_lba_geom_from_tot_sectors()
79 else if (dev->tot_sectors < 128u*dev->sectors*1024) in compute_lba_geom_from_tot_sectors()
80 dev->heads = 128; in compute_lba_geom_from_tot_sectors()
82 dev->heads = 255; in compute_lba_geom_from_tot_sectors()
86 if(!dev->tracks) { in compute_lba_geom_from_tot_sectors()
87 sect_per_track = dev->heads * dev->sectors; in compute_lba_geom_from_tot_sectors()
88 tracks = (dev->tot_sectors + sect_per_track - 1) / in compute_lba_geom_from_tot_sectors()
90 dev->tracks = tracks; in compute_lba_geom_from_tot_sectors()