scc_core.c (167996) | scc_core.c (178600) |
---|---|
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 167996 2007-03-28 18:05:17Z marcel $"); | 28__FBSDID("$FreeBSD: head/sys/dev/scc/scc_core.c 178600 2008-04-26 18:40:59Z 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> --- 52 unchanged lines hidden (view full) --- 89 SCC_ICLEAR(sc, ch); 90 } 91 return (FILTER_HANDLED); 92 } 93 return (FILTER_STRAY); 94} 95 96int | 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> --- 52 unchanged lines hidden (view full) --- 89 SCC_ICLEAR(sc, ch); 90 } 91 return (FILTER_HANDLED); 92 } 93 return (FILTER_STRAY); 94} 95 96int |
97scc_bfe_attach(device_t dev) | 97scc_bfe_attach(device_t dev, u_int ipc) |
98{ 99 struct resource_list_entry *rle; 100 struct scc_chan *ch; 101 struct scc_class *cl; 102 struct scc_mode *m; 103 struct scc_softc *sc, *sc0; 104 const char *sep; 105 bus_space_handle_t bh; --- 33 unchanged lines hidden (view full) --- 139 /* 140 * Allocate interrupt resources. There may be a different interrupt 141 * per channel. We allocate them all... 142 */ 143 sc->sc_chan = malloc(sizeof(struct scc_chan) * cl->cl_channels, 144 M_SCC, M_WAITOK | M_ZERO); 145 for (c = 0; c < cl->cl_channels; c++) { 146 ch = &sc->sc_chan[c]; | 98{ 99 struct resource_list_entry *rle; 100 struct scc_chan *ch; 101 struct scc_class *cl; 102 struct scc_mode *m; 103 struct scc_softc *sc, *sc0; 104 const char *sep; 105 bus_space_handle_t bh; --- 33 unchanged lines hidden (view full) --- 139 /* 140 * Allocate interrupt resources. There may be a different interrupt 141 * per channel. We allocate them all... 142 */ 143 sc->sc_chan = malloc(sizeof(struct scc_chan) * cl->cl_channels, 144 M_SCC, M_WAITOK | M_ZERO); 145 for (c = 0; c < cl->cl_channels; c++) { 146 ch = &sc->sc_chan[c]; |
147 ch->ch_irid = c; | 147 /* 148 * XXX temporary hack. If we have more than 1 interrupt 149 * per channel, allocate the first for the channel. At 150 * this time only the macio bus front-end has more than 151 * 1 interrupt per channel and we don't use the 2nd and 152 * 3rd, because we don't support DMA yet. 153 */ 154 ch->ch_irid = c * ipc; |
148 ch->ch_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, 149 &ch->ch_irid, RF_ACTIVE | RF_SHAREABLE); | 155 ch->ch_ires = bus_alloc_resource_any(dev, SYS_RES_IRQ, 156 &ch->ch_irid, RF_ACTIVE | RF_SHAREABLE); |
157 if (ipc == 0) 158 break; |
|
150 } 151 152 /* 153 * Create the control structures for our children. Probe devices 154 * and query them to see if we can reset the hardware. 155 */ 156 sysdev = 0; 157 base = rman_get_start(sc->sc_rres); --- 418 unchanged lines hidden --- | 159 } 160 161 /* 162 * Create the control structures for our children. Probe devices 163 * and query them to see if we can reset the hardware. 164 */ 165 sysdev = 0; 166 base = rman_get_start(sc->sc_rres); --- 418 unchanged lines hidden --- |