]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/infiniband/hw/ipath/ipath_kernel.h
IB/ipath: Add ipath_read_ireg() abstraction
[linux-2.6-omap-h63xx.git] / drivers / infiniband / hw / ipath / ipath_kernel.h
index e07df00683123691391a8e32b62c31d540f0fda7..c472904224578bca556d99b83358b9dcfd79adcd 100644 (file)
@@ -753,6 +753,8 @@ int ipath_set_rx_pol_inv(struct ipath_devdata *dd, u8 new_pol_inv);
                 * are 64bit */
 #define IPATH_32BITCOUNTERS 0x20000
                /* can miss port0 rx interrupts */
+               /* Interrupt register is 64 bits */
+#define IPATH_INTREG_64     0x40000
 #define IPATH_DISABLED      0x80000 /* administratively disabled */
                /* Use GPIO interrupts for new counters */
 #define IPATH_GPIO_ERRINTRS 0x100000
@@ -958,6 +960,12 @@ static inline u32 ipath_get_rcvhdrtail(const struct ipath_portdata *pd)
                                pd->port_rcvhdrtail_kvaddr));
 }
 
+static inline u64 ipath_read_ireg(const struct ipath_devdata *dd, ipath_kreg r)
+{
+       return (dd->ipath_flags & IPATH_INTREG_64) ?
+               ipath_read_kreg64(dd, r) : ipath_read_kreg32(dd, r);
+}
+
 /*
  * sysfs interface.
  */