[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ossig] Re: eBuildings USB dongle and FreeBSD




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

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


---------------------------------------------------------
To unsubscribe: send mail to ossig-request@mncc.com.my
with "unsubscribe ossig" in the body of the message