diff options
author | Arthur Jones <arthur.jones@qlogic.com> | 2008-01-07 00:12:38 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-01-25 17:15:40 -0500 |
commit | 7da0498e7f0eb022107811b9d41697298329f6b4 (patch) | |
tree | 935cd0b8069561de4bb12b0a10eb254b0b9cf7f8 /drivers/infiniband | |
parent | 4ea61b548bc93fb87cec6f52059851076e2ff54d (diff) |
IB/ipath: Add ipath_read_ireg() abstraction
Different chips have different width interrupt status registers, so add
a flag and accessor function to decide which width register read to use.
Signed-off-by: Arthur Jones <arthur.jones@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_intr.c | 4 | ||||
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_kernel.h | 8 |
2 files changed, 10 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_intr.c b/drivers/infiniband/hw/ipath/ipath_intr.c index ddc0a19c5eee..92e58c921522 100644 --- a/drivers/infiniband/hw/ipath/ipath_intr.c +++ b/drivers/infiniband/hw/ipath/ipath_intr.c | |||
@@ -883,7 +883,7 @@ static noinline void ipath_bad_intr(struct ipath_devdata *dd, u32 *unexpectp) | |||
883 | dd->ipath_f_free_irq(dd); | 883 | dd->ipath_f_free_irq(dd); |
884 | } | 884 | } |
885 | } | 885 | } |
886 | if (ipath_read_kreg32(dd, dd->ipath_kregs->kr_intmask)) { | 886 | if (ipath_read_ireg(dd, dd->ipath_kregs->kr_intmask)) { |
887 | ipath_dev_err(dd, "%u unexpected interrupts, " | 887 | ipath_dev_err(dd, "%u unexpected interrupts, " |
888 | "disabling interrupts completely\n", | 888 | "disabling interrupts completely\n", |
889 | *unexpectp); | 889 | *unexpectp); |
@@ -1034,7 +1034,7 @@ irqreturn_t ipath_intr(int irq, void *data) | |||
1034 | goto bail; | 1034 | goto bail; |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | istat = ipath_read_kreg32(dd, dd->ipath_kregs->kr_intstatus); | 1037 | istat = ipath_read_ireg(dd, dd->ipath_kregs->kr_intstatus); |
1038 | 1038 | ||
1039 | if (unlikely(!istat)) { | 1039 | if (unlikely(!istat)) { |
1040 | ipath_stats.sps_nullintr++; | 1040 | ipath_stats.sps_nullintr++; |
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h index e07df0068312..c47290422457 100644 --- a/drivers/infiniband/hw/ipath/ipath_kernel.h +++ b/drivers/infiniband/hw/ipath/ipath_kernel.h | |||
@@ -753,6 +753,8 @@ int ipath_set_rx_pol_inv(struct ipath_devdata *dd, u8 new_pol_inv); | |||
753 | * are 64bit */ | 753 | * are 64bit */ |
754 | #define IPATH_32BITCOUNTERS 0x20000 | 754 | #define IPATH_32BITCOUNTERS 0x20000 |
755 | /* can miss port0 rx interrupts */ | 755 | /* can miss port0 rx interrupts */ |
756 | /* Interrupt register is 64 bits */ | ||
757 | #define IPATH_INTREG_64 0x40000 | ||
756 | #define IPATH_DISABLED 0x80000 /* administratively disabled */ | 758 | #define IPATH_DISABLED 0x80000 /* administratively disabled */ |
757 | /* Use GPIO interrupts for new counters */ | 759 | /* Use GPIO interrupts for new counters */ |
758 | #define IPATH_GPIO_ERRINTRS 0x100000 | 760 | #define IPATH_GPIO_ERRINTRS 0x100000 |
@@ -958,6 +960,12 @@ static inline u32 ipath_get_rcvhdrtail(const struct ipath_portdata *pd) | |||
958 | pd->port_rcvhdrtail_kvaddr)); | 960 | pd->port_rcvhdrtail_kvaddr)); |
959 | } | 961 | } |
960 | 962 | ||
963 | static inline u64 ipath_read_ireg(const struct ipath_devdata *dd, ipath_kreg r) | ||
964 | { | ||
965 | return (dd->ipath_flags & IPATH_INTREG_64) ? | ||
966 | ipath_read_kreg64(dd, r) : ipath_read_kreg32(dd, r); | ||
967 | } | ||
968 | |||
961 | /* | 969 | /* |
962 | * sysfs interface. | 970 | * sysfs interface. |
963 | */ | 971 | */ |