diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/mii/amphy.c | 18 | ||||
-rw-r--r-- | sys/dev/mii/bmtphy.c | 23 | ||||
-rw-r--r-- | sys/dev/mii/brgphy.c | 27 | ||||
-rw-r--r-- | sys/dev/mii/dcphy.c | 26 | ||||
-rw-r--r-- | sys/dev/mii/exphy.c | 19 | ||||
-rw-r--r-- | sys/dev/mii/icsphy.c | 11 | ||||
-rw-r--r-- | sys/dev/mii/mii.c | 40 | ||||
-rw-r--r-- | sys/dev/mii/mii_bitbang.c | 26 | ||||
-rw-r--r-- | sys/dev/mii/mii_physubr.c | 49 | ||||
-rw-r--r-- | sys/dev/mii/miivar.h | 11 | ||||
-rw-r--r-- | sys/dev/mii/mtdphy.c | 16 | ||||
-rw-r--r-- | sys/dev/mii/nsgphy.c | 52 | ||||
-rw-r--r-- | sys/dev/mii/nsphy.c | 23 | ||||
-rw-r--r-- | sys/dev/mii/nsphyter.c | 19 | ||||
-rw-r--r-- | sys/dev/mii/qsphy.c | 23 | ||||
-rw-r--r-- | sys/dev/mii/rgephy.c | 34 | ||||
-rw-r--r-- | sys/dev/mii/rlphy.c | 19 | ||||
-rw-r--r-- | sys/dev/mii/sqphy.c | 19 | ||||
-rw-r--r-- | sys/dev/mii/tlphy.c | 23 | ||||
-rw-r--r-- | sys/dev/mii/tqphy.c | 19 | ||||
-rw-r--r-- | sys/dev/mii/txphy.c | 16 | ||||
-rw-r--r-- | sys/dev/mii/ukphy.c | 16 | ||||
-rw-r--r-- | sys/dev/mii/ukphy_subr.c | 5 | ||||
-rw-r--r-- | sys/dev/mii/xmphy.c | 38 |
24 files changed, 167 insertions, 405 deletions
diff --git a/sys/dev/mii/amphy.c b/sys/dev/mii/amphy.c index fdf8eb28e34..4a0b3409940 100644 --- a/sys/dev/mii/amphy.c +++ b/sys/dev/mii/amphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: amphy.c,v 1.7 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: amphy.c,v 1.8 2004/09/27 18:25:47 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -75,9 +75,7 @@ const struct mii_phy_funcs amphy_funcs = { }; int -amphymatch(parent, match, aux) - struct device *parent; - void *match, *aux; +amphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -98,9 +96,7 @@ amphymatch(parent, match, aux) } void -amphyattach(parent, self, aux) - struct device *parent, *self; - void *aux; +amphyattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -132,10 +128,7 @@ amphyattach(parent, self, aux) } int -amphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +amphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; @@ -193,8 +186,7 @@ amphy_service(sc, mii, cmd) } void -amphy_status(sc) - struct mii_softc *sc; +amphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; diff --git a/sys/dev/mii/bmtphy.c b/sys/dev/mii/bmtphy.c index 4993f66a0de..91dc7d01759 100644 --- a/sys/dev/mii/bmtphy.c +++ b/sys/dev/mii/bmtphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bmtphy.c,v 1.8 2004/09/26 03:38:34 brad Exp $ */ +/* $OpenBSD: bmtphy.c,v 1.9 2004/09/27 18:25:48 brad Exp $ */ /* $NetBSD: nsphy.c,v 1.25 2000/02/02 23:34:57 thorpej Exp $ */ /*- @@ -68,10 +68,7 @@ const struct mii_phy_funcs bmtphy_funcs = { }; int -bmtphymatch(parent, match, aux) - struct device *parent; - void *match; - void *aux; +bmtphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -86,10 +83,7 @@ bmtphymatch(parent, match, aux) } void -bmtphyattach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; +bmtphyattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -119,10 +113,7 @@ bmtphyattach(parent, self, aux) } int -bmtphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +bmtphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; @@ -184,8 +175,7 @@ bmtphy_service(sc, mii, cmd) } void -bmtphy_status(sc) - struct mii_softc *sc; +bmtphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; @@ -233,8 +223,7 @@ bmtphy_status(sc) } void -bmtphy_reset(sc) - struct mii_softc *sc; +bmtphy_reset(struct mii_softc *sc) { int anar; diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index 9388955bcda..31cd4aacc2a 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: brgphy.c,v 1.16 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: brgphy.c,v 1.17 2004/09/27 18:25:48 brad Exp $ */ /* * Copyright (c) 2000 @@ -90,9 +90,7 @@ const struct mii_phy_funcs brgphy_funcs = { }; int -brgphy_probe(parent, match, aux) - struct device *parent; - void *match, *aux; +brgphy_probe(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -111,9 +109,7 @@ brgphy_probe(parent, match, aux) } void -brgphy_attach(parent, self, aux) - struct device *parent, *self; - void *aux; +brgphy_attach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -161,10 +157,7 @@ brgphy_attach(parent, self, aux) } int -brgphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +brgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg, speed, gig; @@ -331,8 +324,7 @@ setit: } void -brgphy_status(sc) - struct mii_softc *sc; +brgphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; @@ -392,8 +384,7 @@ brgphy_status(sc) int -brgphy_mii_phy_auto(sc) - struct mii_softc *sc; +brgphy_mii_phy_auto(struct mii_softc *sc) { int ktcr = 0; @@ -435,8 +426,7 @@ brgphy_loop(struct mii_softc *sc) } void -brgphy_reset(sc) - struct mii_softc *sc; +brgphy_reset(struct mii_softc *sc) { struct bge_softc *bge_sc; struct ifnet *ifp; @@ -515,8 +505,7 @@ static const struct bcm_dspcode bcm5704_dspcode[] = { }; void -brgphy_load_dspcode(sc) - struct mii_softc *sc; +brgphy_load_dspcode(struct mii_softc *sc) { const struct bcm_dspcode *dsp = NULL; int wait=0, i; diff --git a/sys/dev/mii/dcphy.c b/sys/dev/mii/dcphy.c index c3da455f620..22667f8bdd3 100644 --- a/sys/dev/mii/dcphy.c +++ b/sys/dev/mii/dcphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dcphy.c,v 1.9 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: dcphy.c,v 1.10 2004/09/27 18:25:48 brad Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -107,9 +107,7 @@ const struct mii_phy_funcs dcphy_funcs = { }; int -dcphy_match(parent, match, aux) - struct device *parent; - void *match, *aux; +dcphy_match(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -125,10 +123,7 @@ dcphy_match(parent, match, aux) } void -dcphy_attach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; +dcphy_attach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -181,10 +176,7 @@ dcphy_attach(parent, self, aux) } int -dcphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +dcphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct dc_softc *dc_sc; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; @@ -320,8 +312,7 @@ dcphy_service(sc, mii, cmd) } void -dcphy_status(sc) - struct mii_softc *sc; +dcphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; int reg, anlpar, tstat = 0; @@ -406,9 +397,7 @@ skip: } int -dcphy_auto(mii, waitfor) - struct mii_softc *mii; - int waitfor; +dcphy_auto(struct mii_softc *mii, int waitfor) { int i; struct dc_softc *sc; @@ -456,8 +445,7 @@ dcphy_auto(mii, waitfor) } void -dcphy_reset(mii) - struct mii_softc *mii; +dcphy_reset(struct mii_softc *mii) { struct dc_softc *sc; diff --git a/sys/dev/mii/exphy.c b/sys/dev/mii/exphy.c index 30df7922105..02390c9b634 100644 --- a/sys/dev/mii/exphy.c +++ b/sys/dev/mii/exphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exphy.c,v 1.14 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: exphy.c,v 1.15 2004/09/27 18:25:48 brad Exp $ */ /* $NetBSD: exphy.c,v 1.23 2000/02/02 23:34:56 thorpej Exp $ */ /*- @@ -104,10 +104,7 @@ const struct mii_phy_funcs exphy_funcs = { }; int -exphymatch(parent, match, aux) - struct device *parent; - void *match; - void *aux; +exphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -132,9 +129,7 @@ exphymatch(parent, match, aux) } void -exphyattach(parent, self, aux) - struct device *parent, *self; - void *aux; +exphyattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -181,10 +176,7 @@ exphyattach(parent, self, aux) } int -exphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +exphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; @@ -237,8 +229,7 @@ exphy_service(sc, mii, cmd) } void -exphy_reset(sc) - struct mii_softc *sc; +exphy_reset(struct mii_softc *sc) { mii_phy_reset(sc); diff --git a/sys/dev/mii/icsphy.c b/sys/dev/mii/icsphy.c index 9e55557cc74..868c4a0e3e5 100644 --- a/sys/dev/mii/icsphy.c +++ b/sys/dev/mii/icsphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: icsphy.c,v 1.13 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: icsphy.c,v 1.14 2004/09/27 18:25:48 brad Exp $ */ /* $NetBSD: icsphy.c,v 1.17 2000/02/02 23:34:56 thorpej Exp $ */ /*- @@ -109,10 +109,7 @@ const struct mii_phy_funcs icsphy_funcs = { }; int -icsphymatch(parent, match, aux) - struct device *parent; - void *match; - void *aux; +icsphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -132,9 +129,7 @@ icsphymatch(parent, match, aux) } void -icsphyattach(parent, self, aux) - struct device *parent, *self; - void *aux; +icsphyattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c index 5c1ad430081..d7dc8920b58 100644 --- a/sys/dev/mii/mii.c +++ b/sys/dev/mii/mii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mii.c,v 1.13 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: mii.c,v 1.14 2004/09/27 18:25:48 brad Exp $ */ /* $NetBSD: mii.c,v 1.19 2000/02/02 17:09:44 thorpej Exp $ */ /*- @@ -66,10 +66,8 @@ int mii_submatch(struct device *, void *, void *); * to the network interface driver parent. */ void -mii_attach(parent, mii, capmask, phyloc, offloc, flags) - struct device *parent; - struct mii_data *mii; - int capmask, phyloc, offloc, flags; +mii_attach(struct device *parent, struct mii_data *mii, int capmask, + int phyloc, int offloc, int flags) { struct mii_attach_args ma; struct mii_softc *child; @@ -148,9 +146,6 @@ mii_attach(parent, mii, capmask, phyloc, offloc, flags) /* * Link it up in the parent's MII data. */ -#if defined(__NetBSD__) - callout_init(&child->mii_nway_ch); -#endif LIST_INSERT_HEAD(&mii->mii_phys, child, mii_list); child->mii_offset = offset; mii->mii_instance++; @@ -160,10 +155,7 @@ mii_attach(parent, mii, capmask, phyloc, offloc, flags) } void -mii_activate(mii, act, phyloc, offloc) - struct mii_data *mii; - enum devact act; - int phyloc, offloc; +mii_activate(struct mii_data *mii, enum devact act, int phyloc, int offloc) { struct mii_softc *child; @@ -197,9 +189,7 @@ mii_activate(mii, act, phyloc, offloc) } void -mii_detach(mii, phyloc, offloc) - struct mii_data *mii; - int phyloc, offloc; +mii_detach(struct mii_data *mii, int phyloc, int offloc) { struct mii_softc *child, *nchild; @@ -226,9 +216,7 @@ mii_detach(mii, phyloc, offloc) } int -mii_print(aux, pnp) - void *aux; - const char *pnp; +mii_print(void *aux, const char *pnp) { struct mii_attach_args *ma = aux; @@ -242,9 +230,7 @@ mii_print(aux, pnp) } int -mii_submatch(parent, match, aux) - struct device *parent; - void *match, *aux; +mii_submatch(struct device *parent, void *match, void *aux) { struct cfdata *cf = match; struct mii_attach_args *ma = aux; @@ -260,8 +246,7 @@ mii_submatch(parent, match, aux) * Media changed; notify all PHYs. */ int -mii_mediachg(mii) - struct mii_data *mii; +mii_mediachg(struct mii_data *mii) { struct mii_softc *child; int rv; @@ -282,8 +267,7 @@ mii_mediachg(mii) * Call the PHY tick routines, used during autonegotiation. */ void -mii_tick(mii) - struct mii_data *mii; +mii_tick(struct mii_data *mii) { struct mii_softc *child; @@ -296,8 +280,7 @@ mii_tick(mii) * Get media status from PHYs. */ void -mii_pollstat(mii) - struct mii_data *mii; +mii_pollstat(struct mii_data *mii) { struct mii_softc *child; @@ -313,8 +296,7 @@ mii_pollstat(mii) * Inform the PHYs that the interface is down. */ void -mii_down(mii) - struct mii_data *mii; +mii_down(struct mii_data *mii) { struct mii_softc *child; diff --git a/sys/dev/mii/mii_bitbang.c b/sys/dev/mii/mii_bitbang.c index 9d3de86a9aa..ee3870b79da 100644 --- a/sys/dev/mii/mii_bitbang.c +++ b/sys/dev/mii/mii_bitbang.c @@ -1,5 +1,4 @@ -/* $OpenBSD: mii_bitbang.c,v 1.2 2002/03/14 01:26:57 millert Exp $ */ -/* $NetBSD$ */ +/* $OpenBSD: mii_bitbang.c,v 1.3 2004/09/27 18:25:48 brad Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -72,9 +71,7 @@ do { \ * Synchronize the MII. */ void -mii_bitbang_sync(sc, ops) - struct device *sc; - mii_bitbang_ops_t ops; +mii_bitbang_sync(struct device *sc, mii_bitbang_ops_t ops) { int i, v; @@ -93,11 +90,8 @@ mii_bitbang_sync(sc, ops) * Send a series of bits to the MII. */ void -mii_bitbang_sendbits(sc, ops, data, nbits) - struct device *sc; - mii_bitbang_ops_t ops; - u_int32_t data; - int nbits; +mii_bitbang_sendbits(struct device *sc, mii_bitbang_ops_t ops, + u_int32_t data, int nbits) { int i, v; @@ -121,10 +115,8 @@ mii_bitbang_sendbits(sc, ops, data, nbits) * Read a PHY register by bit-bang'ing the MII. */ int -mii_bitbang_readreg(sc, ops, phy, reg) - struct device *sc; - mii_bitbang_ops_t ops; - int phy, reg; +mii_bitbang_readreg(struct device *sc, mii_bitbang_ops_t ops, int phy, + int reg) { int val = 0, err = 0, i; @@ -171,10 +163,8 @@ mii_bitbang_readreg(sc, ops, phy, reg) * Write a PHY register by bit-bang'ing the MII. */ void -mii_bitbang_writereg(sc, ops, phy, reg, val) - struct device *sc; - mii_bitbang_ops_t ops; - int phy, reg, val; +mii_bitbang_writereg(struct device *sc, mii_bitbang_ops_t ops, + int phy, int reg, int val) { mii_bitbang_sync(sc, ops); diff --git a/sys/dev/mii/mii_physubr.c b/sys/dev/mii/mii_physubr.c index e05e7a9f8ac..6ccd7c4da14 100644 --- a/sys/dev/mii/mii_physubr.c +++ b/sys/dev/mii/mii_physubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mii_physubr.c,v 1.18 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: mii_physubr.c,v 1.19 2004/09/27 18:25:48 brad Exp $ */ /* $NetBSD: mii_physubr.c,v 1.20 2001/04/13 23:30:09 thorpej Exp $ */ /*- @@ -94,8 +94,7 @@ const struct mii_media mii_media_table[] = { void mii_phy_auto_timeout(void *); void -mii_phy_setmedia(sc) - struct mii_softc *sc; +mii_phy_setmedia(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; @@ -127,9 +126,7 @@ mii_phy_setmedia(sc) } int -mii_phy_auto(sc, waitfor) - struct mii_softc *sc; - int waitfor; +mii_phy_auto(struct mii_softc *sc, int waitfor) { int bmsr, i; @@ -173,8 +170,7 @@ mii_phy_auto(sc, waitfor) } void -mii_phy_auto_timeout(arg) - void *arg; +mii_phy_auto_timeout(void *arg) { struct mii_softc *sc = arg; int s, bmsr; @@ -192,8 +188,7 @@ mii_phy_auto_timeout(arg) } int -mii_phy_tick(sc) - struct mii_softc *sc; +mii_phy_tick(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; @@ -244,8 +239,7 @@ mii_phy_tick(sc) } void -mii_phy_reset(sc) - struct mii_softc *sc; +mii_phy_reset(struct mii_softc *sc) { int reg, i; @@ -268,8 +262,7 @@ mii_phy_reset(sc) } void -mii_phy_down(sc) - struct mii_softc *sc; +mii_phy_down(struct mii_softc *sc) { if (sc->mii_flags & MIIF_DOINGAUTO) { sc->mii_flags &= ~MIIF_DOINGAUTO; @@ -279,17 +272,13 @@ mii_phy_down(sc) void -mii_phy_status(sc) - struct mii_softc *sc; +mii_phy_status(struct mii_softc *sc) { - PHY_STATUS(sc); } void -mii_phy_update(sc, cmd) - struct mii_softc *sc; - int cmd; +mii_phy_update(struct mii_softc *sc, int cmd) { struct mii_data *mii = sc->mii_pdata; @@ -304,8 +293,7 @@ mii_phy_update(sc, cmd) } void -mii_phy_statusmsg(sc) - struct mii_softc *sc; +mii_phy_statusmsg(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; struct ifnet *ifp = mii->mii_ifp; @@ -353,8 +341,7 @@ mii_phy_statusmsg(sc) * of media names. Does not print a newline. */ void -mii_phy_add_media(sc) - struct mii_softc *sc; +mii_phy_add_media(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; @@ -419,8 +406,7 @@ mii_phy_add_media(sc) } void -mii_phy_delete_media(sc) - struct mii_softc *sc; +mii_phy_delete_media(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; @@ -428,9 +414,7 @@ mii_phy_delete_media(sc) } int -mii_phy_activate(self, act) - struct device *self; - enum devact act; +mii_phy_activate(struct device *self, enum devact act) { int rv = 0; @@ -448,9 +432,7 @@ mii_phy_activate(self, act) } int -mii_phy_detach(self, flags) - struct device *self; - int flags; +mii_phy_detach(struct device *self, int flags) { struct mii_softc *sc = (void *) self; @@ -466,8 +448,7 @@ mii_phy_detach(self, flags) * Given an ifmedia word, return the corresponding ANAR value. */ int -mii_anar(media) - int media; +mii_anar(int media) { int rv; diff --git a/sys/dev/mii/miivar.h b/sys/dev/mii/miivar.h index b54dca67e67..be53ab4cbc1 100644 --- a/sys/dev/mii/miivar.h +++ b/sys/dev/mii/miivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: miivar.h,v 1.19 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: miivar.h,v 1.20 2004/09/27 18:25:48 brad Exp $ */ /* $NetBSD: miivar.h,v 1.17 2000/03/06 20:56:57 thorpej Exp $ */ /*- @@ -42,12 +42,7 @@ #define _DEV_MII_MIIVAR_H_ #include <sys/queue.h> - -#if defined(__NetBSD__) -#include <sys/callout.h> -#elif defined(__OpenBSD__) #include <sys/timeout.h> -#endif /* * Media Independent Interface autoconfiguration definitions. @@ -140,11 +135,7 @@ struct mii_softc { int mii_ticks; /* MII_TICK counter */ int mii_anegticks; /* ticks before retrying aneg */ -#if defined(__NetBSD__) - struct callout mii_nway_ch; /* NWAY callout */ -#elif defined(__OpenBSD__) struct timeout mii_phy_timo; /* timeout handle */ -#endif int mii_media_active; /* last active media */ int mii_media_status; /* last active status */ diff --git a/sys/dev/mii/mtdphy.c b/sys/dev/mii/mtdphy.c index a9d64abb6c0..c4b9a9bb05f 100644 --- a/sys/dev/mii/mtdphy.c +++ b/sys/dev/mii/mtdphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mtdphy.c,v 1.9 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: mtdphy.c,v 1.10 2004/09/27 18:25:48 brad Exp $ */ /* * Copyright (c) 1998, 1999 Jason L. Wright (jason@thought.net) @@ -64,10 +64,7 @@ const struct mii_phy_funcs mtdphy_funcs = { }; int -mtdphymatch(parent, match, aux) - struct device *parent; - void *match; - void *aux; +mtdphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -79,9 +76,7 @@ mtdphymatch(parent, match, aux) } void -mtdphyattach(parent, self, aux) - struct device *parent, *self; - void *aux; +mtdphyattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -104,10 +99,7 @@ mtdphyattach(parent, self, aux) } int -mtdphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +mtdphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; diff --git a/sys/dev/mii/nsgphy.c b/sys/dev/mii/nsgphy.c index ae4cbd6ff3f..bb42ba66495 100644 --- a/sys/dev/mii/nsgphy.c +++ b/sys/dev/mii/nsgphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nsgphy.c,v 1.11 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: nsgphy.c,v 1.12 2004/09/27 18:25:48 brad Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 2001 @@ -85,10 +85,7 @@ const struct mii_phy_funcs nsgphy_funcs = { }; int -nsgphymatch(parent, match, aux) - struct device *parent; - void *match; - void *aux; +nsgphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -101,10 +98,7 @@ nsgphymatch(parent, match, aux) } void -nsgphyattach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; +nsgphyattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -150,10 +144,7 @@ nsgphyattach(parent, self, aux) } int -nsgphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +nsgphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; @@ -288,8 +279,7 @@ nsgphy_service(sc, mii, cmd) } void -nsgphy_status(sc) - struct mii_softc *sc; +nsgphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; int bmsr, bmcr, physup, anlpar, gstat; @@ -358,32 +348,30 @@ nsgphy_status(sc) static int -nsgphy_mii_phy_auto(mii, waitfor) - struct mii_softc *mii; - int waitfor; +nsgphy_mii_phy_auto(struct mii_softc *sc, int waitfor) { int bmsr, ktcr = 0, i; - if ((mii->mii_flags & MIIF_DOINGAUTO) == 0) { - PHY_RESET(mii); - PHY_WRITE(mii, NSGPHY_MII_BMCR, 0); + if ((sc->mii_flags & MIIF_DOINGAUTO) == 0) { + PHY_RESET(sc); + PHY_WRITE(sc, NSGPHY_MII_BMCR, 0); DELAY(1000); - ktcr = PHY_READ(mii, NSGPHY_MII_1000CTL); - PHY_WRITE(mii, NSGPHY_MII_1000CTL, ktcr | + ktcr = PHY_READ(sc, NSGPHY_MII_1000CTL); + PHY_WRITE(sc, NSGPHY_MII_1000CTL, ktcr | (NSGPHY_1000CTL_AFD|NSGPHY_1000CTL_AHD)); - ktcr = PHY_READ(mii, NSGPHY_MII_1000CTL); + ktcr = PHY_READ(sc, NSGPHY_MII_1000CTL); DELAY(1000); - PHY_WRITE(mii, NSGPHY_MII_ANAR, - BMSR_MEDIA_TO_ANAR(mii->mii_capabilities) | ANAR_CSMA); + PHY_WRITE(sc, NSGPHY_MII_ANAR, + BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA); DELAY(1000); - PHY_WRITE(mii, NSGPHY_MII_BMCR, + PHY_WRITE(sc, NSGPHY_MII_BMCR, NSGPHY_BMCR_AUTOEN | NSGPHY_BMCR_STARTNEG); } if (waitfor) { /* Wait 500ms for it to complete. */ for (i = 0; i < 500; i++) { - if ((bmsr = PHY_READ(mii, NSGPHY_MII_BMSR)) & + if ((bmsr = PHY_READ(sc, NSGPHY_MII_BMSR)) & NSGPHY_BMSR_ACOMP) return (0); DELAY(1000); @@ -407,10 +395,10 @@ nsgphy_mii_phy_auto(mii, waitfor) * the tick handler driving autonegotiation. Don't want 500ms * delays all the time while the system is running! */ - if ((mii->mii_flags & MIIF_DOINGAUTO) == 0) { - mii->mii_flags |= MIIF_DOINGAUTO; - timeout_set(&mii->mii_phy_timo, mii_phy_auto_timeout, mii); - timeout_add(&mii->mii_phy_timo, hz >> 1); + if ((sc->mii_flags & MIIF_DOINGAUTO) == 0) { + sc->mii_flags |= MIIF_DOINGAUTO; + timeout_set(&sc->mii_phy_timo, mii_phy_auto_timeout, sc); + timeout_add(&sc->mii_phy_timo, hz >> 1); } return (EJUSTRETURN); } diff --git a/sys/dev/mii/nsphy.c b/sys/dev/mii/nsphy.c index 58086381bea..466f3b26461 100644 --- a/sys/dev/mii/nsphy.c +++ b/sys/dev/mii/nsphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nsphy.c,v 1.15 2004/09/26 03:38:34 brad Exp $ */ +/* $OpenBSD: nsphy.c,v 1.16 2004/09/27 18:25:48 brad Exp $ */ /* $NetBSD: nsphy.c,v 1.25 2000/02/02 23:34:57 thorpej Exp $ */ /*- @@ -109,10 +109,7 @@ const struct mii_phy_funcs nsphy_funcs = { }; int -nsphymatch(parent, match, aux) - struct device *parent; - void *match; - void *aux; +nsphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -124,10 +121,7 @@ nsphymatch(parent, match, aux) } void -nsphyattach(parent, self, aux) - struct device *parent; - struct device *self; - void *aux; +nsphyattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -152,10 +146,7 @@ nsphyattach(parent, self, aux) } int -nsphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +nsphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; @@ -247,8 +238,7 @@ nsphy_service(sc, mii, cmd) } void -nsphy_status(sc) - struct mii_softc *sc; +nsphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; @@ -325,8 +315,7 @@ nsphy_status(sc) } void -nsphy_reset(sc) - struct mii_softc *sc; +nsphy_reset(struct mii_softc *sc) { int anar; diff --git a/sys/dev/mii/nsphyter.c b/sys/dev/mii/nsphyter.c index dd833b296b6..b6b52aa643f 100644 --- a/sys/dev/mii/nsphyter.c +++ b/sys/dev/mii/nsphyter.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nsphyter.c,v 1.7 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: nsphyter.c,v 1.8 2004/09/27 18:25:48 brad Exp $ */ /* $NetBSD: nsphyter.c,v 1.5 2000/02/02 23:34:57 thorpej Exp $ */ /*- @@ -108,10 +108,7 @@ const struct mii_phy_funcs nsphyter_funcs = { }; int -nsphytermatch(parent, match, aux) - struct device *parent; - void *match; - void *aux; +nsphytermatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -127,9 +124,7 @@ nsphytermatch(parent, match, aux) } void -nsphyterattach(parent, self, aux) - struct device *parent, *self; - void *aux; +nsphyterattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -156,10 +151,7 @@ nsphyterattach(parent, self, aux) } int -nsphyter_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +nsphyter_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; @@ -221,8 +213,7 @@ nsphyter_service(sc, mii, cmd) } void -nsphyter_status(sc) - struct mii_softc *sc; +nsphyter_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; diff --git a/sys/dev/mii/qsphy.c b/sys/dev/mii/qsphy.c index 5afcfd6eb61..cbfb37db40e 100644 --- a/sys/dev/mii/qsphy.c +++ b/sys/dev/mii/qsphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qsphy.c,v 1.10 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: qsphy.c,v 1.11 2004/09/27 18:25:48 brad Exp $ */ /* $NetBSD: qsphy.c,v 1.19 2000/02/02 23:34:57 thorpej Exp $ */ /*- @@ -108,10 +108,7 @@ const struct mii_phy_funcs qsphy_funcs = { }; int -qsphymatch(parent, match, aux) - struct device *parent; - void *match; - void *aux; +qsphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -123,9 +120,7 @@ qsphymatch(parent, match, aux) } void -qsphyattach(parent, self, aux) - struct device *parent, *self; - void *aux; +qsphyattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -149,10 +144,7 @@ qsphyattach(parent, self, aux) } int -qsphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +qsphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; @@ -214,8 +206,7 @@ qsphy_service(sc, mii, cmd) } void -qsphy_status(sc) - struct mii_softc *sc; +qsphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; @@ -273,10 +264,8 @@ qsphy_status(sc) } void -qsphy_reset(sc) - struct mii_softc *sc; +qsphy_reset(struct mii_softc *sc) { - mii_phy_reset(sc); PHY_WRITE(sc, MII_QSPHY_IMASK, 0); } diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c index c36b96112d9..cba97480dbd 100644 --- a/sys/dev/mii/rgephy.c +++ b/sys/dev/mii/rgephy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rgephy.c,v 1.3 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: rgephy.c,v 1.4 2004/09/27 18:25:48 brad Exp $ */ /* * Copyright (c) 2003 * Bill Paul <wpaul@windriver.com>. All rights reserved. @@ -90,10 +90,7 @@ const struct mii_phy_funcs rgephy_funcs = { }; int -rgephymatch(parent, match, aux) - struct device *parent; - void *match; - void *aux; +rgephymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -106,9 +103,7 @@ rgephymatch(parent, match, aux) } void -rgephyattach(parent, self, aux) - struct device *parent, *self; - void *aux; +rgephyattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -139,10 +134,7 @@ rgephyattach(parent, self, aux) } int -rgephy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +rgephy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg, speed, gig; @@ -298,8 +290,7 @@ setit: } void -rgephy_status(sc) - struct mii_softc *sc; +rgephy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; int bmsr, bmcr; @@ -339,18 +330,17 @@ rgephy_status(sc) int -rgephy_mii_phy_auto(mii) - struct mii_softc *mii; +rgephy_mii_phy_auto(struct mii_softc *sc) { - rgephy_loop(mii); - PHY_RESET(mii); + rgephy_loop(sc); + PHY_RESET(sc); - PHY_WRITE(mii, RGEPHY_MII_ANAR, - BMSR_MEDIA_TO_ANAR(mii->mii_capabilities) | ANAR_CSMA); + PHY_WRITE(sc, RGEPHY_MII_ANAR, + BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA); DELAY(1000); - PHY_WRITE(mii, RGEPHY_MII_1000CTL, RGEPHY_1000CTL_AFD); + PHY_WRITE(sc, RGEPHY_MII_1000CTL, RGEPHY_1000CTL_AFD); DELAY(1000); - PHY_WRITE(mii, RGEPHY_MII_BMCR, + PHY_WRITE(sc, RGEPHY_MII_BMCR, RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG); DELAY(100); diff --git a/sys/dev/mii/rlphy.c b/sys/dev/mii/rlphy.c index 600bb9becd2..00587708100 100644 --- a/sys/dev/mii/rlphy.c +++ b/sys/dev/mii/rlphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rlphy.c,v 1.11 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: rlphy.c,v 1.12 2004/09/27 18:25:48 brad Exp $ */ /* * Copyright (c) 1998, 1999 Jason L. Wright (jason@thought.net) @@ -66,10 +66,7 @@ const struct mii_phy_funcs rlphy_funcs = { }; int -rlphymatch(parent, match, aux) - struct device *parent; - void *match; - void *aux; +rlphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -94,9 +91,7 @@ rlphymatch(parent, match, aux) } void -rlphyattach(parent, self, aux) - struct device *parent, *self; - void *aux; +rlphyattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -123,10 +118,7 @@ rlphyattach(parent, self, aux) } int -rlphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +rlphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; @@ -172,8 +164,7 @@ rlphy_service(sc, mii, cmd) } void -rlphy_reset(sc) - struct mii_softc *sc; +rlphy_reset(struct mii_softc *sc) { int bmcr; diff --git a/sys/dev/mii/sqphy.c b/sys/dev/mii/sqphy.c index 0a216bd4dbd..275dc6d1e44 100644 --- a/sys/dev/mii/sqphy.c +++ b/sys/dev/mii/sqphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sqphy.c,v 1.10 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: sqphy.c,v 1.11 2004/09/27 18:25:48 brad Exp $ */ /* $NetBSD: sqphy.c,v 1.17 2000/02/02 23:34:57 thorpej Exp $ */ /*- @@ -108,10 +108,7 @@ const struct mii_phy_funcs sqphy_funcs = { }; int -sqphymatch(parent, match, aux) - struct device *parent; - void *match; - void *aux; +sqphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -127,9 +124,7 @@ sqphymatch(parent, match, aux) } void -sqphyattach(parent, self, aux) - struct device *parent, *self; - void *aux; +sqphyattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -162,10 +157,7 @@ sqphyattach(parent, self, aux) } int -sqphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +sqphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; @@ -227,8 +219,7 @@ sqphy_service(sc, mii, cmd) } void -sqphy_status(sc) - struct mii_softc *sc; +sqphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; diff --git a/sys/dev/mii/tlphy.c b/sys/dev/mii/tlphy.c index 3dadb57e574..ce96ad72f91 100644 --- a/sys/dev/mii/tlphy.c +++ b/sys/dev/mii/tlphy.c @@ -123,9 +123,7 @@ const struct mii_phy_funcs tlphy_funcs = { }; int -tlphymatch(parent, match, aux) - struct device *parent; - void *match, *aux; +tlphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -137,9 +135,7 @@ tlphymatch(parent, match, aux) } void -tlphyattach(parent, self, aux) - struct device *parent, *self; - void *aux; +tlphyattach(struct device *parent, struct device *self, void *aux) { struct tlphy_softc *sc = (struct tlphy_softc *)self; struct tl_softc *tlsc = (struct tl_softc *)self->dv_parent; @@ -185,10 +181,7 @@ tlphyattach(parent, self, aux) } int -tlphy_service(self, mii, cmd) - struct mii_softc *self; - struct mii_data *mii; - int cmd; +tlphy_service(struct mii_softc *self, struct mii_data *mii, int cmd) { struct tlphy_softc *sc = (struct tlphy_softc *)self; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; @@ -289,8 +282,7 @@ tlphy_service(self, mii, cmd) } void -tlphy_status(physc) - struct mii_softc *physc; +tlphy_status(struct mii_softc *physc) { struct tlphy_softc *sc = (void *) physc; struct mii_data *mii = sc->sc_mii.mii_pdata; @@ -333,9 +325,7 @@ tlphy_status(physc) } int -tlphy_auto(sc, waitfor) - struct tlphy_softc *sc; - int waitfor; +tlphy_auto(struct tlphy_softc *sc, int waitfor) { int error; @@ -361,8 +351,7 @@ tlphy_auto(sc, waitfor) } void -tlphy_acomp(sc) - struct tlphy_softc *sc; +tlphy_acomp(struct tlphy_softc *sc) { int aner, anlpar; diff --git a/sys/dev/mii/tqphy.c b/sys/dev/mii/tqphy.c index 502042e0954..30920cdf407 100644 --- a/sys/dev/mii/tqphy.c +++ b/sys/dev/mii/tqphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tqphy.c,v 1.7 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: tqphy.c,v 1.8 2004/09/27 18:25:48 brad Exp $ */ /* $NetBSD: tqphy.c,v 1.9 2000/02/02 23:34:57 thorpej Exp $ */ /* @@ -109,10 +109,7 @@ const struct mii_phy_funcs tqphy_funcs = { }; int -tqphymatch(parent, match, aux) - struct device *parent; - void *match; - void *aux; +tqphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -127,9 +124,7 @@ tqphymatch(parent, match, aux) } void -tqphyattach(parent, self, aux) - struct device *parent, *self; - void *aux; +tqphyattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -158,10 +153,7 @@ tqphyattach(parent, self, aux) } int -tqphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +tqphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; @@ -223,8 +215,7 @@ tqphy_service(sc, mii, cmd) } void -tqphy_status(sc) - struct mii_softc *sc; +tqphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; diff --git a/sys/dev/mii/txphy.c b/sys/dev/mii/txphy.c index 368a26b540a..86aa99d5b5d 100644 --- a/sys/dev/mii/txphy.c +++ b/sys/dev/mii/txphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: txphy.c,v 1.7 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: txphy.c,v 1.8 2004/09/27 18:25:48 brad Exp $ */ /* * Copyright (c) 1999 Jason L. Wright (jason@thought.net) @@ -63,10 +63,7 @@ const struct mii_phy_funcs txphy_funcs = { }; int -txphymatch(parent, match, aux) - struct device *parent; - void *match; - void *aux; +txphymatch(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -77,9 +74,7 @@ txphymatch(parent, match, aux) } void -txphyattach(parent, self, aux) - struct device *parent, *self; - void *aux; +txphyattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -103,10 +98,7 @@ txphyattach(parent, self, aux) } int -txphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +txphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; diff --git a/sys/dev/mii/ukphy.c b/sys/dev/mii/ukphy.c index 6a8516aa3ae..7219126eec8 100644 --- a/sys/dev/mii/ukphy.c +++ b/sys/dev/mii/ukphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ukphy.c,v 1.12 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: ukphy.c,v 1.13 2004/09/27 18:25:48 brad Exp $ */ /* $NetBSD: ukphy.c,v 1.9 2000/02/02 23:34:57 thorpej Exp $ */ /*- @@ -103,10 +103,7 @@ const struct mii_phy_funcs ukphy_funcs = { }; int -ukphymatch(parent, match, aux) - struct device *parent; - void *match; - void *aux; +ukphymatch(struct device *parent, void *match, void *aux) { /* @@ -116,9 +113,7 @@ ukphymatch(parent, match, aux) } void -ukphyattach(parent, self, aux) - struct device *parent, *self; - void *aux; +ukphyattach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -154,10 +149,7 @@ ukphyattach(parent, self, aux) } int -ukphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +ukphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; diff --git a/sys/dev/mii/ukphy_subr.c b/sys/dev/mii/ukphy_subr.c index 1017a83fc86..467e157f512 100644 --- a/sys/dev/mii/ukphy_subr.c +++ b/sys/dev/mii/ukphy_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ukphy_subr.c,v 1.3 2004/09/20 06:05:27 brad Exp $ */ +/* $OpenBSD: ukphy_subr.c,v 1.4 2004/09/27 18:25:48 brad Exp $ */ /* $NetBSD: ukphy_subr.c,v 1.2 1998/11/05 04:08:02 thorpej Exp $ */ /*- @@ -59,8 +59,7 @@ * by decoding the NWay autonegotiation, use this routine. */ void -ukphy_status(phy) - struct mii_softc *phy; +ukphy_status(struct mii_softc *phy) { struct mii_data *mii = phy->mii_pdata; struct ifmedia_entry *ife = mii->mii_media.ifm_cur; diff --git a/sys/dev/mii/xmphy.c b/sys/dev/mii/xmphy.c index 4949ae9fd77..b29208067d6 100644 --- a/sys/dev/mii/xmphy.c +++ b/sys/dev/mii/xmphy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xmphy.c,v 1.8 2004/09/26 00:59:58 brad Exp $ */ +/* $OpenBSD: xmphy.c,v 1.9 2004/09/27 18:25:48 brad Exp $ */ /* * Copyright (c) 2000 @@ -78,9 +78,7 @@ const struct mii_phy_funcs xmphy_funcs = { xmphy_service, xmphy_status, mii_phy_reset, }; -int xmphy_probe(parent, match, aux) - struct device *parent; - void *match, *aux; +int xmphy_probe(struct device *parent, void *match, void *aux) { struct mii_attach_args *ma = aux; @@ -92,9 +90,7 @@ int xmphy_probe(parent, match, aux) } void -xmphy_attach(parent, self, aux) - struct device *parent, *self; - void *aux; +xmphy_attach(struct device *parent, struct device *self, void *aux) { struct mii_softc *sc = (struct mii_softc *)self; struct mii_attach_args *ma = aux; @@ -125,10 +121,7 @@ xmphy_attach(parent, self, aux) } int -xmphy_service(sc, mii, cmd) - struct mii_softc *sc; - struct mii_data *mii; - int cmd; +xmphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd) { struct ifmedia_entry *ife = mii->mii_media.ifm_cur; int reg; @@ -241,8 +234,7 @@ xmphy_service(sc, mii, cmd) } void -xmphy_status(sc) - struct mii_softc *sc; +xmphy_status(struct mii_softc *sc) { struct mii_data *mii = sc->mii_pdata; int bmsr, bmcr, anlpar; @@ -296,23 +288,21 @@ xmphy_status(sc) int -xmphy_mii_phy_auto(mii, waitfor) - struct mii_softc *mii; - int waitfor; +xmphy_mii_phy_auto(struct mii_softc *sc, int waitfor) { int bmsr, i; - if ((mii->mii_flags & MIIF_DOINGAUTO) == 0) { - PHY_WRITE(mii, XMPHY_MII_ANAR, + if ((sc->mii_flags & MIIF_DOINGAUTO) == 0) { + PHY_WRITE(sc, XMPHY_MII_ANAR, XMPHY_ANAR_FDX|XMPHY_ANAR_HDX); - PHY_WRITE(mii, XMPHY_MII_BMCR, + PHY_WRITE(sc, XMPHY_MII_BMCR, XMPHY_BMCR_AUTOEN | XMPHY_BMCR_STARTNEG); } if (waitfor) { /* Wait 500ms for it to complete. */ for (i = 0; i < 500; i++) { - if ((bmsr = PHY_READ(mii, XMPHY_MII_BMSR)) & + if ((bmsr = PHY_READ(sc, XMPHY_MII_BMSR)) & XMPHY_BMSR_ACOMP) return (0); DELAY(1000); @@ -336,10 +326,10 @@ xmphy_mii_phy_auto(mii, waitfor) * the tick handler driving autonegotiation. Don't want 500ms * delays all the time while the system is running! */ - if ((mii->mii_flags & MIIF_DOINGAUTO) == 0) { - mii->mii_flags |= MIIF_DOINGAUTO; - timeout_set(&mii->mii_phy_timo, mii_phy_auto_timeout, mii); - timeout_add(&mii->mii_phy_timo, hz >> 1); + if ((sc->mii_flags & MIIF_DOINGAUTO) == 0) { + sc->mii_flags |= MIIF_DOINGAUTO; + timeout_set(&sc->mii_phy_timo, mii_phy_auto_timeout, sc); + timeout_add(&sc->mii_phy_timo, hz >> 1); } return (EJUSTRETURN); } |