asc.c revision 1.1.4.5 1 1.1.4.5 nathanw /* $NetBSD: asc.c,v 1.1.4.5 2002/06/20 03:37:20 nathanw Exp $ */
2 1.1.4.2 nathanw
3 1.1.4.2 nathanw /*
4 1.1.4.2 nathanw * Copyright (c) 2001 Richard Earnshaw
5 1.1.4.2 nathanw * All rights reserved.
6 1.1.4.2 nathanw *
7 1.1.4.2 nathanw * 1. Redistributions of source code must retain the above copyright
8 1.1.4.2 nathanw * notice, this list of conditions and the following disclaimer.
9 1.1.4.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
10 1.1.4.2 nathanw * notice, this list of conditions and the following disclaimer in the
11 1.1.4.2 nathanw * documentation and/or other materials provided with the distribution.
12 1.1.4.2 nathanw * 3. The name of the company nor the name of the author may be used to
13 1.1.4.2 nathanw * endorse or promote products derived from this software without specific
14 1.1.4.2 nathanw * prior written permission.
15 1.1.4.2 nathanw *
16 1.1.4.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
17 1.1.4.2 nathanw * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18 1.1.4.2 nathanw * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.1.4.2 nathanw * IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
20 1.1.4.2 nathanw * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 1.1.4.2 nathanw * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22 1.1.4.2 nathanw * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 1.1.4.2 nathanw * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 1.1.4.2 nathanw * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 1.1.4.2 nathanw * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 1.1.4.2 nathanw * POSSIBILITY OF SUCH DAMAGE.
27 1.1.4.2 nathanw *
28 1.1.4.2 nathanw *
29 1.1.4.2 nathanw * Copyright (c) 1996 Mark Brinicombe
30 1.1.4.2 nathanw * Copyright (c) 1982, 1990 The Regents of the University of California.
31 1.1.4.2 nathanw * All rights reserved.
32 1.1.4.2 nathanw *
33 1.1.4.2 nathanw * Redistribution and use in source and binary forms, with or without
34 1.1.4.2 nathanw * modification, are permitted provided that the following conditions
35 1.1.4.2 nathanw * are met:
36 1.1.4.2 nathanw * 1. Redistributions of source code must retain the above copyright
37 1.1.4.2 nathanw * notice, this list of conditions and the following disclaimer.
38 1.1.4.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
39 1.1.4.2 nathanw * notice, this list of conditions and the following disclaimer in the
40 1.1.4.2 nathanw * documentation and/or other materials provided with the distribution.
41 1.1.4.2 nathanw * 3. All advertising materials mentioning features or use of this software
42 1.1.4.2 nathanw * must display the following acknowledgement:
43 1.1.4.2 nathanw * This product includes software developed by the University of
44 1.1.4.2 nathanw * California, Berkeley and its contributors.
45 1.1.4.2 nathanw * 4. Neither the name of the University nor the names of its contributors
46 1.1.4.2 nathanw * may be used to endorse or promote products derived from this software
47 1.1.4.2 nathanw * without specific prior written permission.
48 1.1.4.2 nathanw *
49 1.1.4.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50 1.1.4.2 nathanw * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 1.1.4.2 nathanw * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52 1.1.4.2 nathanw * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53 1.1.4.2 nathanw * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54 1.1.4.2 nathanw * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55 1.1.4.2 nathanw * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 1.1.4.2 nathanw * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57 1.1.4.2 nathanw * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58 1.1.4.2 nathanw * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59 1.1.4.2 nathanw * SUCH DAMAGE.
60 1.1.4.2 nathanw *
61 1.1.4.2 nathanw * from:ahsc.c
62 1.1.4.2 nathanw */
63 1.1.4.2 nathanw
64 1.1.4.2 nathanw /*
65 1.1.4.2 nathanw * Driver for the Acorn SCSI card using the SBIC (WD33C93A) generic driver
66 1.1.4.2 nathanw *
67 1.1.4.2 nathanw * Thanks to Acorn for supplying programming information on this card.
68 1.1.4.2 nathanw */
69 1.1.4.2 nathanw
70 1.1.4.2 nathanw /* #define ASC_DMAMAP_DEBUG */
71 1.1.4.2 nathanw /* #define DEBUG */
72 1.1.4.2 nathanw
73 1.1.4.2 nathanw #include "opt_ddb.h"
74 1.1.4.2 nathanw
75 1.1.4.2 nathanw #include <sys/param.h>
76 1.1.4.3 nathanw
77 1.1.4.5 nathanw __KERNEL_RCSID(0, "$NetBSD: asc.c,v 1.1.4.5 2002/06/20 03:37:20 nathanw Exp $");
78 1.1.4.3 nathanw
79 1.1.4.2 nathanw #include <sys/systm.h>
80 1.1.4.2 nathanw #include <sys/kernel.h>
81 1.1.4.2 nathanw #include <sys/device.h>
82 1.1.4.2 nathanw #include <sys/buf.h>
83 1.1.4.2 nathanw
84 1.1.4.2 nathanw #include <uvm/uvm_extern.h>
85 1.1.4.2 nathanw
86 1.1.4.2 nathanw #include <machine/bus.h>
87 1.1.4.2 nathanw #include <machine/intr.h>
88 1.1.4.2 nathanw #include <machine/bootconfig.h> /* asc_poll */
89 1.1.4.2 nathanw
90 1.1.4.2 nathanw #include <dev/scsipi/scsi_all.h>
91 1.1.4.2 nathanw #include <dev/scsipi/scsipi_all.h>
92 1.1.4.2 nathanw #include <dev/scsipi/scsiconf.h>
93 1.1.4.2 nathanw
94 1.1.4.2 nathanw #include <arm/arm32/katelib.h>
95 1.1.4.2 nathanw
96 1.1.4.2 nathanw #include <dev/podulebus/podules.h>
97 1.1.4.2 nathanw #include <dev/podulebus/powerromreg.h>
98 1.1.4.2 nathanw
99 1.1.4.2 nathanw #include <acorn32/podulebus/podulebus.h>
100 1.1.4.2 nathanw #include <acorn32/podulebus/sbicreg.h>
101 1.1.4.2 nathanw #include <acorn32/podulebus/sbicvar.h>
102 1.1.4.2 nathanw #include <acorn32/podulebus/ascreg.h>
103 1.1.4.2 nathanw #include <acorn32/podulebus/ascvar.h>
104 1.1.4.2 nathanw
105 1.1.4.2 nathanw void ascattach (struct device *, struct device *, void *);
106 1.1.4.2 nathanw int ascmatch (struct device *, struct cfdata *, void *);
107 1.1.4.2 nathanw
108 1.1.4.2 nathanw void asc_enintr (struct sbic_softc *);
109 1.1.4.2 nathanw
110 1.1.4.2 nathanw int asc_dmaok (void *, bus_dma_tag_t, struct sbic_acb *);
111 1.1.4.2 nathanw int asc_dmasetup (void *, bus_dma_tag_t, struct sbic_acb *, int);
112 1.1.4.2 nathanw int asc_dmanext (void *, bus_dma_tag_t, struct sbic_acb *, int);
113 1.1.4.2 nathanw void asc_dmastop (void *, bus_dma_tag_t, struct sbic_acb *);
114 1.1.4.2 nathanw void asc_dmafinish (void *, bus_dma_tag_t, struct sbic_acb *);
115 1.1.4.2 nathanw
116 1.1.4.2 nathanw void asc_scsi_request (struct scsipi_channel *,
117 1.1.4.2 nathanw scsipi_adapter_req_t, void *);
118 1.1.4.2 nathanw int asc_intr (void *);
119 1.1.4.2 nathanw void asc_minphys (struct buf *);
120 1.1.4.2 nathanw
121 1.1.4.3 nathanw void asc_dump (void);
122 1.1.4.3 nathanw
123 1.1.4.2 nathanw #ifdef DEBUG
124 1.1.4.2 nathanw int asc_dmadebug = 0;
125 1.1.4.2 nathanw #endif
126 1.1.4.2 nathanw
127 1.1.4.2 nathanw struct cfattach asc_ca = {
128 1.1.4.2 nathanw sizeof(struct asc_softc), ascmatch, ascattach
129 1.1.4.2 nathanw };
130 1.1.4.2 nathanw
131 1.1.4.2 nathanw extern struct cfdriver asc_cd;
132 1.1.4.2 nathanw
133 1.1.4.2 nathanw u_long scsi_nosync;
134 1.1.4.2 nathanw int shift_nosync;
135 1.1.4.2 nathanw
136 1.1.4.2 nathanw #if ASC_POLL > 0
137 1.1.4.2 nathanw int asc_poll = 0;
138 1.1.4.2 nathanw
139 1.1.4.2 nathanw #endif
140 1.1.4.2 nathanw
141 1.1.4.2 nathanw int
142 1.1.4.2 nathanw ascmatch(struct device *pdp, struct cfdata *cf, void *auxp)
143 1.1.4.2 nathanw {
144 1.1.4.2 nathanw struct podule_attach_args *pa = (struct podule_attach_args *)auxp;
145 1.1.4.2 nathanw
146 1.1.4.2 nathanw /* Look for the card */
147 1.1.4.2 nathanw
148 1.1.4.2 nathanw /* Standard ROM, skipping the MCS card that used the same ID. */
149 1.1.4.5 nathanw if (pa->pa_product == PODULE_ACORN_SCSI &&
150 1.1.4.2 nathanw strncmp(pa->pa_podule->description, "MCS", 3) != 0)
151 1.1.4.2 nathanw return 1;
152 1.1.4.2 nathanw
153 1.1.4.2 nathanw /* PowerROM */
154 1.1.4.2 nathanw if (pa->pa_product == PODULE_ALSYSTEMS_SCSI &&
155 1.1.4.2 nathanw podulebus_initloader(pa) == 0 &&
156 1.1.4.2 nathanw podloader_callloader(pa, 0, 0) == PRID_ACORN_SCSI1)
157 1.1.4.2 nathanw return 1;
158 1.1.4.2 nathanw
159 1.1.4.2 nathanw return 0;
160 1.1.4.2 nathanw }
161 1.1.4.2 nathanw
162 1.1.4.2 nathanw void
163 1.1.4.2 nathanw ascattach(struct device *pdp, struct device *dp, void *auxp)
164 1.1.4.2 nathanw {
165 1.1.4.2 nathanw /* volatile struct sdmac *rp;*/
166 1.1.4.2 nathanw struct asc_softc *sc;
167 1.1.4.2 nathanw struct sbic_softc *sbic;
168 1.1.4.2 nathanw struct podule_attach_args *pa;
169 1.1.4.2 nathanw
170 1.1.4.2 nathanw sc = (struct asc_softc *)dp;
171 1.1.4.2 nathanw pa = (struct podule_attach_args *)auxp;
172 1.1.4.2 nathanw
173 1.1.4.2 nathanw if (pa->pa_podule_number == -1)
174 1.1.4.2 nathanw panic("Podule has disappeared !");
175 1.1.4.2 nathanw
176 1.1.4.2 nathanw sc->sc_podule_number = pa->pa_podule_number;
177 1.1.4.2 nathanw sc->sc_podule = pa->pa_podule;
178 1.1.4.2 nathanw podules[sc->sc_podule_number].attached = 1;
179 1.1.4.2 nathanw
180 1.1.4.2 nathanw sbic = &sc->sc_softc;
181 1.1.4.2 nathanw
182 1.1.4.2 nathanw sbic->sc_enintr = asc_enintr;
183 1.1.4.2 nathanw sbic->sc_dmaok = asc_dmaok;
184 1.1.4.2 nathanw sbic->sc_dmasetup = asc_dmasetup;
185 1.1.4.2 nathanw sbic->sc_dmanext = asc_dmanext;
186 1.1.4.2 nathanw sbic->sc_dmastop = asc_dmastop;
187 1.1.4.2 nathanw sbic->sc_dmafinish = asc_dmafinish;
188 1.1.4.2 nathanw
189 1.1.4.2 nathanw /* Map sbic */
190 1.1.4.2 nathanw sbic->sc_sbicp.sc_sbiciot = pa->pa_iot;
191 1.1.4.2 nathanw if (bus_space_map (sbic->sc_sbicp.sc_sbiciot,
192 1.1.4.2 nathanw sc->sc_podule->mod_base + ASC_SBIC, ASC_SBIC_SPACE, 0,
193 1.1.4.2 nathanw &sbic->sc_sbicp.sc_sbicioh))
194 1.1.4.2 nathanw panic("%s: Cannot map SBIC\n", dp->dv_xname);
195 1.1.4.2 nathanw
196 1.1.4.2 nathanw sbic->sc_clkfreq = sbic_clock_override ? sbic_clock_override : 143;
197 1.1.4.2 nathanw
198 1.1.4.2 nathanw sbic->sc_adapter.adapt_dev = &sbic->sc_dev;
199 1.1.4.2 nathanw sbic->sc_adapter.adapt_nchannels = 1;
200 1.1.4.2 nathanw sbic->sc_adapter.adapt_openings = 7;
201 1.1.4.2 nathanw sbic->sc_adapter.adapt_max_periph = 1;
202 1.1.4.2 nathanw sbic->sc_adapter.adapt_ioctl = NULL;
203 1.1.4.2 nathanw sbic->sc_adapter.adapt_minphys = asc_minphys;
204 1.1.4.2 nathanw sbic->sc_adapter.adapt_request = asc_scsi_request;
205 1.1.4.2 nathanw
206 1.1.4.2 nathanw sbic->sc_channel.chan_adapter = &sbic->sc_adapter;
207 1.1.4.2 nathanw sbic->sc_channel.chan_bustype = &scsi_bustype;
208 1.1.4.2 nathanw sbic->sc_channel.chan_channel = 0;
209 1.1.4.2 nathanw sbic->sc_channel.chan_ntargets = 8;
210 1.1.4.2 nathanw sbic->sc_channel.chan_nluns = 8;
211 1.1.4.2 nathanw sbic->sc_channel.chan_id = 7;
212 1.1.4.2 nathanw
213 1.1.4.2 nathanw /* Provide an override for the host id */
214 1.1.4.2 nathanw (void)get_bootconf_option(boot_args, "asc.hostid",
215 1.1.4.2 nathanw BOOTOPT_TYPE_INT, &sbic->sc_channel.chan_id);
216 1.1.4.2 nathanw
217 1.1.4.2 nathanw printf(": hostid=%d", sbic->sc_channel.chan_id);
218 1.1.4.2 nathanw
219 1.1.4.2 nathanw #if ASC_POLL > 0
220 1.1.4.2 nathanw if (boot_args)
221 1.1.4.2 nathanw get_bootconf_option(boot_args, "ascpoll", BOOTOPT_TYPE_BOOLEAN,
222 1.1.4.2 nathanw &asc_poll);
223 1.1.4.2 nathanw
224 1.1.4.2 nathanw if (asc_poll)
225 1.1.4.2 nathanw printf(" polling");
226 1.1.4.2 nathanw #endif
227 1.1.4.2 nathanw printf("\n");
228 1.1.4.2 nathanw
229 1.1.4.2 nathanw sc->sc_pagereg = sc->sc_podule->fast_base + ASC_PAGEREG;
230 1.1.4.2 nathanw sc->sc_intstat = sc->sc_podule->fast_base + ASC_INTSTATUS;
231 1.1.4.2 nathanw
232 1.1.4.2 nathanw /* Reset the card */
233 1.1.4.2 nathanw
234 1.1.4.2 nathanw WriteByte(sc->sc_pagereg, 0x80);
235 1.1.4.2 nathanw DELAY(500000);
236 1.1.4.2 nathanw WriteByte(sc->sc_pagereg, 0x00);
237 1.1.4.2 nathanw DELAY(250000);
238 1.1.4.2 nathanw
239 1.1.4.2 nathanw sbicinit(sbic);
240 1.1.4.2 nathanw
241 1.1.4.2 nathanw /* If we are polling only, we don't need a interrupt handler. */
242 1.1.4.2 nathanw
243 1.1.4.2 nathanw #ifdef ASC_POLL
244 1.1.4.2 nathanw if (!asc_poll)
245 1.1.4.2 nathanw #endif
246 1.1.4.2 nathanw {
247 1.1.4.2 nathanw evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, NULL,
248 1.1.4.2 nathanw dp->dv_xname, "intr");
249 1.1.4.2 nathanw sc->sc_ih = podulebus_irq_establish(pa->pa_ih, IPL_BIO,
250 1.1.4.2 nathanw asc_intr, sc, &sc->sc_intrcnt);
251 1.1.4.2 nathanw if (sc->sc_ih == NULL)
252 1.1.4.2 nathanw panic("%s: Cannot claim podule IRQ\n", dp->dv_xname);
253 1.1.4.2 nathanw }
254 1.1.4.2 nathanw
255 1.1.4.2 nathanw /*
256 1.1.4.2 nathanw * attach all scsi units on us
257 1.1.4.2 nathanw */
258 1.1.4.2 nathanw config_found(dp, &sbic->sc_channel, scsiprint);
259 1.1.4.2 nathanw }
260 1.1.4.2 nathanw
261 1.1.4.2 nathanw
262 1.1.4.2 nathanw void
263 1.1.4.2 nathanw asc_enintr(struct sbic_softc *sbicsc)
264 1.1.4.2 nathanw {
265 1.1.4.2 nathanw struct asc_softc *sc = (struct asc_softc *)sbicsc;
266 1.1.4.2 nathanw
267 1.1.4.2 nathanw sbicsc->sc_flags |= SBICF_INTR;
268 1.1.4.2 nathanw WriteByte(sc->sc_pagereg, 0x40);
269 1.1.4.2 nathanw }
270 1.1.4.2 nathanw
271 1.1.4.2 nathanw int
272 1.1.4.2 nathanw asc_dmaok (void *dma_h, bus_dma_tag_t dma_t, struct sbic_acb *acb)
273 1.1.4.2 nathanw {
274 1.1.4.2 nathanw return 0;
275 1.1.4.2 nathanw }
276 1.1.4.2 nathanw
277 1.1.4.2 nathanw int
278 1.1.4.2 nathanw asc_dmasetup (void *dma_h, bus_dma_tag_t dma_t, struct sbic_acb *acb, int dir)
279 1.1.4.2 nathanw {
280 1.1.4.2 nathanw printf("asc_dmasetup()");
281 1.1.4.2 nathanw #ifdef DDB
282 1.1.4.2 nathanw Debugger();
283 1.1.4.2 nathanw #else
284 1.1.4.2 nathanw panic("Hit a brick wall\n");
285 1.1.4.2 nathanw #endif
286 1.1.4.2 nathanw return 0;
287 1.1.4.2 nathanw }
288 1.1.4.2 nathanw
289 1.1.4.2 nathanw int
290 1.1.4.2 nathanw asc_dmanext (void *dma_h, bus_dma_tag_t dma_t, struct sbic_acb *acb, int dir)
291 1.1.4.2 nathanw {
292 1.1.4.2 nathanw printf("asc_dmanext()");
293 1.1.4.2 nathanw #ifdef DDB
294 1.1.4.2 nathanw Debugger();
295 1.1.4.2 nathanw #else
296 1.1.4.2 nathanw panic("Hit a brick wall\n");
297 1.1.4.2 nathanw #endif
298 1.1.4.2 nathanw return 0;
299 1.1.4.2 nathanw }
300 1.1.4.2 nathanw
301 1.1.4.2 nathanw void
302 1.1.4.2 nathanw asc_dmastop (void *dma_h, bus_dma_tag_t dma_t, struct sbic_acb *acb)
303 1.1.4.2 nathanw {
304 1.1.4.2 nathanw printf("asc_dmastop\n");
305 1.1.4.2 nathanw }
306 1.1.4.2 nathanw
307 1.1.4.2 nathanw void
308 1.1.4.2 nathanw asc_dmafinish (void *dma_h, bus_dma_tag_t dma_t, struct sbic_acb *acb)
309 1.1.4.2 nathanw {
310 1.1.4.2 nathanw printf("asc_dmafinish\n");
311 1.1.4.2 nathanw }
312 1.1.4.2 nathanw
313 1.1.4.2 nathanw void
314 1.1.4.2 nathanw asc_dump(void)
315 1.1.4.2 nathanw {
316 1.1.4.2 nathanw int i;
317 1.1.4.2 nathanw
318 1.1.4.2 nathanw for (i = 0; i < asc_cd.cd_ndevs; ++i)
319 1.1.4.2 nathanw if (asc_cd.cd_devs[i])
320 1.1.4.2 nathanw sbic_dump(asc_cd.cd_devs[i]);
321 1.1.4.2 nathanw }
322 1.1.4.2 nathanw
323 1.1.4.2 nathanw void
324 1.1.4.2 nathanw asc_scsi_request(struct scsipi_channel *chan, scsipi_adapter_req_t req,
325 1.1.4.2 nathanw void *arg)
326 1.1.4.2 nathanw {
327 1.1.4.2 nathanw struct scsipi_xfer *xs;
328 1.1.4.2 nathanw
329 1.1.4.2 nathanw switch (req) {
330 1.1.4.2 nathanw case ADAPTER_REQ_RUN_XFER:
331 1.1.4.2 nathanw xs = arg;
332 1.1.4.2 nathanw
333 1.1.4.2 nathanw #if ASC_POLL > 0
334 1.1.4.2 nathanw /* ensure command is polling for the moment */
335 1.1.4.2 nathanw
336 1.1.4.2 nathanw if (asc_poll)
337 1.1.4.2 nathanw xs->xs_control |= XS_CTL_POLL;
338 1.1.4.2 nathanw #endif
339 1.1.4.2 nathanw
340 1.1.4.2 nathanw /* printf("id=%d lun=%dcmdlen=%d datalen=%d opcode=%02x flags=%08x status=%02x blk=%02x %02x\n",
341 1.1.4.2 nathanw xs->xs_periph->periph_target, xs->xs_periph->periph_lun, xs->cmdlen, xs->datalen, xs->cmd->opcode,
342 1.1.4.2 nathanw xs->xs_control, xs->status, xs->cmd->bytes[0], xs->cmd->bytes[1]);*/
343 1.1.4.2 nathanw
344 1.1.4.2 nathanw default:
345 1.1.4.2 nathanw }
346 1.1.4.2 nathanw sbic_scsi_request(chan, req, arg);
347 1.1.4.2 nathanw }
348 1.1.4.2 nathanw
349 1.1.4.2 nathanw
350 1.1.4.2 nathanw int
351 1.1.4.2 nathanw asc_intr(void *arg)
352 1.1.4.2 nathanw {
353 1.1.4.2 nathanw struct asc_softc *sc = arg;
354 1.1.4.2 nathanw int intr;
355 1.1.4.2 nathanw
356 1.1.4.2 nathanw /* printf("ascintr:");*/
357 1.1.4.2 nathanw intr = ReadByte(sc->sc_intstat);
358 1.1.4.2 nathanw /* printf("%02x\n", intr);*/
359 1.1.4.2 nathanw
360 1.1.4.2 nathanw if (intr & IS_SBIC_IRQ)
361 1.1.4.2 nathanw sbicintr((struct sbic_softc *)sc);
362 1.1.4.2 nathanw
363 1.1.4.2 nathanw return 0; /* Pass interrupt on down the chain */
364 1.1.4.2 nathanw }
365 1.1.4.2 nathanw
366 1.1.4.2 nathanw /*
367 1.1.4.2 nathanw * limit the transfer as required.
368 1.1.4.2 nathanw */
369 1.1.4.2 nathanw void
370 1.1.4.2 nathanw asc_minphys(struct buf *bp)
371 1.1.4.2 nathanw {
372 1.1.4.2 nathanw #if 0
373 1.1.4.2 nathanw /*
374 1.1.4.2 nathanw * We must limit the DMA xfer size
375 1.1.4.2 nathanw */
376 1.1.4.2 nathanw if (bp->b_bcount > MAX_DMA_LEN) {
377 1.1.4.2 nathanw printf("asc: Reducing dma length\n");
378 1.1.4.2 nathanw bp->b_bcount = MAX_DMA_LEN;
379 1.1.4.2 nathanw }
380 1.1.4.2 nathanw #endif
381 1.1.4.2 nathanw minphys(bp);
382 1.1.4.2 nathanw }
383 1.1.4.2 nathanw
384