Re: MicroLinear 6692 PHY for tl(4) -- Olicom 2326

2011-03-25 Thread Loganaden Velvindron
Hi Claudio,

The diff fails to apply cleanly:
|Index: share/man/man4/Makefile
|===
|RCS file: /cvs/src/share/man/man4/Makefile,v
|retrieving revision 1.519
|diff -u -p -r1.519 Makefile
|--- share/man/man4/Makefile15 Jan 2011 04:35:34 -  1.519
|+++ share/man/man4/Makefile23 Mar 2011 17:18:26 -
--
Patching file Makefile using Plan A...
No such line 32 in input file, ignoring
Hunk #1 failed at 33.
1 out of 1 hunks failed--saving rejects to Makefile.rej
Hmm...  The next patch looks like a unified diff to me...
The text leading up to this was:


//Logan
C-x-C-c



Re: MicroLinear 6692 PHY for tl(4) -- Olicom 2326

2011-03-23 Thread Claudio Jeker
On Tue, Feb 15, 2011 at 12:32:20PM -0500, Loganaden Velvindron wrote:
 Hi,
 
 Yes, the diff does work with half/full duplex.
 
 I fixed the style issues  added checks for other being NULL. To
 test those changes, I disabled tlphy  ukphy, and tested the tl
 adapter with mlphy only. All modes work. I think it's better to
 be on the safe side and assume that the companion PHY may not be
 present at all (It could be damaged for instance).
 

... and here is a full diff including manpages and all the needed hooks to
make mlphy work.

If no one screams I will commit this end of this week
-- 
:wq Claudio

Index: share/man/man4/Makefile
===
RCS file: /cvs/src/share/man/man4/Makefile,v
retrieving revision 1.519
diff -u -p -r1.519 Makefile
--- share/man/man4/Makefile 15 Jan 2011 04:35:34 -  1.519
+++ share/man/man4/Makefile 23 Mar 2011 17:18:26 -
@@ -33,8 +33,8 @@ MAN=  aac.4 ac97.4 acphy.4 \
kate.4 km.4 ksyms.4 kue.4 lc.4 lge.4 lii.4 lisa.4 lkm.4 lm.4 \
lmc.4 lmenv.4 lmn.4 lmtemp.4 lo.4 lofn.4 lpt.4 lxtphy.4 luphy.4 \
maestro.4 mainbus.4 malo.4 maxds.4 maxtmp.4 mbg.4 midi.4 mii.4 mfi.4 \
-   moscom.4 mos.4 mpe.4 mpath.4 mpi.4 mpii.4 mpu.4 msk.4 msts.4 mtd.4 \
-   mtdphy.4 multicast.4 mtio.4 myx.4 \
+   mlphy.4 moscom.4 mos.4 mpe.4 mpath.4 mpi.4 mpii.4 mpu.4 msk.4 msts.4 \
+   mtd.4 mtdphy.4 multicast.4 mtio.4 myx.4 \
ne.4 neo.4 netintro.4 nfe.4 nge.4 nmea.4 \
noct.4 nofn.4 nsclpcsio.4 nsgphy.4 nsphy.4 nsphyter.4 null.4 nviic.4 \
ohci.4 options.4 onewire.4 oosiop.4 osiop.4 otus.4 \
Index: share/man/man4/mlphy.4
===
RCS file: share/man/man4/mlphy.4
diff -N share/man/man4/mlphy.4
--- /dev/null   1 Jan 1970 00:00:00 -
+++ share/man/man4/mlphy.4  23 Mar 2011 17:19:18 -
@@ -0,0 +1,43 @@
+.\$OpenBSD$
+.\
+.\ Copyright (c) 2011 Loganaden V. Velvindron logana...@devio.us
+.\
+.\ Permission to use, copy, modify, and distribute this software for any
+.\ purpose with or without fee is hereby granted, provided that the above
+.\ copyright notice and this permission notice appear in all copies.
+.\
+.\ THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+.\ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+.\ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+.\ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+.\ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+.\ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+.\ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+.Dd $Mdocdate$
+.Dt MLPHY 4
+.Os
+.Sh NAME
+.Nm mlphy
+.Nd MicroLinear 6692 Ethernet PHY
+.Sh SYNOPSIS
+.Cd mlphy* at mii?
+.Sh DESCRIPTION
+The
+.Nm
+driver supports MicroLinear 6692 10/100 Ethernet PHYs.
+The MicroLinear PHY only supports 100baseTX operation but can advertise
+10baseT operation for a possible companion PHY.
+.Sh SEE ALSO
+.Xr ifmedia 4 ,
+.Xr intro 4 ,
+.Xr mii 4 ,
+.Xr ifconfig 8
+.Sh BUGS
+The OUI and device identification of the MicroLinear 6692 PHY are
+undefined and so
+.Nm
+only attaches to
+.Xr tl 4
+devices using the
+.Xr tlphy 4
+as companion PHY.
Index: share/man/man4/tl.4
===
RCS file: /cvs/src/share/man/man4/tl.4,v
retrieving revision 1.19
diff -u -p -r1.19 tl.4
--- share/man/man4/tl.4 7 Jun 2008 21:36:19 -   1.19
+++ share/man/man4/tl.4 22 Mar 2011 15:55:31 -
@@ -41,6 +41,7 @@
 .Sh SYNOPSIS
 .Cd tl* at pci?
 .Cd lxtphy* at mii?
