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