if_rl.c (166901) | if_rl.c (171560) |
---|---|
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 --- 17 unchanged lines hidden (view full) --- 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 33#include <sys/cdefs.h> | 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 --- 17 unchanged lines hidden (view full) --- 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 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 166901 2007-02-23 12:19:07Z piso $"); | 34__FBSDID("$FreeBSD: head/sys/pci/if_rl.c 171560 2007-07-24 01:24:03Z yongari $"); |
35 36/* 37 * RealTek 8129/8139 PCI NIC driver 38 * 39 * Supports several extremely cheap PCI 10/100 adapters based on 40 * the RealTek chipset. Datasheets can be obtained from 41 * www.realtek.com.tw. 42 * --- 780 unchanged lines hidden (view full) --- 823"Realtek 8139B detected. Warning, this may be unstable in autoselect mode\n"); 824#endif 825 826 sc->rl_btag = rman_get_bustag(sc->rl_res); 827 sc->rl_bhandle = rman_get_bushandle(sc->rl_res); 828 829 /* Allocate interrupt */ 830 rid = 0; | 35 36/* 37 * RealTek 8129/8139 PCI NIC driver 38 * 39 * Supports several extremely cheap PCI 10/100 adapters based on 40 * the RealTek chipset. Datasheets can be obtained from 41 * www.realtek.com.tw. 42 * --- 780 unchanged lines hidden (view full) --- 823"Realtek 8139B detected. Warning, this may be unstable in autoselect mode\n"); 824#endif 825 826 sc->rl_btag = rman_get_bustag(sc->rl_res); 827 sc->rl_bhandle = rman_get_bushandle(sc->rl_res); 828 829 /* Allocate interrupt */ 830 rid = 0; |
831 sc->rl_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, | 831 sc->rl_irq[0] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, |
832 RF_SHAREABLE | RF_ACTIVE); 833 | 832 RF_SHAREABLE | RF_ACTIVE); 833 |
834 if (sc->rl_irq == NULL) { | 834 if (sc->rl_irq[0] == NULL) { |
835 device_printf(dev, "couldn't map interrupt\n"); 836 error = ENXIO; 837 goto fail; 838 } 839 840 /* 841 * Reset the adapter. Only take the lock here as it's needed in 842 * order to call rl_reset(). --- 123 unchanged lines hidden (view full) --- 966 IFQ_SET_READY(&ifp->if_snd); 967 968 /* 969 * Call MI attach routine. 970 */ 971 ether_ifattach(ifp, eaddr); 972 973 /* Hook interrupt last to avoid having to lock softc */ | 835 device_printf(dev, "couldn't map interrupt\n"); 836 error = ENXIO; 837 goto fail; 838 } 839 840 /* 841 * Reset the adapter. Only take the lock here as it's needed in 842 * order to call rl_reset(). --- 123 unchanged lines hidden (view full) --- 966 IFQ_SET_READY(&ifp->if_snd); 967 968 /* 969 * Call MI attach routine. 970 */ 971 ether_ifattach(ifp, eaddr); 972 973 /* Hook interrupt last to avoid having to lock softc */ |
974 error = bus_setup_intr(dev, sc->rl_irq, INTR_TYPE_NET | INTR_MPSAFE, 975 NULL, rl_intr, sc, &sc->rl_intrhand); | 974 error = bus_setup_intr(dev, sc->rl_irq[0], INTR_TYPE_NET | INTR_MPSAFE, 975 NULL, rl_intr, sc, &sc->rl_intrhand[0]); |
976 if (error) { 977 device_printf(sc->rl_dev, "couldn't set up irq\n"); 978 ether_ifdetach(ifp); 979 } 980 981fail: 982 if (error) 983 rl_detach(dev); --- 33 unchanged lines hidden (view full) --- 1017 } 1018#if 0 1019 sc->suspended = 1; 1020#endif 1021 if (sc->rl_miibus) 1022 device_delete_child(dev, sc->rl_miibus); 1023 bus_generic_detach(dev); 1024 | 976 if (error) { 977 device_printf(sc->rl_dev, "couldn't set up irq\n"); 978 ether_ifdetach(ifp); 979 } 980 981fail: 982 if (error) 983 rl_detach(dev); --- 33 unchanged lines hidden (view full) --- 1017 } 1018#if 0 1019 sc->suspended = 1; 1020#endif 1021 if (sc->rl_miibus) 1022 device_delete_child(dev, sc->rl_miibus); 1023 bus_generic_detach(dev); 1024 |
1025 if (sc->rl_intrhand) 1026 bus_teardown_intr(dev, sc->rl_irq, sc->rl_intrhand); 1027 if (sc->rl_irq) 1028 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq); | 1025 if (sc->rl_intrhand[0]) 1026 bus_teardown_intr(dev, sc->rl_irq[0], sc->rl_intrhand[0]); 1027 if (sc->rl_irq[0]) 1028 bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq[0]); |
1029 if (sc->rl_res) 1030 bus_release_resource(dev, RL_RES, RL_RID, sc->rl_res); 1031 1032 if (ifp) 1033 if_free(ifp); 1034 1035 if (sc->rl_tag) { 1036 bus_dmamap_unload(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap); --- 776 unchanged lines hidden --- | 1029 if (sc->rl_res) 1030 bus_release_resource(dev, RL_RES, RL_RID, sc->rl_res); 1031 1032 if (ifp) 1033 if_free(ifp); 1034 1035 if (sc->rl_tag) { 1036 bus_dmamap_unload(sc->rl_tag, sc->rl_cdata.rl_rx_dmamap); --- 776 unchanged lines hidden --- |