if_ed_pccard.c (191469) | if_ed_pccard.c (199380) |
---|---|
1/*- 2 * Copyright (c) 2005, M. Warner Losh 3 * Copyright (c) 1995, David Greenman 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 2005, M. Warner Losh 3 * Copyright (c) 1995, David Greenman 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/dev/ed/if_ed_pccard.c 191469 2009-04-24 17:28:12Z imp $ | 28 * $FreeBSD: head/sys/dev/ed/if_ed_pccard.c 199380 2009-11-17 14:23:09Z jhb $ |
29 */ 30 31/* 32 * Notes for adding media support. Each chipset is somewhat different 33 * from the others. Linux has a table of OIDs that it uses to see what 34 * supports the misc register of the NS83903. But a sampling of datasheets 35 * I could dig up on cards I own paints a different picture. 36 * --- 208 unchanged lines hidden (view full) --- 245 { { NULL } } 246}; 247 248/* 249 * PC Card (PCMCIA) specific code. 250 */ 251static int ed_pccard_probe(device_t); 252static int ed_pccard_attach(device_t); | 29 */ 30 31/* 32 * Notes for adding media support. Each chipset is somewhat different 33 * from the others. Linux has a table of OIDs that it uses to see what 34 * supports the misc register of the NS83903. But a sampling of datasheets 35 * I could dig up on cards I own paints a different picture. 36 * --- 208 unchanged lines hidden (view full) --- 245 { { NULL } } 246}; 247 248/* 249 * PC Card (PCMCIA) specific code. 250 */ 251static int ed_pccard_probe(device_t); 252static int ed_pccard_attach(device_t); |
253static void ed_pccard_tick(void *); | 253static void ed_pccard_tick(struct ed_softc *); |
254 255static int ed_pccard_dl100xx(device_t dev, const struct ed_product *); 256static void ed_pccard_dl100xx_mii_reset(struct ed_softc *sc); 257static u_int ed_pccard_dl100xx_mii_readbits(struct ed_softc *sc, int nbits); 258static void ed_pccard_dl100xx_mii_writebits(struct ed_softc *sc, u_int val, 259 int nbits); 260 261static int ed_pccard_ax88x90(device_t dev, const struct ed_product *); --- 929 unchanged lines hidden (view full) --- 1191 struct ed_softc *sc; 1192 1193 sc = device_get_softc(dev); 1194 if (child == sc->miibus) 1195 sc->miibus = NULL; 1196} 1197 1198static void | 254 255static int ed_pccard_dl100xx(device_t dev, const struct ed_product *); 256static void ed_pccard_dl100xx_mii_reset(struct ed_softc *sc); 257static u_int ed_pccard_dl100xx_mii_readbits(struct ed_softc *sc, int nbits); 258static void ed_pccard_dl100xx_mii_writebits(struct ed_softc *sc, u_int val, 259 int nbits); 260 261static int ed_pccard_ax88x90(device_t dev, const struct ed_product *); --- 929 unchanged lines hidden (view full) --- 1191 struct ed_softc *sc; 1192 1193 sc = device_get_softc(dev); 1194 if (child == sc->miibus) 1195 sc->miibus = NULL; 1196} 1197 1198static void |
1199ed_pccard_tick(void *arg) | 1199ed_pccard_tick(struct ed_softc *sc) |
1200{ | 1200{ |
1201 struct ed_softc *sc = arg; | |
1202 struct mii_data *mii; 1203 int media = 0; 1204 1205 ED_ASSERT_LOCKED(sc); 1206 if (sc->miibus != NULL) { 1207 mii = device_get_softc(sc->miibus); 1208 media = mii->mii_media_status; 1209 mii_tick(mii); --- 8 unchanged lines hidden (view full) --- 1218 write_asic(sc, ED_DL10019_MAGIC, 1219 (mii->mii_media_active & IFM_FDX) ? 1220 DL19FDUPLX : 0); 1221#endif 1222 } 1223 } 1224 1225 } | 1201 struct mii_data *mii; 1202 int media = 0; 1203 1204 ED_ASSERT_LOCKED(sc); 1205 if (sc->miibus != NULL) { 1206 mii = device_get_softc(sc->miibus); 1207 media = mii->mii_media_status; 1208 mii_tick(mii); --- 8 unchanged lines hidden (view full) --- 1217 write_asic(sc, ED_DL10019_MAGIC, 1218 (mii->mii_media_active & IFM_FDX) ? 1219 DL19FDUPLX : 0); 1220#endif 1221 } 1222 } 1223 1224 } |
1226 callout_reset(&sc->tick_ch, hz, ed_pccard_tick, sc); | |
1227} 1228 1229static device_method_t ed_pccard_methods[] = { 1230 /* Device interface */ 1231 DEVMETHOD(device_probe, ed_pccard_probe), 1232 DEVMETHOD(device_attach, ed_pccard_attach), 1233 DEVMETHOD(device_detach, ed_detach), 1234 --- 20 unchanged lines hidden --- | 1225} 1226 1227static device_method_t ed_pccard_methods[] = { 1228 /* Device interface */ 1229 DEVMETHOD(device_probe, ed_pccard_probe), 1230 DEVMETHOD(device_attach, ed_pccard_attach), 1231 DEVMETHOD(device_detach, ed_detach), 1232 --- 20 unchanged lines hidden --- |