diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2007-03-15 17:44:45 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2007-04-18 23:20:53 -0400 |
commit | 946db67fbf836af30835d610b914cdde0cf467f8 (patch) | |
tree | 9a1c5839fceffb3d576fe9b8cd9140e05b0b6abd /drivers/infiniband | |
parent | a89875fc7e23ec91561bc3742df3bd5d12b376b4 (diff) |
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 <dave.olson@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_common.h | 2 | ||||
-rw-r--r-- | 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 54139d398181..a41367803529 100644 --- a/drivers/infiniband/hw/ipath/ipath_common.h +++ b/drivers/infiniband/hw/ipath/ipath_common.h | |||
@@ -78,6 +78,8 @@ | |||
78 | #define IPATH_IB_LINKINIT 3 | 78 | #define IPATH_IB_LINKINIT 3 |
79 | #define IPATH_IB_LINKDOWN_SLEEP 4 | 79 | #define IPATH_IB_LINKDOWN_SLEEP 4 |
80 | #define IPATH_IB_LINKDOWN_DISABLE 5 | 80 | #define IPATH_IB_LINKDOWN_DISABLE 5 |
81 | #define IPATH_IB_LINK_LOOPBACK 6 /* enable local loopback */ | ||
82 | #define IPATH_IB_LINK_EXTERNAL 7 /* normal, disable local loopback */ | ||
81 | 83 | ||
82 | /* | 84 | /* |
83 | * stats maintained by the driver. For now, at least, this is global | 85 | * 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 ae7f21a0cdc0..c2fe5417ff45 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) | |||
1662 | lstate = IPATH_LINKACTIVE; | 1662 | lstate = IPATH_LINKACTIVE; |
1663 | break; | 1663 | break; |
1664 | 1664 | ||
1665 | case IPATH_IB_LINK_LOOPBACK: | ||
1666 | dev_info(&dd->pcidev->dev, "Enabling IB local loopback\n"); | ||
1667 | dd->ipath_ibcctrl |= INFINIPATH_IBCC_LOOPBACK; | ||
1668 | ipath_write_kreg(dd, dd->ipath_kregs->kr_ibcctrl, | ||
1669 | dd->ipath_ibcctrl); | ||
1670 | ret = 0; | ||
1671 | goto bail; // no state change to wait for | ||
1672 | |||
1673 | case IPATH_IB_LINK_EXTERNAL: | ||
1674 | dev_info(&dd->pcidev->dev, "Disabling IB local loopback (normal)\n"); | ||
1675 | dd->ipath_ibcctrl &= ~INFINIPATH_IBCC_LOOPBACK; | ||
1676 | ipath_write_kreg(dd, dd->ipath_kregs->kr_ibcctrl, | ||
1677 | dd->ipath_ibcctrl); | ||
1678 | ret = 0; | ||
1679 | goto bail; // no state change to wait for | ||
1680 | |||
1665 | default: | 1681 | default: |
1666 | ipath_dbg("Invalid linkstate 0x%x requested\n", newstate); | 1682 | ipath_dbg("Invalid linkstate 0x%x requested\n", newstate); |
1667 | ret = -EINVAL; | 1683 | ret = -EINVAL; |