• Home
  • Raw
  • Download

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 = dev->bd_contains->bd_inode->i_mapping; in scsi_bios_ptable()
51 * scsi_partsize - Parse cylinders/heads/sectors from PC partition table
74 int largest_cyl = -1, i; in scsi_partsize()
77 if (!p->sys_ind) in scsi_partsize()
83 cyl = p->cyl + ((p->sector & 0xc0) << 2); in scsi_partsize()
91 end_cyl = largest->end_cyl + ((largest->end_sector & 0xc0) << 2); in scsi_partsize()
92 end_head = largest->end_head; in scsi_partsize()
93 end_sector = largest->end_sector & 0x3f; in scsi_partsize()
107 logical_end = get_unaligned_le32(&largest->start_sect) in scsi_partsize()
108 + get_unaligned_le32(&largest->nr_sects); in scsi_partsize()
111 ext_cyl = (logical_end - (end_head * end_sector + end_sector)) in scsi_partsize()
146 * Purpose : to determine a near-optimal int 0x13 mapping for a
150 * Returns : -1 on failure, 0 on success.
156 * see http://www.t10.org/ftp/t10/drafts/cam/cam-r12b.pdf
159 * 10-MAR-94
160 * Information technology -
161 * SCSI-2 Common access method
167 * head-cylinder-sector requirements. It minimizes the value for
180 unsigned long heads, sectors, cylinders, temp; in setsize() local
185 temp = cylinders * sectors; /* Compute divisor for heads */ in setsize()
186 heads = capacity / temp; /* Compute value for number of heads */ in setsize()
187 if (capacity % temp) { /* If no remainder, done! */ in setsize()
189 temp = cylinders * heads; /* Compute divisor for sectors */ in setsize()
190 sectors = capacity / temp; /* Compute value for sectors per in setsize()
192 if (capacity % temp) { /* If no remainder, done! */ in setsize()
194 temp = heads * sectors; /* Compute divisor for cylinders */ in setsize()
195 cylinders = capacity / temp; /* Compute number of cylinders */ in setsize()
199 rv = (unsigned) -1; /* Give error if 0 cylinders */ in setsize()
208 * scsicam_bios_param - Determine geometry of a disk in cylinders/heads/sectors.
214 * SCSI-CAM system, storing the results in ip as required
217 * Returns : -1 on failure, 0 on success.
231 * at most 62 sectors per track - this works up to 7905 MB. in scsicam_bios_param()