Lines Matching refs:esc

137 	struct esp_softc *esc = device_private(self);  in esp_mca_attach()  local
138 struct ncr53c9x_softc *sc = &esc->sc_ncr53c9x; in esp_mca_attach()
195 esc->sc_iot = ma->ma_iot; in esp_mca_attach()
196 esc->sc_ioh = ioh; in esp_mca_attach()
200 ESP_MCA_IOSIZE-ESP_REG_OFFSET, &esc->sc_esp_ioh)) { in esp_mca_attach()
206 esc->sc_dmat = ma->ma_dmat; in esp_mca_attach()
207 if ((error = mca_dmamap_create(esc->sc_dmat, MAXPHYS, in esp_mca_attach()
209 &esc->sc_xfer, drq)) != 0){ in esp_mca_attach()
231 esc->sc_ih = mca_intr_establish(ma->ma_mc, irq, IPL_BIO, ncr53c9x_intr, in esp_mca_attach()
232 esc); in esp_mca_attach()
233 if (esc->sc_ih == NULL) { in esp_mca_attach()
244 bus_space_write_1(esc->sc_iot, esc->sc_ioh, N86C01_MODE_ENABLE, in esp_mca_attach()
245 bus_space_read_1(esc->sc_iot, esc->sc_ioh, N86C01_MODE_ENABLE) | in esp_mca_attach()
266 struct esp_softc *esc = (struct esp_softc *)sc; in esp_read_reg() local
268 return bus_space_read_1(esc->sc_iot, esc->sc_esp_ioh, reg); in esp_read_reg()
274 struct esp_softc *esc = (struct esp_softc *)sc; in esp_write_reg() local
276 bus_space_write_1(esc->sc_iot, esc->sc_esp_ioh, reg, val); in esp_write_reg()
282 struct esp_softc *esc = (struct esp_softc *)sc; in esp_dma_isintr() local
285 return bus_space_read_1(esc->sc_iot, esc->sc_ioh, N86C01_STATUS) & in esp_dma_isintr()
292 struct esp_softc *esc = (struct esp_softc *)sc; in esp_dma_reset() local
296 if (esc->sc_flags & ESP_XFER_LOADED) { in esp_dma_reset()
297 bus_dmamap_unload(esc->sc_dmat, esc->sc_xfer); in esp_dma_reset()
298 esc->sc_flags &= ~ESP_XFER_LOADED; in esp_dma_reset()
301 if (esc->sc_flags & ESP_XFER_ACTIVE) { in esp_dma_reset()
302 esc->sc_flags &= ~ESP_XFER_ACTIVE; in esp_dma_reset()
310 struct esp_softc *esc = (struct esp_softc *)sc; in esp_dma_intr() local
314 if ((esc->sc_flags & ESP_XFER_ACTIVE) == 0) { in esp_dma_intr()
321 esc->sc_flags &= ~ESP_XFER_ACTIVE; in esp_dma_intr()
333 bus_dmamap_sync(esc->sc_dmat, esc->sc_xfer, 0, *esc->sc_xfer_len, in esp_dma_intr()
334 (esc->sc_flags & ESP_XFER_READ) ? in esp_dma_intr()
337 bus_dmamap_unload(esc->sc_dmat, esc->sc_xfer); in esp_dma_intr()
338 esc->sc_flags &= ~ESP_XFER_LOADED; in esp_dma_intr()
340 *esc->sc_xfer_addr += *esc->sc_xfer_len; in esp_dma_intr()
341 *esc->sc_xfer_len = 0; in esp_dma_intr()
343 esc->sc_flags &= ~ESP_XFER_ACTIVE; in esp_dma_intr()
356 struct esp_softc *esc = (struct esp_softc *)sc; in esp_dma_setup() local
362 if (esc->sc_flags & ESP_XFER_LOADED) { in esp_dma_setup()
365 bus_dmamap_unload(esc->sc_dmat, esc->sc_xfer); in esp_dma_setup()
366 esc->sc_flags &= ~ESP_XFER_LOADED; in esp_dma_setup()
372 if ((error = bus_dmamap_load(esc->sc_dmat, esc->sc_xfer, *addr, in esp_dma_setup()
379 bus_dmamap_sync(esc->sc_dmat, esc->sc_xfer, 0, *len, in esp_dma_setup()
382 esc->sc_flags |= ESP_XFER_LOADED | (datain ? ESP_XFER_READ : 0); in esp_dma_setup()
383 esc->sc_xfer_addr = addr; in esp_dma_setup()
384 esc->sc_xfer_len = len; in esp_dma_setup()
392 struct esp_softc *esc = (struct esp_softc *)sc; in esp_dma_go() local
395 esc->sc_flags |= ESP_XFER_ACTIVE; in esp_dma_go()
411 struct esp_softc *esc = (struct esp_softc *)sc; in esp_dma_isactive() local
414 return esc->sc_flags & ESP_XFER_ACTIVE; in esp_dma_isactive()