Lines Matching defs:bsc
158 struct bzivsc_softc *bsc = device_private(self);
159 struct ncr53c9x_softc *sc = &bsc->sc_ncr53c9x;
175 bsc->sc_reg = &((volatile uint8_t *)zap->va)[0x8000];
176 bsc->sc_dmabase = &bsc->sc_reg[0x8000];
180 aprint_normal(": address %p", bsc->sc_reg);
229 bsc->sc_isr.isr_intr = ncr53c9x_intr;
230 bsc->sc_isr.isr_arg = sc;
231 bsc->sc_isr.isr_ipl = 2;
232 add_isr(&bsc->sc_isr);
249 struct bzivsc_softc *bsc = (struct bzivsc_softc *)sc;
251 return bsc->sc_reg[reg * 4];
257 struct bzivsc_softc *bsc = (struct bzivsc_softc *)sc;
260 bsc->sc_reg[reg * 4] = v;
263 reg == NCR_CMD/* && bsc->sc_active*/) {
273 struct bzivsc_softc *bsc = (struct bzivsc_softc *)sc;
275 if ((bsc->sc_reg[NCR_STAT * 4] & NCRSTAT_INT) == 0)
280 bzivsc_trace[bzivsc_trace_ptr].status = bsc->sc_reg[NCR_STAT * 4];
281 bzivsc_trace[bzivsc_trace_ptr].xx = bsc->sc_reg[NCR_CMD * 4];
282 bzivsc_trace[bzivsc_trace_ptr].yy = bsc->sc_active;
292 struct bzivsc_softc *bsc = (struct bzivsc_softc *)sc;
294 bsc->sc_active = 0;
300 register struct bzivsc_softc *bsc = (struct bzivsc_softc *)sc;
304 bsc->sc_dmasize, sc->sc_espintr, sc->sc_espstat,
305 bsc->sc_reg[NCR_FFLAG * 4] & NCRFIFO_FF));
306 if (bsc->sc_active == 0) {
312 cnt = bsc->sc_reg[NCR_TCL * 4];
313 cnt += bsc->sc_reg[NCR_TCM * 4] << 8;
314 cnt += bsc->sc_reg[NCR_TCH * 4] << 16;
315 if (!bsc->sc_datain) {
316 cnt += bsc->sc_reg[NCR_FFLAG * 4] & NCRFIFO_FF;
317 bsc->sc_reg[NCR_CMD * 4] = NCRCMD_FLUSH;
319 cnt = bsc->sc_dmasize - cnt; /* number of bytes transferred */
321 if (bsc->sc_xfr_align) {
322 memcpy(*bsc->sc_dmaaddr, bsc->sc_alignbuf, cnt);
323 bsc->sc_xfr_align = 0;
325 *bsc->sc_dmaaddr += cnt;
326 *bsc->sc_pdmalen -= cnt;
327 bsc->sc_active = 0;
335 struct bzivsc_softc *bsc = (struct bzivsc_softc *)sc;
340 bsc->sc_dmaaddr = addr;
341 bsc->sc_pdmalen = len;
342 bsc->sc_datain = datain;
343 bsc->sc_dmasize = *dmasize;
352 bsc->sc_dmasize > bzivsc_max_dma)
353 bsc->sc_dmasize = bzivsc_max_dma;
356 xfer = uimin(bsc->sc_dmasize, PAGE_SIZE - (pa & (PAGE_SIZE - 1)));
357 bsc->sc_xfr_align = 0;
365 bsc->sc_reg[NCR_FIFO * 4] = *ptr++;
371 pa = kvtop((void *)&bsc->sc_alignbuf);
372 xfer = bsc->sc_dmasize = uimin(xfer, sizeof(bsc->sc_alignbuf));
374 bsc->sc_xfr_align = 1;
378 while (xfer < bsc->sc_dmasize) {
381 if ((bsc->sc_dmasize - xfer) < PAGE_SIZE)
382 xfer = bsc->sc_dmasize;
390 bsc->sc_dmasize = xfer;
391 *dmasize = bsc->sc_dmasize;
392 bsc->sc_pa = pa;
395 if (bsc->sc_xfr_align) {
396 dma_cachectl(bsc->sc_alignbuf,
397 sizeof(bsc->sc_alignbuf));
400 dma_cachectl(*bsc->sc_dmaaddr, bsc->sc_dmasize);
405 if (!bsc->sc_datain)
407 bsc->sc_dmabase[0x8000] = (uint8_t)(pa >> 24);
408 bsc->sc_dmabase[0] = (uint8_t)(pa >> 24);
409 bsc->sc_dmabase[0] = (uint8_t)(pa >> 16);
410 bsc->sc_dmabase[0] = (uint8_t)(pa >> 8);
411 bsc->sc_dmabase[0] = (uint8_t)(pa);
412 bsc->sc_active = 1;
429 struct bzivsc_softc *bsc = (struct bzivsc_softc *)sc;
431 return bsc->sc_active;