1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-28 16:43:09 +00:00

fix a couple of stuffups in the worm driver and in other associated scsi files

This commit is contained in:
Julian Elischer 1995-12-05 07:14:27 +00:00
parent 61f20197ae
commit d3004119ff
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12631
4 changed files with 13 additions and 35 deletions

View File

@ -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;

View File

@ -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 */

View File

@ -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)

View File

@ -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 @@ wormstart(unit, flags)
}
}
} /* go back and see if we can cram more work in.. */
badnews:
}
static void