diff options
author | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 1999-08-24 01:20:23 +0000 |
---|---|---|
committer | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 1999-08-24 01:20:23 +0000 |
commit | b24f9df7ec3ec16be1cd52c9189217ab9af11311 (patch) | |
tree | 66ba79b8e8415341d8568978a4d07533f8fa5114 /sys/scsi | |
parent | fab392781711b5f3ab639479a93d855b6c0e1dc3 (diff) |
Added type field to scsi_addr to reflect bus/device type (ATAPI or SCSI).
Updated ioctls to match
Minor patches in anticipation of wd->sd translation layer
Diffstat (limited to 'sys/scsi')
-rw-r--r-- | sys/scsi/cd.c | 3 | ||||
-rw-r--r-- | sys/scsi/scsi_disk.h | 8 | ||||
-rw-r--r-- | sys/scsi/scsi_ioctl.c | 18 | ||||
-rw-r--r-- | sys/scsi/sd.c | 6 |
4 files changed, 30 insertions, 5 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c index 3199c5af986..746dbcc110b 100644 --- a/sys/scsi/cd.c +++ b/sys/scsi/cd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd.c,v 1.40 1999/08/10 23:09:49 deraadt Exp $ */ +/* $OpenBSD: cd.c,v 1.41 1999/08/24 01:20:22 csapuntz Exp $ */ /* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */ /* @@ -766,6 +766,7 @@ cdioctl(dev, cmd, addr, flag, p) case DIOCLOCK: case DIOCEJECT: case SCIOCIDENTIFY: + case OSCIOCIDENTIFY: case SCIOCCOMMAND: case SCIOCDEBUG: case CDIOCLOADUNLOAD: diff --git a/sys/scsi/scsi_disk.h b/sys/scsi/scsi_disk.h index 33c207d6bb7..59a34e62bbb 100644 --- a/sys/scsi/scsi_disk.h +++ b/sys/scsi/scsi_disk.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_disk.h,v 1.7 1999/07/25 07:09:19 csapuntz Exp $ */ +/* $OpenBSD: scsi_disk.h,v 1.8 1999/08/24 01:20:22 csapuntz Exp $ */ /* $NetBSD: scsi_disk.h,v 1.10 1996/07/05 16:19:05 christos Exp $ */ /* @@ -240,6 +240,12 @@ struct scsi_reassign_blocks_data { } defect_descriptor[1]; }; +struct scsi_disk_blk_desc { + u_int8_t nblocks[4]; + u_int8_t density; + u_int8_t blklen[3]; +}; + union scsi_disk_pages { #define DISK_PGCODE 0x3F /* only 6 bits valid */ struct page_disk_format { diff --git a/sys/scsi/scsi_ioctl.c b/sys/scsi/scsi_ioctl.c index dfe18a0ea49..80cdbbd4a83 100644 --- a/sys/scsi/scsi_ioctl.c +++ b/sys/scsi/scsi_ioctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_ioctl.c,v 1.9 1997/09/01 19:11:46 niklas Exp $ */ +/* $OpenBSD: scsi_ioctl.c,v 1.10 1999/08/24 01:20:22 csapuntz Exp $ */ /* $NetBSD: scsi_ioctl.c,v 1.23 1996/10/12 23:23:17 christos Exp $ */ /* @@ -347,6 +347,11 @@ scsi_do_ioctl(sc_link, dev, cmd, addr, flag, p) sc_link->flags |= SDEV_DB4; return 0; } + case OSCIOCREPROBE: { + struct oscsi_addr *sca = (struct oscsi_addr *)addr; + + return scsi_probe_busses(sca->scbus, sca->target, sca->lun); + } case SCIOCREPROBE: { struct scsi_addr *sca = (struct scsi_addr *)addr; @@ -383,9 +388,19 @@ scsi_do_safeioctl(sc_link, dev, cmd, addr, flag, p) SC_DEBUG(sc_link, SDEV_DB2, ("scsi_do_safeioctl(0x%lx)\n", cmd)); switch(cmd) { + case OSCIOCIDENTIFY: { + struct oscsi_addr *sca = (struct oscsi_addr *)addr; + + sca->scbus = sc_link->scsibus; + sca->target = sc_link->target; + sca->lun = sc_link->lun; + return 0; + } case SCIOCIDENTIFY: { struct scsi_addr *sca = (struct scsi_addr *)addr; + sca->type = (sc_link->flags & SDEV_ATAPI) + ? TYPE_ATAPI : TYPE_SCSI; sca->scbus = sc_link->scsibus; sca->target = sc_link->target; sca->lun = sc_link->lun; @@ -394,6 +409,7 @@ scsi_do_safeioctl(sc_link, dev, cmd, addr, flag, p) case SCIOCCOMMAND: case SCIOCDEBUG: case SCIOCREPROBE: + case OSCIOCREPROBE: case SCIOCRESET: return EBADF; case SCIOCRECONFIG: diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index b1c8cb3fa3b..f2dcaffee9c 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.39 1999/08/10 23:09:49 deraadt Exp $ */ +/* $OpenBSD: sd.c,v 1.40 1999/08/24 01:20:22 csapuntz Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -184,7 +184,8 @@ sdattach(parent, self, aux) dk_establish(&sd->sc_dk, &sd->sc_dev); - if (sc_link->flags & SDEV_ATAPI) { + if (sc_link->flags & SDEV_ATAPI && + (sc_link->flags & SDEV_REMOVABLE)) { sd->sc_ops = &sd_atapibus_ops; } else { sd->sc_ops = &sd_scsibus_ops; @@ -772,6 +773,7 @@ sdioctl(dev, cmd, addr, flag, p) case DIOCLOCK: case DIOCEJECT: case SCIOCIDENTIFY: + case OSCIOCIDENTIFY: case SCIOCCOMMAND: case SCIOCDEBUG: if (part == RAW_PART) |