From owner-freebsd-bugs@FreeBSD.ORG Tue Jan 13 01:00:35 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8EFFD16A4CE for ; Tue, 13 Jan 2004 01:00:35 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE50D43D58 for ; Tue, 13 Jan 2004 01:00:29 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i0D90TFR042335 for ; Tue, 13 Jan 2004 01:00:29 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i0D90TtU042334; Tue, 13 Jan 2004 01:00:29 -0800 (PST) (envelope-from gnats) Resent-Date: Tue, 13 Jan 2004 01:00:29 -0800 (PST) Resent-Message-Id: <200401130900.i0D90TtU042334@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dinesh Nair Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C18D716A4CE for ; Tue, 13 Jan 2004 00:57:33 -0800 (PST) Received: from ns2.alphaque.com (ns2.alphaque.com [202.75.47.153]) by mx1.FreeBSD.org (Postfix) with SMTP id 9891643D4C for ; Tue, 13 Jan 2004 00:57:21 -0800 (PST) (envelope-from dinesh@alphaque.com) Received: (qmail 5570 invoked by uid 0); 13 Jan 2004 08:57:20 -0000 Received: from lucifer.net-gw.com (HELO prophet.alphaque.com) (202.75.47.153) by lucifer.net-gw.com with SMTP; 13 Jan 2004 08:57:20 -0000 Received: from prophet.alphaque.com (localhost.alphaque.com [127.0.0.1]) by prophet.alphaque.com (8.12.10/8.12.9) with ESMTP id i0D8tLab046490; Tue, 13 Jan 2004 16:55:21 +0800 (MYT) (envelope-from dinesh@alphaque.com) Received: (from dinesh@localhost) by prophet.alphaque.com (8.12.10/8.12.9/Submit) id i0D8tL7t046489; Tue, 13 Jan 2004 16:55:21 +0800 (MYT) Message-Id: <200401130855.i0D8tL7t046489@prophet.alphaque.com> Date: Tue, 13 Jan 2004 16:55:21 +0800 (MYT) From: Dinesh Nair To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: dinesh@alphaque.com Subject: kern/61300: [patch] Enabling HomePNA PHY on aue(4) for HomePNA connections X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Dinesh Nair List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jan 2004 09:00:35 -0000 >Number: 61300 >Category: kern >Synopsis: [patch] Enabling HomePNA PHY on aue(4) for HomePNA connections >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jan 13 01:00:29 PST 2004 >Closed-Date: >Last-Modified: >Originator: Dinesh Nair >Release: FreeBSD 4.9-STABLE i386 >Organization: www.alphaque.com >Environment: System: FreeBSD prophet.alphaque.com 4.9-STABLE FreeBSD 4.9-STABLE #14: Thu Jan 8 21:14:15 MYT 2004 dinesh@prophet.alphaque.com:/usr/src/sys/compile/ALPHAQUE i386 >Description: The ADMtek AN986 Pegasus USB Ethernet driver aue(4) currently has no support for the HomePNA PHY interface for the PegasusII chipset. This means that users who are using this USB device for HomePNA usage will not be able to do so. The following patch addresses this lack of functionality by enabling the HomePNA PHY with the 'ifconfig aueX media homepna' command, and enabling the Ethernet PHY with the 'ifconfig aueX media auto' command. auto is also synonymous with 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX. Reference was made to the ADM8511 Datasheet at http://www.admtek.com.tw/download/nic/adm8511/ADM8511_DSH_204.pdf. Do note that upon USB attach, the HomePNA PHY is disabled and the Ethernet PHY is enabled by default. This PR contains a patch to /usr/src/sys/dev/usb/if_aue.c to enable the HomePNA PHY as per the Description above. >How-To-Repeat: Attach device to USB and configure for HomePNA >Fix: Apply the following patch to /usr/src/sys/dev/usb/if_aue.c --- if_aue.c.patch begins here --- --- if_aue.c.org Thu Jan 8 19:29:27 2004 +++ if_aue.c Fri Jan 9 01:55:48 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,26 @@ mii = device_get_softc(sc->aue_miibus); AUE_CLRBIT(sc, AUE_CTL0, AUE_CTL0_RX_ENB|AUE_CTL0_TX_ENB); + + /* + * If media type is set to HomePNA, + * set GPIO0 and GPI01 output value to 1 and + * enable MII and USB test mode + * + * Patched by Dinesh Nair + * Fri Jan 9 01:55:25 MYT 2004 + * + */ + 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 +596,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 --- if_aue.c.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted: