Use the mii_data provided via mii_attach_args and mii_pdata respectively

instead of reaching out for the softc of the parent.
This commit is contained in:
Marius Strobl 2010-09-27 20:31:03 +00:00
parent a71199dab4
commit 7b9a15f73c
33 changed files with 33 additions and 34 deletions

View File

@ -146,7 +146,7 @@ dcphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -129,7 +129,7 @@ pnphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -129,7 +129,7 @@ acphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -106,7 +106,7 @@ amphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -110,7 +110,7 @@ atphy_attach(device_t dev)
sc = &asc->mii_sc;
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -96,7 +96,7 @@ axphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -144,7 +144,7 @@ bmtphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -187,7 +187,7 @@ brgphy_attach(device_t dev)
sc = &bsc->mii_sc;
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
/* Initialize mii_softc structure */

View File

@ -115,7 +115,7 @@ ciphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -141,7 +141,7 @@ e1000phy_attach(device_t dev)
sc = &esc->mii_sc;
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -135,7 +135,7 @@ exphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
/*
* The 3Com PHY can never be isolated, so never allow non-zero

View File

@ -158,7 +158,7 @@ gentbi_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
if (bootverbose)

View File

@ -138,7 +138,7 @@ icsphy_attach(device_t dev)
sc = &isc->mii_sc;
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -104,7 +104,7 @@ inphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -111,7 +111,7 @@ ip1000phy_attach(device_t dev)
sc = &isc->mii_sc;
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -109,7 +109,7 @@ jmphy_attach(device_t dev)
sc = &jsc->mii_sc;
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -132,7 +132,7 @@ lxtphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -326,10 +326,9 @@ mii_anar(int media)
void
mii_add_media(struct mii_softc *sc)
{
struct mii_data *mii = sc->mii_pdata;
const char *sep = "";
struct mii_data *mii;
mii = device_get_softc(sc->mii_dev);
if ((sc->mii_capabilities & BMSR_MEDIAMASK) == 0) {
printf("no media present");
return;

View File

@ -143,7 +143,7 @@ mlphy_attach(dev)
sc = &msc->ml_mii;
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -126,7 +126,7 @@ nsgphy_attach(device_t dev)
device_printf(dev, "<rev. %d>\n", MII_REV(ma->mii_id2));
device_printf(dev, " ");
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -130,7 +130,7 @@ nsphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -135,7 +135,7 @@ nsphyter_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -107,7 +107,7 @@ pnaphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -130,7 +130,7 @@ qsphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -119,7 +119,7 @@ rgephy_attach(device_t dev)
sc = &rsc->mii_sc;
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -129,7 +129,7 @@ rlphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
/*
* Check whether we're the RTL8201L PHY and remember so the status

View File

@ -117,7 +117,7 @@ rlswitch_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
/*
* We handle all pseudo PHY in a single instance, so never allow

View File

@ -108,7 +108,7 @@ ruephy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
/*
* The RealTek PHY can never be isolated, so never allow non-zero

View File

@ -102,7 +102,7 @@ smcphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -108,7 +108,7 @@ tdkphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
if (bootverbose)

View File

@ -150,7 +150,7 @@ truephy_attach(device_t dev)
if (sc->mii_anegticks == 0)
sc->mii_anegticks = MII_ANEGTICKS;
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;

View File

@ -122,7 +122,7 @@ ukphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
if (bootverbose)

View File

@ -107,7 +107,7 @@ xmphy_attach(device_t dev)
sc = device_get_softc(dev);
ma = device_get_ivars(dev);
sc->mii_dev = device_get_parent(dev);
mii = device_get_softc(sc->mii_dev);
mii = ma->mii_data;
LIST_INSERT_HEAD(&mii->mii_phys, sc, mii_list);
sc->mii_inst = mii->mii_instance;