aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_verbs.c
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2006-09-28 12:00:00 -0400
committerRoland Dreier <rolandd@cisco.com>2006-09-28 14:16:27 -0400
commit2c9446a1d63f1ca570e92f89422595732efedf44 (patch)
tree9b401358de12f9f88e79ac471c5950b61aba45a3 /drivers/infiniband/hw/ipath/ipath_verbs.c
parent9929b0fb0f35f54371e9364bab809bcd753f9d3a (diff)
IB/ipath: Support revision 2 InfiniPath PCIE devices
This also entailed a little GPIO-interrupt general cleanup. Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_verbs.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_verbs.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.c b/drivers/infiniband/hw/ipath/ipath_verbs.c
index a4bf870c5e31..56c01938f714 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs.c
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.c
@@ -898,7 +898,8 @@ int ipath_get_counters(struct ipath_devdata *dd,
898 ipath_snap_cntr(dd, dd->ipath_cregs->cr_erricrccnt) + 898 ipath_snap_cntr(dd, dd->ipath_cregs->cr_erricrccnt) +
899 ipath_snap_cntr(dd, dd->ipath_cregs->cr_errvcrccnt) + 899 ipath_snap_cntr(dd, dd->ipath_cregs->cr_errvcrccnt) +
900 ipath_snap_cntr(dd, dd->ipath_cregs->cr_errlpcrccnt) + 900 ipath_snap_cntr(dd, dd->ipath_cregs->cr_errlpcrccnt) +
901 ipath_snap_cntr(dd, dd->ipath_cregs->cr_badformatcnt); 901 ipath_snap_cntr(dd, dd->ipath_cregs->cr_badformatcnt) +
902 dd->ipath_rxfc_unsupvl_errs;
902 cntrs->port_rcv_remphys_errors = 903 cntrs->port_rcv_remphys_errors =
903 ipath_snap_cntr(dd, dd->ipath_cregs->cr_rcvebpcnt); 904 ipath_snap_cntr(dd, dd->ipath_cregs->cr_rcvebpcnt);
904 cntrs->port_xmit_discards = 905 cntrs->port_xmit_discards =
@@ -911,8 +912,10 @@ int ipath_get_counters(struct ipath_devdata *dd,
911 ipath_snap_cntr(dd, dd->ipath_cregs->cr_pktsendcnt); 912 ipath_snap_cntr(dd, dd->ipath_cregs->cr_pktsendcnt);
912 cntrs->port_rcv_packets = 913 cntrs->port_rcv_packets =
913 ipath_snap_cntr(dd, dd->ipath_cregs->cr_pktrcvcnt); 914 ipath_snap_cntr(dd, dd->ipath_cregs->cr_pktrcvcnt);
914 cntrs->local_link_integrity_errors = dd->ipath_lli_errors; 915 cntrs->local_link_integrity_errors =
915 cntrs->excessive_buffer_overrun_errors = 0; /* XXX */ 916 (dd->ipath_flags & IPATH_GPIO_ERRINTRS) ?
917 dd->ipath_lli_errs : dd->ipath_lli_errors;
918 cntrs->excessive_buffer_overrun_errors = dd->ipath_overrun_thresh_errs;
916 919
917 ret = 0; 920 ret = 0;
918 921
@@ -1380,11 +1383,13 @@ static int enable_timer(struct ipath_devdata *dd)
1380 * processing. 1383 * processing.
1381 */ 1384 */
1382 if (dd->ipath_flags & IPATH_GPIO_INTR) { 1385 if (dd->ipath_flags & IPATH_GPIO_INTR) {
1386 u64 val;
1383 ipath_write_kreg(dd, dd->ipath_kregs->kr_debugportselect, 1387 ipath_write_kreg(dd, dd->ipath_kregs->kr_debugportselect,
1384 0x2074076542310ULL); 1388 0x2074076542310ULL);
1385 /* Enable GPIO bit 2 interrupt */ 1389 /* Enable GPIO bit 2 interrupt */
1386 ipath_write_kreg(dd, dd->ipath_kregs->kr_gpio_mask, 1390 val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_gpio_mask);
1387 (u64) (1 << 2)); 1391 val |= (u64) (1 << IPATH_GPIO_PORT0_BIT);
1392 ipath_write_kreg( dd, dd->ipath_kregs->kr_gpio_mask, val);
1388 } 1393 }
1389 1394
1390 init_timer(&dd->verbs_timer); 1395 init_timer(&dd->verbs_timer);
@@ -1399,8 +1404,17 @@ static int enable_timer(struct ipath_devdata *dd)
1399static int disable_timer(struct ipath_devdata *dd) 1404static int disable_timer(struct ipath_devdata *dd)
1400{ 1405{
1401 /* Disable GPIO bit 2 interrupt */ 1406 /* Disable GPIO bit 2 interrupt */
1402 if (dd->ipath_flags & IPATH_GPIO_INTR) 1407 if (dd->ipath_flags & IPATH_GPIO_INTR) {
1403 ipath_write_kreg(dd, dd->ipath_kregs->kr_gpio_mask, 0); 1408 u64 val;
1409 /* Disable GPIO bit 2 interrupt */
1410 val = ipath_read_kreg64(dd, dd->ipath_kregs->kr_gpio_mask);
1411 val &= ~((u64) (1 << IPATH_GPIO_PORT0_BIT));
1412 ipath_write_kreg( dd, dd->ipath_kregs->kr_gpio_mask, val);
1413 /*
1414 * We might want to undo changes to debugportselect,
1415 * but how?
1416 */
1417 }
1404 1418
1405 del_timer_sync(&dd->verbs_timer); 1419 del_timer_sync(&dd->verbs_timer);
1406 1420