Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Nov 1998 14:17:25 -0800 (PST)
From:      asami@FreeBSD.ORG (Satoshi Asami)
To:        mike@smith.net.au
Cc:        alexandr@mail.eecis.udel.edu, mobile@FreeBSD.ORG
Subject:   Re: 10/100 Question
Message-ID:  <199811202217.OAA10053@silvia.hip.berkeley.edu>
In-Reply-To: <199811200731.XAA00481@dingo.cdrom.com> (message from Mike Smith on Thu, 19 Nov 1998 23:31:03 -0800)

next in thread | previous in thread | raw e-mail | index | archive | help
 * > Are any 16-bit 10/100 cards supported under -current?  I'm eyeing the
 * > 3Com 3c574-TX, but any 10/100 16-bit card should do.

I have a Linksys 10/100 card working.  Here's the relevant post (sent
to freebsd-mobile originally).

It's pretty slow, but I didn't want to buy a dual-speed hub or switch
just for the laptop.

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-mobile" in the body of the message



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