patches for tulip driver
Hi Jeff,
I don't know if you received my previous mail, but I didn't see any reply. That's why I'm resending my patches to the tulip driver. The first patch makes this driver work on the Apple 100BaseTX card. The second patch makes it work on MIPS boards and the NEC DDB5074 board.
Comments welcome,
Peter.
drivers/net/tulip/tulip_core.c +12 -0
@@ -463,6 +463,18 @@ }else tulip_select_media (dev,1 ); +/* check for Apple 100BaseTX card and disable loops */ + +if ((dev->dev_addr[0 ] ==0x00 ) && + (dev->dev_addr[1 ] ==0x05 ) && + (dev->dev_addr[2 ] ==0x02 ) && + (tp->chip_id ==DC21140 )) { +outl (0x10f , ioaddr +CSR12 ); +iobarrier_rw (); +outl (0x03 , ioaddr +CSR12 ); +iobarrier_rw (); + } +/* Start the chip's Tx to process setup frame. */ tulip_stop_rxtx (tp);barrier ();
drivers/net/tulip/media.c +2 -2
@@ -389,9 +389,9 @@if (tulip_media_cap[dev->if_port] & MediaIsMII) { new_csr6 =0x020E0000 ; }else if (tulip_media_cap[dev->if_port] & MediaIsFx) { - new_csr6 =0x028600000 ; + new_csr6 =0x02860000 ; }else - new_csr6 =0x038600000 ; + new_csr6 =0x03860000 ;if (tulip_debug >1 ) printk(KERN_DEBUG "%s: No media description table, assuming " "%s transceiver, CSR12 %2.2x.\n",
linux/drivers/net//tulip/interrupt.c renamed from linux/drivers/net/tulip/interrupt.c +4 -0
@@ -186,6 +186,10 @@ tp->rx_buffers[entry].skb->tail, pkt_len);#endif +#if defined(__mips__) +dma_cache_inv ((unsigned long )bus_to_virt (tp->rx_ring[entry].buffer1),pkt_len); +#endif + }else {/* Pass up the skb already on the Rx ring. */ char *temp =skb_put (skb = tp->rx_buffers[entry].skb, pkt_len);
linux/drivers/net//tulip/tulip_core.c renamed from linux/drivers/net/tulip/tulip_core.c +22 -0
@@ -339,6 +339,11 @@ tp->tx_buffers[tp->cur_tx].skb =NULL ; tp->tx_buffers[tp->cur_tx].mapping = mapping; +#if defined(__mips__) +dma_cache_wback_inv ((unsigned long )tp->setup_frame, +sizeof (tp->setup_frame)); +#endif +/* Put the setup frame on the Tx list. */ tp->tx_ring[tp->cur_tx].length =cpu_to_le32 (0x08000000 |192 ); tp->tx_ring[tp->cur_tx].buffer1 =cpu_to_le32 (mapping);
@@ -683,6 +688,11 @@ PKT_BUF_SZ, PCI_DMA_FROMDEVICE); tp->rx_buffers[i].mapping = mapping; skb->dev = dev;/* Mark as being used by this device. */ +#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 */ tp->rx_ring[i].buffer1 =cpu_to_le32 (mapping); }
@@ -736,6 +746,9 @@/* if we were using Transmit Automatic Polling, we would need a * wmb() here. */ tp->tx_ring[entry].status =cpu_to_le32 (DescOwned); +#if defined(__mips__) +dma_cache_wback_inv ((unsigned long )skb->data, skb->len); +#endif wmb (); tp->cur_tx++;
@@ -1568,6 +1581,15 @@ tp->flags &= ~HAS_MEDIA_TABLE ; }#endif +#ifdef CONFIG_DDB5074 +if ((pdev->bus->number ==0 ) && (PCI_SLOT (pdev->devfn) ==1 )) { +/* DDB5477 MAC address in first EEPROM locations. */ + sa_offset =0 ; +/* No media table either */ + tp->flags &= ~HAS_MEDIA_TABLE ; + } +#endif +#ifdef CONFIG_MIPS_COBALT if ((pdev->bus->number == 0) && ((PCI_SLOT(pdev->devfn) == 7) ||