+.Cd mlphy* at mii?
 .Cd nsphy* at mii?
 .Cd tlphy* at mii?
 .Sh DESCRIPTION
@@ -119,6 +120,7 @@ allocating a pad buffer or collapsing an
 .Xr ifmedia 4 ,
 .Xr intro 4 ,
 .Xr lxtphy 4 ,
+.Xr mlphy 4 ,
 .Xr netintro 4 ,
 .Xr nsphy 4 ,
 .Xr pci 4 ,
Index: sys/arch/alpha/conf/GENERIC
===
RCS file: /cvs/src/sys/arch/alpha/conf/GENERIC,v
retrieving revision 1.220
diff -u -p -r1.220 GENERIC
--- sys/arch/alpha/conf/GENERIC 7 Mar 2011 07:05:50 -   1.220
+++ sys/arch/alpha/conf/GENERIC 22 Mar 2011 14:57:04 -
@@ -299,6 +299,7 @@ urlphy* at mii? # Realtek 
RTL8150L in
 rgephy*at mii? # Realtek 8169S/8110S PHY
 ciphy* at mii? # Cicada CS8201 10/100/1000 copper PHY
 ipgphy*at mii? # IC Plus IP1000A PHYs
+mlphy* at mii? # Micro Linear 6692 PHY
 ukphy* at mii? # unknown PHYs
 
 # sensors
Index: sys/arch/alpha/conf/RAMDISKBIG
===
RCS file: /cvs/src/sys/arch/alpha/conf/RAMDISKBIG,v
retrieving revision 1.81
diff -u -p -r1.81 RAMDISKBIG
--- sys/arch/alpha/conf/RAMDISKBIG  3 Jul 2010 03:59:16 

Re: MicroLinear 6692 PHY for tl(4) -- Olicom 2326

