kern/61300: [patch] Enabling HomePNA PHY on aue(4) for HomePNA connections

Dinesh Nair dinesh at alphaque.com
Tue Jan 13 01:00:35 PST 2004


>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 at 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 <dinesh at alphaque.com>
+	 * 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:


More information about the freebsd-bugs mailing list