Lines Matching +full:custom +full:- +full:temp

1 // SPDX-License-Identifier: GPL-2.0
3 * scsicam.c - SCSI CAM support functions, use for HDIO_GETGEO, etc.
7 * (Unix and Linux consulting and custom programming)
9 * +1 (303) 786-7975
11 * For more information, please consult the SCSI-CAM draft.
26 * scsi_bios_ptable - Read PC partition table out of first sector of device.
35 struct address_space *mapping = bdev_whole(dev)->bd_mapping; in scsi_bios_ptable()
50 * scsi_partsize - Parse cylinders/heads/sectors from PC partition table
73 int largest_cyl = -1, i; in scsi_partsize()
76 if (!p->sys_ind) in scsi_partsize()
82 cyl = p->cyl + ((p->sector & 0xc0) << 2); in scsi_partsize()
90 end_cyl = largest->end_cyl + ((largest->end_sector & 0xc0) << 2); in scsi_partsize()
91 end_head = largest->end_head; in scsi_partsize()
92 end_sector = largest->end_sector & 0x3f; in scsi_partsize()
106 logical_end = get_unaligned_le32(&largest->start_sect) in scsi_partsize()
107 + get_unaligned_le32(&largest->nr_sects); in scsi_partsize()
110 ext_cyl = (logical_end - (end_head * end_sector + end_sector)) in scsi_partsize()
145 * Purpose : to determine a near-optimal int 0x13 mapping for a
149 * Returns : -1 on failure, 0 on success.
155 * see http://www.t10.org/ftp/t10/drafts/cam/cam-r12b.pdf
158 * 10-MAR-94
159 * Information technology -
160 * SCSI-2 Common access method
166 * head-cylinder-sector requirements. It minimizes the value for
179 unsigned long heads, sectors, cylinders, temp; in setsize() local
184 temp = cylinders * sectors; /* Compute divisor for heads */ in setsize()
185 heads = capacity / temp; /* Compute value for number of heads */ in setsize()
186 if (capacity % temp) { /* If no remainder, done! */ in setsize()
188 temp = cylinders * heads; /* Compute divisor for sectors */ in setsize()
189 sectors = capacity / temp; /* Compute value for sectors per in setsize()
191 if (capacity % temp) { /* If no remainder, done! */ in setsize()
193 temp = heads * sectors; /* Compute divisor for cylinders */ in setsize()
194 cylinders = capacity / temp; /* Compute number of cylinders */ in setsize()
198 rv = (unsigned) -1; /* Give error if 0 cylinders */ in setsize()
207 * scsicam_bios_param - Determine geometry of a disk in cylinders/heads/sectors.
213 * SCSI-CAM system, storing the results in ip as required
216 * Returns : -1 on failure, 0 on success.
230 * at most 62 sectors per track - this works up to 7905 MB. in scsicam_bios_param()