Lines Matching refs:esc

164 static int	espattach(struct esp_softc *esc,
166 static int espdetach(struct esp_softc *esc);
200 struct esp_softc *esc;
206 esc = device_get_softc(dev);
207 sc = &esc->sc_ncr53c9x;
210 esc->sc_dev = dev;
224 esc->sc_dma = lsc;
275 if ((esc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
299 esc->sc_dma = (struct lsi64854_softc *)
305 if (esc->sc_dma == NULL) {
309 esc->sc_dma->sc_client = sc;
315 if ((esc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
323 error = espattach(esc, &esp_sbus_glue);
332 bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(esc->sc_res),
333 esc->sc_res);
349 struct esp_softc *esc;
353 esc = device_get_softc(dev);
354 lsc = esc->sc_dma;
356 error = espdetach(esc);
359 bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(esc->sc_res),
360 esc->sc_res);
374 struct esp_softc *esc;
378 esc = device_get_softc(dev);
379 sc = &esc->sc_ncr53c9x;
381 esc->sc_dev = dev;
389 esc->sc_dma = (struct lsi64854_softc *)
391 esc->sc_dma->sc_client = sc;
397 if ((esc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
403 error = espattach(esc, &esp_sbus_glue);
412 bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(esc->sc_res),
413 esc->sc_res);
420 struct esp_softc *esc;
423 esc = device_get_softc(dev);
425 error = espdetach(esc);
428 bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(esc->sc_res),
429 esc->sc_res);
449 espattach(struct esp_softc *esc, const struct ncr53c9x_glue *gluep)
451 struct ncr53c9x_softc *sc = &esc->sc_ncr53c9x;
457 sc->sc_id = OF_getscsinitid(esc->sc_dev);
460 device_printf(esc->sc_dev, "%s: sc_id %d, freq %d\n",
468 if (esc->sc_dma->sc_rev == DMAREV_ESC)
469 DMA_RESET(esc->sc_dma);
557 device_printf(esc->sc_dev,
639 error = lsi64854_attach(esc->sc_dma);
641 device_printf(esc->sc_dev, "lsi64854_attach failed\n");
647 if ((esc->sc_irqres = bus_alloc_resource_any(esc->sc_dev, SYS_RES_IRQ,
649 device_printf(esc->sc_dev, "cannot allocate interrupt\n");
652 if (bus_setup_intr(esc->sc_dev, esc->sc_irqres,
654 &esc->sc_irq)) {
655 device_printf(esc->sc_dev, "cannot set up interrupt\n");
665 sc->sc_dev = esc->sc_dev;
668 device_printf(esc->sc_dev, "ncr53c9x_attach failed\n");
675 bus_teardown_intr(esc->sc_dev, esc->sc_irqres, esc->sc_irq);
677 bus_release_resource(esc->sc_dev, SYS_RES_IRQ,
678 rman_get_rid(esc->sc_irqres), esc->sc_irqres);
680 lsi64854_detach(esc->sc_dma);
687 espdetach(struct esp_softc *esc)
689 struct ncr53c9x_softc *sc = &esc->sc_ncr53c9x;
692 bus_teardown_intr(esc->sc_dev, esc->sc_irqres, esc->sc_irq);
696 error = lsi64854_detach(esc->sc_dma);
700 bus_release_resource(esc->sc_dev, SYS_RES_IRQ,
701 rman_get_rid(esc->sc_irqres), esc->sc_irqres);
761 struct esp_softc *esc = (struct esp_softc *)sc;
764 v = bus_read_1(esc->sc_res, reg * 4);
778 struct esp_softc *esc = (struct esp_softc *)sc;
786 bus_write_1(esc->sc_res, reg * 4, v);
792 struct esp_softc *esc = (struct esp_softc *)sc;
794 return (DMA_ISINTR(esc->sc_dma));
800 struct esp_softc *esc = (struct esp_softc *)sc;
802 DMA_RESET(esc->sc_dma);
808 struct esp_softc *esc = (struct esp_softc *)sc;
810 return (DMA_INTR(esc->sc_dma));
817 struct esp_softc *esc = (struct esp_softc *)sc;
819 return (DMA_SETUP(esc->sc_dma, addr, len, datain, dmasize));
825 struct esp_softc *esc = (struct esp_softc *)sc;
827 DMA_GO(esc->sc_dma);
833 struct esp_softc *esc = (struct esp_softc *)sc;
835 L64854_SCSR(esc->sc_dma, L64854_GCSR(esc->sc_dma) & ~D_EN_DMA);
841 struct esp_softc *esc = (struct esp_softc *)sc;
843 return (DMA_ISACTIVE(esc->sc_dma));