Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156883
b: refs/heads/master
c: 9555b31
h: refs/heads/master
i:
  156881: fdc3fc8
  156879: 231a184
v: v3
  • Loading branch information
Greg Ungerer authored and David S. Miller committed Aug 10, 2009
1 parent 5b6764f commit ad7301b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e84b90ae5eb3c112d1f208964df1d8156a538289
refs/heads/master: 9555b31e8c29d2000e1e1f569f6f242ebd596e47
9 changes: 5 additions & 4 deletions trunk/drivers/net/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct fec_enet_private *fep = netdev_priv(dev);
struct bufdesc *bdp;
void *bufaddr;
unsigned short status;
unsigned long flags;

Expand Down Expand Up @@ -312,19 +313,19 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
status &= ~BD_ENET_TX_STATS;

/* Set buffer length and buffer pointer */
bdp->cbd_bufaddr = __pa(skb->data);
bufaddr = skb->data;
bdp->cbd_datlen = skb->len;

/*
* On some FEC implementations data must be aligned on
* 4-byte boundaries. Use bounce buffers to copy data
* and get it aligned. Ugh.
*/
if (bdp->cbd_bufaddr & FEC_ALIGNMENT) {
if (((unsigned long) bufaddr) & FEC_ALIGNMENT) {
unsigned int index;
index = bdp - fep->tx_bd_base;
memcpy(fep->tx_bounce[index], (void *)skb->data, skb->len);
bdp->cbd_bufaddr = __pa(fep->tx_bounce[index]);
bufaddr = fep->tx_bounce[index];
}

/* Save skb pointer */
Expand All @@ -336,7 +337,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Push the data cache so the CPM does not get stale memory
* data.
*/
bdp->cbd_bufaddr = dma_map_single(&dev->dev, skb->data,
bdp->cbd_bufaddr = dma_map_single(&dev->dev, bufaddr,
FEC_ENET_TX_FRSIZE, DMA_TO_DEVICE);

/* Send it on its way. Tell FEC it's ready, interrupt when done,
Expand Down

0 comments on commit ad7301b

Please sign in to comment.