From owner-freebsd-mobile Tue Jun 9 05:39:39 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA07991 for freebsd-mobile-outgoing; Tue, 9 Jun 1998 05:39:39 -0700 (PDT) (envelope-from owner-freebsd-mobile@FreeBSD.ORG) Received: from vader.cs.berkeley.edu (vader.CS.Berkeley.EDU [128.32.38.234]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA07960 for ; Tue, 9 Jun 1998 05:39:35 -0700 (PDT) (envelope-from asami@vader.cs.berkeley.edu) Received: from silvia.HIP.Berkeley.EDU (sjx-ca115-10.ix.netcom.com [207.223.162.74]) by vader.cs.berkeley.edu (8.8.7/8.7.3) with ESMTP id DAA11956; Tue, 9 Jun 1998 03:48:18 -0700 (PDT) Received: (from asami@localhost) by silvia.HIP.Berkeley.EDU (8.8.8/8.6.9) id DAA13823; Tue, 9 Jun 1998 03:48:05 -0700 (PDT) Date: Tue, 9 Jun 1998 03:48:05 -0700 (PDT) Message-Id: <199806091048.DAA13823@silvia.HIP.Berkeley.EDU> To: ohashi@mickey.ai.kyutech.ac.jp CC: mobile@FreeBSD.ORG In-reply-to: <199806081156.UAA18595@atohasi.mickey.ai.kyutech.ac.jp> (ohashi@mickey.ai.kyutech.ac.jp) Subject: Re: 100Mbps ether for PCCARD? From: asami@FreeBSD.ORG (Satoshi Asami) Sender: owner-freebsd-mobile@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org * 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 #include @@ -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