aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_kernel.h
diff options
context:
space:
mode:
authorRalph Campbell <ralph.campbell@qlogic.com>2008-04-17 00:09:29 -0400
committerRoland Dreier <rolandd@cisco.com>2008-04-17 00:09:29 -0400
commit9355fb6a064723c71e80e9c78de3140b43bfb52d (patch)
treedd0fffeb6633aed6cb2c946a05bf33e05f2e9436 /drivers/infiniband/hw/ipath/ipath_kernel.h
parent2ba3f56eb402672ff83601b5990b219d39577636 (diff)
IB/ipath: Add support for 7220 receive queue changes
Newer HCAs have a HW option to write a sequence number to each receive queue entry and avoid a separate DMA of the tail register to memory. This patch adds support for these changes. Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_kernel.h')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_kernel.h53
1 files changed, 37 insertions, 16 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h
index 9867c3f80ec2..2447e85bf4f8 100644
--- a/drivers/infiniband/hw/ipath/ipath_kernel.h
+++ b/drivers/infiniband/hw/ipath/ipath_kernel.h
@@ -175,6 +175,8 @@ struct ipath_portdata {
175 u16 poll_type; 175 u16 poll_type;
176 /* port rcvhdrq head offset */ 176 /* port rcvhdrq head offset */
177 u32 port_head; 177 u32 port_head;
178 /* receive packet sequence counter */
179 u32 port_seq_cnt;
178}; 180};
179 181
180struct sk_buff; 182struct sk_buff;
@@ -224,11 +226,6 @@ struct ipath_devdata {
224 unsigned long ipath_physaddr; 226 unsigned long ipath_physaddr;
225 /* base of memory alloced for ipath_kregbase, for free */ 227 /* base of memory alloced for ipath_kregbase, for free */
226 u64 *ipath_kregalloc; 228 u64 *ipath_kregalloc;
227 /*
228 * virtual address where port0 rcvhdrqtail updated for this unit.
229 * only written to by the chip, not the driver.
230 */
231 volatile __le64 *ipath_hdrqtailptr;
232 /* ipath_cfgports pointers */ 229 /* ipath_cfgports pointers */
233 struct ipath_portdata **ipath_pd; 230 struct ipath_portdata **ipath_pd;
234 /* sk_buffs used by port 0 eager receive queue */ 231 /* sk_buffs used by port 0 eager receive queue */
@@ -286,6 +283,7 @@ struct ipath_devdata {
286 /* per chip actions needed for IB Link up/down changes */ 283 /* per chip actions needed for IB Link up/down changes */
287 int (*ipath_f_ib_updown)(struct ipath_devdata *, int, u64); 284 int (*ipath_f_ib_updown)(struct ipath_devdata *, int, u64);
288 285
286 unsigned ipath_lastegr_idx;
289 struct ipath_ibdev *verbs_dev; 287 struct ipath_ibdev *verbs_dev;
290 struct timer_list verbs_timer; 288 struct timer_list verbs_timer;
291 /* total dwords sent (summed from counter) */ 289 /* total dwords sent (summed from counter) */
@@ -593,14 +591,6 @@ struct ipath_devdata {
593 u8 ipath_minrev; 591 u8 ipath_minrev;
594 /* board rev, from ipath_revision */ 592 /* board rev, from ipath_revision */
595 u8 ipath_boardrev; 593 u8 ipath_boardrev;
596
597 u8 ipath_r_portenable_shift;
598 u8 ipath_r_intravail_shift;
599 u8 ipath_r_tailupd_shift;
600 u8 ipath_r_portcfg_shift;
601
602 /* unit # of this chip, if present */
603 int ipath_unit;
604 /* saved for restore after reset */ 594 /* saved for restore after reset */
605 u8 ipath_pci_cacheline; 595 u8 ipath_pci_cacheline;
606 /* LID mask control */ 596 /* LID mask control */
@@ -616,6 +606,14 @@ struct ipath_devdata {
616 /* Rx Polarity inversion (compensate for ~tx on partner) */ 606 /* Rx Polarity inversion (compensate for ~tx on partner) */
617 u8 ipath_rx_pol_inv; 607 u8 ipath_rx_pol_inv;
618 608
609 u8 ipath_r_portenable_shift;
610 u8 ipath_r_intravail_shift;
611 u8 ipath_r_tailupd_shift;
612 u8 ipath_r_portcfg_shift;
613
614 /* unit # of this chip, if present */
615 int ipath_unit;
616
619 /* local link integrity counter */ 617 /* local link integrity counter */
620 u32 ipath_lli_counter; 618 u32 ipath_lli_counter;
621 /* local link integrity errors */ 619 /* local link integrity errors */
@@ -645,8 +643,8 @@ struct ipath_devdata {
645 * Below should be computable from number of ports, 643 * Below should be computable from number of ports,
646 * since they are never modified. 644 * since they are never modified.
647 */ 645 */
648 u32 ipath_i_rcvavail_mask; 646 u64 ipath_i_rcvavail_mask;
649 u32 ipath_i_rcvurg_mask; 647 u64 ipath_i_rcvurg_mask;
650 u16 ipath_i_rcvurg_shift; 648 u16 ipath_i_rcvurg_shift;
651 u16 ipath_i_rcvavail_shift; 649 u16 ipath_i_rcvavail_shift;
652 650
@@ -835,6 +833,8 @@ void ipath_hol_event(unsigned long);
835#define IPATH_LINKUNK 0x400 833#define IPATH_LINKUNK 0x400
836 /* Write combining flush needed for PIO */ 834 /* Write combining flush needed for PIO */
837#define IPATH_PIO_FLUSH_WC 0x1000 835#define IPATH_PIO_FLUSH_WC 0x1000
836 /* DMA Receive tail pointer */
837#define IPATH_NODMA_RTAIL 0x2000
838 /* no IB cable, or no device on IB cable */ 838 /* no IB cable, or no device on IB cable */
839#define IPATH_NOCABLE 0x4000 839#define IPATH_NOCABLE 0x4000
840 /* Supports port zero per packet receive interrupts via 840 /* Supports port zero per packet receive interrupts via
@@ -845,9 +845,9 @@ void ipath_hol_event(unsigned long);
845 /* packet/word counters are 32 bit, else those 4 counters 845 /* packet/word counters are 32 bit, else those 4 counters
846 * are 64bit */ 846 * are 64bit */
847#define IPATH_32BITCOUNTERS 0x20000 847#define IPATH_32BITCOUNTERS 0x20000
848 /* can miss port0 rx interrupts */
849 /* Interrupt register is 64 bits */ 848 /* Interrupt register is 64 bits */
850#define IPATH_INTREG_64 0x40000 849#define IPATH_INTREG_64 0x40000
850 /* can miss port0 rx interrupts */
851#define IPATH_DISABLED 0x80000 /* administratively disabled */ 851#define IPATH_DISABLED 0x80000 /* administratively disabled */
852 /* Use GPIO interrupts for new counters */ 852 /* Use GPIO interrupts for new counters */
853#define IPATH_GPIO_ERRINTRS 0x100000 853#define IPATH_GPIO_ERRINTRS 0x100000
@@ -1035,6 +1035,27 @@ static inline u32 ipath_get_rcvhdrtail(const struct ipath_portdata *pd)
1035 pd->port_rcvhdrtail_kvaddr)); 1035 pd->port_rcvhdrtail_kvaddr));
1036} 1036}
1037 1037
1038static inline u32 ipath_get_hdrqtail(const struct ipath_portdata *pd)
1039{
1040 const struct ipath_devdata *dd = pd->port_dd;
1041 u32 hdrqtail;
1042
1043 if (dd->ipath_flags & IPATH_NODMA_RTAIL) {
1044 __le32 *rhf_addr;
1045 u32 seq;
1046
1047 rhf_addr = (__le32 *) pd->port_rcvhdrq +
1048 pd->port_head + dd->ipath_rhf_offset;
1049 seq = ipath_hdrget_seq(rhf_addr);
1050 hdrqtail = pd->port_head;
1051 if (seq == pd->port_seq_cnt)
1052 hdrqtail++;
1053 } else
1054 hdrqtail = ipath_get_rcvhdrtail(pd);
1055
1056 return hdrqtail;
1057}
1058
1038static inline u64 ipath_read_ireg(const struct ipath_devdata *dd, ipath_kreg r) 1059static inline u64 ipath_read_ireg(const struct ipath_devdata *dd, ipath_kreg r)
1039{ 1060{
1040 return (dd->ipath_flags & IPATH_INTREG_64) ? 1061 return (dd->ipath_flags & IPATH_INTREG_64) ?