Lines Matching defs:bsc
166 struct bzsc_softc *bsc = device_private(self);
167 struct ncr53c9x_softc *sc = &bsc->sc_ncr53c9x;
183 bsc->sc_reg = &((volatile uint8_t *)zap->va)[0x10000];
184 bsc->sc_dmabase = &bsc->sc_reg[0x21];
188 aprint_normal(": address %p", bsc->sc_reg);
237 bsc->sc_isr.isr_intr = ncr53c9x_intr;
238 bsc->sc_isr.isr_arg = sc;
239 bsc->sc_isr.isr_ipl = 2;
240 add_isr(&bsc->sc_isr);
257 struct bzsc_softc *bsc = (struct bzsc_softc *)sc;
259 return bsc->sc_reg[reg * 2];
265 struct bzsc_softc *bsc = (struct bzsc_softc *)sc;
268 bsc->sc_reg[reg * 2] = v;
271 reg == NCR_CMD/* && bsc->sc_active*/) {
281 struct bzsc_softc *bsc = (struct bzsc_softc *)sc;
283 if ((bsc->sc_reg[NCR_STAT * 2] & NCRSTAT_INT) == 0)
288 bzsc_trace[bzsc_trace_ptr].status = bsc->sc_reg[NCR_STAT * 2];
289 bzsc_trace[bzsc_trace_ptr].xx = bsc->sc_reg[NCR_CMD * 2];
290 bzsc_trace[bzsc_trace_ptr].yy = bsc->sc_active;
300 struct bzsc_softc *bsc = (struct bzsc_softc *)sc;
302 bsc->sc_active = 0;
308 struct bzsc_softc *bsc = (struct bzsc_softc *)sc;
312 bsc->sc_dmasize, sc->sc_espintr, sc->sc_espstat,
313 bsc->sc_reg[NCR_FFLAG * 2] & NCRFIFO_FF));
314 if (bsc->sc_active == 0) {
320 cnt = bsc->sc_reg[NCR_TCL * 2];
321 cnt += bsc->sc_reg[NCR_TCM * 2] << 8;
322 cnt += bsc->sc_reg[NCR_TCH * 2] << 16;
323 if (!bsc->sc_datain) {
324 cnt += bsc->sc_reg[NCR_FFLAG * 2] & NCRFIFO_FF;
325 bsc->sc_reg[NCR_CMD * 2] = NCRCMD_FLUSH;
327 cnt = bsc->sc_dmasize - cnt; /* number of bytes transferred */
329 if (bsc->sc_xfr_align) {
330 memcpy(*bsc->sc_dmaaddr, bsc->sc_alignbuf, cnt);
331 bsc->sc_xfr_align = 0;
333 *bsc->sc_dmaaddr += cnt;
334 *bsc->sc_pdmalen -= cnt;
335 bsc->sc_active = 0;
343 struct bzsc_softc *bsc = (struct bzsc_softc *)sc;
348 bsc->sc_dmaaddr = addr;
349 bsc->sc_pdmalen = len;
350 bsc->sc_datain = datain;
351 bsc->sc_dmasize = *dmasize;
360 bsc->sc_dmasize > bzsc_max_dma)
361 bsc->sc_dmasize = bzsc_max_dma;
364 xfer = uimin(bsc->sc_dmasize, PAGE_SIZE - (pa & (PAGE_SIZE - 1)));
365 bsc->sc_xfr_align = 0;
373 bsc->sc_reg[NCR_FIFO * 2] = *ptr++;
379 pa = kvtop((void *)&bsc->sc_alignbuf);
380 xfer = bsc->sc_dmasize = uimin(xfer, sizeof(bsc->sc_alignbuf));
382 bsc->sc_xfr_align = 1;
386 while (xfer < bsc->sc_dmasize) {
389 if ((bsc->sc_dmasize - xfer) < PAGE_SIZE)
390 xfer = bsc->sc_dmasize;
398 bsc->sc_dmasize = xfer;
399 *dmasize = bsc->sc_dmasize;
400 bsc->sc_pa = pa;
403 if (bsc->sc_xfr_align) {
404 dma_cachectl(bsc->sc_alignbuf,
405 sizeof(bsc->sc_alignbuf));
408 dma_cachectl(*bsc->sc_dmaaddr, bsc->sc_dmasize);
413 if (!bsc->sc_datain)
415 bsc->sc_dmabase[0x10] = (uint8_t)(pa >> 24);
416 bsc->sc_dmabase[0] = (uint8_t)(pa >> 16);
417 bsc->sc_dmabase[0] = (uint8_t)(pa >> 8);
418 bsc->sc_dmabase[0] = (uint8_t)(pa);
419 bsc->sc_active = 1;
436 struct bzsc_softc *bsc = (struct bzsc_softc *)sc;
438 return bsc->sc_active;