Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=946db67fbf836af30835d610b914cdde0cf467f8
Commit:     946db67fbf836af30835d610b914cdde0cf467f8
Parent:     a89875fc7e23ec91561bc3742df3bd5d12b376b4
Author:     Bryan O'Sullivan <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 15 14:44:45 2007 -0700
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Wed Apr 18 20:20:53 2007 -0700

    IB/ipath: Add ability to set and clear IB local loopback
    
    This is a sticky state.  It is useful for diagnosing problems with
    boards versus cable/switch problems.
    
    Signed-off-by: Dave Olson <[EMAIL PROTECTED]>
    Signed-off-by: Bryan O'Sullivan <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ipath/ipath_common.h |    2 ++
 drivers/infiniband/hw/ipath/ipath_driver.c |   16 ++++++++++++++++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/ipath/ipath_common.h 
b/drivers/infiniband/hw/ipath/ipath_common.h
index 54139d3..a413678 100644
--- a/drivers/infiniband/hw/ipath/ipath_common.h
+++ b/drivers/infiniband/hw/ipath/ipath_common.h
@@ -78,6 +78,8 @@
 #define IPATH_IB_LINKINIT              3
 #define IPATH_IB_LINKDOWN_SLEEP                4
 #define IPATH_IB_LINKDOWN_DISABLE      5
+#define IPATH_IB_LINK_LOOPBACK 6 /* enable local loopback */
+#define IPATH_IB_LINK_EXTERNAL 7 /* normal, disable local loopback */
 
 /*
  * stats maintained by the driver.  For now, at least, this is global
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c 
b/drivers/infiniband/hw/ipath/ipath_driver.c
index ae7f21a..c2fe541 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -1662,6 +1662,22 @@ int ipath_set_linkstate(struct ipath_devdata *dd, u8 
newstate)
                lstate = IPATH_LINKACTIVE;
                break;
 
+       case IPATH_IB_LINK_LOOPBACK:
+               dev_info(&dd->pcidev->dev, "Enabling IB local loopback\n");
+               dd->ipath_ibcctrl |= INFINIPATH_IBCC_LOOPBACK;
+               ipath_write_kreg(dd, dd->ipath_kregs->kr_ibcctrl,
+                                dd->ipath_ibcctrl);
+               ret = 0;
+               goto bail; // no state change to wait for
+
+       case IPATH_IB_LINK_EXTERNAL:
+               dev_info(&dd->pcidev->dev, "Disabling IB local loopback 
(normal)\n");
+               dd->ipath_ibcctrl &= ~INFINIPATH_IBCC_LOOPBACK;
+               ipath_write_kreg(dd, dd->ipath_kregs->kr_ibcctrl,
+                                dd->ipath_ibcctrl);
+               ret = 0;
+               goto bail; // no state change to wait for
+
        default:
                ipath_dbg("Invalid linkstate 0x%x requested\n", newstate);
                ret = -EINVAL;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to