2011-02-15 Thread Claudio Jeker
On Sun, Feb 13, 2011 at 05:03:03AM -0500, Loganaden Velvindron wrote:
 Hi,
 
 Claudio suggested to me a better way of cycling through the PHYs.
 Does this look good ?
 
 /*$OpenBSD: ukphy.c,v 1.20 2010/07/23 07:47:13 jsg Exp $  */
 /*$NetBSD: ukphy.c,v 1.9 2000/02/02 23:34:57 thorpej Exp $*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999
  *Bill Paul wpaul at ctr.columbia.edu.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * 1. Redistributions of source code must retain the above copyright
  *notice, this list of conditions and the following disclaimer.
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
  * 3. All advertising materials mentioning features or use of this software
  *must display the following acknowledgement:
  *This product includes software developed by Bill Paul.
  * 4. Neither the name of the author nor the names of any co-contributors
  *may be used to endorse or promote products derived from this software
  *without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
  */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
  * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
  * NASA Ames Research Center, and by Frank van der Linden.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * 1. Redistributions of source code must retain the above copyright
  *notice, this list of conditions and the following disclaimer.
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
 /*
  * Copyright (c) 1997 Manuel Bouyer.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * 1. Redistributions of source code must retain the above copyright
  *notice, this list of conditions and the following disclaimer.
  * 2. Redistributions in binary form must reproduce the above copyright
  *notice, this list of conditions and the following disclaimer in the
  *documentation and/or other materials provided with the distribution.
  *
  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) 

Re: MicroLinear 6692 PHY for tl(4) -- Olicom 2326

2011-02-15 Thread Stuart Henderson
On 2011/02/15 14:05, Claudio Jeker wrote:
  
  /*
   * Micro Linear PHY reports oui == 0 model == 0
   */
  if (MII_OUI(ma-mii_id1, ma-mii_id2) != 0 ||
 MII_MODEL(ma-mii_id2) != 0)
  return (0);
  /*
   * Make sure the parent is a `tl'. So far, I have only
   * encountered the 6692 on an Olicom card with a ThunderLAN
   * controller chip.
   */
  if (strcmp(parent-dv_cfdata-cf_driver-cd_name, tl) != 0)
  return (0);
 
 I don't like this. Why restrict it to tl(4) only. The phy may work on any
 other mii bus so there is no reason for this restriction.

I'm not sure attaching to every OUI 0x00 model 0x is safe..

pcn0 at pci0 dev 3 function 0 AMD 79c970 PCnet-PCI rev 0x30, Am79c973, rev 0: 
irq 11, address 08:00:27:6a:ef:bc
ukphy0 at pcn0 phy 0: Generic IEEE 802.3u media interface, rev. 0: OUI 
0x00, model 0x

mos0 at uhub0 port 4 configuration 1 interface 0 Moschip Semiconductor USB-MAC 
Controller rev 2.00/1.00 addr 2
mos0: MCS7830, address 00:0c:f6:3a:f4:46
ukphy0 at mos0 phy 1: Generic IEEE 802.3u media interface, rev. 0: OUI 
0x00, model 0x



Re: MicroLinear 6692 PHY for tl(4) -- Olicom 2326

2011-02-15 Thread Claudio Jeker
On Tue, Feb 15, 2011 at 01:28:28PM +, Stuart Henderson wrote:
 On 2011/02/15 14:05, Claudio Jeker wrote:
   
 /*
  * Micro Linear PHY reports oui == 0 model == 0
  */
 if (MII_OUI(ma-mii_id1, ma-mii_id2) != 0 ||
MII_MODEL(ma-mii_id2) != 0)
 return (0);
 /*
  * Make sure the parent is a `tl'. So far, I have only
  * encountered the 6692 on an Olicom card with a ThunderLAN
  * controller chip.
  */
 if (strcmp(parent-dv_cfdata-cf_driver-cd_name, tl) != 0)
 return (0);
  
  I don't like this. Why restrict it to tl(4) only. The phy may work on any
  other mii bus so there is no reason for this restriction.
 
 I'm not sure attaching to every OUI 0x00 model 0x is safe..
 
 pcn0 at pci0 dev 3 function 0 AMD 79c970 PCnet-PCI rev 0x30, Am79c973, rev 
 0: irq 11, address 08:00:27:6a:ef:bc
 ukphy0 at pcn0 phy 0: Generic IEEE 802.3u media interface, rev. 0: OUI 
 0x00, model 0x
 
 mos0 at uhub0 port 4 configuration 1 interface 0 Moschip Semiconductor 
 USB-MAC Controller rev 2.00/1.00 addr 2
 mos0: MCS7830, address 00:0c:f6:3a:f4:46
 ukphy0 at mos0 phy 1: Generic IEEE 802.3u media interface, rev. 0: OUI 
 0x00, model 0x
 

