Try to adhere to style(9) and be consistent within this file.

This commit is contained in:
marius 2010-10-02 17:20:30 +00:00
parent e637357341
commit 0be508d1c1

View File

@ -128,7 +128,7 @@ miibus_probe(device_t dev)
*/
bmsr = MIIBUS_READREG(parent, ma.mii_phyno, MII_BMSR);
if (bmsr == 0 || bmsr == 0xffff ||
(bmsr & (BMSR_EXTSTAT|BMSR_MEDIAMASK)) == 0) {
(bmsr & (BMSR_EXTSTAT | BMSR_MEDIAMASK)) == 0) {
/* Assume no PHY at this address. */
continue;
}
@ -154,11 +154,11 @@ miibus_probe(device_t dev)
}
if (child == NULL)
return(ENXIO);
return (ENXIO);
device_set_desc(dev, "MII bus");
return(0);
return (0);
}
int
@ -180,7 +180,7 @@ miibus_attach(device_t dev)
ivars->ifmedia_sts);
bus_generic_attach(dev);
return(0);
return (0);
}
int
@ -193,7 +193,7 @@ miibus_detach(device_t dev)
ifmedia_removeall(&mii->mii_media);
mii->mii_ifp = NULL;
return(0);
return (0);
}
static int
@ -214,10 +214,12 @@ static int
miibus_child_pnpinfo_str(device_t bus, device_t child, char *buf,
size_t buflen)
{
struct mii_attach_args *maa = device_get_ivars(child);
struct mii_attach_args *ma;
ma = device_get_ivars(child);
snprintf(buf, buflen, "oui=0x%x model=0x%x rev=0x%x",
MII_OUI(maa->mii_id1, maa->mii_id2),
MII_MODEL(maa->mii_id2), MII_REV(maa->mii_id2));
MII_OUI(ma->mii_id1, ma->mii_id2),
MII_MODEL(ma->mii_id2), MII_REV(ma->mii_id2));
return (0);
}
@ -225,8 +227,10 @@ static int
miibus_child_location_str(device_t bus, device_t child, char *buf,
size_t buflen)
{
struct mii_attach_args *maa = device_get_ivars(child);
snprintf(buf, buflen, "phyno=%d", maa->mii_phyno);
struct mii_attach_args *ma;
ma = device_get_ivars(child);
snprintf(buf, buflen, "phyno=%d", ma->mii_phyno);
return (0);
}
@ -236,7 +240,7 @@ miibus_readreg(device_t dev, int phy, int reg)
device_t parent;
parent = device_get_parent(dev);
return(MIIBUS_READREG(parent, phy, reg));
return (MIIBUS_READREG(parent, phy, reg));
}
static int
@ -245,7 +249,7 @@ miibus_writereg(device_t dev, int phy, int reg, int data)
device_t parent;
parent = device_get_parent(dev);
return(MIIBUS_WRITEREG(parent, phy, reg, data));
return (MIIBUS_WRITEREG(parent, phy, reg, data));
}
static void
@ -259,7 +263,6 @@ miibus_statchg(device_t dev)
mii = device_get_softc(dev);
mii->mii_ifp->if_baudrate = ifmedia_baudrate(mii->mii_media_active);
return;
}
static void
@ -297,13 +300,11 @@ miibus_mediainit(device_t dev)
mii = device_get_softc(dev);
LIST_FOREACH(m, &mii->mii_media.ifm_list, ifm_list) {
media = m->ifm_media;
if (media == (IFM_ETHER|IFM_AUTO))
if (media == (IFM_ETHER | IFM_AUTO))
break;
}
ifmedia_set(&mii->mii_media, media);
return;
}
int
@ -324,7 +325,7 @@ mii_phy_probe(device_t dev, device_t *child, ifm_change_cb_t ifmedia_upd,
for (i = 0; i < MII_NPHY; i++) {
bmsr = MIIBUS_READREG(dev, i, MII_BMSR);
if (bmsr == 0 || bmsr == 0xffff ||
(bmsr & (BMSR_EXTSTAT|BMSR_MEDIAMASK)) == 0) {
(bmsr & (BMSR_EXTSTAT | BMSR_MEDIAMASK)) == 0) {
/* Assume no PHY at this address. */
continue;
} else
@ -334,12 +335,12 @@ mii_phy_probe(device_t dev, device_t *child, ifm_change_cb_t ifmedia_upd,
if (i == MII_NPHY) {
device_delete_child(dev, *child);
*child = NULL;
return(ENXIO);
return (ENXIO);
}
bus_generic_attach(dev);
return(0);
return (0);
}
/*
@ -371,7 +372,7 @@ mii_tick(struct mii_data *mii)
struct mii_softc *child;
LIST_FOREACH(child, &mii->mii_phys, mii_list)
(void) (*child->mii_service)(child, mii, MII_TICK);
(void)(*child->mii_service)(child, mii, MII_TICK);
}
/*
@ -386,7 +387,7 @@ mii_pollstat(struct mii_data *mii)
mii->mii_media_active = IFM_NONE;
LIST_FOREACH(child, &mii->mii_phys, mii_list)
(void) (*child->mii_service)(child, mii, MII_POLLSTAT);
(void)(*child->mii_service)(child, mii, MII_POLLSTAT);
}
/*