summaryrefslogtreecommitdiff
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
parent03cd64efdc23904de693c055bd99ca9996b623b4 (diff)
Add ses link. Tested and ok deraadt@
-rw-r--r--sys/dev/biovar.h5
-rw-r--r--sys/dev/ic/ami.c15
-rw-r--r--sys/dev/ic/amivar.h5
3 files changed, 21 insertions, 4 deletions
diff --git a/sys/dev/biovar.h b/sys/dev/biovar.h
index 44d71ef5b55..82d913cc7e4 100644
--- a/sys/dev/biovar.h
+++ b/sys/dev/biovar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: biovar.h,v 1.11 2005/08/08 04:02:30 deraadt Exp $ */
+/* $OpenBSD: biovar.h,v 1.12 2005/08/08 20:23:46 marco Exp $ */
/*
* Copyright (c) 2002 Niklas Hallqvist. All rights reserved.
@@ -94,7 +94,8 @@ struct bioc_disk {
char bd_product[16]; /* product string */
char bd_revision[4]; /* revision string */
char bd_pad[4]; /* zero terminate in here */
- char bd_serial[16];
+ char bd_serial[16]; /* serial number */
+ char bd_procdev[16]; /* processor device */
};
#define BIOCVOL _IOWR('B', 34, struct bioc_vol)
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;
}
diff --git a/sys/dev/ic/amivar.h b/sys/dev/ic/amivar.h
index 4ff0a74dbe8..3131ccd2ec8 100644
--- a/sys/dev/ic/amivar.h
+++ b/sys/dev/ic/amivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: amivar.h,v 1.16 2005/08/08 03:11:36 marco Exp $ */
+/* $OpenBSD: amivar.h,v 1.17 2005/08/08 20:23:46 marco Exp $ */
/*
* Copyright (c) 2001 Michael Shalayeff
@@ -59,6 +59,9 @@ struct ami_rawsoftc {
struct scsi_link sc_link;
struct ami_softc *sc_softc;
u_int8_t sc_channel;
+
+ int sc_proctarget; /* ses/safte target id */
+ char sc_procdev[16]; /* ses/safte device */
};
struct ami_softc {