aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/sgi-xp/xpnet.c
diff options
context:
space:
mode:
authorDean Nelson <dcn@sgi.com>2008-07-30 01:34:05 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-30 12:41:49 -0400
commit908787db9b95f548270af18d83d62b9d2020ca10 (patch)
tree7fd4837accae2af478af95618357f106d04c265e /drivers/misc/sgi-xp/xpnet.c
parentbc63d387e4f5dbbe4ea0c5ade862c38073fd7fa3 (diff)
sgi-xp: create a common xp_remote_memcpy() function
Create a common remote memcpy function that maps to what the hardware booted supports. Signed-off-by: Dean Nelson <dcn@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-xp/xpnet.c')
-rw-r--r--drivers/misc/sgi-xp/xpnet.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/misc/sgi-xp/xpnet.c b/drivers/misc/sgi-xp/xpnet.c
index cc252f201b25..9c540eb1847d 100644
--- a/drivers/misc/sgi-xp/xpnet.c
+++ b/drivers/misc/sgi-xp/xpnet.c
@@ -32,7 +32,6 @@
32#include <linux/mii.h> 32#include <linux/mii.h>
33#include <linux/smp.h> 33#include <linux/smp.h>
34#include <linux/string.h> 34#include <linux/string.h>
35#include <asm/sn/bte.h>
36#include <asm/sn/io.h> 35#include <asm/sn/io.h>
37#include <asm/sn/sn_sal.h> 36#include <asm/sn/sn_sal.h>
38#include <asm/atomic.h> 37#include <asm/atomic.h>
@@ -169,7 +168,7 @@ static void
169xpnet_receive(short partid, int channel, struct xpnet_message *msg) 168xpnet_receive(short partid, int channel, struct xpnet_message *msg)
170{ 169{
171 struct sk_buff *skb; 170 struct sk_buff *skb;
172 bte_result_t bret; 171 enum xp_retval ret;
173 struct xpnet_dev_private *priv = 172 struct xpnet_dev_private *priv =
174 (struct xpnet_dev_private *)xpnet_device->priv; 173 (struct xpnet_dev_private *)xpnet_device->priv;
175 174
@@ -201,7 +200,7 @@ xpnet_receive(short partid, int channel, struct xpnet_message *msg)
201 200
202 /* 201 /*
203 * The allocated skb has some reserved space. 202 * The allocated skb has some reserved space.
204 * In order to use bte_copy, we need to get the 203 * In order to use xp_remote_memcpy(), we need to get the
205 * skb->data pointer moved forward. 204 * skb->data pointer moved forward.
206 */ 205 */
207 skb_reserve(skb, (L1_CACHE_BYTES - ((u64)skb->data & 206 skb_reserve(skb, (L1_CACHE_BYTES - ((u64)skb->data &
@@ -227,25 +226,24 @@ xpnet_receive(short partid, int channel, struct xpnet_message *msg)
227 (size_t)msg->embedded_bytes); 226 (size_t)msg->embedded_bytes);
228 } else { 227 } else {
229 dev_dbg(xpnet, "transferring buffer to the skb->data area;\n\t" 228 dev_dbg(xpnet, "transferring buffer to the skb->data area;\n\t"
230 "bte_copy(0x%p, 0x%p, %hu)\n", (void *)msg->buf_pa, 229 "xp_remote_memcpy(0x%p, 0x%p, %hu)\n", (void *)
231 (void *)__pa((u64)skb->data & ~(L1_CACHE_BYTES - 1)), 230 ((u64)skb->data & ~(L1_CACHE_BYTES - 1)),
232 msg->size); 231 (void *)msg->buf_pa, msg->size);
233 232
234 bret = bte_copy(msg->buf_pa, 233 ret = xp_remote_memcpy((void *)((u64)skb->data &
235 __pa((u64)skb->data & ~(L1_CACHE_BYTES - 1)), 234 ~(L1_CACHE_BYTES - 1)),
236 msg->size, (BTE_NOTIFY | BTE_WACQUIRE), NULL); 235 (void *)msg->buf_pa, msg->size);
237 236
238 if (bret != BTE_SUCCESS) { 237 if (ret != xpSuccess) {
239 /* 238 /*
240 * >>> Need better way of cleaning skb. Currently skb 239 * >>> Need better way of cleaning skb. Currently skb
241 * >>> appears in_use and we can't just call 240 * >>> appears in_use and we can't just call
242 * >>> dev_kfree_skb. 241 * >>> dev_kfree_skb.
243 */ 242 */
244 dev_err(xpnet, "bte_copy(0x%p, 0x%p, 0x%hx) returned " 243 dev_err(xpnet, "xp_remote_memcpy(0x%p, 0x%p, 0x%hx) "
245 "error=0x%x\n", (void *)msg->buf_pa, 244 "returned error=0x%x\n", (void *)
246 (void *)__pa((u64)skb->data & 245 ((u64)skb->data & ~(L1_CACHE_BYTES - 1)),
247 ~(L1_CACHE_BYTES - 1)), 246 (void *)msg->buf_pa, msg->size, ret);
248 msg->size, bret);
249 247
250 xpc_received(partid, channel, (void *)msg); 248 xpc_received(partid, channel, (void *)msg);
251 249