summaryrefslogtreecommitdiff
path: root/sys/dev/ic/ami.c
diff options
context:
space:
mode:
authorMarco Peereboom <marco@cvs.openbsd.org>2005-08-08 20:23:47 +0000
committerMarco Peereboom <marco@cvs.openbsd.org>2005-08-08 20:23:47 +0000
commitd918f290f44c0663e4ba9a971f4ad8207a2aff66 (patch)
treec579f4778bde6d54ea2155315d2124b1b7b6a90b /sys/dev/ic/ami.c
parent03cd64efdc23904de693c055bd99ca9996b623b4 (diff)
Add ses link. Tested and ok deraadt@
Diffstat (limited to 'sys/dev/ic/ami.c')
-rw-r--r--sys/dev/ic/ami.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/ic/ami.c b/sys/dev/ic/ami.c
index 6f9a2c9d78a..604ed5cf99d 100644
--- a/sys/dev/ic/ami.c
+++ b/sys/dev/ic/ami.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ami.c,v 1.55 2005/08/08 04:02:31 deraadt Exp $ */
+/* $OpenBSD: ami.c,v 1.56 2005/08/08 20:23:46 marco Exp $ */
/*
* Copyright (c) 2001 Michael Shalayeff
@@ -636,6 +636,7 @@ ami_attach(sc)
rsc->sc_link.openings = sc->sc_maxcmds;
rsc->sc_link.adapter_softc = rsc;
rsc->sc_link.adapter = &ami_raw_switch;
+ rsc->sc_proctarget = -1;
/* TODO fetch it from the controller */
rsc->sc_link.adapter_target = 16;
rsc->sc_link.adapter_buswidth = 16;
@@ -1320,6 +1321,7 @@ ami_scsi_raw_cmd(xs)
struct ami_rawsoftc *rsc = link->adapter_softc;
struct ami_softc *sc = rsc->sc_softc;
u_int8_t channel = rsc->sc_channel, target = link->target;
+ struct device *dev = link->device_softc;
struct ami_ccb *ccb;
struct ami_iocmd *cmd;
struct ami_passthrough *ps;
@@ -1355,6 +1357,11 @@ ami_scsi_raw_cmd(xs)
case READ_BIG:
case READ_BUFFER:
case RECEIVE_DIAGNOSTIC:
+ if (!cold) /* XXX bogus */
+ if (target == rsc->sc_proctarget)
+ strlcpy(rsc->sc_procdev, dev->dv_xname,
+ sizeof(rsc->sc_procdev));
+
direction = AMI_PT_IN;
break;
@@ -1460,8 +1467,11 @@ ami_scsi_raw_cmd(xs)
if (!(type == T_PROCESSOR || type == T_ENCLOSURE))
xs->error = XS_DRIVER_STUFFUP;
+ else
+ rsc->sc_proctarget = target; /* save off target */
}
+
if (ccb->ami_pt.dir == AMI_PT_IN)
memcpy(xs->data, ccb->ami_pt.idata + sizeof *ps,
xs->datalen);
@@ -2191,6 +2201,9 @@ ami_ioctl_disk(sc, bd)
bd->bd_channel = ch;
bd->bd_target = tg;
+ strlcpy(bd->bd_procdev, sc->sc_rawsoftcs[ch].sc_procdev,
+ sizeof(bd->bd_procdev));
+
error = 0;
goto bail;
}