Lines Matching refs:hs
193 fhpibreset(struct hpibbus_softc *hs) in fhpibreset() argument
195 struct fhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in fhpibreset()
213 hs->sc_flags |= HPIBF_DMA16; in fhpibreset()
235 fhpibsend(struct hpibbus_softc *hs, int slave, int sec, void *ptr, int origcnt) in fhpibsend() argument
237 struct fhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in fhpibsend()
249 hd->hpib_data = C_TAG + hs->sc_ba; in fhpibsend()
296 fhpibrecv(struct hpibbus_softc *hs, int slave, int sec, void *ptr, int origcnt) in fhpibrecv() argument
298 struct fhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in fhpibrecv()
315 hd->hpib_data = C_LAG + hs->sc_ba; in fhpibrecv()
357 fhpibgo(struct hpibbus_softc *hs, int slave, int sec, void *ptr, int count, in fhpibgo() argument
360 struct fhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in fhpibgo()
366 hs->sc_flags |= HPIBF_IO; in fhpibgo()
368 hs->sc_flags |= HPIBF_TIMO; in fhpibgo()
370 hs->sc_flags |= HPIBF_READ; in fhpibgo()
372 else if (hs->sc_flags & HPIBF_READ) { in fhpibgo()
374 hs->sc_flags &= ~HPIBF_READ; in fhpibgo()
377 hs->sc_count = count; in fhpibgo()
378 hs->sc_addr = addr; in fhpibgo()
382 if ((hs->sc_flags & HPIBF_DMA16) && in fhpibgo()
398 if (hs->sc_flags & HPIBF_READ) { in fhpibgo()
400 hs->sc_curcnt = count; in fhpibgo()
401 dmago(hs->sc_dq->dq_chan, addr, count, flags|DMAGO_READ); in fhpibgo()
402 if (fhpibrecv(hs, slave, sec, 0, 0) < 0) { in fhpibgo()
406 (void)fhpibrecv(hs, slave, sec, 0, 0); in fhpibgo()
410 hd->hpib_ie = IDS_DMA(hs->sc_dq->dq_chan) | in fhpibgo()
422 hs->sc_curcnt = count; in fhpibgo()
423 (void) fhpibsend(hs, slave, sec, addr, count); in fhpibgo()
424 fhpibdone(hs); in fhpibgo()
428 hs->sc_curcnt = count; in fhpibgo()
429 dmago(hs->sc_dq->dq_chan, addr, count, flags); in fhpibgo()
430 if (fhpibsend(hs, slave, sec, 0, 0) < 0) { in fhpibgo()
434 (void)fhpibsend(hs, slave, sec, 0, 0); in fhpibgo()
438 hd->hpib_ie = IDS_DMA(hs->sc_dq->dq_chan) | IDS_WRITE | in fhpibgo()
452 struct hpibbus_softc *hs = arg; in fhpibdmadone() local
453 struct fhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in fhpibdmadone()
456 if (hs->sc_flags & HPIBF_IO) { in fhpibdmadone()
467 hs->sc_flags &= ~(HPIBF_DONE|HPIBF_IO|HPIBF_READ|HPIBF_TIMO); in fhpibdmadone()
468 dmafree(hs->sc_dq); in fhpibdmadone()
470 hq = TAILQ_FIRST(&hs->sc_queue); in fhpibdmadone()
477 fhpibdone(struct hpibbus_softc *hs) in fhpibdone() argument
479 struct fhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in fhpibdone()
484 cnt = hs->sc_curcnt; in fhpibdone()
485 hs->sc_addr += cnt; in fhpibdone()
486 hs->sc_count -= cnt; in fhpibdone()
491 __func__, hs->sc_addr, hs->sc_count); in fhpibdone()
493 if (hs->sc_flags & HPIBF_READ) { in fhpibdone()
495 if (hs->sc_flags & HPIBF_TIMO) in fhpibdone()
497 fhpibdmadone, hs); in fhpibdone()
499 cnt = hs->sc_count; in fhpibdone()
501 addr = hs->sc_addr; in fhpibdone()
514 hs->sc_flags |= HPIBF_DONE; in fhpibdone()
523 struct hpibbus_softc *hs = sc->sc_hpibbus; in fhpibintr() local
532 (hs->sc_flags & (HPIBF_IO|HPIBF_DONE)) != HPIBF_IO) in fhpibintr()
539 if ((hs->sc_flags & (HPIBF_IO|HPIBF_DONE)) == HPIBF_IO) { in fhpibintr()
548 printf("%s: flags %x\n", __func__, hs->sc_flags); in fhpibintr()
550 hq = TAILQ_FIRST(&hs->sc_queue); in fhpibintr()
551 if (hs->sc_flags & HPIBF_IO) { in fhpibintr()
552 if (hs->sc_flags & HPIBF_TIMO) in fhpibintr()
560 hs->sc_flags &= ~(HPIBF_DONE|HPIBF_IO|HPIBF_READ|HPIBF_TIMO); in fhpibintr()
561 dmafree(hs->sc_dq); in fhpibintr()
563 } else if (hs->sc_flags & HPIBF_PPOLL) { in fhpibintr()
574 stat0 = fhpibppoll(hs); in fhpibintr()
584 stat0 = fhpibppoll(hs); in fhpibintr()
593 hs->sc_flags &= ~HPIBF_PPOLL; in fhpibintr()
600 fhpibppoll(struct hpibbus_softc *hs) in fhpibppoll() argument
602 struct fhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in fhpibppoll()
645 struct hpibbus_softc *hs = arg; in fhpibppwatch() local
646 struct fhpib_softc *sc = device_private(device_parent(hs->sc_dev)); in fhpibppwatch()
650 if ((hs->sc_flags & HPIBF_PPOLL) == 0) in fhpibppwatch()
652 slave = (0x80 >> TAILQ_FIRST(&hs->sc_queue)->hq_slave); in fhpibppwatch()
655 if (fhpibppoll(hs) & slave) { in fhpibppwatch()