if_tl.c (61041) | if_tl.c (63090) |
---|---|
1/* 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.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 --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * | 1/* 2 * Copyright (c) 1997, 1998 3 * Bill Paul <wpaul@ctr.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 --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/sys/pci/if_tl.c 61041 2000-05-28 16:13:43Z peter $ | 32 * $FreeBSD: head/sys/pci/if_tl.c 63090 2000-07-13 22:54:34Z archie $ |
33 */ 34 35/* 36 * Texas Instruments ThunderLAN driver for FreeBSD 2.2.6 and 3.x. 37 * Supports many Compaq PCI NICs based on the ThunderLAN ethernet controller, 38 * the National Semiconductor DP83840A physical interface and the 39 * Microchip Technology 24Cxx series serial EEPROM. 40 * --- 180 unchanged lines hidden (view full) --- 221 222MODULE_DEPEND(tl, miibus, 1, 1, 1); 223 224/* "controller miibus0" required. See GENERIC if you get errors here. */ 225#include "miibus_if.h" 226 227#if !defined(lint) 228static const char rcsid[] = | 33 */ 34 35/* 36 * Texas Instruments ThunderLAN driver for FreeBSD 2.2.6 and 3.x. 37 * Supports many Compaq PCI NICs based on the ThunderLAN ethernet controller, 38 * the National Semiconductor DP83840A physical interface and the 39 * Microchip Technology 24Cxx series serial EEPROM. 40 * --- 180 unchanged lines hidden (view full) --- 221 222MODULE_DEPEND(tl, miibus, 1, 1, 1); 223 224/* "controller miibus0" required. See GENERIC if you get errors here. */ 225#include "miibus_if.h" 226 227#if !defined(lint) 228static const char rcsid[] = |
229 "$FreeBSD: head/sys/pci/if_tl.c 61041 2000-05-28 16:13:43Z peter $"; | 229 "$FreeBSD: head/sys/pci/if_tl.c 63090 2000-07-13 22:54:34Z archie $"; |
230#endif 231 232/* 233 * Various supported device vendors/types and their names. 234 */ 235 236static struct tl_type tl_devs[] = { 237 { TI_VENDORID, TI_DEVICEID_THUNDERLAN, --- 1092 unchanged lines hidden (view full) --- 1330 /* Reset again, this time setting bitrate mode. */ 1331 tl_softreset(sc, 1); 1332 ifm = &sc->ifmedia; 1333 ifm->ifm_media = ifm->ifm_cur->ifm_media; 1334 tl_ifmedia_upd(ifp); 1335 } 1336 1337 /* | 230#endif 231 232/* 233 * Various supported device vendors/types and their names. 234 */ 235 236static struct tl_type tl_devs[] = { 237 { TI_VENDORID, TI_DEVICEID_THUNDERLAN, --- 1092 unchanged lines hidden (view full) --- 1330 /* Reset again, this time setting bitrate mode. */ 1331 tl_softreset(sc, 1); 1332 ifm = &sc->ifmedia; 1333 ifm->ifm_media = ifm->ifm_cur->ifm_media; 1334 tl_ifmedia_upd(ifp); 1335 } 1336 1337 /* |
1338 * Call MI attach routines. | 1338 * Call MI attach routine. |
1339 */ | 1339 */ |
1340 if_attach(ifp); 1341 ether_ifattach(ifp); | 1340 ether_ifattach(ifp, ETHER_BPF_SUPPORTED); |
1342 | 1341 |
1343 bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); 1344 | |
1345fail: 1346 splx(s); 1347 return(error); 1348} 1349 1350static int tl_detach(dev) 1351 device_t dev; 1352{ 1353 struct tl_softc *sc; 1354 struct ifnet *ifp; 1355 int s; 1356 1357 s = splimp(); 1358 1359 sc = device_get_softc(dev); 1360 ifp = &sc->arpcom.ac_if; 1361 1362 tl_stop(sc); | 1342fail: 1343 splx(s); 1344 return(error); 1345} 1346 1347static int tl_detach(dev) 1348 device_t dev; 1349{ 1350 struct tl_softc *sc; 1351 struct ifnet *ifp; 1352 int s; 1353 1354 s = splimp(); 1355 1356 sc = device_get_softc(dev); 1357 ifp = &sc->arpcom.ac_if; 1358 1359 tl_stop(sc); |
1363 if_detach(ifp); | 1360 ether_ifdetach(ifp, ETHER_BPF_SUPPORTED); |
1364 1365 bus_generic_detach(dev); 1366 device_delete_child(dev, sc->tl_miibus); 1367 1368 contigfree(sc->tl_ldata, sizeof(struct tl_list_data), M_DEVBUF); 1369 if (sc->tl_bitrate) 1370 ifmedia_removeall(&sc->ifmedia); 1371 --- 969 unchanged lines hidden --- | 1361 1362 bus_generic_detach(dev); 1363 device_delete_child(dev, sc->tl_miibus); 1364 1365 contigfree(sc->tl_ldata, sizeof(struct tl_list_data), M_DEVBUF); 1366 if (sc->tl_bitrate) 1367 ifmedia_removeall(&sc->ifmedia); 1368 --- 969 unchanged lines hidden --- |