Deleted Added
full compact
scc_core.c (166901) scc_core.c (167822)
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 166901 2007-02-23 12:19:07Z piso $");
28__FBSDID("$FreeBSD: head/sys/dev/scc/scc_core.c 167822 2007-03-22 23:45:25Z marcel $");
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>

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

327
328 free(sc->sc_chan, M_SCC);
329
330 mtx_destroy(&sc->sc_hwmtx);
331 return (0);
332}
333
334int
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>

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

327
328 free(sc->sc_chan, M_SCC);
329
330 mtx_destroy(&sc->sc_hwmtx);
331 return (0);
332}
333
334int
335scc_bfe_probe(device_t dev, u_int regshft, u_int rclk)
335scc_bfe_probe(device_t dev, u_int regshft, u_int rclk, u_int rid)
336{
337 struct scc_softc *sc;
338 struct scc_class *cl;
339 u_long size;
340 int error;
341
342 /*
343 * Initialize the instance. Note that the instance (=softc) does

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

356 size = abs(cl->cl_range) << regshft;
357
358 /*
359 * Allocate the register resource. We assume that all SCCs have a
360 * single register window in either I/O port space or memory mapped
361 * I/O space. Any SCC that needs multiple windows will consequently
362 * not be supported by this driver as-is.
363 */
336{
337 struct scc_softc *sc;
338 struct scc_class *cl;
339 u_long size;
340 int error;
341
342 /*
343 * Initialize the instance. Note that the instance (=softc) does

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

356 size = abs(cl->cl_range) << regshft;
357
358 /*
359 * Allocate the register resource. We assume that all SCCs have a
360 * single register window in either I/O port space or memory mapped
361 * I/O space. Any SCC that needs multiple windows will consequently
362 * not be supported by this driver as-is.
363 */
364 sc->sc_rrid = 0;
364 sc->sc_rrid = rid;
365 sc->sc_rtype = SYS_RES_MEMORY;
366 sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, &sc->sc_rrid,
367 0, ~0, cl->cl_channels * size, RF_ACTIVE);
368 if (sc->sc_rres == NULL) {
365 sc->sc_rtype = SYS_RES_MEMORY;
366 sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype, &sc->sc_rrid,
367 0, ~0, cl->cl_channels * size, RF_ACTIVE);
368 if (sc->sc_rres == NULL) {
369 sc->sc_rrid = 0;
369 sc->sc_rrid = rid;
370 sc->sc_rtype = SYS_RES_IOPORT;
371 sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype,
372 &sc->sc_rrid, 0, ~0, cl->cl_channels * size, RF_ACTIVE);
373 if (sc->sc_rres == NULL)
374 return (ENXIO);
375 }
376
377 /*

--- 191 unchanged lines hidden ---
370 sc->sc_rtype = SYS_RES_IOPORT;
371 sc->sc_rres = bus_alloc_resource(dev, sc->sc_rtype,
372 &sc->sc_rrid, 0, ~0, cl->cl_channels * size, RF_ACTIVE);
373 if (sc->sc_rres == NULL)
374 return (ENXIO);
375 }
376
377 /*

--- 191 unchanged lines hidden ---