aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_layer.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-10 14:47:26 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-10 14:47:26 -0400
commitf0cd91a68acdc9b49d7f6738b514a426da627649 (patch)
tree8ad73564015794197583b094217ae0a71e71e753 /drivers/infiniband/hw/ipath/ipath_layer.c
parent60eef25701d25e99c991dd0f4a9f3832a0c3ad3e (diff)
parent128e6ced247cda88f96fa9f2e4ba8b2c4a681560 (diff)
Merge ../linux-2.6
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_layer.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_layer.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_layer.c b/drivers/infiniband/hw/ipath/ipath_layer.c
index 2cabf6340572..9ec4ac77b87f 100644
--- a/drivers/infiniband/hw/ipath/ipath_layer.c
+++ b/drivers/infiniband/hw/ipath/ipath_layer.c
@@ -46,13 +46,15 @@
46/* Acquire before ipath_devs_lock. */ 46/* Acquire before ipath_devs_lock. */
47static DEFINE_MUTEX(ipath_layer_mutex); 47static DEFINE_MUTEX(ipath_layer_mutex);
48 48
49static int ipath_verbs_registered;
50
49u16 ipath_layer_rcv_opcode; 51u16 ipath_layer_rcv_opcode;
52
50static int (*layer_intr)(void *, u32); 53static int (*layer_intr)(void *, u32);
51static int (*layer_rcv)(void *, void *, struct sk_buff *); 54static int (*layer_rcv)(void *, void *, struct sk_buff *);
52static int (*layer_rcv_lid)(void *, void *); 55static int (*layer_rcv_lid)(void *, void *);
53static int (*verbs_piobufavail)(void *); 56static int (*verbs_piobufavail)(void *);
54static void (*verbs_rcv)(void *, void *, void *, u32); 57static void (*verbs_rcv)(void *, void *, void *, u32);
55int ipath_verbs_registered;
56 58
57static void *(*layer_add_one)(int, struct ipath_devdata *); 59static void *(*layer_add_one)(int, struct ipath_devdata *);
58static void (*layer_remove_one)(void *); 60static void (*layer_remove_one)(void *);
@@ -586,6 +588,8 @@ void ipath_verbs_unregister(void)
586 verbs_rcv = NULL; 588 verbs_rcv = NULL;
587 verbs_timer_cb = NULL; 589 verbs_timer_cb = NULL;
588 590
591 ipath_verbs_registered = 0;
592
589 mutex_unlock(&ipath_layer_mutex); 593 mutex_unlock(&ipath_layer_mutex);
590} 594}
591 595
@@ -868,12 +872,13 @@ static void copy_io(u32 __iomem *piobuf, struct ipath_sge_state *ss,
868 update_sge(ss, len); 872 update_sge(ss, len);
869 length -= len; 873 length -= len;
870 } 874 }
875 /* Update address before sending packet. */
876 update_sge(ss, length);
871 /* must flush early everything before trigger word */ 877 /* must flush early everything before trigger word */
872 ipath_flush_wc(); 878 ipath_flush_wc();
873 __raw_writel(last, piobuf); 879 __raw_writel(last, piobuf);
874 /* be sure trigger word is written */ 880 /* be sure trigger word is written */
875 ipath_flush_wc(); 881 ipath_flush_wc();
876 update_sge(ss, length);
877} 882}
878 883
879/** 884/**
@@ -939,17 +944,18 @@ int ipath_verbs_send(struct ipath_devdata *dd, u32 hdrwords,
939 if (likely(ss->num_sge == 1 && len <= ss->sge.length && 944 if (likely(ss->num_sge == 1 && len <= ss->sge.length &&
940 !((unsigned long)ss->sge.vaddr & (sizeof(u32) - 1)))) { 945 !((unsigned long)ss->sge.vaddr & (sizeof(u32) - 1)))) {
941 u32 w; 946 u32 w;
947 u32 *addr = (u32 *) ss->sge.vaddr;
942 948
949 /* Update address before sending packet. */
950 update_sge(ss, len);
943 /* Need to round up for the last dword in the packet. */ 951 /* Need to round up for the last dword in the packet. */
944 w = (len + 3) >> 2; 952 w = (len + 3) >> 2;
945 __iowrite32_copy(piobuf, ss->sge.vaddr, w - 1); 953 __iowrite32_copy(piobuf, addr, w - 1);
946 /* must flush early everything before trigger word */ 954 /* must flush early everything before trigger word */
947 ipath_flush_wc(); 955 ipath_flush_wc();
948 __raw_writel(((u32 *) ss->sge.vaddr)[w - 1], 956 __raw_writel(addr[w - 1], piobuf + w - 1);
949 piobuf + w - 1);
950 /* be sure trigger word is written */ 957 /* be sure trigger word is written */
951 ipath_flush_wc(); 958 ipath_flush_wc();
952 update_sge(ss, len);
953 ret = 0; 959 ret = 0;
954 goto bail; 960 goto bail;
955 } 961 }