• Home
  • Raw
  • Download

Lines Matching full:drive

29 void ide_tf_readback(ide_drive_t *drive, struct ide_cmd *cmd)  in ide_tf_readback()  argument
31 ide_hwif_t *hwif = drive->hwif; in ide_tf_readback()
37 tp_ops->tf_read(drive, &cmd->tf, cmd->valid.in.tf); in ide_tf_readback()
42 tp_ops->tf_read(drive, &cmd->hob, cmd->valid.in.hob); in ide_tf_readback()
59 int taskfile_lib_get_identify(ide_drive_t *drive, u8 *buf) in taskfile_lib_get_identify() argument
65 if (drive->media == ide_disk) in taskfile_lib_get_identify()
73 return ide_raw_taskfile(drive, &cmd, buf, 1); in taskfile_lib_get_identify()
80 ide_startstop_t do_rw_taskfile(ide_drive_t *drive, struct ide_cmd *orig_cmd) in do_rw_taskfile() argument
82 ide_hwif_t *hwif = drive->hwif; in do_rw_taskfile()
91 drive->mult_count == 0) { in do_rw_taskfile()
92 pr_err("%s: multimode not set!\n", drive->name); in do_rw_taskfile()
102 ide_tf_dump(drive->name, cmd); in do_rw_taskfile()
108 tp_ops->output_data(drive, cmd, data, 2); in do_rw_taskfile()
117 cmd->tf.device |= drive->select; in do_rw_taskfile()
120 tp_ops->tf_load(drive, &cmd->hob, cmd->valid.out.hob); in do_rw_taskfile()
121 tp_ops->tf_load(drive, &cmd->tf, cmd->valid.out.tf); in do_rw_taskfile()
129 return pre_task_out_intr(drive, cmd); in do_rw_taskfile()
136 ide_execute_command(drive, cmd, handler, WAIT_WORSTCASE); in do_rw_taskfile()
139 if (ide_dma_prepare(drive, cmd)) in do_rw_taskfile()
142 ide_execute_command(drive, cmd, ide_dma_intr, 2 * WAIT_CMD); in do_rw_taskfile()
143 dma_ops->dma_start(drive); in do_rw_taskfile()
151 static ide_startstop_t task_no_data_intr(ide_drive_t *drive) in task_no_data_intr() argument
153 ide_hwif_t *hwif = drive->hwif; in task_no_data_intr()
171 drive->mult_req = drive->mult_count = 0; in task_no_data_intr()
172 drive->special_flags |= IDE_SFLAG_RECALIBRATE; in task_no_data_intr()
173 (void)ide_dump_status(drive, __func__, stat); in task_no_data_intr()
177 ide_set_handler(drive, &task_no_data_intr, in task_no_data_intr()
182 return ide_error(drive, "task_no_data_intr", stat); in task_no_data_intr()
186 drive->mult_count = drive->mult_req; in task_no_data_intr()
193 ide_complete_pm_rq(drive, rq); in task_no_data_intr()
195 ide_finish_cmd(drive, cmd, stat); in task_no_data_intr()
201 static u8 wait_drive_not_busy(ide_drive_t *drive) in wait_drive_not_busy() argument
203 ide_hwif_t *hwif = drive->hwif; in wait_drive_not_busy()
221 pr_err("%s: drive still BUSY!\n", drive->name); in wait_drive_not_busy()
226 void ide_pio_bytes(ide_drive_t *drive, struct ide_cmd *cmd, in ide_pio_bytes() argument
229 ide_hwif_t *hwif = drive->hwif; in ide_pio_bytes()
263 hwif->tp_ops->output_data(drive, cmd, buf, nr_bytes); in ide_pio_bytes()
265 hwif->tp_ops->input_data(drive, cmd, buf, nr_bytes); in ide_pio_bytes()
274 static void ide_pio_datablock(ide_drive_t *drive, struct ide_cmd *cmd, in ide_pio_datablock() argument
279 u8 saved_io_32bit = drive->io_32bit; in ide_pio_datablock()
285 drive->io_32bit = 0; in ide_pio_datablock()
290 nr_bytes = min_t(unsigned, cmd->nleft, drive->mult_count << 9); in ide_pio_datablock()
294 ide_pio_bytes(drive, cmd, write, nr_bytes); in ide_pio_datablock()
296 drive->io_32bit = saved_io_32bit; in ide_pio_datablock()
299 static void ide_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd) in ide_error_cmd() argument
307 nr_bytes -= drive->mult_count << 9; in ide_error_cmd()
313 ide_complete_rq(drive, BLK_STS_OK, nr_bytes); in ide_error_cmd()
317 void ide_finish_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat) in ide_finish_cmd() argument
319 struct request *rq = drive->hwif->rq; in ide_finish_cmd()
320 u8 err = ide_read_error(drive), nsect = cmd->tf.nsect; in ide_finish_cmd()
323 ide_complete_cmd(drive, cmd, stat, err); in ide_finish_cmd()
327 ide_set_xfer_rate(drive, nsect); in ide_finish_cmd()
328 ide_driveid_update(drive); in ide_finish_cmd()
331 ide_complete_rq(drive, err ? BLK_STS_IOERR : BLK_STS_OK, blk_rq_bytes(rq)); in ide_finish_cmd()
337 static ide_startstop_t task_pio_intr(ide_drive_t *drive) in task_pio_intr() argument
339 ide_hwif_t *hwif = drive->hwif; in task_pio_intr()
340 struct ide_cmd *cmd = &drive->hwif->cmd; in task_pio_intr()
359 if (!OK_STAT(stat, DRIVE_READY, drive->bad_wstat)) in task_pio_intr()
371 ide_pio_datablock(drive, cmd, write); in task_pio_intr()
375 stat = wait_drive_not_busy(drive); in task_pio_intr()
383 ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE); in task_pio_intr()
387 ide_finish_cmd(drive, cmd, stat); in task_pio_intr()
389 ide_complete_rq(drive, BLK_STS_OK, blk_rq_sectors(cmd->rq) << 9); in task_pio_intr()
392 ide_error_cmd(drive, cmd); in task_pio_intr()
393 return ide_error(drive, __func__, stat); in task_pio_intr()
396 static ide_startstop_t pre_task_out_intr(ide_drive_t *drive, in pre_task_out_intr() argument
401 if (ide_wait_stat(&startstop, drive, ATA_DRQ, in pre_task_out_intr()
402 drive->bad_wstat, WAIT_DRQ)) { in pre_task_out_intr()
403 pr_err("%s: no DRQ after issuing %sWRITE%s\n", drive->name, in pre_task_out_intr()
405 (drive->dev_flags & IDE_DFLAG_LBA48) ? "_EXT" : ""); in pre_task_out_intr()
409 if (!force_irqthreads && (drive->dev_flags & IDE_DFLAG_UNMASK) == 0) in pre_task_out_intr()
412 ide_set_handler(drive, &task_pio_intr, WAIT_WORSTCASE); in pre_task_out_intr()
414 ide_pio_datablock(drive, cmd, 1); in pre_task_out_intr()
419 int ide_raw_taskfile(ide_drive_t *drive, struct ide_cmd *cmd, u8 *buf, in ide_raw_taskfile() argument
425 rq = blk_get_request(drive->queue, in ide_raw_taskfile()
437 error = blk_rq_map_kern(drive->queue, rq, buf, in ide_raw_taskfile()
446 blk_execute_rq(drive->queue, NULL, rq, 0); in ide_raw_taskfile()
454 int ide_no_data_taskfile(ide_drive_t *drive, struct ide_cmd *cmd) in ide_no_data_taskfile() argument
458 return ide_raw_taskfile(drive, cmd, NULL, 0); in ide_no_data_taskfile()
463 int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg) in ide_taskfile_ioctl() argument
524 if (drive->dev_flags & IDE_DFLAG_LBA48) { in ide_taskfile_ioctl()
574 if (!drive->mult_count) { in ide_taskfile_ioctl()
577 drive->name, __func__); in ide_taskfile_ioctl()
593 if (!drive->mult_count) { in ide_taskfile_ioctl()
596 drive->name, __func__); in ide_taskfile_ioctl()
625 drive->name); in ide_taskfile_ioctl()
631 err = ide_raw_taskfile(drive, &cmd, data_buf, nsect); in ide_taskfile_ioctl()
639 if (drive->dev_flags & IDE_DFLAG_LBA48) in ide_taskfile_ioctl()