Re: [Re: mad dmesg output with via-rhine driver] VIA rhine 2.3.99pre3 patch location

From: Urban Widmark (urban@svenskatest.se)
Date: Tue Apr 04 2000 - 19:32:30 EST


On Tue, 4 Apr 2000, Patrick Cole wrote:

> Where does one find this patch? I noticed the VIA rhine wasn't working in
> 2.3.99-pre3, then after reading this noted that I used gcc 2.95.2 :-).

Here ... it has been sent to Linus (passing Jeff Garzik's watchful eyes :)
but it's not in the pre4-X, maybe it got lost or maybe it is bad ...

The writel change isn't correct according to Donald Becker, it works for
me but apparently there are "rhine" chips that don't zero their counters
when they are read, so look out for rapidly increasing ifconfig errors.

/Urban

--- linux-2.3.99-pre3-patchup/drivers/net/via-rhine.c Sat Mar 25 12:28:13 2000
+++ linux/drivers/net/via-rhine.c Tue Mar 28 21:38:50 2000
@@ -36,6 +36,10 @@
                          update "Theory of Operation" with softnet/locking changes
         - Dave Miller: PCI DMA and endian fixups
         - Jeff Garzik: MOD_xxx race fixes, updated PCI resource allocation
+
+ LK1.1.4:
+ - Urban Widmark: fix gcc 2.95.2 problem and
+ remove writel's to fixed address 0x7c
 */
 
 /* A few user-configurable values. These may be modified when a driver
@@ -105,7 +109,7 @@
 #include <asm/io.h>
 
 static const char *versionA __devinitdata =
-"via-rhine.c:v1.03a-LK1.1.3 3/23/2000 Written by Donald Becker\n";
+"via-rhine.c:v1.03a-LK1.1.4 3/28/2000 Written by Donald Becker\n";
 static const char *versionB __devinitdata =
 " http://cesdis.gsfc.nasa.gov/linux/drivers/via-rhine.html\n";
 
@@ -774,6 +778,7 @@
 {
         struct netdev_private *np = (struct netdev_private *)dev->priv;
         int i;
+ dma_addr_t next = np->rx_ring_dma;
 
         np->cur_rx = np->cur_tx = 0;
         np->dirty_rx = np->dirty_tx = 0;
@@ -784,8 +789,8 @@
         for (i = 0; i < RX_RING_SIZE; i++) {
                 np->rx_ring[i].rx_status = 0;
                 np->rx_ring[i].desc_length = cpu_to_le32(np->rx_buf_sz);
- np->rx_ring[i].next_desc =
- cpu_to_le32(np->rx_ring_dma + sizeof(struct rx_desc)*(i+1));
+ next += sizeof(struct rx_desc);
+ np->rx_ring[i].next_desc = cpu_to_le32(next);
                 np->rx_skbuff[i] = 0;
         }
         /* Mark the last entry as wrapping the ring. */
@@ -806,13 +811,15 @@
                 np->rx_ring[i].addr = cpu_to_le32(np->rx_skbuff_dma[i]);
                 np->rx_ring[i].rx_status = cpu_to_le32(DescOwn);
         }
+ np->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
 
+ next = np->tx_ring_dma;
         for (i = 0; i < TX_RING_SIZE; i++) {
                 np->tx_skbuff[i] = 0;
                 np->tx_ring[i].tx_status = 0;
                 np->tx_ring[i].desc_length = cpu_to_le32(0x00e08000);
- np->tx_ring[i].next_desc =
- cpu_to_le32(np->tx_ring_dma + sizeof(struct tx_desc)*(i+1));
+ next += sizeof(struct tx_desc);
+ np->tx_ring[i].next_desc = cpu_to_le32(next);
                 np->tx_buf[i] = kmalloc(PKT_BUF_SZ, GFP_KERNEL);
         }
         np->tx_ring[i-1].next_desc = cpu_to_le32(np->tx_ring_dma);
@@ -1097,7 +1104,6 @@
         if (intr_status & IntrStatsMax) {
                 np->stats.rx_crc_errors += readw(ioaddr + RxCRCErrs);
                 np->stats.rx_missed_errors += readw(ioaddr + RxMissed);
- writel(0, RxMissed);
         }
         if (intr_status & IntrTxAbort) {
                 /* Stats counted in Tx-done handler, just restart Tx. */
@@ -1129,7 +1135,6 @@
            non-critical. */
         np->stats.rx_crc_errors += readw(ioaddr + RxCRCErrs);
         np->stats.rx_missed_errors += readw(ioaddr + RxMissed);
- writel(0, RxMissed);
 
         return &np->stats;
 }

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:13 EST