Deleted Added
full compact
scc_core.c (294883) scc_core.c (296137)
1/*-
2 * Copyright (c) 2004-2006 Marcel Moolenaar
3 * 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 *

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2004-2006 Marcel Moolenaar
3 * 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 *

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

20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/scc/scc_core.c 294883 2016-01-27 02:23:54Z jhibbits $");
28__FBSDID("$FreeBSD: head/sys/dev/scc/scc_core.c 296137 2016-02-27 03:38:01Z jhibbits $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/conf.h>
34#include <sys/kernel.h>
35#include <sys/malloc.h>
36#include <sys/queue.h>

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

124 size = abs(cl->cl_range) << sc->sc_bas.regshft;
125
126 mtx_init(&sc->sc_hwmtx, "scc_hwmtx", NULL, MTX_SPIN);
127
128 /*
129 * Re-allocate. We expect that the softc contains the information
130 * collected by scc_bfe_probe() intact.
131 */
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/conf.h>
34#include <sys/kernel.h>
35#include <sys/malloc.h>
36#include <sys/queue.h>

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

124 size = abs(cl->cl_range) << sc->sc_bas.regshft;
125
126 mtx_init(&sc->sc_hwmtx, "scc_hwmtx", NULL, MTX_SPIN);
127
128 /*
129 * Re-allocate. We expect that the softc contains the information
130 * collected by scc_bfe_probe() intact.
131 */
132 sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, &sc->sc_rrid,
133 0, ~0, cl->cl_channels * size, RF_ACTIVE);
132 sc->sc_rres = bus_alloc_resource_anywhere(dev, sc->sc_rtype,
133 &sc->sc_rrid, cl->cl_channels * size, RF_ACTIVE);
134 if (sc->sc_rres == NULL)
135 return (ENXIO);
136 sc->sc_bas.bsh = rman_get_bushandle(sc->sc_rres);
137 sc->sc_bas.bst = rman_get_bustag(sc->sc_rres);
138
139 /*
140 * Allocate interrupt resources. There may be a different interrupt
141 * per channel. We allocate them all...

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

373 /*
374 * Allocate the register resource. We assume that all SCCs have a
375 * single register window in either I/O port space or memory mapped
376 * I/O space. Any SCC that needs multiple windows will consequently
377 * not be supported by this driver as-is.
378 */
379 sc->sc_rrid = rid;
380 sc->sc_rtype = SYS_RES_MEMORY;
134 if (sc->sc_rres == NULL)
135 return (ENXIO);
136 sc->sc_bas.bsh = rman_get_bushandle(sc->sc_rres);
137 sc->sc_bas.bst = rman_get_bustag(sc->sc_rres);
138
139 /*
140 * Allocate interrupt resources. There may be a different interrupt
141 * per channel. We allocate them all...

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

373 /*
374 * Allocate the register resource. We assume that all SCCs have a
375 * single register window in either I/O port space or memory mapped
376 * I/O space. Any SCC that needs multiple windows will consequently
377 * not be supported by this driver as-is.
378 */
379 sc->sc_rrid = rid;
380 sc->sc_rtype = SYS_RES_MEMORY;
381 sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, &sc->sc_rrid,
382 0, ~0, cl->cl_channels * size, RF_ACTIVE);
381 sc->sc_rres = bus_alloc_resource_anywhere(dev, sc->sc_rtype,
382 &sc->sc_rrid, cl->cl_channels * size, RF_ACTIVE);
383 if (sc->sc_rres == NULL) {
384 sc->sc_rrid = rid;
385 sc->sc_rtype = SYS_RES_IOPORT;
383 if (sc->sc_rres == NULL) {
384 sc->sc_rrid = rid;
385 sc->sc_rtype = SYS_RES_IOPORT;
386 sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype,
387 &sc->sc_rrid, 0, ~0, cl->cl_channels * size, RF_ACTIVE);
386 sc->sc_rres = bus_alloc_resource_anywhere(dev, sc->sc_rtype,
387 &sc->sc_rrid, cl->cl_channels * size, RF_ACTIVE);
388 if (sc->sc_rres == NULL)
389 return (ENXIO);
390 }
391
392 /*
393 * Fill in the bus access structure and call the hardware specific
394 * probe method.
395 */

--- 189 unchanged lines hidden ---
388 if (sc->sc_rres == NULL)
389 return (ENXIO);
390 }
391
392 /*
393 * Fill in the bus access structure and call the hardware specific
394 * probe method.
395 */

--- 189 unchanged lines hidden ---