From owner-svn-src-all@FreeBSD.ORG Tue Apr 7 15:40:38 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 978F91065689; Tue, 7 Apr 2009 15:40:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AA708FC18; Tue, 7 Apr 2009 15:40:38 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n37Fec3s012958; Tue, 7 Apr 2009 15:40:38 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n37FecLb012957; Tue, 7 Apr 2009 15:40:38 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <200904071540.n37FecLb012957@svn.freebsd.org> From: Warner Losh Date: Tue, 7 Apr 2009 15:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190803 - head/sys/dev/ed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Apr 2009 15:40:39 -0000 Author: imp Date: Tue Apr 7 15:40:38 2009 New Revision: 190803 URL: http://svn.freebsd.org/changeset/base/190803 Log: The DL100xx cards have 24k of packet memory, not 16k. Use it for them and update comments about original patches doing this and it not working. It works for both the DL10019 and DL10022 based cards that I have. It really helps the DL10019 cards, since they were using 8k instead of the normal 16k that regular NE-2000 cards help. # Note to self: need to provide a common routine to setup memory # parameters. Modified: head/sys/dev/ed/if_ed_pccard.c Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Tue Apr 7 15:36:02 2009 (r190802) +++ head/sys/dev/ed/if_ed_pccard.c Tue Apr 7 15:40:38 2009 (r190803) @@ -622,10 +622,6 @@ bad: /* * Probe the Ethernet MAC addrees for PCMCIA Linksys EtherFast 10/100 * and compatible cards (DL10019C Ethernet controller). - * - * Note: The PAO patches try to use more memory for the card, but that - * seems to fail for my card. A future optimization would add this back - * conditionally. */ static int ed_pccard_dl100xx(device_t dev, const struct ed_product *pp) @@ -633,6 +629,7 @@ ed_pccard_dl100xx(device_t dev, const st struct ed_softc *sc = device_get_softc(dev); u_char sum; uint8_t id; + u_int memsize; int i, error; if (!(pp->flags & NE2000DVF_DL100XX)) @@ -666,8 +663,26 @@ ed_pccard_dl100xx(device_t dev, const st ed_nic_outb(sc, ED_P0_DCR, ED_DCR_WTS | ED_DCR_FT1 | ED_DCR_LS); id = ed_asic_inb(sc, 0xf); sc->isa16bit = 1; - sc->vendor = ED_VENDOR_NOVELL; + /* + * Hard code values based on the datasheet. We're NE-2000 compatible + * NIC with 24kb of packet memory starting at 24k offset. These + * cards also work with 16k at 16k, but don't work with 24k at 16k + * or 32k at 16k. + */ sc->type = ED_TYPE_NE2000; + sc->mem_start = 24 * 1024; + memsize = sc->mem_size = 24 * 1024; + sc->mem_end = sc->mem_start + memsize; + sc->tx_page_start = memsize / ED_PAGE_SIZE; + sc->txb_cnt = 3; + 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; + + sc->mem_ring = sc->mem_start + sc->txb_cnt * ED_PAGE_SIZE * ED_TXBUF_SIZE; + + ed_nic_outb(sc, ED_P0_PSTART, sc->mem_start / ED_PAGE_SIZE); + ed_nic_outb(sc, ED_P0_PSTOP, sc->mem_end / ED_PAGE_SIZE); + sc->vendor = ED_VENDOR_NOVELL; sc->chip_type = (id & 0x90) == 0x90 ? ED_CHIP_TYPE_DL10022 : ED_CHIP_TYPE_DL10019; sc->type_str = ((id & 0x90) == 0x90) ? "DL10022" : "DL10019";