Pass PHY location information and remove PHY access hack.

This commit is contained in:
yongari 2016-08-18 01:48:58 +00:00
parent 9f34116ab4
commit 838285e785
2 changed files with 3 additions and 5 deletions

View File

@ -303,8 +303,6 @@ axge_miibus_writereg(device_t dev, int phy, int reg, int val)
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 *ue)
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);

View File

@ -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 */