From: James S. <jsi...@us...> - 2001-10-22 19:17:59
|
Update of /cvsroot/linux-mips/linux/drivers/net/tulip In directory usw-pr-cvs1:/tmp/cvs-serv12199 Modified Files: interrupt.c media.c tulip_core.c Removed Files: tulip.h Log Message: Many improvements. The tulip driver has alot of the functional we need already. NOTE: the udelay in media.c is vitual for the qube to work. Index: interrupt.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/net/tulip/interrupt.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- interrupt.c 2001/10/22 18:20:56 1.4 +++ interrupt.c 2001/10/22 19:17:55 1.5 @@ -74,7 +74,7 @@ struct sk_buff *skb; dma_addr_t mapping; - skb = tp->rx_buffers[entry].skb = dev_alloc_skb(PKT_BUF_SZ + PKT_BUF_FUDGE); + skb = tp->rx_buffers[entry].skb = dev_alloc_skb(PKT_BUF_SZ); if (skb == NULL) break; @@ -186,7 +186,7 @@ tp->rx_buffers[entry].skb->tail, pkt_len); #endif -#ifdef CONFIG_COBALT_27 +#if defined(__mips__) /* * Scrub the cache to avoid stale data in * the next packet delivered in this slot. Index: media.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/net/tulip/media.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- media.c 2001/10/22 18:20:56 1.5 +++ media.c 2001/10/22 19:17:55 1.6 @@ -232,7 +232,7 @@ outl(csr13val, ioaddr + CSR13); } else { csr13val = 1; - csr14val = 0x0003FFFF; + csr14val = 0; csr15dir = (setup[0]<<16) | 0x0008; csr15val = (setup[1]<<16) | 0x0008; if (dev->if_port <= 4) Index: tulip_core.c =================================================================== RCS file: /cvsroot/linux-mips/linux/drivers/net/tulip/tulip_core.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- tulip_core.c 2001/10/22 18:20:56 1.6 +++ tulip_core.c 2001/10/22 19:17:55 1.7 @@ -33,15 +33,7 @@ static char version[] __devinitdata = "Linux Tulip driver version " DRV_VERSION " (" DRV_RELDATE ")\n"; -#ifdef CONFIG_COBALT_27 -#include <asm/io.h> -#endif -#ifdef CONFIG_COBALT_27 -/* COBALT LOCAL: Needed because our mips is not DMA coherent. -DaveM */ -#define CACHED_TO_UNCACHED(x) (((unsigned long)(x) & (unsigned long)0x1fffffff) + KSEG1) -#endif - /* A few user-configurable values. */ /* Maximum events (Rx packets, etc.) to handle at each interrupt. */ @@ -66,10 +58,8 @@ /* 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(__sh__) || defined(__mips__) static int rx_copybreak = 1518; -#elif defined(__mips__) -static int rx_copybreak = 1536; #else static int rx_copybreak = 100; #endif @@ -352,7 +342,7 @@ tp->tx_buffers[tp->cur_tx].skb = NULL; tp->tx_buffers[tp->cur_tx].mapping = mapping; -#ifdef CONFIG_COBALT_27 +#if defined(__mips__) dma_cache_wback_inv((unsigned long)tp->setup_frame, sizeof(tp->setup_frame)); #endif @@ -687,7 +677,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 + PKT_BUF_FUDGE); + struct sk_buff *skb = dev_alloc_skb(PKT_BUF_SZ); tp->rx_buffers[i].skb = skb; if (skb == NULL) break; @@ -695,9 +685,8 @@ PKT_BUF_SZ, PCI_DMA_FROMDEVICE); tp->rx_buffers[i].mapping = mapping; skb->dev = dev; /* Mark as being used by this device. */ -#ifdef CONFIG_COBALT_27 - /* COBALT LOCAL: Kick out any matching lines in the cache. - -DaveM */ +#if defined(__mips__) + /* Kick out any matching lines in the cache. */ dma_cache_inv((unsigned long)skb->tail, PKT_BUF_SZ); #endif tp->rx_ring[i].status = cpu_to_le32(DescOwned); /* Owned by Tulip chip */ @@ -777,7 +766,7 @@ tp->tx_ring[entry].length = cpu_to_le32(skb->len | flag); /* if we were using Transmit Automatic Polling, we would need a * wmb() here. */ -#ifdef CONFIG_COBALT_27 +#if defined(__mips__) dma_cache_wback_inv((unsigned long)skb->data, skb->len); #endif tp->tx_ring[entry].status = cpu_to_le32(DescOwned); @@ -864,12 +853,6 @@ init_timer(&tp->timer); tp->timer.data = (unsigned long)dev; -#ifdef __mips__ // workaround compiler bug?! -if(tp->chip_id == DC21143 && tulip_tbl[tp->chip_id].media_timer != t21142_timer) { - tp->timer.function = t21142_timer; - printk(KERN_ERR"tulip_down: set timer.function to %p (chipid=%d) - bad pointer bug=%p\n", tp->timer.function, (int)tp->chip_id, tulip_tbl[tp->chip_id].media_timer); -} else -#endif tp->timer.function = tulip_tbl[tp->chip_id].media_timer; dev->if_port = tp->saved_if_port; @@ -1518,13 +1501,6 @@ /* grab all resources from both PIO and MMIO regions, as we * don't want anyone else messing around with our hardware */ -#ifdef CONFIG_COBALT_27 - for(i=0; i<6; i++) - if(pci_resource_flags(pdev, i) & IORESOURCE_MEM) - pci_resource_start(pdev,i) = \ - pci_resource_end(pdev,i) = \ - pci_resource_flags(pdev,i) = 0; -#endif if (pci_request_regions (pdev, "tulip")) goto err_out_free_netdev; @@ -1562,12 +1538,6 @@ spin_lock_init(&tp->mii_lock); init_timer(&tp->timer); tp->timer.data = (unsigned long)dev; -#ifdef __mips__ // workaround compiler bug?! -if(tp->chip_id == DC21143 && tulip_tbl[tp->chip_id].media_timer != t21142_timer) { - tp->timer.function = t21142_timer; - printk(KERN_ERR"tulip_init_one: set timer.function to %p (chipid=%d) - bad pointer bug=%p\n", tp->timer.function, (int)tp->chip_id, tulip_tbl[tp->chip_id].media_timer); -} else -#endif tp->timer.function = tulip_tbl[tp->chip_id].media_timer; dev->base_addr = ioaddr; @@ -1585,6 +1555,7 @@ /* Stop the chip's Tx and Rx processes. */ tulip_stop_rxtx(tp); + pci_set_master(pdev); /* Clear the missed-packet counter. */ inl(ioaddr + CSR8); @@ -1642,11 +1613,11 @@ just put the address in the first EEPROM locations. */ /* This does memcmp(eedata, eedata+16, 8) */ #ifdef __mips__ - if (ioaddr == 0x10108000) /* PCI board does it right */ + if (ioaddr == 0x10108000) /* PCI board does it right */ #endif - for (i = 0; i < 8; i ++) - if (ee_data[i] != ee_data[16+i]) - sa_offset = 20; + for (i = 0; i < 8; i ++) + if (ee_data[i] != ee_data[16+i]) + sa_offset = 20; if (ee_data[0] == 0xff && ee_data[1] == 0xff && ee_data[2] == 0) { sa_offset = 2; /* Grrr, damn Matrox boards. */ multiport_cnt = 4; --- tulip.h DELETED --- |