From: James S. <jsi...@us...> - 2001-10-22 18:20:59
|
Update of /cvsroot/linux-mips/linux/drivers/net/tulip In directory usw-pr-cvs1:/tmp/cvs-serv28805 Modified Files: eeprom.c interrupt.c tulip.h tulip_core.c Added Files: media.c Log Message: Fixed tulip driver on cobalt qube again. Index: eeprom.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/net/tulip/eeprom.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- eeprom.c 2001/07/10 00:07:16 1.1 +++ eeprom.c 2001/10/22 18:20:56 1.2 @@ -180,10 +180,10 @@ for (i = 0; i < count; i++) { unsigned char media_block = *p++; int media_code = media_block & MEDIA_MASK; - if (media_code & 0x40) + if (media_block & 0x40) p += 6; printk(KERN_INFO "%s: 21041 media #%d, %s.\n", - dev->name, media_code & 15, medianame[media_code & 15]); + dev->name, media_code, medianame[media_code]); } } else { unsigned char *p = (void *)ee_data + ee_data[27]; Index: interrupt.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/net/tulip/interrupt.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- interrupt.c 2001/08/25 02:19:28 1.3 +++ interrupt.c 2001/10/22 18:20:56 1.4 @@ -74,7 +74,7 @@ struct sk_buff *skb; dma_addr_t mapping; - skb = tp->rx_buffers[entry].skb = dev_alloc_skb(PKT_BUF_SZ); + skb = tp->rx_buffers[entry].skb = dev_alloc_skb(PKT_BUF_SZ + PKT_BUF_FUDGE); if (skb == NULL) break; @@ -309,7 +309,7 @@ long ioaddr = dev->base_addr; int csr5; int entry; - int missed; + int csr8; int rx = 0; int tx = 0; int oi = 0; @@ -442,7 +442,6 @@ } } if (csr5 & RxDied) { /* Missed a Rx frame. */ - tp->stats.rx_missed_errors += inl(ioaddr + CSR8) & 0xffff; #ifdef CONFIG_NET_HW_FLOWCONTROL if (tp->fc_bit && !test_bit(tp->fc_bit, &netdev_fc_xoff)) { tp->stats.rx_errors++; @@ -556,9 +555,8 @@ } } - if ((missed = inl(ioaddr + CSR8) & 0x1ffff)) { - tp->stats.rx_dropped += missed & 0x10000 ? 0x10000 : missed; - } + csr8 = inl(ioaddr + CSR8); + tp->stats.rx_dropped += (csr8 & 0x1ffff) + ((csr8 >> 17) & 0xfff); if (tulip_debug > 4) printk(KERN_DEBUG "%s: exiting interrupt, csr5=%#4.4x.\n", Index: tulip.h =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/net/tulip/tulip.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- tulip.h 2001/08/25 02:19:28 1.6 +++ tulip.h 2001/10/22 18:20:56 1.7 @@ -29,7 +29,7 @@ /* undefine, or define to various debugging levels (>4 == obscene levels) */ -#define TULIP_DEBUG 1 +#define TULIP_DEBUG 1 /* undefine USE_IO_OPS for MMIO, define for PIO */ #ifdef CONFIG_TULIP_MMIO Index: tulip_core.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/net/tulip/tulip_core.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- tulip_core.c 2001/08/25 06:24:45 1.5 +++ tulip_core.c 2001/10/22 18:20:56 1.6 @@ -15,8 +15,8 @@ */ #define DRV_NAME "tulip" -#define DRV_VERSION "0.9.15-pre6" -#define DRV_RELDATE "July 2, 2001" +#define DRV_VERSION "0.9.15-pre7" +#define DRV_RELDATE "Oct 2, 2001" #include <linux/config.h> #include <linux/module.h> @@ -66,7 +66,7 @@ /* Set the copy breakpoint for the copy-only-tiny-buffer Rx structure. */ #if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \ || defined(__sparc_) || defined(__ia64__) \ - || defined(__sh__) || defined(__mips__) + || defined(__sh__) static int rx_copybreak = 1518; #elif defined(__mips__) static int rx_copybreak = 1536; @@ -87,7 +87,7 @@ ToDo: Non-Intel setting could be better. */ -#if defined(__alpha__) || defined(__ia64__) +#if defined(__alpha__) || defined(__ia64__) || defined(__x86_64__) static int csr0 = 0x01A00000 | 0xE000; #elif defined(__i386__) || defined(__powerpc__) static int csr0 = 0x01A00000 | 0x8000; @@ -113,6 +113,7 @@ MODULE_AUTHOR("The Linux Kernel Team"); MODULE_DESCRIPTION("Digital 21*4* Tulip ethernet driver"); +MODULE_LICENSE("GPL"); MODULE_PARM(tulip_debug, "i"); MODULE_PARM(max_interrupt_work, "i"); MODULE_PARM(rx_copybreak, "i"); @@ -686,7 +687,7 @@ /* Note the receive buffer must be longword aligned. dev_alloc_skb() provides 16 byte alignment. But do *not* use skb_reserve() to align the IP header! */ - struct sk_buff *skb = dev_alloc_skb(PKT_BUF_SZ); + struct sk_buff *skb = dev_alloc_skb(PKT_BUF_SZ + PKT_BUF_FUDGE); tp->rx_buffers[i].skb = skb; if (skb == NULL) break; @@ -777,7 +778,7 @@ /* if we were using Transmit Automatic Polling, we would need a * wmb() here. */ #ifdef CONFIG_COBALT_27 - dma_cache_wback_inv((unsigned long)skb->data, skb->len); + dma_cache_wback_inv((unsigned long)skb->data, skb->len); #endif tp->tx_ring[entry].status = cpu_to_le32(DescOwned); wmb(); @@ -1318,7 +1319,7 @@ if (tulip_debug > 3) printk(KERN_DEBUG "%s: tulip_mwi_config()\n", pdev->slot_name); - tp->csr0 = 0; + tp->csr0 = csr0 = 0; /* check for sane cache line size. from acenic.c. */ pci_read_config_byte(pdev, PCI_CACHE_LINE_SIZE, &cache); @@ -1454,7 +1455,7 @@ */ #ifdef CONFIG_COBALT_27 - force_csr0 = 1; + force_csr0 = 1; #endif /* Intel Saturn. Switch to 8 long words burst, 8 long word cache aligned Aries might need this too. The Saturn errata are not pretty reading but @@ -1534,8 +1535,6 @@ goto err_out_free_res; #endif - pci_set_master(pdev); - pci_read_config_byte (pdev, PCI_REVISION_ID, &chip_rev); /* @@ -1577,10 +1576,15 @@ #ifdef CONFIG_TULIP_MWI if (!force_csr0 && (tp->flags & HAS_PCI_MWI)) tulip_mwi_config (pdev, dev); +#else + /* MWI is broken for DC21143 rev 65... */ + if (chip_idx == DC21143 && chip_rev == 65) + tp->csr0 &= ~MWI; #endif /* Stop the chip's Tx and Rx processes. */ tulip_stop_rxtx(tp); + /* Clear the missed-packet counter. */ inl(ioaddr + CSR8); |