summaryrefslogtreecommitdiffstats
path: root/sys/scsi
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1995-12-05 07:14:27 +0000
committerjulian <julian@FreeBSD.org>1995-12-05 07:14:27 +0000
commitac8328a67ce4ce3dfa1e5fed229411aba2e40c8b (patch)
treee28bc3b27485a2ac2b7a2f96336d530f975790ed /sys/scsi
parent94363a94a157f6a16d2349e5afddda7f1c94f77a (diff)
downloadFreeBSD-src-ac8328a67ce4ce3dfa1e5fed229411aba2e40c8b.zip
FreeBSD-src-ac8328a67ce4ce3dfa1e5fed229411aba2e40c8b.tar.gz
fix a couple of stuffups in the worm driver and in other associated scsi files
Diffstat (limited to 'sys/scsi')
-rw-r--r--sys/scsi/scsi_cd.h14
-rw-r--r--sys/scsi/scsi_driver.c5
-rw-r--r--sys/scsi/scsiconf.h7
-rw-r--r--sys/scsi/worm.c22
4 files changed, 13 insertions, 35 deletions
diff --git a/sys/scsi/scsi_cd.h b/sys/scsi/scsi_cd.h
index 7b8f63c..a6fb645 100644
--- a/sys/scsi/scsi_cd.h
+++ b/sys/scsi/scsi_cd.h
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
*
- * $Id: scsi_cd.h,v 1.6 1993/11/18 05:02:52 rgrimes Exp $
+ * $Id: scsi_cd.h,v 1.7 1995/05/30 08:13:29 rgrimes Exp $
*/
#ifndef _SCSI_SCSI_CD_H
#define _SCSI_SCSI_CD_H 1
@@ -29,18 +29,6 @@
* SCSI command format
*/
-struct scsi_read_capacity_cd
-{
- u_char op_code;
- u_char byte2;
- u_char addr_3; /* Most Significant */
- u_char addr_2;
- u_char addr_1;
- u_char addr_0; /* Least Significant */
- u_char unused[3];
- u_char control;
-};
-
struct scsi_pause
{
u_char op_code;
diff --git a/sys/scsi/scsi_driver.c b/sys/scsi/scsi_driver.c
index a49da2c..5db60ca 100644
--- a/sys/scsi/scsi_driver.c
+++ b/sys/scsi/scsi_driver.c
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scsi_driver.c,v 1.10 1995/05/30 08:13:37 rgrimes Exp $
+ * $Id: scsi_driver.c,v 1.11 1995/12/05 04:41:20 julian Exp $
*
*/
#include <sys/types.h>
@@ -54,7 +54,8 @@
#include <scsi/scsi_driver.h>
#define GETUNIT(DEVICE, DEV) \
- ((DEVICE)->getunit) ? (*(DEVICE)->getunit)((DEV)) : minor((DEV))
+ ((DEVICE)->getunit) ? (*(DEVICE)->getunit)((DEV)) \
+ : (minor((DEV)) & ~SCSI_CONTROL_MASK)
int
scsi_goaway(struct kern_devconf *kdc, int force) /* XXX should do a lot more */
diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h
index c0c09f4..e637a53 100644
--- a/sys/scsi/scsiconf.h
+++ b/sys/scsi/scsiconf.h
@@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
*
- * $Id: scsiconf.h,v 1.30 1995/11/20 12:42:31 phk Exp $
+ * $Id: scsiconf.h,v 1.31 1995/11/21 12:55:01 bde Exp $
*/
#ifndef SCSI_SCSICONF_H
#define SCSI_SCSICONF_H 1
@@ -587,9 +587,10 @@ void ukinit __P((void));
* m: Old style minor device number.
*/
-#define SCSI_FIXED(DEV) (((DEV) & SCSI_FIXED_MASK))
#define SCSI_FIXED_MASK 0x40000000
-#define SCSI_CONTROL(DEV) (((DEV) & 0x20000000))
+#define SCSI_FIXED(DEV) (((DEV) & SCSI_FIXED_MASK))
+#define SCSI_CONTROL_MASK 0x20000000
+#define SCSI_CONTROL(DEV) (((DEV) & SCSI_CONTROL_MASK))
#define SCSI_BUS(DEV) (((DEV) & 0x07000000) >> 24)
#define SCSI_ID(DEV) (((DEV) & 0x00F00000) >> 20)
diff --git a/sys/scsi/worm.c b/sys/scsi/worm.c
index 059c7d8..8878bd2 100644
--- a/sys/scsi/worm.c
+++ b/sys/scsi/worm.c
@@ -37,7 +37,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: worm.c,v 1.11 1995/11/29 10:49:07 julian Exp $
+ * $Id: worm.c,v 1.12 1995/11/29 14:41:09 julian Exp $
*/
/* XXX This is PRELIMINARY.
@@ -177,19 +177,7 @@ wormstart(unit, flags)
struct scsi_link *sc_link = SCSI_LINK(&worm_switch, unit);
struct scsi_data *worm = sc_link->sd;
register struct buf *bp = 0;
- struct
- {
- u_char op_code;
- u_char byte2;
- u_char lba3; /* I don't want to worry about packing */
- u_char lba2;
- u_char lba1;
- u_char lba0;
- u_char reserved;
- u_char tl1;
- u_char tl0;
- u_char ctl;
- } cmd;
+ struct scsi_rw_big cmd;
u_int32 lba; /* Logical block address */
u_int32 tl; /* Transfer length */
@@ -238,8 +226,8 @@ wormstart(unit, flags)
lba = bp->b_blkno / (worm->blk_size / DEV_BSIZE);
tl = bp->b_bcount / worm->blk_size;
- scsi_uto4b(lba, &cmd.lba3);
- scsi_uto2b(tl, &cmd.tl1);
+ scsi_uto4b(lba, &cmd.addr_3);
+ scsi_uto2b(tl, &cmd.length2);
/*
* go ask the adapter to do all this for us
@@ -254,7 +242,6 @@ wormstart(unit, flags)
bp,
flags | SCSI_NOSLEEP) == SUCCESSFULLY_QUEUED) {
} else {
-badnews:
printf("worm%ld: oops not queued\n", unit);
if (bp) {
bp->b_flags |= B_ERROR;
@@ -263,6 +250,7 @@ badnews:
}
}
} /* go back and see if we can cram more work in.. */
+badnews:
}
static void
OpenPOWER on IntegriCloud