aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_driver.c
diff options
context:
space:
mode:
authorRalph Campbell <ralph.campbell@qlogic.com>2007-12-20 05:43:23 -0500
committerRoland Dreier <rolandd@cisco.com>2008-01-25 17:15:35 -0500
commitc59a80aca0bfc491d90534ed5606d5493eca24a3 (patch)
tree181af3a515feb82e1c77b1d8bc5ec460485d44df /drivers/infiniband/hw/ipath/ipath_driver.c
parentd65708f3a766116662ff9bac81088d52a49901f4 (diff)
IB/ipath: kreceive uses portdata rather than devdata
kreceive is now portdata * instead of devdata * and other kreceive related cleanups.... 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_driver.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_driver.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index 5a5fbdf66ac..7c69090f6bd 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -1104,13 +1104,14 @@ static void ipath_rcv_hdrerr(struct ipath_devdata *dd,
1104 1104
1105/* 1105/*
1106 * ipath_kreceive - receive a packet 1106 * ipath_kreceive - receive a packet
1107 * @dd: the infinipath device 1107 * @pd: the infinipath port
1108 * 1108 *
1109 * called from interrupt handler for errors or receive interrupt 1109 * called from interrupt handler for errors or receive interrupt
1110 */ 1110 */
1111void ipath_kreceive(struct ipath_devdata *dd) 1111void ipath_kreceive(struct ipath_portdata *pd)
1112{ 1112{
1113 u64 *rc; 1113 u64 *rc;
1114 struct ipath_devdata *dd = pd->port_dd;
1114 void *ebuf; 1115 void *ebuf;
1115 const u32 rsize = dd->ipath_rcvhdrentsize; /* words */ 1116 const u32 rsize = dd->ipath_rcvhdrentsize; /* words */
1116 const u32 maxcnt = dd->ipath_rcvhdrcnt * rsize; /* words */ 1117 const u32 maxcnt = dd->ipath_rcvhdrcnt * rsize; /* words */
@@ -1125,8 +1126,8 @@ void ipath_kreceive(struct ipath_devdata *dd)
1125 goto bail; 1126 goto bail;
1126 } 1127 }
1127 1128
1128 l = dd->ipath_port0head; 1129 l = pd->port_head;
1129 hdrqtail = (u32) le64_to_cpu(*dd->ipath_hdrqtailptr); 1130 hdrqtail = ipath_get_rcvhdrtail(pd);
1130 if (l == hdrqtail) 1131 if (l == hdrqtail)
1131 goto bail; 1132 goto bail;
1132 1133
@@ -1135,7 +1136,7 @@ reloop:
1135 u32 qp; 1136 u32 qp;
1136 u8 *bthbytes; 1137 u8 *bthbytes;
1137 1138
1138 rc = (u64 *) (dd->ipath_pd[0]->port_rcvhdrq + (l << 2)); 1139 rc = (u64 *) (pd->port_rcvhdrq + (l << 2));
1139 hdr = (struct ipath_message_header *)&rc[1]; 1140 hdr = (struct ipath_message_header *)&rc[1];
1140 /* 1141 /*
1141 * could make a network order version of IPATH_KD_QP, and 1142 * could make a network order version of IPATH_KD_QP, and
@@ -1245,7 +1246,7 @@ reloop:
1245 * earlier packets, we "almost" guarantee we have covered 1246 * earlier packets, we "almost" guarantee we have covered
1246 * that case. 1247 * that case.
1247 */ 1248 */
1248 u32 hqtail = (u32)le64_to_cpu(*dd->ipath_hdrqtailptr); 1249 u32 hqtail = ipath_get_rcvhdrtail(pd);
1249 if (hqtail != hdrqtail) { 1250 if (hqtail != hdrqtail) {
1250 hdrqtail = hqtail; 1251 hdrqtail = hqtail;
1251 reloop = 1; /* loop 1 extra time at most */ 1252 reloop = 1; /* loop 1 extra time at most */
@@ -1255,7 +1256,7 @@ reloop:
1255 1256
1256 pkttot += i; 1257 pkttot += i;
1257 1258
1258 dd->ipath_port0head = l; 1259 pd->port_head = l;
1259 1260
1260 if (pkttot > ipath_stats.sps_maxpkts_call) 1261 if (pkttot > ipath_stats.sps_maxpkts_call)
1261 ipath_stats.sps_maxpkts_call = pkttot; 1262 ipath_stats.sps_maxpkts_call = pkttot;
@@ -1605,7 +1606,8 @@ int ipath_create_rcvhdrq(struct ipath_devdata *dd,
1605 1606
1606 /* clear for security and sanity on each use */ 1607 /* clear for security and sanity on each use */
1607 memset(pd->port_rcvhdrq, 0, pd->port_rcvhdrq_size); 1608 memset(pd->port_rcvhdrq, 0, pd->port_rcvhdrq_size);
1608 memset(pd->port_rcvhdrtail_kvaddr, 0, PAGE_SIZE); 1609 if (pd->port_rcvhdrtail_kvaddr)
1610 memset(pd->port_rcvhdrtail_kvaddr, 0, PAGE_SIZE);
1609 1611
1610 /* 1612 /*
1611 * tell chip each time we init it, even if we are re-using previous 1613 * tell chip each time we init it, even if we are re-using previous