Hmm. Right. Forgot that the PHY has no oui or model. So ignore that.

-- 
:wq Claudio



Re: MicroLinear 6692 PHY for tl(4) -- Olicom 2326

2011-02-15 Thread Loganaden Velvindron
Hi,

Yes, the diff does work with half/full duplex.

I fixed the style issues  added checks for other being NULL. To
test those changes, I disabled tlphy  ukphy, and tested the tl
adapter with mlphy only. All modes work. I think it's better to
be on the safe side and assume that the companion PHY may not be
present at all (It could be damaged for instance).

/*  $OpenBSD: ukphy.c,v 1.20 2010/07/23 07:47:13 jsg Exp $  */
/*  $NetBSD: ukphy.c,v 1.9 2000/02/02 23:34:57 thorpej Exp $*/

/*-
 * Copyright (c) 1997, 1998, 1999
 *  Bill Paul wpaul at ctr.columbia.edu.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *must display the following acknowledgement:
 *  This product includes software developed by Bill Paul.
 * 4. Neither the name of the author nor the names of any co-contributors
 *may be used to endorse or promote products derived from this software
 *without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

/*-
 * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
 * NASA Ames Research Center, and by Frank van der Linden.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * Copyright (c) 1997 Manuel Bouyer.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 

Re: MicroLinear 6692 PHY for tl(4) -- Olicom 2326

2011-02-13 Thread Loganaden Velvindron
Hi,
Claudio suggests better cylcing through the list of PHYs. Does
this look ok ?

/*  $OpenBSD: ukphy.c,v 1.20 2010/07/23 07:47:13 jsg Exp $  */
/*  $NetBSD: ukphy.c,v 1.9 2000/02/02 23:34:57 thorpej Exp $*/

/*-
 * Copyright (c) 1997, 1998, 1999
 *  Bill Paul wpaul at ctr.columbia.edu.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *must display the following acknowledgement:
 *  This product includes software developed by Bill Paul.
 * 4. Neither the name of the author nor the names of any co-contributors
 *may be used to endorse or promote products derived from this software
 *without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

/*-
 * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
 * NASA Ames Research Center, and by Frank van der Linden.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * Copyright (c) 1997 Manuel Bouyer.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * Micro Linear 6692 PHY
 */

#include sys/param.h

Re: MicroLinear 6692 PHY for tl(4) -- Olicom 2326

2011-02-13 Thread Loganaden Velvindron
Hi,

Claudio suggested to me a better way of cycling through the PHYs.
Does this look good ?

/*  $OpenBSD: ukphy.c,v 1.20 2010/07/23 07:47:13 jsg Exp $  */
/*  $NetBSD: ukphy.c,v 1.9 2000/02/02 23:34:57 thorpej Exp $*/

/*-
 * Copyright (c) 1997, 1998, 1999
 *  Bill Paul wpaul at ctr.columbia.edu.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *must display the following acknowledgement:
 *  This product includes software developed by Bill Paul.
 * 4. Neither the name of the author nor the names of any co-contributors
 *may be used to endorse or promote products derived from this software
 *without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

/*-
 * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
 * NASA Ames Research Center, and by Frank van der Linden.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * Copyright (c) 1997 Manuel Bouyer.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * Micro Linear 6692 PHY
 */

#include 

Re: MicroLinear 6692 PHY for tl(4) -- Olicom 2326

2011-02-11 Thread Loganaden Velvindron
Hi,

The older diff had issues with 10Mbit mode. I corrected it and now 
autonegociation, 100 Mbit, 10Mbit (in full/half duplex) works fine.

