diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:56 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:56 -0400 |
commit | 374e042c3e767ac2e5a40b78529220e0b3de793c (patch) | |
tree | 433d258f6da9783f0cb34234af9c359353f531fe /drivers/scsi | |
parent | d6276b5f5cc7508124de291f3ed59c6945c17ae7 (diff) |
ide: add struct ide_tp_ops (take 2)
* Add struct ide_tp_ops for transport methods.
* Add 'const struct ide_tp_ops *tp_ops' to struct ide_port_info
and ide_hwif_t.
* Set the default hwif->tp_ops in ide_init_port_data().
* Set host driver specific hwif->tp_ops in ide_init_port().
* Export ide_exec_command(), ide_read_status(), ide_read_altstatus(),
ide_read_sff_dma_status(), ide_set_irq(), ide_tf_{load,read}()
and ata_{in,out}put_data().
* Convert host drivers and core code to use struct ide_tp_ops.
* Remove no longer needed default_hwif_transport().
* Cleanup ide_hwif_t from methods that are now in struct ide_tp_ops.
While at it:
* Use struct ide_port_info in falconide.c and q40ide.c.
* Rename ata_{in,out}put_data() to ide_{in,out}put_data().
v2:
* Fix missing convertion in ns87415.c.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/ide-scsi.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 2a86af91f64a..659db3f7ae08 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c | |||
@@ -142,7 +142,8 @@ static void ide_scsi_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
142 | unsigned int bcount, int write) | 142 | unsigned int bcount, int write) |
143 | { | 143 | { |
144 | ide_hwif_t *hwif = drive->hwif; | 144 | ide_hwif_t *hwif = drive->hwif; |
145 | xfer_func_t *xf = write ? hwif->output_data : hwif->input_data; | 145 | const struct ide_tp_ops *tp_ops = hwif->tp_ops; |
146 | xfer_func_t *xf = write ? tp_ops->output_data : tp_ops->input_data; | ||
146 | char *buf; | 147 | char *buf; |
147 | int count; | 148 | int count; |
148 | 149 | ||
@@ -246,9 +247,9 @@ idescsi_atapi_error(ide_drive_t *drive, struct request *rq, u8 stat, u8 err) | |||
246 | { | 247 | { |
247 | ide_hwif_t *hwif = drive->hwif; | 248 | ide_hwif_t *hwif = drive->hwif; |
248 | 249 | ||
249 | if (hwif->read_status(hwif) & (BUSY_STAT | DRQ_STAT)) | 250 | if (hwif->tp_ops->read_status(hwif) & (BUSY_STAT | DRQ_STAT)) |
250 | /* force an abort */ | 251 | /* force an abort */ |
251 | hwif->exec_command(hwif, WIN_IDLEIMMEDIATE); | 252 | hwif->tp_ops->exec_command(hwif, WIN_IDLEIMMEDIATE); |
252 | 253 | ||
253 | rq->errors++; | 254 | rq->errors++; |
254 | 255 | ||