Lines Matching refs:hs

259 nhpibreset(struct hpibbus_softc *hs)  in nhpibreset()  argument
261 struct nhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in nhpibreset()
265 hd->hpib_ar = hs->sc_ba; in nhpibreset()
296 nhpibsend(struct hpibbus_softc *hs, int slave, int sec, void *ptr, int origcnt) in nhpibsend() argument
298 struct nhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in nhpibsend()
307 hd->hpib_data = talker_par[hs->sc_ba]; in nhpibsend()
351 nhpibrecv(struct hpibbus_softc *hs, int slave, int sec, void *ptr, int origcnt) in nhpibrecv() argument
353 struct nhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in nhpibrecv()
367 hd->hpib_data = listnr_par[hs->sc_ba]; in nhpibrecv()
401 nhpibgo(struct hpibbus_softc *hs, int slave, int sec, void *ptr, int count, in nhpibgo() argument
404 struct nhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in nhpibgo()
408 hs->sc_flags |= HPIBF_IO; in nhpibgo()
410 hs->sc_flags |= HPIBF_TIMO; in nhpibgo()
412 hs->sc_flags |= HPIBF_READ; in nhpibgo()
414 else if (hs->sc_flags & HPIBF_READ) { in nhpibgo()
416 hs->sc_flags &= ~HPIBF_READ; in nhpibgo()
419 hs->sc_count = count; in nhpibgo()
420 hs->sc_addr = addr; in nhpibgo()
421 if (hs->sc_flags & HPIBF_READ) { in nhpibgo()
422 hs->sc_curcnt = count; in nhpibgo()
423 dmago(hs->sc_dq->dq_chan, addr, count, DMAGO_BYTE|DMAGO_READ); in nhpibgo()
424 nhpibrecv(hs, slave, sec, 0, 0); in nhpibgo()
429 hs->sc_curcnt = count; in nhpibgo()
430 nhpibsend(hs, slave, sec, addr, count); in nhpibgo()
431 nhpibdone(hs); in nhpibgo()
434 hs->sc_curcnt = --count; in nhpibgo()
435 dmago(hs->sc_dq->dq_chan, addr, count, DMAGO_BYTE); in nhpibgo()
436 nhpibsend(hs, slave, sec, 0, 0); in nhpibgo()
438 hd->hpib_ie = IDS_IE | IDS_DMA(hs->sc_dq->dq_chan); in nhpibgo()
451 struct hpibbus_softc *hs = arg; in nhpibreadtimo() local
452 struct nhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in nhpibreadtimo()
455 if (hs->sc_flags & HPIBF_IO) { in nhpibreadtimo()
461 hs->sc_flags &= ~(HPIBF_DONE|HPIBF_IO|HPIBF_READ|HPIBF_TIMO); in nhpibreadtimo()
462 dmafree(hs->sc_dq); in nhpibreadtimo()
464 hq = TAILQ_FIRST(&hs->sc_queue); in nhpibreadtimo()
471 nhpibdone(struct hpibbus_softc *hs) in nhpibdone() argument
473 struct nhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in nhpibdone()
477 cnt = hs->sc_curcnt; in nhpibdone()
478 hs->sc_addr += cnt; in nhpibdone()
479 hs->sc_count -= cnt; in nhpibdone()
480 hs->sc_flags |= HPIBF_DONE; in nhpibdone()
482 if (hs->sc_flags & HPIBF_READ) { in nhpibdone()
483 if ((hs->sc_flags & HPIBF_TIMO) && in nhpibdone()
486 nhpibreadtimo, hs); in nhpibdone()
488 if (hs->sc_count == 1) { in nhpibdone()
491 hd->hpib_data = *hs->sc_addr; in nhpibdone()
495 else if (hs->sc_count) in nhpibdone()
505 struct hpibbus_softc *hs = sc->sc_hpibbus; in nhpibintr() local
517 hq = TAILQ_FIRST(&hs->sc_queue); in nhpibintr()
519 if (hs->sc_flags & HPIBF_IO) { in nhpibintr()
521 if ((hs->sc_flags & HPIBF_DONE) == 0) { in nhpibintr()
522 hs->sc_flags &= ~HPIBF_TIMO; in nhpibintr()
523 dmastop(hs->sc_dq->dq_chan); in nhpibintr()
524 } else if (hs->sc_flags & HPIBF_TIMO) in nhpibintr()
527 hs->sc_flags &= ~(HPIBF_DONE|HPIBF_IO|HPIBF_READ|HPIBF_TIMO); in nhpibintr()
529 dmafree(hs->sc_dq); in nhpibintr()
531 } else if (hs->sc_flags & HPIBF_PPOLL) { in nhpibintr()
533 stat0 = nhpibppoll(hs); in nhpibintr()
535 hs->sc_flags &= ~HPIBF_PPOLL; in nhpibintr()
541 device_xname(hs->sc_dev), stat0); in nhpibintr()
548 nhpibppoll(struct hpibbus_softc *hs) in nhpibppoll() argument
550 struct nhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in nhpibppoll()
585 struct hpibbus_softc *hs = arg; in nhpibppwatch() local
586 struct nhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in nhpibppwatch()
588 if ((hs->sc_flags & HPIBF_PPOLL) == 0) in nhpibppwatch()
591 if (nhpibppoll(hs) & (0x80 >> TAILQ_FIRST(&hs->sc_queue)->hq_slave)) in nhpibppwatch()
597 callout_reset(&sc->sc_ppwatch_ch, 1, nhpibppwatch, hs); in nhpibppwatch()