summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authormjacob <mjacob@NetBSD.org>2001-04-10 21:52:00 +0000
committermjacob <mjacob@NetBSD.org>2001-04-10 21:52:00 +0000
commit78a44662f537bb0a4ea40bb693d39eddca322c10 (patch)
tree10469379af88e9fc21fd805bf5b12995c8b8fc9a /sys/dev
parent7bcf01a29ad4caeab02f30903a2f4543feaa1caf (diff)
Add initial implementation of ISP_SDBLEV, ISP_RESETHBA, ISP_FC_RESCAN,
ISP_FC_LIP and ISP_FC_GETDINFO ioctls.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/isp_netbsd.c61
1 files changed, 60 insertions, 1 deletions
diff --git a/sys/dev/ic/isp_netbsd.c b/sys/dev/ic/isp_netbsd.c
index 3bd8ecf5273..51e4b87810a 100644
--- a/sys/dev/ic/isp_netbsd.c
+++ b/sys/dev/ic/isp_netbsd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_netbsd.c,v 1.40 2001/03/14 05:44:21 mjacob Exp $ */
+/* $NetBSD: isp_netbsd.c,v 1.41 2001/04/10 21:52:00 mjacob Exp $ */
/*
* This driver, which is contained in NetBSD in the files:
*
@@ -252,6 +252,65 @@ ispioctl(struct scsipi_link *sc_link, u_long cmd, caddr_t addr,
retval = 0;
(void) splx(s);
break;
+ case ISP_SDBLEV:
+ {
+ int olddblev = isp->isp_dblev;
+ isp->isp_dblev = *(int *)addr;
+ *(int *)addr = olddblev;
+ retval = 0;
+ break;
+ }
+ case ISP_RESETHBA:
+ ISP_LOCK(isp);
+ isp_reinit(isp);
+ ISP_UNLOCK(isp);
+ retval = 0;
+ break;
+ case ISP_FC_RESCAN:
+ if (IS_FC(isp)) {
+ ISP_LOCK(isp);
+ if (isp_fc_runstate(isp, 5 * 1000000)) {
+ retval = EIO;
+ } else {
+ retval = 0;
+ }
+ ISP_UNLOCK(isp);
+ }
+ break;
+ case ISP_FC_LIP:
+ if (IS_FC(isp)) {
+ ISP_LOCK(isp);
+ if (isp_control(isp, ISPCTL_SEND_LIP, 0)) {
+ retval = EIO;
+ } else {
+ retval = 0;
+ }
+ ISP_UNLOCK(isp);
+ }
+ break;
+ case ISP_FC_GETDINFO:
+ {
+ struct isp_fc_device *ifc = (struct isp_fc_device *) addr;
+ struct lportdb *lp;
+
+ if (ifc->loopid < 0 || ifc->loopid >= MAX_FC_TARG) {
+ retval = EINVAL;
+ break;
+ }
+ ISP_LOCK(isp);
+ lp = &FCPARAM(isp)->portdb[ifc->loopid];
+ if (lp->valid) {
+ ifc->loopid = lp->loopid;
+ ifc->portid = lp->portid;
+ ifc->node_wwn = lp->node_wwn;
+ ifc->port_wwn = lp->port_wwn;
+ retval = 0;
+ } else {
+ retval = ENODEV;
+ }
+ ISP_UNLOCK(isp);
+ break;
+ }
default:
break;
}