pnphy.c (f34fa851e0b97ea3637d73827346927014e1b137) pnphy.c (d9730b8b5308cdb98f8c628dc0a02c8182eca8af)
1/*
2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 89 unchanged lines hidden (view full) ---

98static driver_t pnphy_driver = {
99 "pnphy",
100 pnphy_methods,
101 sizeof(struct mii_softc)
102};
103
104DRIVER_MODULE(pnphy, miibus, pnphy_driver, pnphy_devclass, 0, 0);
105
1/*
2 * Copyright (c) 1997, 1998, 1999
3 * Bill Paul <wpaul@ee.columbia.edu>. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 89 unchanged lines hidden (view full) ---

98static driver_t pnphy_driver = {
99 "pnphy",
100 pnphy_methods,
101 sizeof(struct mii_softc)
102};
103
104DRIVER_MODULE(pnphy, miibus, pnphy_driver, pnphy_devclass, 0, 0);
105
106int pnphy_service __P((struct mii_softc *, struct mii_data *, int));
107void pnphy_status __P((struct mii_softc *));
106static int pnphy_service __P((struct mii_softc *, struct mii_data *, int));
107static void pnphy_status __P((struct mii_softc *));
108
109static int pnphy_probe(dev)
110 device_t dev;
111{
112 struct mii_attach_args *ma;
113
114 ma = device_get_ivars(dev);
115

--- 63 unchanged lines hidden (view full) ---

179 sc = device_get_softc(dev);
180 mii = device_get_softc(device_get_parent(dev));
181 sc->mii_dev = NULL;
182 LIST_REMOVE(sc, mii_list);
183
184 return(0);
185}
186
108
109static int pnphy_probe(dev)
110 device_t dev;
111{
112 struct mii_attach_args *ma;
113
114 ma = device_get_ivars(dev);
115

--- 63 unchanged lines hidden (view full) ---

179 sc = device_get_softc(dev);
180 mii = device_get_softc(device_get_parent(dev));
181 sc->mii_dev = NULL;
182 LIST_REMOVE(sc, mii_list);
183
184 return(0);
185}
186
187int
187static int
188pnphy_service(sc, mii, cmd)
189 struct mii_softc *sc;
190 struct mii_data *mii;
191 int cmd;
192{
193 struct dc_softc *dc_sc;
194 struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
195

--- 56 unchanged lines hidden (view full) ---

252 case MII_TICK:
253 /*
254 * If we're not currently selected, just return.
255 */
256 if (IFM_INST(ife->ifm_media) != sc->mii_inst)
257 return (0);
258
259 /*
188pnphy_service(sc, mii, cmd)
189 struct mii_softc *sc;
190 struct mii_data *mii;
191 int cmd;
192{
193 struct dc_softc *dc_sc;
194 struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
195

--- 56 unchanged lines hidden (view full) ---

252 case MII_TICK:
253 /*
254 * If we're not currently selected, just return.
255 */
256 if (IFM_INST(ife->ifm_media) != sc->mii_inst)
257 return (0);
258
259 /*
260 * Only used for autonegotiation.
261 */
262 if (IFM_SUBTYPE(ife->ifm_media) != IFM_AUTO)
263 return (0);
264
265 /*
266 * Is the interface even up?
267 */
268 if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
269 return (0);
270
260 * Is the interface even up?
261 */
262 if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
263 return (0);
264
271 return(0);
265 break;
272 }
273
274 /* Update the media status. */
275 pnphy_status(sc);
276
277 /* Callback if something changed. */
266 }
267
268 /* Update the media status. */
269 pnphy_status(sc);
270
271 /* Callback if something changed. */
278 if (sc->mii_active != mii->mii_media_active || cmd == MII_MEDIACHG) {
279 MIIBUS_STATCHG(sc->mii_dev);
280 sc->mii_active = mii->mii_media_active;
281 }
272 mii_phy_update(sc, cmd);
282 return (0);
283}
284
273 return (0);
274}
275
285void
276static void
286pnphy_status(sc)
287 struct mii_softc *sc;
288{
289 struct mii_data *mii = sc->mii_pdata;
290 int reg;
291 struct dc_softc *dc_sc;
292
293 dc_sc = mii->mii_ifp->if_softc;

--- 18 unchanged lines hidden ---
277pnphy_status(sc)
278 struct mii_softc *sc;
279{
280 struct mii_data *mii = sc->mii_pdata;
281 int reg;
282 struct dc_softc *dc_sc;
283
284 dc_sc = mii->mii_ifp->if_softc;

--- 18 unchanged lines hidden ---