From: p2@mind.be (Peter 'p2' De Schrijver)
To: jgarzik@mandrakesoft.com
Cc: linux-kernel@vger.kernel.org
Subject: patches for tulip driver
Date: Fri, 2 Aug 2002 18:23:26 +0200 [thread overview]
Message-ID: <20020802162326.GD23428@mind.be> (raw)
[-- Attachment #1: Type: text/plain, Size: 314 bytes --]
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.
--
[-- Attachment #2: patch.ans100basetx --]
[-- Type: text/plain, Size: 1142 bytes --]
--- linux/drivers/net/tulip/tulip_core.c Sun Jun 23 23:28:58 2002
+++ linux-2.4-benh/drivers/net/tulip/tulip_core.c Sun Jun 23 23:23:31 2002
@@ -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();
--- linux/drivers/net/tulip/media.c Mon Jun 17 15:20:00 2002
+++ linux-2.4-benh/drivers/net/tulip/media.c Sat Jun 22 13:15:26 2002
@@ -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",
[-- Attachment #3: patch-tulip-mips --]
[-- Type: text/plain, Size: 2611 bytes --]
diff -r -N -u -w oss-2.4/linux/drivers/net/tulip/interrupt.c oss-2.4-ddb5074/linux/drivers/net//tulip/interrupt.c
--- oss-2.4/linux/drivers/net/tulip/interrupt.c Sun Dec 2 12:34:45 2001
+++ oss-2.4-ddb5074/linux/drivers/net//tulip/interrupt.c Tue Jul 9 13:18:13 2002
@@ -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);
diff -r -N -u -w oss-2.4/linux/drivers/net/tulip/tulip_core.c oss-2.4-ddb5074/linux/drivers/net//tulip/tulip_core.c
--- oss-2.4/linux/drivers/net/tulip/tulip_core.c Thu Jun 27 00:36:01 2002
+++ oss-2.4-ddb5074/linux/drivers/net//tulip/tulip_core.c Tue Jul 9 13:31:04 2002
@@ -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) ||
reply other threads:[~2002-08-02 16:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020802162326.GD23428@mind.be \
--to=p2@mind.be \
--cc=jgarzik@mandrakesoft.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox