Home | History | Annotate | Download | only in scsipi

Lines Matching defs:chp

115 	struct ata_channel *chp = ata_sc->sc_chan;
116 struct atac_softc *atac = chp->ch_atac;
118 struct scsipi_channel *chan = &chp->ch_atapi_channel;
137 chan->chan_channel = chp->ch_channel;
141 chan->chan_ntargets = chp->ch_ndrives;
144 chp->atapibus = config_found(ata_sc->sc_dev, chan, atapiprint,
167 struct ata_channel *chp =
170 ata_kill_pending(&chp->ch_drive[periph->periph_target]);
174 wdc_atapi_kill_xfer(struct ata_channel *chp, struct ata_xfer *xfer, int reason)
197 ata_deactivate_xfer(chp, xfer);
199 ata_free_xfer(chp, xfer);
210 struct ata_channel *chp = atac->atac_channels[chan->chan_channel];
214 xfer = ata_get_xfer(chp, false);
226 wdc_exec_command(&chp->ch_drive[drive], xfer);
227 ata_wait_cmd(chp, xfer);
232 device_xname(atac->atac_dev), chp->ch_channel, drive,
237 chp->ch_drive[drive].state = 0;
239 ata_free_xfer(chp, xfer);
245 if (ata_get_params(&chp->ch_drive[drive], AT_WAIT, id) != 0) {
248 device_xname(atac->atac_dev), chp->ch_channel, drive),
258 ata_free_xfer(chp, xfer);
271 struct ata_channel *chp = atac->atac_channels[chan->chan_channel];
272 struct ata_drive_datas *drvp = &chp->ch_drive[target];
478 wdc_atapi_start(struct ata_channel *chp, struct ata_xfer *xfer)
480 struct atac_softc *atac = chp->ch_atac;
481 struct wdc_softc *wdc = CHAN_TO_WDC(chp);
482 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
484 struct ata_drive_datas *drvp = &chp->ch_drive[xfer->c_drive];
490 device_xname(atac->atac_dev), chp->ch_channel, drvp->drive,
493 ata_channel_lock_owned(chp);
503 && !ata_is_thread_run(chp))
512 wdc->select(chp, xfer->c_drive);
522 if (wdc_wait_for_unbusy(chp, ATAPI_DELAY, wait_flags, &tfd))
524 wdccommand(chp, drvp->drive, SET_FEATURES, 0, 0, 0,
527 if (wdc_wait_for_unbusy(chp, ATAPI_MODE_DELAY, wait_flags,
540 chp->ch_channel, xfer->c_drive,
550 wdccommand(chp, drvp->drive, SET_FEATURES, 0, 0, 0,
555 wdccommand(chp, drvp->drive, SET_FEATURES, 0, 0, 0,
561 if (wdc_wait_for_unbusy(chp, ATAPI_MODE_DELAY, wait_flags,
579 chp->ch_channel, xfer->c_drive,
596 callout_reset(&chp->c_timo_callout, mstohz(sc_xfer->timeout),
597 wdctimeout, chp);
600 wdc->select(chp, xfer->c_drive);
603 switch (wdc_wait_for_unbusy(chp, ATAPI_DELAY, wait_flags, &tfd)) {
624 wdccommand(chp, xfer->c_drive, ATAPI_PKT_CMD,
644 chp->ch_channel, xfer->c_drive,
674 chp->ch_flags |= ATACH_IRQ_WAIT;
680 device_xname(atac->atac_dev), chp->ch_channel, xfer->c_drive,
689 device_xname(atac->atac_dev), chp->ch_channel, xfer->c_drive,
700 wdc_atapi_poll(struct ata_channel *chp, struct ata_xfer *xfer)
711 wdc_atapi_intr(chp, xfer, 0);
717 if (chp->ch_flags & ATACH_DMA_WAIT) {
718 wdc_dmawait(chp, xfer, xfer->c_scsipi->timeout);
719 chp->ch_flags &= ~ATACH_DMA_WAIT;
725 wdc_atapi_intr(chp, xfer, 0);
732 wdc_atapi_intr(struct ata_channel *chp, struct ata_xfer *xfer, int irq)
734 struct atac_softc *atac = chp->ch_atac;
735 struct wdc_softc *wdc = CHAN_TO_WDC(chp);
736 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel];
738 struct ata_drive_datas *drvp = &chp->ch_drive[xfer->c_drive];
750 device_xname(atac->atac_dev), chp->ch_channel, drvp->drive),
753 ata_channel_lock(chp);
758 device_xname(atac->atac_dev), chp->ch_channel,
767 ata_channel_unlock(chp);
769 wdc_atapi_reset(chp, xfer);
775 if ((xfer->c_flags & C_PIOBM) && (chp->ch_flags & ATACH_PIOBM_WAIT)) {
776 chp->ch_flags &= ~ATACH_PIOBM_WAIT;
792 wdc->select(chp, xfer->c_drive);
795 if (wdc_wait_for_unbusy(chp,
798 ata_channel_unlock(chp);
802 device_xname(atac->atac_dev), chp->ch_channel,
811 ata_channel_unlock(chp);
812 wdc_atapi_reset(chp, xfer);
816 wdc->irqack(chp);
826 ata_channel_unlock(chp);
827 wdc_atapi_reset(chp, xfer);
858 chp->ch_channel, xfer->c_drive,
879 wdc->dataout_pio(chp, drvp->drive_flags, cmd, sc_xfer->cmdlen);
885 chp->ch_channel, xfer->c_drive);
886 chp->ch_flags |= ATACH_DMA_WAIT;
891 chp->ch_flags |= ATACH_IRQ_WAIT;
894 ata_channel_unlock(chp);
909 ata_channel_unlock(chp);
910 wdc_atapi_reset(chp, xfer);
925 chp->ch_channel, xfer->c_drive,
927 chp->ch_flags |= ATACH_DMA_WAIT | ATACH_IRQ_WAIT |
929 ata_channel_unlock(chp);
933 wdc->dataout_pio(chp, drvp->drive_flags,
946 chp->ch_flags |= ATACH_IRQ_WAIT;
948 ata_channel_unlock(chp);
963 ata_channel_unlock(chp);
964 wdc_atapi_reset(chp, xfer);
979 chp->ch_channel, xfer->c_drive,
981 chp->ch_flags |= ATACH_DMA_WAIT | ATACH_IRQ_WAIT |
983 ata_channel_unlock(chp);
987 wdc->datain_pio(chp, drvp->drive_flags,
994 wdcbit_bucket(chp, xfer->c_atapi.c_lenoff);
999 chp->ch_flags |= ATACH_IRQ_WAIT;
1001 ata_channel_unlock(chp);
1040 ata_channel_unlock(chp);
1041 wdc_atapi_reset(chp, xfer);
1048 ata_channel_unlock(chp);
1049 wdc_atapi_done(chp, xfer);
1056 struct ata_channel *chp = xfer->c_chp;
1057 struct atac_softc *atac = chp->ch_atac;
1059 struct wdc_softc *wdc = CHAN_TO_WDC(chp);
1062 struct ata_drive_datas *drvp = &chp->ch_drive[xfer->c_drive];
1064 ata_channel_lock_owned(chp);
1070 chp->ch_channel,
1076 if (wdcwait(chp, WDCS_DSC, WDCS_DSC, 10,
1084 chp->ch_channel, xfer->c_drive);
1085 ata_channel_unlock(chp);
1087 wdc_atapi_reset(chp, xfer);
1089 callout_reset(&chp->c_timo_callout, 1,
1090 wdc_atapi_polldsc, chp);
1091 ata_channel_unlock(chp);
1123 ata_channel_unlock(chp);
1124 wdc_atapi_reset(chp, xfer);
1142 ata_channel_unlock(chp);
1143 wdc_atapi_done(chp, xfer);
1147 wdc_atapi_done(struct ata_channel *chp, struct ata_xfer *xfer)
1149 struct atac_softc *atac = chp->ch_atac;
1153 device_xname(atac->atac_dev), chp->ch_channel, xfer->c_drive,
1156 if (ata_waitdrain_xfer_check(chp, xfer))
1159 ata_deactivate_xfer(chp, xfer);
1160 ata_free_xfer(chp, xfer);
1165 chp->ch_flags), DEBUG_XFERS);
1166 atastart(chp);
1170 wdc_atapi_reset(struct ata_channel *chp, struct ata_xfer *xfer)
1172 struct atac_softc *atac = chp->ch_atac;
1173 struct ata_drive_datas *drvp = &chp->ch_drive[xfer->c_drive];
1177 ata_channel_lock(chp);
1178 wdccommandshort(chp, xfer->c_drive, ATAPI_SOFT_RESET);
1180 if (wdc_wait_for_unbusy(chp, WDC_RESET_WAIT, AT_POLL, &tfd) != 0) {
1182 device_xname(atac->atac_dev), chp->ch_channel,
1186 ata_channel_unlock(chp);
1187 wdc_atapi_done(chp, xfer);
1194 struct ata_channel *chp = arg;
1195 struct ata_xfer *xfer = ata_queue_get_active_xfer(chp);
1199 ata_channel_lock(chp);