Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Jan 2004 20:09:58 +0800 (MYT)
From:      Dinesh Nair <dinesh@alphaque.com>
To:        freebsd-questions@freebsd.org, <freebsd-hackers@freebsd.org>
Subject:   SOLVED: ADMtek USB To LAN Converter and HomePNA
Message-ID:  <20040108200607.N384-100000@prophet.alphaque.com>
In-Reply-To: <20040107212459.X330-100000@prophet.alphaque.com>

next in thread | previous in thread | raw e-mail | index | archive | help

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.org	Thu Jan  8 19:29:27 2004
+++ if_aue.c	Thu 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=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
>         ether 00:08:54:d0:5d:2e
>         media: Ethernet homePNA (none)
>
> i run 'ifconfig aue0 10.1.105.26 netmask 0xffff0000 media homepna' and the
> device then gets to the following:
>
> aue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         inet 10.1.105.26 netmask 0xffff0000 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.org        Wed Jan  7 20:02:51 2004
> +++ if_aue.c    Wed 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 <dinesh@alphaque.com>
> +        * 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."
> dinesh@alphaque.com                (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."
dinesh@alphaque.com                (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                                                              |
+=========================================================================+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040108200607.N384-100000>