Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Jun 1998 03:49:52 -0700 (PDT)
From:      asami@FreeBSD.ORG (Satoshi Asami)
To:        hamada@astec.co.jp
Cc:        cdubuque@rrnet.com, freebsd-hardware@FreeBSD.ORG
Subject:   Re: 3com 10/100 PCMCIA cards?
Message-ID:  <199806091049.DAA14032@silvia.HIP.Berkeley.EDU>
In-Reply-To: <ixwwarf530.fsf@astec.co.jp> (message from HAMADA Naoki on 09 Jun 1998 15:43:15 %2B0900)

next in thread | previous in thread | raw e-mail | index | archive | help
 * Chad Dubuque <cdubuque@rrnet.com> writes:
 * >Has anyone tried the 3Com 574 or 575 10/100 PCMCIA (PC Card) Ethernet
 * >adaptors in a FreeBSD machine yet? I need a 10/100 PC Card, and like 3Com,
 * >but would entertain suggestions for other cards known to work.

If you don't really need 3Com, I just got a Linksys 10/100 card to
work.  Here's the relevant post (sent to freebsd-mobile just now).

Satoshi
-------
To: ohashi@mickey.ai.kyutech.ac.jp
CC: mobile@FreeBSD.ORG
Subject: Re: 100Mbps ether for PCCARD?
From: asami@freebsd.org (Satoshi Asami)

 * Mr. Arai said PLANET FNW-3600-T is the OEM of LINKSYS EtherFast
 * 10/100 and it is woking under ed driver with a patch.

Thanks!  I got it to work with PAO-980430 (2.2.6R).  Boy this thing is 
slow (something like 1.2MB/s over a 100Mbps link) but it's good enough 
for my purpose (connect the laptop to a stupid 100Mbps hub). :)

 * http://www.jp.FreeBSD.ORG/~yuki/FreeBSD/readmail.cgi?source=nomads&docnum=7152
 * (sorry in Japanese :-)

I can read that, no problem. :)

Anyway, here's the patch for anyone who might be wondering.  It's
almost the same as the patch in the above-mentioned article (only one
hunk fails due to NCRD -> NCARD change).

Satoshi
-------
--- if_ed.c.orig	Mon Jun  8 19:37:04 1998
+++ if_ed.c	Mon Jun  8 22:13:21 1998
@@ -194,6 +194,9 @@
 
 static u_long ds_crc(u_char *ep);
 
+static int    ed_get_Linksys __P((struct ed_softc *));
+#define       GWETHER 1
+
 #if NCARD > 0
 #include <sys/select.h>
 #include <pccard/card.h>
@@ -1066,6 +1069,24 @@
 	return (ED_3COM_IO_PORTS);
 }
 
+static int
+ed_get_Linksys(sc)
+	struct ed_softc *sc;
+{
+	u_char sum;
+	int i;
+
+	for (sum = 0, i = 0x14; i < 0x1c; i++)
+		sum += inb(sc->nic_addr + i);
+	if (sum != 0xff)
+		return (0);
+	for (i = 0; i < ETHER_ADDR_LEN; i++) {
+		sc->arpcom.ac_enaddr[i] = inb(sc->nic_addr + 0x14 + i);
+		printf("%02x.", sc->arpcom.ac_enaddr[i]);
+	}
+	return (1);
+}
+
 /*
  * Probe and vendor-specific initialization routine for NE1000/2000 boards
  */
@@ -1080,6 +1101,7 @@
 	u_char  romdata[16], tmp;
 	static char test_pattern[32] = "THIS is A memory TEST pattern";
 	char    test_buffer[32];
+	int	linksys = 0;
 
 	sc->asic_addr = port + ED_NOVELL_ASIC_OFFSET;
 	sc->nic_addr = port + ED_NOVELL_NIC_OFFSET;
@@ -1149,7 +1171,13 @@
 	ed_pio_writemem(sc, test_pattern, 8192, sizeof(test_pattern));
 	ed_pio_readmem(sc, 8192, test_buffer, sizeof(test_pattern));
 
-	if (bcmp(test_pattern, test_buffer, sizeof(test_pattern))) {
+	linksys = ed_get_Linksys(sc);
+	if (linksys) {
+		outb(sc->nic_addr + ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS);
+		sc->isa16bit = 1;
+		sc->type = ED_TYPE_NE2000;
+		sc->type_str = "Linksys";
+	} else if (bcmp(test_pattern, test_buffer, sizeof(test_pattern))) {
 		/* not an NE1000 - try NE2000 */
 
 		outb(sc->nic_addr + ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS);
@@ -1259,19 +1287,22 @@
 	 * Use one xmit buffer if < 16k, two buffers otherwise (if not told
 	 * otherwise).
 	 */
-	if ((memsize < 16384) || (flags & ED_FLAGS_NO_MULTI_BUFFERING))
+	if ((sc->mem_size < 16384) || (flags & ED_FLAGS_NO_MULTI_BUFFERING))
 		sc->txb_cnt = 1;
 	else
 		sc->txb_cnt = 2;
 
 	sc->rec_page_start = sc->tx_page_start + sc->txb_cnt * ED_TXBUF_SIZE;
-	sc->rec_page_stop = sc->tx_page_start + memsize / ED_PAGE_SIZE;
+	n = sc->tx_page_start + sc->mem_size / ED_PAGE_SIZE;
+	sc->rec_page_stop = (n > 0xff) ? 0xff : n;
 
 	sc->mem_ring = sc->mem_start + sc->txb_cnt * ED_PAGE_SIZE * ED_TXBUF_SIZE;
 
-	ed_pio_readmem(sc, 0, romdata, 16);
-	for (n = 0; n < ETHER_ADDR_LEN; n++)
-		sc->arpcom.ac_enaddr[n] = romdata[n * (sc->isa16bit + 1)];
+	if (!linksys) {
+		ed_pio_readmem(sc, 0, romdata, 16);
+		for (n = 0; n < ETHER_ADDR_LEN; n++)
+			sc->arpcom.ac_enaddr[n] = romdata[n * (sc->isa16bit + 1)];
+	}
 
 #ifdef GWETHER
 	if (sc->arpcom.ac_enaddr[2] == 0x86) {

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hardware" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199806091049.DAA14032>