Author: yongari
Date: Thu Aug 18 01:48:58 2016
New Revision: 304323
URL: https://svnweb.freebsd.org/changeset/base/304323

Log:
  Pass PHY location information and remove PHY access hack.

Modified:
  head/sys/dev/usb/net/if_axge.c
  head/sys/dev/usb/net/if_axgereg.h

Modified: head/sys/dev/usb/net/if_axge.c
==============================================================================
--- head/sys/dev/usb/net/if_axge.c      Thu Aug 18 01:25:12 2016        
(r304322)
+++ head/sys/dev/usb/net/if_axge.c      Thu Aug 18 01:48:58 2016        
(r304323)
@@ -303,8 +303,6 @@ axge_miibus_writereg(device_t dev, int p
        int locked;
 
        sc = device_get_softc(dev);
-       if (sc->sc_phyno != phy)
-               return (0);
        locked = mtx_owned(&sc->sc_mtx);
        if (!locked)
                AXGE_LOCK(sc);
@@ -434,7 +432,6 @@ axge_attach_post(struct usb_ether *ue)
        struct axge_softc *sc;
 
        sc = uether_getsc(ue);
-       sc->sc_phyno = 3;
 
        /* Initialize controller and get station address. */
        axge_chip_init(sc);
@@ -466,7 +463,7 @@ axge_attach_post_sub(struct usb_ether *u
        mtx_lock(&Giant);
        error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp,
            uether_ifmedia_upd, ue->ue_methods->ue_mii_sts,
-           BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, MIIF_DOPAUSE);
+           BMSR_DEFCAPMASK, AXGE_PHY_ADDR, MII_OFFSET_ANY, MIIF_DOPAUSE);
        mtx_unlock(&Giant);
 
        return (error);

Modified: head/sys/dev/usb/net/if_axgereg.h
==============================================================================
--- head/sys/dev/usb/net/if_axgereg.h   Thu Aug 18 01:25:12 2016        
(r304322)
+++ head/sys/dev/usb/net/if_axgereg.h   Thu Aug 18 01:48:58 2016        
(r304323)
@@ -158,11 +158,12 @@ enum {
        AXGE_N_TRANSFER,
 };
 
+#define        AXGE_PHY_ADDR           3
+
 struct axge_softc {
        struct usb_ether        sc_ue;
        struct mtx              sc_mtx;
        struct usb_xfer         *sc_xfer[AXGE_N_TRANSFER];
-       int                     sc_phyno;
 
        int                     sc_flags;
 #define        AXGE_FLAG_LINK          0x0001  /* got a link */
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to