diff options
-rw-r--r-- | sys/scsi/scsi_ioctl.c | 12 | ||||
-rw-r--r-- | sys/sys/scsiio.h | 8 |
2 files changed, 14 insertions, 6 deletions
diff --git a/sys/scsi/scsi_ioctl.c b/sys/scsi/scsi_ioctl.c index 8e340f7..7998282 100644 --- a/sys/scsi/scsi_ioctl.c +++ b/sys/scsi/scsi_ioctl.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. *End copyright * - * $Id: scsi_ioctl.c,v 1.27 1997/12/02 21:07:01 phk Exp $ + * $Id: scsi_ioctl.c,v 1.28 1998/02/01 04:13:00 wollman Exp $ * * */ @@ -256,7 +256,7 @@ struct proc *p, struct scsi_link *sc_link) /* If we can't write the device we can't permit much: */ - if (cmd != SCIOCIDENTIFY && cmd != SCSIOCGETDEVINFO&& !(flags & FWRITE)) + if (cmd != SCIOCIDENTIFY && cmd != SCIOCGETDEVINFO&& !(flags & FWRITE)) return EACCES; SC_DEBUG(sc_link,SDEV_DB2,("scsi_do_ioctl(0x%x)\n",cmd)); @@ -367,10 +367,16 @@ struct proc *p, struct scsi_link *sc_link) { struct scsi_devinfo *scd = (struct scsi_devinfo *)addr; struct scsi_link *scl; - scl = scsi_link_get(scd->addr.bus, scd->addr.target, + scl = scsi_link_get(scd->addr.scbus, scd->addr.target, scd->addr.lun); if (scl != 0) { scd->dev = scl->dev; + /* XXX buffers better be big enough... */ + sprintf(scd->devname, "%s%d", + scl->device->name, scl->dev_unit); + sprintf(scd->adname, "%s%d:%d", + scl->adapter->name, scl->adapter_unit, + scl->adapter_bus); ret = 0; } else { ret = ENXIO; diff --git a/sys/sys/scsiio.h b/sys/sys/scsiio.h index af6d2e0..b7cbfd4 100644 --- a/sys/sys/scsiio.h +++ b/sys/sys/scsiio.h @@ -1,5 +1,5 @@ /* - * $Id: scsiio.h,v 1.8 1997/02/22 09:45:49 peter Exp $ + * $Id: scsiio.h,v 1.9 1998/02/01 04:13:13 wollman Exp $ */ #ifndef _SYS_SCSIIO_H_ #define _SYS_SCSIIO_H_ @@ -67,12 +67,14 @@ struct scsi_addr { #define SCIOCFREEZETHAW _IOW('Q', 11, int) /* Freeze SCSI for some seconds */ #define SCIOCWAITTHAW _IO('Q', 12) /* Wait for SCSI to thaw */ -struct scsi_getdevinfo { +struct scsi_devinfo { struct scsi_addr addr; dev_t dev; + char devname[16]; + char adname[16]; }; -#define SCIOCGETDEVINFO _IOWR('Q', 13, struct scsi_getdevinfo) +#define SCIOCGETDEVINFO _IOWR('Q', 13, struct scsi_devinfo) #endif /* !_SYS_SCSIIO_H_ */ |