SOLVED: ADMtek USB To LAN Converter and HomePNA

2004-01-08 Thread Dinesh Nair

people,

the following patch solves this problem. according to the ADM8511
datasheet, a couple of registers need to be set with specific values to
enable the HomePNA PHY on the device. the current aue(4) driver does not
do this, and thus by default the device will only enable the Ethernet PHY.
you'd need to rebuild kernel or just kldunload/kldload if using the
if_aue.ko module.

--- CUT HERE ---
--- if_aue.c.orgThu Jan  8 19:29:27 2004
+++ if_aue.cThu Jan  8 19:29:27 2004
@@ -581,7 +581,7 @@
csr_write_1(sc, AUE_REG_81, 6);
else
 #endif
-   csr_write_1(sc, AUE_REG_81, 2);
+   csr_write_1(sc, AUE_REG_81, 6);
 }

 Static void
@@ -610,6 +610,7 @@
 */
csr_write_1(sc, AUE_GPIO0, AUE_GPIO_OUT0|AUE_GPIO_SEL0);
csr_write_1(sc, AUE_GPIO0, AUE_GPIO_OUT0|AUE_GPIO_SEL0|AUE_GPIO_SEL1);
+   csr_write_1(sc, AUE_GPIO1, 0x34);

/* Grrr. LinkSys has to be different from everyone else. */
if (sc-aue_info-aue_flags  LSYS) {
---CUT HERE ---

On Wed, 7 Jan 2004, Dinesh Nair wrote:

 hey,

 i have one of the above. it's a usb device which connects to a HomePNA
 network, with a 10/100Mbps ethernet port as well as a couple of RJ11s for
 the HomePNA connection.

 my problem is i am unable to utilize this device to connect to the HomePNA
 network. upon plugging it in, the console says:

 aue0: ADMtek USB To LAN Converter, rev 1.10/1.01, addr 2
 aue0: Ethernet address: 00:08:54:d0:5d:2e
 miibus1: MII bus on aue0
 pnaphy0: Am79c978 HomePNA PHY on miibus1
 pnaphy0:  HomePNA

 ifconfig aue0 response is:
 aue0: flags=8802BROADCAST,SIMPLEX,MULTICAST mtu 1500
 ether 00:08:54:d0:5d:2e
 media: Ethernet homePNA (none)

 i run 'ifconfig aue0 10.1.105.26 netmask 0x media homepna' and the
 device then gets to the following:

 aue0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
 inet 10.1.105.26 netmask 0x broadcast 10.1.255.255
 ether 00:08:54:d0:5d:2e
 media: Ethernet homePNA
 status: active

 however, i am unable to ping any ip address other than the interface's
 address. obviously, no firewalls (ipfw/ipchains/ipf) are being run and
 this is on FreeBSD 4.9-STABLE built as of a couple of weeks back.

 i've played around with disabling the ethernet PHY on the device with the
 following diff to /usr/src/sys/dev/usb/if_aue.c:

 --- CUT HERE ---
 --- if_aue.c.orgWed Jan  7 20:02:51 2004
 +++ if_aue.cWed Jan  7 21:04:06 2004
 @@ -434,6 +434,28 @@
  #endif
 }

 +   /*
 +* The Am79C978 HomePNA PHY actually contains
 +* two transceivers: a 1Mbps HomePNA PHY and a
 +* 10Mbps full/half duplex ethernet PHY with
 +* NWAY autoneg. However, the HomePNA PHY is
 +* not recognized, but the 10/100Mbps PHY is
 +* though. This skips over the 10/100Mbps PHY
 +* and only activates the 1Mbps HomePNA PHY
 +*
 +* Modified by Dinesh Nair [EMAIL PROTECTED]
 +* Wed Jan  7 20:36:34 MYT 2004
 +*
 +*/
 +   if (sc-aue_info-aue_vid == USB_VENDOR_ADMTEK 
 +   sc-aue_info-aue_did == USB_PRODUCT_ADMTEK_PEGASUSII) {
 +   if (phy == 1)
 +   return(0);
 +   }
 +   /*
 +* End of modifications by Dinesh Nair
 +*/
 +
 csr_write_1(sc, AUE_PHY_ADDR, phy);
 csr_write_1(sc, AUE_PHY_CTL, reg|AUE_PHYCTL_READ);
 --- CUT HERE ---

 but to no avail. i've discovered that the ethernet PHY is phy==1, while
 the two RJ11 PHYs are 2 and 3.

 the ethernet PHY works fine and dandy, and i am able to connect it to my
 local switch fine. however, i need to use it for a HomePNA application,
 and thus need to HomePNA portion of this to work.

 any ideas from anyone who's tried something like this before with some
 measure of success ? any media types or mediaopts i should be passing to
 ifconfig ?

 this setup is used by a broadband provider in kuala lumpur, malaysia and
 to date this has been the one barrier which prevents freebsd users from
 utilizing their service.

 Regards,   /\_/\   All dogs go to heaven.
 [EMAIL PROTECTED](0 0)http://www.alphaque.com/
 +==oOO--(_)--OOo==+
 | for a in past present future; do|
 |   for b in clients employers associates relatives neighbours pets; do   |
 |   echo The opinions here in no way reflect the opinions of my $a $b.  |
 | done; done  |
 +=+