However, I encountered a few issues: When cylcing through the PHYs, it
seems that OpenBSD MII framework starts from PHY nmber 31 and decrements
till in reaches 0. If I disable the 2nd phy (tlphy(4)), 10Mbit doesn't work
correctly when it looks for the 2nd PHY. Can someone confirm this ? In 
FreeBSD, the driver is written to cycle through the PHY in ascending order.

/*  $OpenBSD: ukphy.c,v 1.20 2010/07/23 07:47:13 jsg Exp $  */
/*  $NetBSD: ukphy.c,v 1.9 2000/02/02 23:34:57 thorpej Exp $*/

/*-
 * Copyright (c) 1997, 1998, 1999
 *  Bill Paul wpaul at ctr.columbia.edu.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *must display the following acknowledgement:
 *  This product includes software developed by Bill Paul.
 * 4. Neither the name of the author nor the names of any co-contributors
 *may be used to endorse or promote products derived from this software
 *without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

/*-
 * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
 * NASA Ames Research Center, and by Frank van der Linden.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * Copyright (c) 1997 Manuel Bouyer.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 

Re: MicroLinear 6692 PHY for tl(4) -- Olicom 2326

2010-12-30 Thread Loganaden Velvindron
You can have the card if you want it. Contact me offline, and
we can discuss on ways to get it to you. I no longer have time
to hack on openbsd.



Re: MicroLinear 6692 PHY for tl(4) -- Olicom 2326

2010-12-27 Thread Mark Kettenis
 Date: Mon, 27 Dec 2010 02:02:03 -0500 (EST)
 From: logana...@devio.us (Loganaden Velvindron)

Looks like your diff has some issues with tabs versus spaces.

 void
 mlphy_attach(struct device *parent, struct device *self, void *aux)
 {
   struct mlphy_softc *msc = (struct mlphy_softc *)self;
   struct mii_softc *sc = (struct mii_softc *)self;
   struct mii_attach_args *ma = aux;
   struct mii_data *mii = ma-mii_data;
 
   printf(:ML phy \n);

To be consistent with other PHY drivers, this should probably be
something like:

printf(: ML6692 100baseTX PHY\n);

   sc-mii_inst = mii-mii_instance;
   sc-mii_phy = ma-mii_phyno;
   sc-mii_funcs = mlphy_funcs;
   sc-mii_pdata = mii;
   sc-mii_flags = ma-mii_flags;
   msc-ml_dev = parent; 
 
 mii_phy_reset(sc);
 
   sc-mii_capabilities = PHY_READ(sc, MII_BMSR)  ma-mii_capmask;
 #define ADD(m, c) ifmedia_add(mii-mii_media, (m), (c), NULL)
   ADD(IFM_MAKEWORD(IFM_ETHER, IFM_100_TX, IFM_LOOP, sc-mii_inst),
  MII_MEDIA_100_TX);
   ma-mii_capmask = ~sc-mii_capabilities;
 #undef ADD
   if(sc-mii_capabilities  BMSR_MEDIAMASK)
   mii_phy_add_media(sc);
 }
 
 int
 mlphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
 {
   struct ifmedia_entry *ife = mii-mii_media.ifm_cur;
   struct mii_softc*other = NULL;
   struct mlphy_softc  *msc = (struct mlphy_softc *)sc;
   int other_inst, reg;
 
   other = LIST_FIRST(mii-mii_phys);
 for (; other != NULL ; other = LIST_NEXT(other, mii_list)) {
 /*going through list of PHYs*/
 }

Ehm, what does this actually do?  This will always result in other
being set to NULL isn't it?

It looks like this driver is written to deal with a 10baseT companion
PHY.  Does your tl(4) have such a companion PHY?  Did you test 10baseT
mode?

 
   if ((sc-mii_dev.dv_flags  DVF_ACTIVE) == 0) {
   return (ENXIO);
   }

