linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* (no subject)
@ 2002-04-21 21:16 Ivan G.
  2002-04-21 23:02 ` your mail Jeff Garzik
  0 siblings, 1 reply; 10+ messages in thread
From: Ivan G. @ 2002-04-21 21:16 UTC (permalink / raw)
  To: Urban Widmark; +Cc: LKML

Urban,

About the suggestion to make via_rhine_error handle more interrupts,

enum intr_status_bits {
        IntrRxDone=0x0001, IntrRxErr=0x0004, IntrRxEmpty=0x0020,
        IntrTxDone=0x0002, IntrTxAbort=0x0008, IntrTxUnderrun=0x0010,
        IntrPCIErr=0x0040,
        IntrStatsMax=0x0080, IntrRxEarly=0x0100, IntrMIIChange=0x0200,
        IntrRxOverflow=0x0400, IntrRxDropped=0x0800, IntrRxNoBuf=0x1000,
        IntrTxAborted=0x2000, IntrLinkChange=0x4000,
        IntrRxWakeUp=0x8000,
        IntrNormalSummary=0x0003, IntrAbnormalSummary=0xC260,
};

RxEarly, RxOverflow, RxNoBuf are not handled
(which brings up another question - how should they be handled 
and where?? It doesn't seem to me that those should end up in error,
sending CmdTxDemand. )

RxErr, RxWakeUp, RxDropped, RxEmpty call via_rhine_rx
TxAbort, TxUnderrun,PCIErr, StatsMax, MIIChange call via_rhine_error
TxAborted calls via_rgine_tx
The others don't look like errors.


Martin Eriksson,
The reason my message said PCI Error and not unhandled
is because it specifies a specific interrupt - IntrPCIErr.
(basically the onle one that's left unhandled that can call via_rhine_error)




^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH] Via-rhine minor issues
@ 2002-04-21  7:02 Ivan G.
  2002-04-21 10:00 ` Martin Eriksson
  2002-04-21 10:19 ` Urban Widmark
  0 siblings, 2 replies; 10+ messages in thread
From: Ivan G. @ 2002-04-21  7:02 UTC (permalink / raw)
  To: Urban Widmark, Shing Chuang; +Cc: LKML

Please comment on this before I send to Marcello.
I am a newbie and would like some help.
Patch fixes minor issues in the driver.

Note: Shing Chuang, this includes your own patch for Rhine-III support 
since it's not yet in the kernel and I diff-ed against the original source, 
while I added your patch to my driver version.

BTW your own patch wouldn't patch cleanly for some reason.

DIFF-ED AGAINST:
2.4.19-pre3 ( I don't think there were changes to via-rhine 
b-ween pre3 and pre7)

CONTENTS:
- Shing Chuang's Rhine III support and 6100 cleanup patch.
- edited comments on supported cards
- removed unused W_MAX_TIMEOUT
- added flag HasDavicomPhy for VT86C100A card
- changed chip_id in wait_for_reset as parameter since np is not initialized
the first time this function is called (should this be fixed differently?)
- enable all interrupts (add 4 additional ones)
- fix debug message - frame is off by one
- change "Something Wicked" message to "PCI Error" (I still don't see the 
purpose of the trap)

NOTE:
Urban, this should clear up the annoying minor issues so I can do more tests
on my own delay problem (Via-Rhine stalls on transmit thread)

PATCH:  (watch out for kmail newlines on several places)

--- via-rhine.c.origkernel      Sat Mar 30 01:10:02 2002
+++ via-rhine.c Sun Apr 21 00:30:34 2002
@@ -9,8 +9,8 @@
        a complete program and may only be used when the entire operating
        system is licensed under the GPL.

-       This driver is designed for the VIA VT86c100A Rhine-II PCI Fast 
Ethernet
-       controller.  It also works with the older 3043 Rhine-I chip.
+       This driver is designed for the VIA VT86C100A Rhine-I.
+       It also works with the 6102 Rhine-II, and 6105/6105M Rhine-III.

        The author may be reached as becker@scyld.com, or C/O
        Scyld Computing Corporation
@@ -136,9 +136,6 @@

 #define PKT_BUF_SZ             1536                    /* Size of each 
temporary Rx buffer.*/

-/* max time out delay time */
-#define W_MAX_TIMEOUT  0x0FFFU
-
 #if !defined(__OPTIMIZE__)  ||  !defined(__KERNEL__)
 #warning  You must compile this file with the correct options!
 #warning  See the last lines of the source file.
@@ -317,7 +314,8 @@
 enum via_rhine_chips {
        VT86C100A = 0,
        VT6102,
-       VT3043,
+       VT6105,
+       VT6105M
 };

 struct via_rhine_chip_info {
@@ -342,18 +340,21 @@
 static struct via_rhine_chip_info via_rhine_chip_info[] __devinitdata =
 {
        { "VIA VT86C100A Rhine", RHINE_IOTYPE, 128,
-         CanHaveMII | ReqTxAlign },
+         CanHaveMII | ReqTxAlign | HasDavicomPhy },
        { "VIA VT6102 Rhine-II", RHINE_IOTYPE, 256,
          CanHaveMII | HasWOL },
-       { "VIA VT3043 Rhine",    RHINE_IOTYPE, 128,
-         CanHaveMII | ReqTxAlign }
+       { "VIA VT6105 Rhine-III", RHINE_IOTYPE, 256,
+         CanHaveMII | HasWOL },
+       { "VIA VT6105M Rhine-III", RHINE_IOTYPE, 256,
+         CanHaveMII | HasWOL },
 };

 static struct pci_device_id via_rhine_pci_tbl[] __devinitdata =
 {
-       {0x1106, 0x6100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT86C100A},
+       {0x1106, 0x3043, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT86C100A},
        {0x1106, 0x3065, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT6102},
-       {0x1106, 0x3043, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT3043},
+       {0x1106, 0x3106, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT6105},
+       {0x1106, 0x3053, PCI_ANY_ID, PCI_ANY_ID, 0, 0, VT6105M},
        {0,}                    /* terminate list */
 };
 MODULE_DEVICE_TABLE(pci, via_rhine_pci_tbl);
@@ -502,15 +503,13 @@
 static int  via_rhine_close(struct net_device *dev);
 static inline void clear_tally_counters(long ioaddr);

-static void wait_for_reset(struct net_device *dev, char *name)
+static void wait_for_reset(struct net_device *dev, int chip_id, char *name)
 {
-       struct netdev_private *np = dev->priv;
        long ioaddr = dev->base_addr;
-       int chip_id = np->chip_id;
        int i;

-       /* 3043 may need long delay after reset (dlink) */
-       if (chip_id == VT3043 || chip_id == VT86C100A)
+       /* VT86C100A may need long delay after reset (dlink) */
+       if (chip_id == VT86C100A)
                udelay(100);

        i = 0;
@@ -531,7 +530,7 @@
 static void __devinit enable_mmio(long ioaddr, int chip_id)
 {
        int n;
-       if (chip_id == VT3043 || chip_id == VT86C100A) {
+       if (chip_id == VT86C100A) {
                /* More recent docs say that this bit is reserved ... */
                n = inb(ioaddr + ConfigA) | 0x20;
                outb(n, ioaddr + ConfigA);
@@ -659,7 +658,7 @@
        writew(CmdReset, ioaddr + ChipCmd);

        dev->base_addr = ioaddr;
-       wait_for_reset(dev, shortname);
+       wait_for_reset(dev, chip_id, shortname);

        /* Reload the station address from the EEPROM. */
 #ifdef USE_IO
@@ -980,7 +979,8 @@

        /* Enable interrupts by setting the interrupt mask. */
        writew(IntrRxDone | IntrRxErr | IntrRxEmpty| IntrRxOverflow| 
IntrRxDropped|
-                  IntrTxDone | IntrTxAbort | IntrTxUnderrun |
+                  IntrRxEarly | IntrRxNoBuf | IntrRxWakeUp | IntrTxAborted|
+                  IntrTxDone | IntrTxAbort | IntrTxUnderrun |
                   IntrPCIErr | IntrStatsMax | IntrLinkChange | IntrMIIChange,
                   ioaddr + IntrEnable);

@@ -1070,7 +1070,7 @@
                return i;
        alloc_rbufs(dev);
        alloc_tbufs(dev);
-       wait_for_reset(dev, dev->name);
+       wait_for_reset(dev, np->chip_id, dev->name);
        init_registers(dev);
        if (debug > 2)
                printk(KERN_DEBUG "%s: Done via_rhine_open(), status %4.4x "
@@ -1177,7 +1177,7 @@
        alloc_rbufs(dev);

        /* Reinitialize the hardware. */
-       wait_for_reset(dev, dev->name);
+       wait_for_reset(dev, np->chip_id, dev->name);
        init_registers(dev);

        spin_unlock(&np->lock);
@@ -1247,7 +1247,7 @@

        if (debug > 4) {
                printk(KERN_DEBUG "%s: Transmit frame #%d queued in slot 
%d.\n",
-                          dev->name, np->cur_tx, entry);
+                          dev->name, np->cur_tx-1, entry);
        }
        return 0;
 }
@@ -1498,12 +1498,11 @@
                        printk(KERN_INFO "%s: Transmitter underrun, 
increasing Tx "
                                   "threshold setting to %2.2x.\n", 
dev->name, np->tx_thresh);
        }
-       if ((intr_status & ~( IntrLinkChange | IntrStatsMax |
-                                                 IntrTxAbort | 
IntrTxAborted))) {
+       if (intr_status & IntrPCIErr) {
                if (debug > 1)
-                       printk(KERN_ERR "%s: Something Wicked happened! 
%4.4x.\n",
+                       printk(KERN_ERR "%s: PCI Error! %4.4x.\n",
                           dev->name, intr_status);
-               /* Recovery for other fault sources not known. */
+               /* Recovery for PCI Error. */
                writew(CmdTxDemand | np->chip_cmd, dev->base_addr + ChipCmd);
        }


 


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-04-23 13:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-21 21:16 Ivan G.
2002-04-21 23:02 ` your mail Jeff Garzik
2002-04-21 23:25   ` [PATCH] Via-rhine minor issues Ivan G.
2002-04-22 19:33     ` Urban Widmark
2002-04-23  4:07       ` Ivan G.
2002-04-23 13:44         ` Urban Widmark
  -- strict thread matches above, loose matches on Subject: below --
2002-04-21  7:02 Ivan G.
2002-04-21 10:00 ` Martin Eriksson
2002-04-21 10:19 ` Urban Widmark
2002-04-21 16:07   ` Jeff Garzik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).