- if (state->flags & DMA_IN) {
- if (state->flags & DMA_IN_PROGRESS) {
- len = state->dmalen;
- do_in:
- state->flags &= ~DMA_IN_PROGRESS;
- (*asc->dma_end)(asc, state, ASCDMA_READ);
- bcopy(state->dmaBufAddr, state->buf,
- len);
- state->buf += len;
- state->buflen -= len;
- }
- if (state->buflen)
- state->script =
- &asc_scripts[SCRIPT_RESUME_IN];
- else
- state->script =
- &asc_scripts[SCRIPT_RESUME_NO_DATA];
- } else if (state->flags & DMA_OUT) {
- /*
- * If this is the last chunk, the next expected
- * state is to get status.
- */
- if (state->flags & DMA_IN_PROGRESS) {
- state->flags &= ~DMA_IN_PROGRESS;
- (*asc->dma_end)(asc, state, ASCDMA_WRITE);
- len = state->dmalen;
- state->buf += len;
- state->buflen -= len;
- }
- if (state->buflen)
- state->script =
- &asc_scripts[SCRIPT_RESUME_OUT];
- else
- state->script =
- &asc_scripts[SCRIPT_RESUME_NO_DATA];
- } else if (asc->script == &asc_scripts[SCRIPT_SIMPLE])
+ if (state->flags & DMA_IN_PROGRESS) {
+ len = state->dmalen;
+ state->flags &= ~DMA_IN_PROGRESS;
+ do_in:
+ (*asc->dma_end)(asc, state, ASCDMA_READ);
+ bcopy(state->dmaBufAddr, state->buf, len);
+ state->buf += len;
+ state->buflen -= len;
+ }
+ if (state->buflen)