Deleted Added
full compact
if_smc.c (278671) if_smc.c (296137)
1/*-
2 * Copyright (c) 2008 Benno Rice. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2008 Benno Rice. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include <sys/cdefs.h>
26__FBSDID("$FreeBSD: head/sys/dev/smc/if_smc.c 278671 2015-02-13 11:13:08Z br $");
26__FBSDID("$FreeBSD: head/sys/dev/smc/if_smc.c 296137 2016-02-27 03:38:01Z jhibbits $");
27
28/*
29 * Driver for SMSC LAN91C111, may work for older variants.
30 */
31
32#ifdef HAVE_KERNEL_OPTION_HEADERS
33#include "opt_device_polling.h"
34#endif

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

229 sc = device_get_softc(dev);
230 rid = 0;
231 type = SYS_RES_IOPORT;
232 error = 0;
233
234 if (sc->smc_usemem)
235 type = SYS_RES_MEMORY;
236
27
28/*
29 * Driver for SMSC LAN91C111, may work for older variants.
30 */
31
32#ifdef HAVE_KERNEL_OPTION_HEADERS
33#include "opt_device_polling.h"
34#endif

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

229 sc = device_get_softc(dev);
230 rid = 0;
231 type = SYS_RES_IOPORT;
232 error = 0;
233
234 if (sc->smc_usemem)
235 type = SYS_RES_MEMORY;
236
237 reg = bus_alloc_resource(dev, type, &rid, 0, ~0, 16, RF_ACTIVE);
237 reg = bus_alloc_resource_anywhere(dev, type, &rid, 16, RF_ACTIVE);
238 if (reg == NULL) {
239 if (bootverbose)
240 device_printf(dev,
241 "could not allocate I/O resource for probe\n");
242 return (ENXIO);
243 }
244
245 /* Check for the identification value in the BSR. */

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

323 /* Set up watchdog callout. */
324 callout_init_mtx(&sc->smc_watchdog, &sc->smc_mtx, 0);
325
326 type = SYS_RES_IOPORT;
327 if (sc->smc_usemem)
328 type = SYS_RES_MEMORY;
329
330 sc->smc_reg_rid = 0;
238 if (reg == NULL) {
239 if (bootverbose)
240 device_printf(dev,
241 "could not allocate I/O resource for probe\n");
242 return (ENXIO);
243 }
244
245 /* Check for the identification value in the BSR. */

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

323 /* Set up watchdog callout. */
324 callout_init_mtx(&sc->smc_watchdog, &sc->smc_mtx, 0);
325
326 type = SYS_RES_IOPORT;
327 if (sc->smc_usemem)
328 type = SYS_RES_MEMORY;
329
330 sc->smc_reg_rid = 0;
331 sc->smc_reg = bus_alloc_resource(dev, type, &sc->smc_reg_rid, 0, ~0,
331 sc->smc_reg = bus_alloc_resource_anywhere(dev, type, &sc->smc_reg_rid,
332 16, RF_ACTIVE);
333 if (sc->smc_reg == NULL) {
334 error = ENXIO;
335 goto done;
336 }
337
332 16, RF_ACTIVE);
333 if (sc->smc_reg == NULL) {
334 error = ENXIO;
335 goto done;
336 }
337
338 sc->smc_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &sc->smc_irq_rid, 0,
339 ~0, 1, RF_ACTIVE | RF_SHAREABLE);
338 sc->smc_irq = bus_alloc_resource_anywhere(dev, SYS_RES_IRQ,
339 &sc->smc_irq_rid, 1, RF_ACTIVE | RF_SHAREABLE);
340 if (sc->smc_irq == NULL) {
341 error = ENXIO;
342 goto done;
343 }
344
345 SMC_LOCK(sc);
346 smc_reset(sc);
347 SMC_UNLOCK(sc);

--- 981 unchanged lines hidden ---
340 if (sc->smc_irq == NULL) {
341 error = ENXIO;
342 goto done;
343 }
344
345 SMC_LOCK(sc);
346 smc_reset(sc);
347 SMC_UNLOCK(sc);

--- 981 unchanged lines hidden ---