summaryrefslogtreecommitdiffstats
path: root/sys/scsi
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1997-12-28 09:10:37 +0000
committerjulian <julian@FreeBSD.org>1997-12-28 09:10:37 +0000
commit25198655718d852db065e79725918b87ad8e141a (patch)
tree2ccbba0e937e7a3ebfcb901c35467925f0b91974 /sys/scsi
parente50e705007f0b1ed0eb894b3f68a4ae6aca76406 (diff)
downloadFreeBSD-src-25198655718d852db065e79725918b87ad8e141a.zip
FreeBSD-src-25198655718d852db065e79725918b87ad8e141a.tar.gz
back out previous commit
got a better version.
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/sd.c37
1 files changed, 13 insertions, 24 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 37ff30d..233d423 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -318,6 +318,18 @@ sd_open(dev, mode, fmt, p, sc_link)
*/
if(errcode = sd_get_parms(unit, 0)) /* sets SDEV_MEDIA_LOADED */
goto bad;
+ switch (sd->params.secsiz) {
+ case 512:
+ case 1024:
+ case 2048:
+ break;
+ default:
+ printf("sd%ld: Can't deal with %d bytes logical blocks\n",
+ unit, sd->params.secsiz);
+ Debugger("sd");
+ errcode = ENXIO;
+ goto bad;
+ }
SC_DEBUG(sc_link, SDEV_DB3, ("Params loaded "));
@@ -411,7 +423,7 @@ sd_strategy(struct buf *bp, struct scsi_link *sc_link)
/*
* check it's not too big a transfer for our adapter
*/
- scsi_minphys(bp,&sd_switch);
+ scsi_minphys(bp,&sd_switch);
/*
* Odd number of bytes or negative offset
@@ -837,29 +849,6 @@ sd_get_parms(unit, flags)
disk_parms->cyls = scsi_3btou(&scsi_sense.pages.rigid_geometry.ncyl_2);
disk_parms->secsiz = scsi_3btou(scsi_sense.blk_desc.blklen);
- switch (sd->params.secsiz) {
- case 528:/*
- * This is not the correct fix but will do till
- * I get to my scsi docs. Some drives return this value
- * for physical size when actually presenting
- * a 512 byte logical sector size. The correct
- * fix involves figuring out what hte correct
- * command sequence is to get teh logical blocksize,
- * and figuring out what to do if it doesn't
- * work on an old drive. Possibly only do this
- * if the value here is not a power of 2.
- */
- sd->params.secsiz = 512;
- case 512:
- case 1024:
- case 2048:
- break;
- default:
- printf("sd%ld: Can't deal with %d byte blocks\n",
- unit, sd->params.secsiz);
- Debugger("sd");
- return (ENXIO);
- }
sectors = sd_size(unit, flags);
disk_parms->disksize = sectors;
/* Check if none of these values are zero */
OpenPOWER on IntegriCloud