Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb axen(4): Use axen mii read/write reg routines, n...



details:   https://anonhg.NetBSD.org/src/rev/7505c015b0c3
branches:  trunk
changeset: 362537:7505c015b0c3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu Mar 03 05:54:11 2022 +0000

description:
axen(4): Use axen mii read/write reg routines, not usbnet ones.

The usbnet wrappers don't add anything important.  We already test
usbnet_isdying in axen_cmd, and that's already a best-effort thing
(which should probably be done better by having usbd_do_request fail
promptly if detaching anyway).

diffstat:

 sys/dev/usb/if_axen.c |  18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diffs (44 lines):

diff -r 019ceaed0284 -r 7505c015b0c3 sys/dev/usb/if_axen.c
--- a/sys/dev/usb/if_axen.c     Thu Mar 03 05:54:03 2022 +0000
+++ b/sys/dev/usb/if_axen.c     Thu Mar 03 05:54:11 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_axen.c,v 1.86 2022/03/03 05:54:03 riastradh Exp $   */
+/*     $NetBSD: if_axen.c,v 1.87 2022/03/03 05:54:11 riastradh Exp $   */
 /*     $OpenBSD: if_axen.c,v 1.3 2013/10/21 10:10:22 yuo Exp $ */
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.86 2022/03/03 05:54:03 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_axen.c,v 1.87 2022/03/03 05:54:11 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -492,18 +492,18 @@
 #define GMII_PHY_PAGE_SEL      0x1e
 #define GMII_PHY_PAGE_SEL      0x1f
 #define GMII_PAGE_EXT          0x0007
-       usbnet_mii_writereg(un->un_dev, un->un_phyno, GMII_PHY_PAGE_SEL,
+       axen_uno_mii_write_reg(un, un->un_phyno, GMII_PHY_PAGE_SEL,
            GMII_PAGE_EXT);
-       usbnet_mii_writereg(un->un_dev, un->un_phyno, GMII_PHY_PAGE,
+       axen_uno_mii_write_reg(un, un->un_phyno, GMII_PHY_PAGE,
            0x002c);
 #endif
 
 #if 1 /* XXX: phy hack ? */
-       usbnet_mii_writereg(un->un_dev, un->un_phyno, 0x1F, 0x0005);
-       usbnet_mii_writereg(un->un_dev, un->un_phyno, 0x0C, 0x0000);
-       usbnet_mii_readreg(un->un_dev, un->un_phyno, 0x0001, &wval);
-       usbnet_mii_writereg(un->un_dev, un->un_phyno, 0x01, wval | 0x0080);
-       usbnet_mii_writereg(un->un_dev, un->un_phyno, 0x1F, 0x0000);
+       axen_uno_mii_write_reg(un, un->un_phyno, 0x1F, 0x0005);
+       axen_uno_mii_write_reg(un, un->un_phyno, 0x0C, 0x0000);
+       axen_uno_mii_read_reg(un, un->un_phyno, 0x0001, &wval);
+       axen_uno_mii_write_reg(un, un->un_phyno, 0x01, wval | 0x0080);
+       axen_uno_mii_write_reg(un, un->un_phyno, 0x1F, 0x0000);
 #endif
 
        usbnet_unlock_core(un);



Home | Main Index | Thread Index | Old Index