Lines Matching defs:xfer
146 wdc_ata_bio(struct ata_drive_datas *drvp, struct ata_xfer *xfer)
150 struct ata_bio *ata_bio = &xfer->c_bio;
155 xfer->c_flags |= C_POLL;
159 xfer->c_flags |= C_DMA;
166 xfer->c_flags |= C_PIOBM;
168 xfer->c_drive = drvp->drive;
169 xfer->c_databuf = ata_bio->databuf;
170 xfer->c_bcount = ata_bio->bcount;
171 xfer->ops = &wdc_bio_xfer_ops;
172 ata_exec_xfer(chp, xfer);
176 wdc_ata_bio_start(struct ata_channel *chp, struct ata_xfer *xfer)
181 struct ata_bio *ata_bio = &xfer->c_bio;
182 struct ata_drive_datas *drvp = &chp->ch_drive[xfer->c_drive];
188 wait_flags = (xfer->c_flags & C_POLL) ? AT_POLL : 0;
193 device_xname(atac->atac_dev), chp->ch_channel, xfer->c_drive,
194 drvp->state, drvp->drive_flags, xfer->c_flags, chp->ch_flags),
207 if ((xfer->c_flags & C_POLL) == 0 && !ata_is_thread_run(chp))
218 wdc->select(chp, xfer->c_drive);
220 WDSD_IBM | (xfer->c_drive << 4));
226 wdccommandshort(chp, xfer->c_drive, WDCC_RECAL);
272 wdccommand(chp, xfer->c_drive, WDCC_IDP,
286 wdccommand(chp, xfer->c_drive, WDCC_SETMULTI, 0, 0, 0,
305 return _wdc_ata_bio_start(chp, xfer);
308 device_xname(atac->atac_dev), chp->ch_channel, xfer->c_drive,
314 device_xname(atac->atac_dev), chp->ch_channel, xfer->c_drive,
334 _wdc_ata_bio_start(struct ata_channel *chp, struct ata_xfer *xfer)
339 struct ata_bio *ata_bio = &xfer->c_bio;
340 struct ata_drive_datas *drvp = &chp->ch_drive[xfer->c_drive];
341 int wait_flags = (xfer->c_flags & C_POLL) ? AT_POLL : 0;
350 device_xname(atac->atac_dev), chp->ch_channel, xfer->c_drive),
354 if (xfer->c_flags & (C_DMA | C_PIOBM)) {
369 if (xfer->c_skip == 0 || (ata_bio->flags & ATA_SINGLE) != 0) {
373 nblks = xfer->c_bcount / drvp->lp->d_secsize;
418 if (xfer->c_flags & C_DMA) {
422 ata_bio->nbytes = xfer->c_bcount;
427 chp->ch_channel, xfer->c_drive,
428 (char *)xfer->c_databuf + xfer->c_skip,
437 xfer->c_flags &= ~C_DMA;
447 wdc->select(chp, xfer->c_drive);
449 0, WDSD_IBM | (xfer->c_drive << 4));
462 chp->ch_channel, xfer->c_drive);
467 atacmd_toncq(xfer, &cmd, &count, &features,
470 wdccommandext(chp, xfer->c_drive, cmd,
473 wdccommand(chp, xfer->c_drive, cmd, cyl,
479 chp->ch_channel, xfer->c_drive);
487 if ((xfer->c_flags & C_PIOBM) && xfer->c_skip == 0) {
490 xfer->c_flags &= ~C_PIOBM;
494 chp->ch_channel, xfer->c_drive,
495 (char *)xfer->c_databuf + xfer->c_skip,
496 xfer->c_bcount,
505 xfer->c_flags &= ~C_PIOBM;
528 wdc->select(chp, xfer->c_drive);
530 WDSD_IBM | (xfer->c_drive << 4));
540 wdccommandext(chp, xfer->c_drive, atacmd_to48(cmd),
543 wdccommand(chp, xfer->c_drive, cmd, cyl,
550 nblks = xfer->c_bcount / drvp->lp->d_secsize;
553 ata_bio->nbytes = xfer->c_bcount;
566 xfer->c_drive,
576 if (xfer->c_flags & C_PIOBM) {
579 chp->ch_channel, xfer->c_drive,
580 xfer->c_skip, ata_bio->nbytes, 0);
586 (char *)xfer->c_databuf + xfer->c_skip, ata_bio->nbytes);
593 if ((xfer->c_flags & C_POLL) == 0) {
605 device_xname(atac->atac_dev), chp->ch_channel, xfer->c_drive,
613 wdc_ata_bio_poll(struct ata_channel *chp, struct ata_xfer *xfer)
619 wdc_dmawait(chp, xfer, ATA_DELAY);
623 wdc_ata_bio_intr(chp, xfer, 0);
624 return (xfer->c_bio.flags & ATA_ITSDONE) ? ATAPOLL_DONE : ATAPOLL_AGAIN;
628 wdc_ata_bio_intr(struct ata_channel *chp, struct ata_xfer *xfer, int irq)
632 struct ata_bio *ata_bio = &xfer->c_bio;
633 struct ata_drive_datas *drvp = &chp->ch_drive[xfer->c_drive];
637 device_xname(atac->atac_dev), chp->ch_channel, xfer->c_drive),
645 device_xname(atac->atac_dev), chp->ch_channel, xfer->c_drive,
654 if ((xfer->c_flags & (C_TIMEOU | C_DMA)) == C_TIMEOU) {
661 if ((xfer->c_flags & C_PIOBM) && (chp->ch_flags & ATACH_PIOBM_WAIT)) {
670 if (irq && (xfer->c_flags & C_TIMEOU) == 0) {
676 xfer->c_drive, xfer->c_bcount, xfer->c_skip);
687 if (xfer->c_flags & C_DMA) {
700 chp->ch_channel, xfer->c_drive,
717 xfer->c_drive, ATACH_ST(tfd));
726 (xfer->c_flags & C_POLL) ? AT_POLL : 0);
741 xfer->c_drive);
746 if (xfer->c_flags & C_PIOBM) {
749 chp->ch_channel, xfer->c_drive,
750 xfer->c_skip, ata_bio->nbytes,
758 (char *)xfer->c_databuf + xfer->c_skip, ata_bio->nbytes);
766 xfer->c_skip += ata_bio->nbytes;
767 xfer->c_bcount -= ata_bio->nbytes;
770 if (xfer->c_bcount > 0) {
775 ata_xfer_start(xfer);
789 wdc_ata_bio_done(chp, xfer);
794 wdc_ata_bio_kill_xfer(struct ata_channel *chp, struct ata_xfer *xfer,
797 struct ata_bio *ata_bio = &xfer->c_bio;
798 int drive = xfer->c_drive;
820 ata_deactivate_xfer(chp, xfer);
823 (*chp->ch_drive[drive].drv_done)(chp->ch_drive[drive].drv_softc, xfer);
827 wdc_ata_bio_done(struct ata_channel *chp, struct ata_xfer *xfer)
829 struct ata_bio *ata_bio = &xfer->c_bio;
830 int drive = xfer->c_drive;
834 xfer->c_drive, (u_int)xfer->c_flags),
837 if (ata_waitdrain_xfer_check(chp, xfer))
841 ata_bio->bcount = xfer->c_bcount;
843 /* mark controller inactive and free xfer */
844 ata_deactivate_xfer(chp, xfer);
848 (*chp->ch_drive[drive].drv_done)(chp->ch_drive[drive].drv_softc, xfer);