Regards,   /\_/\   All dogs go to heaven.
[EMAIL PROTECTED](0 0)http://www.alphaque.com/
+==oOO--(_)--OOo==+
| for a in past present future; do

SOLVED: ADMtek USB To LAN Converter and HomePNA

2004-01-08 Thread Dinesh Nair

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.orgWed Jan  7 20:02:51 2004
+++ if_aue.cThu 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


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


ADMtek USB To LAN Converter and HomePNA

2004-01-07 Thread Dinesh Nair

hey,

i have one of the above. it's a usb device which connects to a HomePNA
network, with a 10/100Mbps ethernet port as well as a couple of RJ11s for
the HomePNA connection.

my problem is i am unable to utilize this device to connect to the HomePNA
network. upon plugging it in, the console says:

aue0: ADMtek USB To LAN Converter, rev 1.10/1.01, addr 2
aue0: Ethernet address: 00:08:54:d0:5d:2e
miibus1: MII bus on aue0
pnaphy0: Am79c978 HomePNA PHY on miibus1
pnaphy0:  HomePNA

ifconfig aue0 response is:
aue0: flags=8802BROADCAST,SIMPLEX,MULTICAST mtu 1500
ether 00:08:54:d0:5d:2e
media: Ethernet homePNA (none)

i run 'ifconfig aue0 10.1.105.26 netmask 0x media homepna' and the
device then gets to the following:

aue0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
inet 10.1.105.26 netmask 0x broadcast 10.1.255.255
ether 00:08:54:d0:5d:2e
media: Ethernet homePNA
status: active

however, i am unable to ping any ip address other than the interface's
address. obviously, no firewalls (ipfw/ipchains/ipf) are being run and
this is on FreeBSD 4.9-STABLE built as of a couple of weeks back.

i've played around with disabling the ethernet PHY on the device with the
following diff to /usr/src/sys/dev/usb/if_aue.c:

--- CUT HERE ---
--- if_aue.c.orgWed Jan  7 20:02:51 2004
+++ if_aue.cWed Jan  7 21:04:06 2004
@@ -434,6 +434,28 @@
 #endif
}

+   /*
+* The Am79C978 HomePNA PHY actually contains
+* two transceivers: a 1Mbps HomePNA PHY and a
+* 10Mbps full/half duplex ethernet PHY with
+* NWAY autoneg. However, the HomePNA PHY is
+* not recognized, but the 10/100Mbps PHY is
+* though. This skips over the 10/100Mbps PHY
+* and only activates the 1Mbps HomePNA PHY
+*
+* Modified by Dinesh Nair [EMAIL PROTECTED]
+* Wed Jan  7 20:36:34 MYT 2004
+*
+*/
+   if (sc-aue_info-aue_vid == USB_VENDOR_ADMTEK 
+   sc-aue_info-aue_did == USB_PRODUCT_ADMTEK_PEGASUSII) {
+   if (phy == 1)
+   return(0);
+   }
+   /*
+* End of modifications by Dinesh Nair
+*/
+
csr_write_1(sc, AUE_PHY_ADDR, phy);
csr_write_1(sc, AUE_PHY_CTL, reg|AUE_PHYCTL_READ);
--- CUT HERE ---

but to no avail. i've discovered that the ethernet PHY is phy==1, while
the two RJ11 PHYs are 2 and 3.

the ethernet PHY works fine and dandy, and i am able to connect it to my
local switch fine. however, i need to use it for a HomePNA application,
and thus need to HomePNA portion of this to work.

any ideas from anyone who's tried something like this before with some
measure of success ? any media types or mediaopts i should be passing to
ifconfig ?

this setup is used by a broadband provider in kuala lumpur, malaysia and
to date this has been the one barrier which prevents freebsd users from
utilizing their service.

Regards,   /\_/\   All dogs go to heaven.
[EMAIL PROTECTED](0 0)http://www.alphaque.com/
+==oOO--(_)--OOo==+
| for a in past present future; do|
|   for b in clients employers associates relatives neighbours pets; do   |
|   echo The opinions here in no way reflect the opinions of my $a $b.  |
| done; done  |
+=+

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]