aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/fec.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/fec.c')
-rw-r--r--drivers/net/fec.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index d4b98074b1b..c9fd82d3a80 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -285,6 +285,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
285{ 285{
286 struct fec_enet_private *fep = netdev_priv(dev); 286 struct fec_enet_private *fep = netdev_priv(dev);
287 struct bufdesc *bdp; 287 struct bufdesc *bdp;
288 void *bufaddr;
288 unsigned short status; 289 unsigned short status;
289 unsigned long flags; 290 unsigned long flags;
290 291
@@ -312,7 +313,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
312 status &= ~BD_ENET_TX_STATS; 313 status &= ~BD_ENET_TX_STATS;
313 314
314 /* Set buffer length and buffer pointer */ 315 /* Set buffer length and buffer pointer */
315 bdp->cbd_bufaddr = __pa(skb->data); 316 bufaddr = skb->data;
316 bdp->cbd_datlen = skb->len; 317 bdp->cbd_datlen = skb->len;
317 318
318 /* 319 /*
@@ -320,11 +321,11 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
320 * 4-byte boundaries. Use bounce buffers to copy data 321 * 4-byte boundaries. Use bounce buffers to copy data
321 * and get it aligned. Ugh. 322 * and get it aligned. Ugh.
322 */ 323 */
323 if (bdp->cbd_bufaddr & FEC_ALIGNMENT) { 324 if (((unsigned long) bufaddr) & FEC_ALIGNMENT) {
324 unsigned int index; 325 unsigned int index;
325 index = bdp - fep->tx_bd_base; 326 index = bdp - fep->tx_bd_base;
326 memcpy(fep->tx_bounce[index], (void *)skb->data, skb->len); 327 memcpy(fep->tx_bounce[index], (void *)skb->data, skb->len);
327 bdp->cbd_bufaddr = __pa(fep->tx_bounce[index]); 328 bufaddr = fep->tx_bounce[index];
328 } 329 }
329 330
330 /* Save skb pointer */ 331 /* Save skb pointer */
@@ -336,7 +337,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
336 /* Push the data cache so the CPM does not get stale memory 337 /* Push the data cache so the CPM does not get stale memory
337 * data. 338 * data.
338 */ 339 */
339 bdp->cbd_bufaddr = dma_map_single(&dev->dev, skb->data, 340 bdp->cbd_bufaddr = dma_map_single(&dev->dev, bufaddr,
340 FEC_ENET_TX_FRSIZE, DMA_TO_DEVICE); 341 FEC_ENET_TX_FRSIZE, DMA_TO_DEVICE);
341 342
342 /* Send it on its way. Tell FEC it's ready, interrupt when done, 343 /* Send it on its way. Tell FEC it's ready, interrupt when done,