Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ic Add support for ISP_FC_GETHINFO which can tell yo...



details:   https://anonhg.NetBSD.org/src/rev/8d8dd1e63cad
branches:  trunk
changeset: 532785:8d8dd1e63cad
user:      mjacob <mjacob%NetBSD.org@localhost>
date:      Sat Jun 15 00:20:18 2002 +0000

description:
Add support for ISP_FC_GETHINFO which can tell you connection topology,
current speed, loopid, etc.

diffstat:

 sys/dev/ic/isp_netbsd.c |  86 ++++++++++++++++++++++++++++--------------------
 1 files changed, 50 insertions(+), 36 deletions(-)

diffs (114 lines):

diff -r 0a8f0f907924 -r 8d8dd1e63cad sys/dev/ic/isp_netbsd.c
--- a/sys/dev/ic/isp_netbsd.c   Sat Jun 15 00:18:02 2002 +0000
+++ b/sys/dev/ic/isp_netbsd.c   Sat Jun 15 00:20:18 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isp_netbsd.c,v 1.54 2002/06/08 16:59:27 yamt Exp $ */
+/* $NetBSD: isp_netbsd.c,v 1.55 2002/06/15 00:20:18 mjacob Exp $ */
 /*
  * This driver, which is contained in NetBSD in the files:
  *
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.54 2002/06/08 16:59:27 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: isp_netbsd.c,v 1.55 2002/06/15 00:20:18 mjacob Exp $");
 
 #include <dev/ic/isp_netbsd.h>
 #include <sys/scsiio.h>
@@ -273,40 +273,6 @@
                retval = 0;
                break;
 #endif
-       case ISP_GET_STATS:
-       {
-               isp_stats_t *sp = (isp_stats_t *) addr;
-
-               MEMZERO(sp, sizeof (*sp));
-               sp->isp_stat_version = ISP_STATS_VERSION;
-               sp->isp_type = isp->isp_type;
-               sp->isp_revision = isp->isp_revision;
-               ISP_LOCK(isp);
-               sp->isp_stats[ISP_INTCNT] = isp->isp_intcnt;
-               sp->isp_stats[ISP_INTBOGUS] = isp->isp_intbogus;
-               sp->isp_stats[ISP_INTMBOXC] = isp->isp_intmboxc;
-               sp->isp_stats[ISP_INGOASYNC] = isp->isp_intoasync;
-               sp->isp_stats[ISP_RSLTCCMPLT] = isp->isp_rsltccmplt;
-               sp->isp_stats[ISP_FPHCCMCPLT] = isp->isp_fphccmplt;
-               sp->isp_stats[ISP_RSCCHIWAT] = isp->isp_rscchiwater;
-               sp->isp_stats[ISP_FPCCHIWAT] = isp->isp_fpcchiwater;
-               ISP_UNLOCK(isp);
-               retval = 0;
-               break;
-       }
-       case ISP_CLR_STATS:
-               ISP_LOCK(isp);
-               isp->isp_intcnt = 0;
-               isp->isp_intbogus = 0;
-               isp->isp_intmboxc = 0;
-               isp->isp_intoasync = 0;
-               isp->isp_rsltccmplt = 0;
-               isp->isp_fphccmplt = 0;
-               isp->isp_rscchiwater = 0;
-               isp->isp_fpcchiwater = 0;
-               ISP_UNLOCK(isp);
-               retval = 0;
-               break;
        case ISP_SDBLEV:
        {
                int olddblev = isp->isp_dblev;
@@ -366,6 +332,54 @@
                ISP_UNLOCK(isp);
                break;
        }
+       case ISP_GET_STATS:
+       {
+               isp_stats_t *sp = (isp_stats_t *) addr;
+
+               MEMZERO(sp, sizeof (*sp));
+               sp->isp_stat_version = ISP_STATS_VERSION;
+               sp->isp_type = isp->isp_type;
+               sp->isp_revision = isp->isp_revision;
+               ISP_LOCK(isp);
+               sp->isp_stats[ISP_INTCNT] = isp->isp_intcnt;
+               sp->isp_stats[ISP_INTBOGUS] = isp->isp_intbogus;
+               sp->isp_stats[ISP_INTMBOXC] = isp->isp_intmboxc;
+               sp->isp_stats[ISP_INGOASYNC] = isp->isp_intoasync;
+               sp->isp_stats[ISP_RSLTCCMPLT] = isp->isp_rsltccmplt;
+               sp->isp_stats[ISP_FPHCCMCPLT] = isp->isp_fphccmplt;
+               sp->isp_stats[ISP_RSCCHIWAT] = isp->isp_rscchiwater;
+               sp->isp_stats[ISP_FPCCHIWAT] = isp->isp_fpcchiwater;
+               ISP_UNLOCK(isp);
+               retval = 0;
+               break;
+       }
+       case ISP_CLR_STATS:
+               ISP_LOCK(isp);
+               isp->isp_intcnt = 0;
+               isp->isp_intbogus = 0;
+               isp->isp_intmboxc = 0;
+               isp->isp_intoasync = 0;
+               isp->isp_rsltccmplt = 0;
+               isp->isp_fphccmplt = 0;
+               isp->isp_rscchiwater = 0;
+               isp->isp_fpcchiwater = 0;
+               ISP_UNLOCK(isp);
+               retval = 0;
+               break;
+       case ISP_FC_GETHINFO:
+       {
+               struct isp_hba_device *hba = (struct isp_hba_device *) addr;
+               MEMZERO(hba, sizeof (*hba));
+               ISP_LOCK(isp);
+               hba->fc_speed = FCPARAM(isp)->isp_gbspeed;
+               hba->fc_scsi_supported = 1;
+               hba->fc_topology = FCPARAM(isp)->isp_topo + 1;
+               hba->fc_loopid = FCPARAM(isp)->isp_loopid;
+               hba->active_node_wwn = FCPARAM(isp)->isp_nodewwn;
+               hba->active_port_wwn = FCPARAM(isp)->isp_portwwn;
+               ISP_UNLOCK(isp);
+               break;
+       }
        case SCBUSIORESET:
                ISP_LOCK(isp);
                if (isp_control(isp, ISPCTL_RESET_BUS, &chan->chan_channel))



Home | Main Index | Thread Index | Old Index