summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsicam.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-01-04 16:03:48 +0000
commit78c388aed2b7184182c08428db1de6c872d815f5 (patch)
tree4b2003b1b4ceb241a17faa995da8dd1004bb8e45 /drivers/scsi/scsicam.c
parenteb7a5bf93aaa4be1d7c6181100ab7639e74d67f7 (diff)
Merge with Linux 2.1.131 and more MIPS goodies.
(Did I mention that CVS is buggy ...)
Diffstat (limited to 'drivers/scsi/scsicam.c')
-rw-r--r--drivers/scsi/scsicam.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c
index 3d434d2f6..9aa0d8fbc 100644
--- a/drivers/scsi/scsicam.c
+++ b/drivers/scsi/scsicam.c
@@ -45,6 +45,7 @@ int scsicam_bios_param (Disk *disk, /* SCSI disk */
struct buffer_head *bh;
int ret_code;
int size = disk->capacity;
+ unsigned long temp_cyl;
if (!(bh = bread(MKDEV(MAJOR(dev), MINOR(dev)&~0xf), 0, 1024)))
return -1;
@@ -67,6 +68,11 @@ int scsicam_bios_param (Disk *disk, /* SCSI disk */
if (ret_code || ip[0] > 255 || ip[1] > 63) {
ip[0] = 64;
ip[1] = 32;
+ temp_cyl = size / (ip[0] * ip[1]);
+ if (temp_cyl > 65534) {
+ ip[0] = 255;
+ ip[1] = 63;
+ }
ip[2] = size / (ip[0] * ip[1]);
}
@@ -114,6 +120,8 @@ static int partsize(struct buffer_head *bh, unsigned long capacity,
end_head = largest->end_head;
end_sector = largest->end_sector & 0x3f;
+ if( end_head + 1 == 0 || end_sector == 0 ) return -1;
+
#ifdef DEBUG
printk ("scsicam_bios_param : end at h = %d, c = %d, s = %d\n",
end_head, end_cyl, end_sector);