Deleted Added
full compact
if_an_pci.c (175445) if_an_pci.c (175446)
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 175445 2008-01-18 16:31:24Z ambrisko $");
34__FBSDID("$FreeBSD: head/sys/dev/an/if_an_pci.c 175446 2008-01-18 16:34:18Z 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 struct an_softc *sc = device_get_softc(dev);
122
123 bzero(sc, sizeof(struct an_softc));
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);

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

226 goto fail;
227 }
228 }
229
230 /* Allocate interrupt */
231 error = an_alloc_irq(dev, 0, RF_SHAREABLE);
232 if (error) {
233 goto fail;
122
123 bzero(sc, sizeof(struct an_softc));
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);

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

226 goto fail;
227 }
228 }
229
230 /* Allocate interrupt */
231 error = an_alloc_irq(dev, 0, RF_SHAREABLE);
232 if (error) {
233 goto fail;
234 }
234 }
235
236 sc->an_dev = dev;
237 error = an_attach(sc, device_get_unit(dev), flags);
238 if (error) {
239 goto fail;
240 }
241
242 /*

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

263an_resume_pci(device_t dev)
264{
265 an_resume(dev);
266
267 return (0);
268}
269
270static device_method_t an_pci_methods[] = {
235
236 sc->an_dev = dev;
237 error = an_attach(sc, device_get_unit(dev), flags);
238 if (error) {
239 goto fail;
240 }
241
242 /*

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

263an_resume_pci(device_t dev)
264{
265 an_resume(dev);
266
267 return (0);
268}
269
270static device_method_t an_pci_methods[] = {
271 /* Device interface */
272 DEVMETHOD(device_probe, an_probe_pci),
273 DEVMETHOD(device_attach, an_attach_pci),
271 /* Device interface */
272 DEVMETHOD(device_probe, an_probe_pci),
273 DEVMETHOD(device_attach, an_attach_pci),
274 DEVMETHOD(device_detach, an_detach),
275 DEVMETHOD(device_shutdown, an_shutdown),
276 DEVMETHOD(device_suspend, an_suspend_pci),
277 DEVMETHOD(device_resume, an_resume_pci),
274 DEVMETHOD(device_detach, an_detach),
275 DEVMETHOD(device_shutdown, an_shutdown),
276 DEVMETHOD(device_suspend, an_suspend_pci),
277 DEVMETHOD(device_resume, an_resume_pci),
278 { 0, 0 }
278 { 0, 0 }
279};
280
281static driver_t an_pci_driver = {
279};
280
281static driver_t an_pci_driver = {
282 "an",
283 an_pci_methods,
284 sizeof(struct an_softc),
282 "an",
283 an_pci_methods,
284 sizeof(struct an_softc),
285};
286
287static devclass_t an_devclass;
288
289DRIVER_MODULE(an, pci, an_pci_driver, an_devclass, 0, 0);
290MODULE_DEPEND(an, pci, 1, 1, 1);
291MODULE_DEPEND(an, wlan, 1, 1, 1);
285};
286
287static devclass_t an_devclass;
288
289DRIVER_MODULE(an, pci, an_pci_driver, an_devclass, 0, 0);
290MODULE_DEPEND(an, pci, 1, 1, 1);
291MODULE_DEPEND(an, wlan, 1, 1, 1);