From 1c460afaa550eda5df011168bdda7441a7788c3a Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Wed, 27 Aug 2008 11:35:13 +0800 Subject: 8139too: use netdev_alloc_skb This patch uses netdev_alloc_skb. This sets skb->dev and allows arch specific allocation. Also cleanup the alignment code. Signed-off-by: Kevin Lo Signed-off-by: Jeff Garzik --- drivers/net/8139too.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/net/8139too.c') diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index 8a5b0d2..f6ca997 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c @@ -2009,9 +2009,9 @@ no_early_rx: /* Malloc up new buffer, compatible with net-2e. */ /* Omit the four octet CRC from the length. */ - skb = dev_alloc_skb (pkt_size + 2); + skb = netdev_alloc_skb(dev, pkt_size + NET_IP_ALIGN); if (likely(skb)) { - skb_reserve (skb, 2); /* 16 byte align the IP fields. */ + skb_reserve (skb, NET_IP_ALIGN); /* 16 byte align the IP fields. */ #if RX_BUF_IDX == 3 wrap_copy(skb, rx_ring, ring_offset+4, pkt_size); #else -- cgit v1.1 From da8de3929da9396977b3c9096f36b173f3d9085a Mon Sep 17 00:00:00 2001 From: Mats Erik Andersson Date: Thu, 17 Jul 2008 01:05:43 +0200 Subject: 8139too: [cosmetic] fix incorrect register for flash-rom I would like to submit a correction to the driver drivers/net/8139too.c, which in no way changes the compiled driver, but does change the value of a previously incorrect value for the configuration register address of Flash PROM on the network processor rtl8139C. This corrected value is in accordance with the datasheet for rtl8139C, and in addition this new value is indeed used in other functional drivers that use this adapter for programming a Flash memory chip in situ. But as said, the two new constants are never referenced in the driver maintained by you: they are only informational and correct! Mats Erik Andersson, meand@users.sourceforge.net Signed-off-by: Jeff Garzik --- drivers/net/8139too.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/net/8139too.c') diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index f6ca997..32e66f0 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c @@ -309,7 +309,7 @@ enum RTL8139_registers { Cfg9346 = 0x50, Config0 = 0x51, Config1 = 0x52, - FlashReg = 0x54, + TimerInt = 0x54, MediaStatus = 0x58, Config3 = 0x59, Config4 = 0x5A, /* absent on RTL-8139A */ @@ -325,6 +325,7 @@ enum RTL8139_registers { FIFOTMS = 0x70, /* FIFO Control and test. */ CSCR = 0x74, /* Chip Status and Configuration Register. */ PARA78 = 0x78, + FlashReg = 0xD4, /* Communication with Flash ROM, four bytes. */ PARA7c = 0x7c, /* Magic transceiver parameter register. */ Config5 = 0xD8, /* absent on RTL-8139A */ }; -- cgit v1.1 From 176eaa589b3d242f25f24e472883fcce5f196777 Mon Sep 17 00:00:00 2001 From: Andreas Oberritter Date: Wed, 8 Oct 2008 06:14:16 +0000 Subject: 8139too: move wmb before TX DMA start The write barrier should be used before starting a DMA transfer. This fixes a problem, where almost all packets received on another machine had garbled content. Tested with an RTL8100C on a MIPS machine. Signed-off-by: Andreas Oberritter Signed-off-by: David S. Miller --- drivers/net/8139too.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'drivers/net/8139too.c') diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index 32e66f0..0daf8c1 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c @@ -1723,13 +1723,18 @@ static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev) } spin_lock_irqsave(&tp->lock, flags); + /* + * Writing to TxStatus triggers a DMA transfer of the data + * copied to tp->tx_buf[entry] above. Use a memory barrier + * to make sure that the device sees the updated data. + */ + wmb(); RTL_W32_F (TxStatus0 + (entry * sizeof (u32)), tp->tx_flag | max(len, (unsigned int)ETH_ZLEN)); dev->trans_start = jiffies; tp->cur_tx++; - wmb(); if ((tp->cur_tx - NUM_TX_DESC) == tp->dirty_tx) netif_stop_queue (dev); -- cgit v1.1