aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethoc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index 747562037e23..f92747fc5f8b 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -284,7 +284,7 @@ static int ethoc_init_ring(struct ethoc *dev)
284 dev->cur_rx = 0; 284 dev->cur_rx = 0;
285 285
286 /* setup transmission buffers */ 286 /* setup transmission buffers */
287 bd.addr = 0; 287 bd.addr = virt_to_phys(dev->membase);
288 bd.stat = TX_BD_IRQ | TX_BD_CRC; 288 bd.stat = TX_BD_IRQ | TX_BD_CRC;
289 289
290 for (i = 0; i < dev->num_tx; i++) { 290 for (i = 0; i < dev->num_tx; i++) {
@@ -295,7 +295,6 @@ static int ethoc_init_ring(struct ethoc *dev)
295 bd.addr += ETHOC_BUFSIZ; 295 bd.addr += ETHOC_BUFSIZ;
296 } 296 }
297 297
298 bd.addr = dev->num_tx * ETHOC_BUFSIZ;
299 bd.stat = RX_BD_EMPTY | RX_BD_IRQ; 298 bd.stat = RX_BD_EMPTY | RX_BD_IRQ;
300 299
301 for (i = 0; i < dev->num_rx; i++) { 300 for (i = 0; i < dev->num_rx; i++) {
@@ -401,7 +400,7 @@ static int ethoc_rx(struct net_device *dev, int limit)
401 int size = bd.stat >> 16; 400 int size = bd.stat >> 16;
402 struct sk_buff *skb = netdev_alloc_skb(dev, size); 401 struct sk_buff *skb = netdev_alloc_skb(dev, size);
403 if (likely(skb)) { 402 if (likely(skb)) {
404 void *src = priv->membase + bd.addr; 403 void *src = phys_to_virt(bd.addr);
405 memcpy_fromio(skb_put(skb, size), src, size); 404 memcpy_fromio(skb_put(skb, size), src, size);
406 skb->protocol = eth_type_trans(skb, dev); 405 skb->protocol = eth_type_trans(skb, dev);
407 priv->stats.rx_packets++; 406 priv->stats.rx_packets++;
@@ -823,7 +822,7 @@ static netdev_tx_t ethoc_start_xmit(struct sk_buff *skb, struct net_device *dev)
823 else 822 else
824 bd.stat &= ~TX_BD_PAD; 823 bd.stat &= ~TX_BD_PAD;
825 824
826 dest = priv->membase + bd.addr; 825 dest = phys_to_virt(bd.addr);
827 memcpy_toio(dest, skb->data, skb->len); 826 memcpy_toio(dest, skb->data, skb->len);
828 827
829 bd.stat &= ~(TX_BD_STATS | TX_BD_LEN_MASK); 828 bd.stat &= ~(TX_BD_STATS | TX_BD_LEN_MASK);