From owner-freebsd-questions@FreeBSD.ORG Thu Jan 8 05:30:29 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6F98316A4CE for ; Thu, 8 Jan 2004 05:30:29 -0800 (PST) Received: from ns2.alphaque.com (ns2.alphaque.com [202.75.47.153]) by mx1.FreeBSD.org (Postfix) with SMTP id 2580043D54 for ; Thu, 8 Jan 2004 05:30:24 -0800 (PST) (envelope-from dinesh@alphaque.com) Received: (qmail 70899 invoked by uid 0); 8 Jan 2004 13:30:21 -0000 Received: from lucifer.net-gw.com (HELO prophet.alphaque.com) (202.75.47.153) by lucifer.net-gw.com with SMTP; 8 Jan 2004 13:30:21 -0000 Received: from localhost (localhost.alphaque.com [127.0.0.1]) by prophet.alphaque.com (8.12.10/8.12.9) with ESMTP id i08DU1ac000357; Thu, 8 Jan 2004 21:30:01 +0800 (MYT) (envelope-from dinesh@alphaque.com) Date: Thu, 8 Jan 2004 21:30:01 +0800 (MYT) From: Dinesh Nair To: freebsd-hackers@freebsd.org, Message-ID: <20040108212829.C336-100000@prophet.alphaque.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: SOLVED: ADMtek USB To LAN Converter and HomePNA X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jan 2004 13:30:29 -0000 use the following patch instead of earlier one. earlier patch hardcoded use of HomePNA PHY and disabled Ethernet PHY. this patch corrects this behaviour and allows switching between either PHY thru use of the ifconfig command. this means that the USB dongle can either be used as an Ethernet device (connect to switch/hub) or as a HomePNA access device, but not both simultaneously. ifconfig aue0 media homepna # activates HomePNA PHY/RJ11 ifconfig aue0 media auto # activates Ethernet PHY/RJ45 using auto as media type is synonymous with the following media types: 10baseT 10baseT-FDX 100baseTX 100baseTX-FDX much apologies for not checking things correctly before submitting the patch. patch follows: ------- CUT HERE ------- --- if_aue.c.org Wed Jan 7 20:02:51 2004 +++ if_aue.c Thu Jan 8 21:12:23 2004 @@ -118,7 +118,7 @@ { USB_VENDOR_ACCTON, USB_PRODUCT_ACCTON_USB320_EC, 0 }, { USB_VENDOR_ACCTON, USB_PRODUCT_ACCTON_SS1001, PII }, { USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUS, PNA }, - { USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUSII, PII }, + { USB_VENDOR_ADMTEK, USB_PRODUCT_ADMTEK_PEGASUSII, PNA|PII }, { USB_VENDOR_BELKIN, USB_PRODUCT_BELKIN_USB2LAN, PII }, { USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USB100, 0 }, { USB_VENDOR_BILLIONTON, USB_PRODUCT_BILLIONTON_USBLP100, PNA }, @@ -492,6 +492,17 @@ mii = device_get_softc(sc->aue_miibus); AUE_CLRBIT(sc, AUE_CTL0, AUE_CTL0_RX_ENB|AUE_CTL0_TX_ENB); + + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_homePNA) { + if (sc->aue_info->aue_flags & (PNA|PII)) { + csr_write_1(sc, AUE_GPIO1, 0x34); + csr_write_1(sc, AUE_REG_81, 6); + } + } else { + csr_write_1(sc, AUE_GPIO1, 0x26); + csr_write_1(sc, AUE_REG_81, 2); + } + if (IFM_SUBTYPE(mii->mii_media_active) == IFM_100_TX) { AUE_SETBIT(sc, AUE_CTL1, AUE_CTL1_SPEEDSEL); } else { @@ -576,12 +587,10 @@ /* Magic constants taken from Linux driver. */ csr_write_1(sc, AUE_REG_1D, 0); csr_write_1(sc, AUE_REG_7B, 2); -#if 0 - if ((sc->aue_flags & HAS_HOME_PNA) && mii_mode) - csr_write_1(sc, AUE_REG_81, 6); - else -#endif + + if (sc->aue_info->aue_flags & PNA) { csr_write_1(sc, AUE_REG_81, 2); + } } Static void ------- CUT HERE ------- --dinesh