Deleted Added
sdiff udiff text old ( 212410 ) new ( 254263 )
full compact
1/*-
2 * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting
3 * Copyright (c) 2007-2009 Marvell Semiconductor, Inc.
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:

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

25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
26 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
28 * THE POSSIBILITY OF SUCH DAMAGES.
29 */
30
31#include <sys/cdefs.h>
32#ifdef __FreeBSD__
33__FBSDID("$FreeBSD: head/sys/dev/mwl/if_mwl_pci.c 254263 2013-08-12 23:30:01Z scottl $");
34#endif
35
36/*
37 * PCI front-end for the Marvell Wireless LAN controller driver.
38 */
39
40#include <sys/param.h>
41#include <sys/systm.h>

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

115 ident = mwl_pci_lookup(pci_get_vendor(dev), pci_get_device(dev));
116 if (ident != NULL) {
117 device_set_desc(dev, ident->name);
118 return BUS_PROBE_DEFAULT;
119 }
120 return ENXIO;
121}
122
123static int
124mwl_pci_attach(device_t dev)
125{
126 struct mwl_pci_softc *psc = device_get_softc(dev);
127 struct mwl_softc *sc = &psc->sc_sc;
128 int rid, error = ENXIO;
129
130 sc->sc_dev = dev;
131
132 pci_enable_busmaster(dev);
133
134 /*
135 * Setup memory-mapping of PCI registers.
136 */
137 rid = BS_BAR0;
138 psc->sc_sr0 = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
139 RF_ACTIVE);
140 if (psc->sc_sr0 == NULL) {
141 device_printf(dev, "cannot map BAR0 register space\n");

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

254 return (0);
255}
256
257static int
258mwl_pci_resume(device_t dev)
259{
260 struct mwl_pci_softc *psc = device_get_softc(dev);
261
262 pci_enable_busmaster(dev);
263
264 mwl_resume(&psc->sc_sc);
265
266 return (0);
267}
268
269static device_method_t mwl_pci_methods[] = {
270 /* Device interface */

--- 19 unchanged lines hidden ---