From: David W. <dw...@in...> - 2001-08-22 14:47:01
|
Some fixes to the via-rhine driver which aren't actually bogus this time. I'll commit them shortly. Index: ChangeLog =================================================================== RCS file: /cvsroot/linuxsh/kernel/ChangeLog,v retrieving revision 1.328 diff -u -r1.328 ChangeLog --- ChangeLog 2001/08/14 14:44:58 1.328 +++ ChangeLog 2001/08/22 14:45:32 @@ -1,3 +1,10 @@ +2001-08-22 David Woodhouse <dw...@in...> + + * drivers/net/via-rhine.c: Update to version LK1.1.11 from + 2.4.9-ac9 (set dev->base_addr before first call to wait_for_reset() + and free the bounce buffers only if we allocated any in the first + place. + 2001-08-14 David Woodhouse <dw...@in...> * arch/sh/kernel/pci-dma.c: Use dma_cache_wback_inv() in Index: drivers/net/via-rhine.c =================================================================== RCS file: /cvsroot/linuxsh/kernel/drivers/net/via-rhine.c,v retrieving revision 1.9 diff -u -r1.9 via-rhine.c --- drivers/net/via-rhine.c 2001/07/18 02:54:27 1.9 +++ drivers/net/via-rhine.c 2001/08/22 14:45:32 @@ -69,6 +69,10 @@ - Manfred Spraul: use "singlecopy" for unaligned buffers don't allocate bounce buffers for !ReqTxAlign cards + LK1.1.11: + - David Woodhouse: Set dev->base_addr before the first time we call + wait_for_reset(). It's a lot happier that way. + Free np->tx_bufs only if we actually allocated it. */ @@ -151,7 +155,7 @@ /* These identify the driver base version and may not be removed. */ static char version[] __devinitdata = -KERN_INFO "via-rhine.c:v1.10-LK1.1.10 07/12/2001 Written by Donald Becker\n" +KERN_INFO "via-rhine.c:v1.10-LK1.1.11 20/08/2001 Written by Donald Becker\n" KERN_INFO " http://www.scyld.com/network/via-rhine.html\n"; static char shortname[] __devinitdata = "via-rhine"; @@ -584,6 +588,8 @@ /* Reset the chip to erase previous misconfiguration. */ writew(CmdReset, ioaddr + ChipCmd); + + dev->base_addr = ioaddr; wait_for_reset(dev, shortname); /* Reload the station address from the EEPROM. */ @@ -609,7 +615,6 @@ writeb(readb(ioaddr + ConfigA) & 0xFE, ioaddr + ConfigA); } - dev->base_addr = ioaddr; dev->irq = pdev->irq; np = dev->priv; @@ -757,9 +762,12 @@ RX_RING_SIZE * sizeof(struct rx_desc) + TX_RING_SIZE * sizeof(struct tx_desc), np->rx_ring, np->rx_ring_dma); + + if (np->tx_bufs) + pci_free_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE, + np->tx_bufs, np->tx_bufs_dma); - pci_free_consistent(np->pdev, PKT_BUF_SZ * TX_RING_SIZE, - np->tx_bufs, np->tx_bufs_dma); + np->tx_bufs = NULL; } -- dwmw2 |