Curly braces are redundant.

   switch (cmd) {
   case MII_POLLSTAT:
   /*
* If we're not polling our PHY instance, just return.
*/
   if (IFM_INST(ife-ifm_media) != sc-mii_inst)
   return (0);
   break;
 
   case MII_MEDIACHG:
   /*
* If the interface is not up, don't do anything.
*/
   if ((mii-mii_ifp-if_flags  IFF_UP) == 0)
   break;
 
   switch (IFM_SUBTYPE(ife-ifm_media)) {
   case IFM_AUTO:
   msc-ml_state = ML_STATE_AUTO_SELF; 
   if (other != NULL) {
   mii_phy_reset(other);
   PHY_WRITE(other, MII_BMCR, BMCR_ISO);
   }
   (void)mii_phy_auto(sc, 0);
   msc-ml_linked = 0;
   break;
 
   case IFM_10_T:
   /*
* For 10baseT modes, reset and program the
* companion PHY (of any), then setup ourselves
* to match. This will put us in pass-through
* mode and let the companion PHY do all the
* work.   
* BMCR data is stored in the ifmedia entry.
*/
   if (other != NULL) {
   mii_phy_reset(other);
   PHY_WRITE(other, MII_BMCR, 
  ife-ifm_data);
   }
   mii_phy_setmedia(sc);
   msc-ml_state = 0;
   break;
 
   case IFM_100_TX:
   /*
* For 100baseTX modes, reset and isolate the
* companion PHY (if any), then setup ourselves
* accordingly.
*
* BMCR data is stored in the ifmedia entry.
*/
   if (other != NULL) {
   mii_phy_reset(other);
   PHY_WRITE(other, MII_BMCR, BMCR_ISO);
   }
   mii_phy_setmedia(sc);
   msc-ml_state = 0;
   break;
 
   default:
   return (EINVAL);
   }
   break;
 
   case MII_TICK:
   /*
* If interface is not up, 

Re: MicroLinear 6692 PHY for tl(4) -- Olicom 2326

2010-12-26 Thread Ted Unangst
On Sun, Dec 26, 2010 at 3:40 PM, Loganaden Velvindron
logana...@devio.us wrote:
 Hi,
 With help from theo and miod, I ported mlphy(4) from freebsd,
 written originally by Bill Paul.

Not entirely relevant, but this is crediting NetBSD.  If the code came
from the FreeBSD tl driver, it should be credited as such.  It looks
like you probably started with the ukphy driver, but I'm not sure how
extensive the changes were.

 /*  $OpenBSD: ukphy.c,v 1.20 2010/07/23 07:47:13 jsg Exp $  */
 /*  $NetBSD: ukphy.c,v 1.9 2000/02/02 23:34:57 thorpej Exp $*/

 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.



Re: MicroLinear 6692 PHY for tl(4) -- Olicom 2326

2010-12-26 Thread Loganaden Velvindron
Yep. I started from ukphy.c and ported bits from the freebsd mlphy driver. I'll 
amend it shortly, once I get to work.

//Logan



Re: MicroLinear 6692 PHY for tl(4) -- Olicom 2326

2010-12-26 Thread Loganaden Velvindron
Here's the src with appropriate copyright.

/*  $OpenBSD: ukphy.c,v 1.20 2010/07/23 07:47:13 jsg Exp $  */
/*  $NetBSD: ukphy.c,v 1.9 2000/02/02 23:34:57 thorpej Exp $*/

/*-
 * Copyright (c) 1997, 1998, 1999
 *  Bill Paul wp...@ctr.columbia.edu.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *must display the following acknowledgement:
 *  This product includes software developed by Bill Paul.
 * 4. Neither the name of the author nor the names of any co-contributors
 *may be used to endorse or promote products derived from this software
 *without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 *
 */

/*-
 * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
 * NASA Ames Research Center, and by Frank van der Linden.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * Copyright (c) 1997 Manuel Bouyer.  All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *notice, this list of conditions and the following disclaimer in the
 *documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * Micro Linear 6692 PHY
 */

#include sys/param.h
#include sys/systm.h
#include sys/kernel.h