patch-2.3.99-pre6 linux/drivers/scsi/sd.c
Next file: linux/drivers/scsi/st.c
Previous file: linux/drivers/scsi/scsi_obsolete.c
Back to the patch index
Back to the overall index
- Lines: 38
- Date:
Thu Apr 13 22:54:26 2000
- Orig file:
v2.3.99-pre5/linux/drivers/scsi/sd.c
- Orig date:
Tue Apr 11 15:09:18 2000
diff -u --recursive --new-file v2.3.99-pre5/linux/drivers/scsi/sd.c linux/drivers/scsi/sd.c
@@ -166,6 +166,37 @@
return -EFAULT;
return 0;
}
+ case HDIO_GETGEO_BIG:
+ {
+ struct hd_big_geometry *loc = (struct hd_big_geometry *) arg;
+
+ if(!loc)
+ return -EINVAL;
+
+ host = rscsi_disks[DEVICE_NR(dev)].device->host;
+
+ /* default to most commonly used values */
+
+ diskinfo[0] = 0x40;
+ diskinfo[1] = 0x20;
+ diskinfo[2] = rscsi_disks[DEVICE_NR(dev)].capacity >> 11;
+
+ /* override with calculated, extended default, or driver values */
+
+ if(host->hostt->bios_param != NULL)
+ host->hostt->bios_param(&rscsi_disks[DEVICE_NR(dev)],
+ dev,
+ &diskinfo[0]);
+ else scsicam_bios_param(&rscsi_disks[DEVICE_NR(dev)],
+ dev, &diskinfo[0]);
+
+ if (put_user(diskinfo[0], &loc->heads) ||
+ put_user(diskinfo[1], &loc->sectors) ||
+ put_user(diskinfo[2], (unsigned int *) &loc->cylinders) ||
+ put_user(sd[SD_PARTITION(inode->i_rdev)].start_sect, &loc->start))
+ return -EFAULT;
+ return 0;
+ }
case BLKGETSIZE: /* Return device size */
if (!arg)
return -EINVAL;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)