aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/8139too.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/8139too.c')
-rw-r--r--drivers/net/8139too.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 8a5b0d293f75..0daf8c15e381 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -309,7 +309,7 @@ enum RTL8139_registers {
309 Cfg9346 = 0x50, 309 Cfg9346 = 0x50,
310 Config0 = 0x51, 310 Config0 = 0x51,
311 Config1 = 0x52, 311 Config1 = 0x52,
312 FlashReg = 0x54, 312 TimerInt = 0x54,
313 MediaStatus = 0x58, 313 MediaStatus = 0x58,
314 Config3 = 0x59, 314 Config3 = 0x59,
315 Config4 = 0x5A, /* absent on RTL-8139A */ 315 Config4 = 0x5A, /* absent on RTL-8139A */
@@ -325,6 +325,7 @@ enum RTL8139_registers {
325 FIFOTMS = 0x70, /* FIFO Control and test. */ 325 FIFOTMS = 0x70, /* FIFO Control and test. */
326 CSCR = 0x74, /* Chip Status and Configuration Register. */ 326 CSCR = 0x74, /* Chip Status and Configuration Register. */
327 PARA78 = 0x78, 327 PARA78 = 0x78,
328 FlashReg = 0xD4, /* Communication with Flash ROM, four bytes. */
328 PARA7c = 0x7c, /* Magic transceiver parameter register. */ 329 PARA7c = 0x7c, /* Magic transceiver parameter register. */
329 Config5 = 0xD8, /* absent on RTL-8139A */ 330 Config5 = 0xD8, /* absent on RTL-8139A */
330}; 331};
@@ -1722,13 +1723,18 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
1722 } 1723 }
1723 1724
1724 spin_lock_irqsave(&tp->lock, flags); 1725 spin_lock_irqsave(&tp->lock, flags);
1726 /*
1727 * Writing to TxStatus triggers a DMA transfer of the data
1728 * copied to tp->tx_buf[entry] above. Use a memory barrier
1729 * to make sure that the device sees the updated data.
1730 */
1731 wmb();
1725 RTL_W32_F (TxStatus0 + (entry * sizeof (u32)), 1732 RTL_W32_F (TxStatus0 + (entry * sizeof (u32)),
1726 tp->tx_flag | max(len, (unsigned int)ETH_ZLEN)); 1733 tp->tx_flag | max(len, (unsigned int)ETH_ZLEN));
1727 1734
1728 dev->trans_start = jiffies; 1735 dev->trans_start = jiffies;
1729 1736
1730 tp->cur_tx++; 1737 tp->cur_tx++;
1731 wmb();
1732 1738
1733 if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx) 1739 if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx)
1734 netif_stop_queue (dev); 1740 netif_stop_queue (dev);
@@ -2009,9 +2015,9 @@ no_early_rx:
2009 /* Malloc up new buffer, compatible with net-2e. */ 2015 /* Malloc up new buffer, compatible with net-2e. */
2010 /* Omit the four octet CRC from the length. */ 2016 /* Omit the four octet CRC from the length. */
2011 2017
2012 skb = dev_alloc_skb (pkt_size + 2); 2018 skb = netdev_alloc_skb(dev, pkt_size + NET_IP_ALIGN);
2013 if (likely(skb)) { 2019 if (likely(skb)) {
2014 skb_reserve (skb, 2); /* 16 byte align the IP fields. */ 2020 skb_reserve (skb, NET_IP_ALIGN); /* 16 byte align the IP fields. */
2015#if RX_BUF_IDX == 3 2021#if RX_BUF_IDX == 3
2016 wrap_copy(skb, rx_ring, ring_offset+4, pkt_size); 2022 wrap_copy(skb, rx_ring, ring_offset+4, pkt_size);
2017#else 2023#else