if_an_pci.c (166901) | if_an_pci.c (175445) |
---|---|
1/*- 2 * Copyright (c) 1997, 1998, 1999 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, 1999 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/dev/an/if_an_pci.c 166901 2007-02-23 12:19:07Z piso $"); | 34__FBSDID("$FreeBSD: head/sys/dev/an/if_an_pci.c 175445 2008-01-18 16:31:24Z ambrisko $"); |
35 36/* 37 * This is a PCI shim for the Aironet PC4500/4800 wireless network 38 * driver. Aironet makes PCMCIA, ISA and PCI versions of these devices, 39 * which all have basically the same interface. The ISA and PCI cards 40 * are actually bridge adapters with PCMCIA cards inserted into them, 41 * however they appear as normal PCI or ISA devices to the host. 42 * --- 70 unchanged lines hidden (view full) --- 113static int an_attach_pci (device_t); 114static int an_suspend_pci (device_t); 115static int an_resume_pci (device_t); 116 117static int 118an_probe_pci(device_t dev) 119{ 120 struct an_type *t; | 35 36/* 37 * This is a PCI shim for the Aironet PC4500/4800 wireless network 38 * driver. Aironet makes PCMCIA, ISA and PCI versions of these devices, 39 * which all have basically the same interface. The ISA and PCI cards 40 * are actually bridge adapters with PCMCIA cards inserted into them, 41 * however they appear as normal PCI or ISA devices to the host. 42 * --- 70 unchanged lines hidden (view full) --- 113static int an_attach_pci (device_t); 114static int an_suspend_pci (device_t); 115static int an_resume_pci (device_t); 116 117static int 118an_probe_pci(device_t dev) 119{ 120 struct an_type *t; |
121 struct an_softc *sc = device_get_softc(dev); |
|
121 | 122 |
123 bzero(sc, sizeof(struct an_softc)); |
|
122 t = an_devs; 123 124 while (t->an_name != NULL) { 125 if (pci_get_vendor(dev) == t->an_vid && 126 pci_get_device(dev) == t->an_did) { 127 device_set_desc(dev, t->an_name); | 124 t = an_devs; 125 126 while (t->an_name != NULL) { 127 if (pci_get_vendor(dev) == t->an_vid && 128 pci_get_device(dev) == t->an_did) { 129 device_set_desc(dev, t->an_name); |
130 an_pci_probe(dev); |
|
128 return(BUS_PROBE_DEFAULT); 129 } 130 t++; 131 } 132 133 if (pci_get_vendor(dev) == AIRONET_VENDORID && 134 pci_get_device(dev) == AIRONET_DEVICEID_MPI350) { 135 device_set_desc(dev, "Cisco Aironet MPI350"); | 131 return(BUS_PROBE_DEFAULT); 132 } 133 t++; 134 } 135 136 if (pci_get_vendor(dev) == AIRONET_VENDORID && 137 pci_get_device(dev) == AIRONET_DEVICEID_MPI350) { 138 device_set_desc(dev, "Cisco Aironet MPI350"); |
139 an_pci_probe(dev); |
|
136 return(BUS_PROBE_DEFAULT); 137 } 138 139 return(ENXIO); 140} 141 142static int 143an_attach_pci(dev) 144 device_t dev; 145{ 146 u_int32_t command; 147 struct an_softc *sc; 148 int unit, flags, error = 0; 149 150 sc = device_get_softc(dev); 151 unit = device_get_unit(dev); 152 flags = device_get_flags(dev); | 140 return(BUS_PROBE_DEFAULT); 141 } 142 143 return(ENXIO); 144} 145 146static int 147an_attach_pci(dev) 148 device_t dev; 149{ 150 u_int32_t command; 151 struct an_softc *sc; 152 int unit, flags, error = 0; 153 154 sc = device_get_softc(dev); 155 unit = device_get_unit(dev); 156 flags = device_get_flags(dev); |
153 bzero(sc, sizeof(struct an_softc)); | |
154 155 if (pci_get_vendor(dev) == AIRONET_VENDORID && 156 pci_get_device(dev) == AIRONET_DEVICEID_MPI350) { 157 sc->mpi350 = 1; 158 sc->port_rid = PCIR_BAR(0); 159 } else { 160 /* 161 * Map control/status registers. --- 127 unchanged lines hidden --- | 157 158 if (pci_get_vendor(dev) == AIRONET_VENDORID && 159 pci_get_device(dev) == AIRONET_DEVICEID_MPI350) { 160 sc->mpi350 = 1; 161 sc->port_rid = PCIR_BAR(0); 162 } else { 163 /* 164 * Map control/status registers. --- 127 unchanged lines hidden --- |