diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 20:30:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 20:30:26 -0400 |
commit | 8ab68ab420d5fc084b8cdd76a72df72c5e1cdb5d (patch) | |
tree | 6aef86d06a5eda99f09ac00c1af4084c2d49d2ac /drivers/scsi/ide-scsi.c | |
parent | f05c463be51898e745c4aa8245b05e25d73fa975 (diff) | |
parent | 7b255436df0543856faaae4704034fe83bc20717 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (35 commits)
siimage: coding style cleanup (take 2)
ide-cd: clean up cdrom_analyze_sense_data()
ide-cd: fix test unsigned var < 0
ide: add TSSTcorp CDDVDW SH-S202H to ivb_list[]
piix: add Asus Eee 701 controller to short cable list
ARM: always select HAVE_IDE
remove the broken ETRAX_IDE driver
ide: remove ->dma_prdtable field from ide_hwif_t
ide: remove ->dma_vendor{1,3} fields from ide_hwif_t
scc_pata: add ->dma_host_set and ->dma_start methods
ide: skip "VLB sync" if host uses MMIO
ide: add ide_pad_transfer() helper
ide: remove ->INW and ->OUTW methods
ide: use IDE I/O helpers directly in ide_tf_{load,read}()
ns87415: add ->tf_read method
scc_pata: add ->tf_{load,read} methods
ide-h8300: add ->tf_{load,read} methods
ide-cris: add ->tf_{load,read} methods
ide: add ->tf_load and ->tf_read methods
ide: move ide_tf_{load,read} to ide-iops.c
...
Diffstat (limited to 'drivers/scsi/ide-scsi.c')
-rw-r--r-- | drivers/scsi/ide-scsi.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c index 32553639aded..44d8d5163a1a 100644 --- a/drivers/scsi/ide-scsi.c +++ b/drivers/scsi/ide-scsi.c | |||
@@ -134,6 +134,7 @@ static inline idescsi_scsi_t *drive_to_idescsi(ide_drive_t *ide_drive) | |||
134 | static void idescsi_input_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | 134 | static void idescsi_input_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, |
135 | unsigned int bcount) | 135 | unsigned int bcount) |
136 | { | 136 | { |
137 | ide_hwif_t *hwif = drive->hwif; | ||
137 | int count; | 138 | int count; |
138 | char *buf; | 139 | char *buf; |
139 | 140 | ||
@@ -145,14 +146,12 @@ static void idescsi_input_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
145 | local_irq_save(flags); | 146 | local_irq_save(flags); |
146 | buf = kmap_atomic(sg_page(pc->sg), KM_IRQ0) + | 147 | buf = kmap_atomic(sg_page(pc->sg), KM_IRQ0) + |
147 | pc->sg->offset; | 148 | pc->sg->offset; |
148 | drive->hwif->atapi_input_bytes(drive, | 149 | hwif->input_data(drive, NULL, buf + pc->b_count, count); |
149 | buf + pc->b_count, count); | ||
150 | kunmap_atomic(buf - pc->sg->offset, KM_IRQ0); | 150 | kunmap_atomic(buf - pc->sg->offset, KM_IRQ0); |
151 | local_irq_restore(flags); | 151 | local_irq_restore(flags); |
152 | } else { | 152 | } else { |
153 | buf = sg_virt(pc->sg); | 153 | buf = sg_virt(pc->sg); |
154 | drive->hwif->atapi_input_bytes(drive, | 154 | hwif->input_data(drive, NULL, buf + pc->b_count, count); |
155 | buf + pc->b_count, count); | ||
156 | } | 155 | } |
157 | bcount -= count; pc->b_count += count; | 156 | bcount -= count; pc->b_count += count; |
158 | if (pc->b_count == pc->sg->length) { | 157 | if (pc->b_count == pc->sg->length) { |
@@ -165,13 +164,14 @@ static void idescsi_input_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
165 | 164 | ||
166 | if (bcount) { | 165 | if (bcount) { |
167 | printk (KERN_ERR "ide-scsi: scatter gather table too small, discarding data\n"); | 166 | printk (KERN_ERR "ide-scsi: scatter gather table too small, discarding data\n"); |
168 | ide_atapi_discard_data(drive, bcount); | 167 | ide_pad_transfer(drive, 0, bcount); |
169 | } | 168 | } |
170 | } | 169 | } |
171 | 170 | ||
172 | static void idescsi_output_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | 171 | static void idescsi_output_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, |
173 | unsigned int bcount) | 172 | unsigned int bcount) |
174 | { | 173 | { |
174 | ide_hwif_t *hwif = drive->hwif; | ||
175 | int count; | 175 | int count; |
176 | char *buf; | 176 | char *buf; |
177 | 177 | ||
@@ -183,14 +183,12 @@ static void idescsi_output_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
183 | local_irq_save(flags); | 183 | local_irq_save(flags); |
184 | buf = kmap_atomic(sg_page(pc->sg), KM_IRQ0) + | 184 | buf = kmap_atomic(sg_page(pc->sg), KM_IRQ0) + |
185 | pc->sg->offset; | 185 | pc->sg->offset; |
186 | drive->hwif->atapi_output_bytes(drive, | 186 | hwif->output_data(drive, NULL, buf + pc->b_count, count); |
187 | buf + pc->b_count, count); | ||
188 | kunmap_atomic(buf - pc->sg->offset, KM_IRQ0); | 187 | kunmap_atomic(buf - pc->sg->offset, KM_IRQ0); |
189 | local_irq_restore(flags); | 188 | local_irq_restore(flags); |
190 | } else { | 189 | } else { |
191 | buf = sg_virt(pc->sg); | 190 | buf = sg_virt(pc->sg); |
192 | drive->hwif->atapi_output_bytes(drive, | 191 | hwif->output_data(drive, NULL, buf + pc->b_count, count); |
193 | buf + pc->b_count, count); | ||
194 | } | 192 | } |
195 | bcount -= count; pc->b_count += count; | 193 | bcount -= count; pc->b_count += count; |
196 | if (pc->b_count == pc->sg->length) { | 194 | if (pc->b_count == pc->sg->length) { |
@@ -203,7 +201,7 @@ static void idescsi_output_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
203 | 201 | ||
204 | if (bcount) { | 202 | if (bcount) { |
205 | printk (KERN_ERR "ide-scsi: scatter gather table too small, padding with zeros\n"); | 203 | printk (KERN_ERR "ide-scsi: scatter gather table too small, padding with zeros\n"); |
206 | ide_atapi_write_zeros(drive, bcount); | 204 | ide_pad_transfer(drive, 1, bcount); |
207 | } | 205 | } |
208 | } | 206 | } |
209 | 207 | ||
@@ -258,7 +256,8 @@ idescsi_atapi_error(ide_drive_t *drive, struct request *rq, u8 stat, u8 err) | |||
258 | 256 | ||
259 | if (ide_read_status(drive) & (BUSY_STAT | DRQ_STAT)) | 257 | if (ide_read_status(drive) & (BUSY_STAT | DRQ_STAT)) |
260 | /* force an abort */ | 258 | /* force an abort */ |
261 | hwif->OUTB(WIN_IDLEIMMEDIATE, hwif->io_ports.command_addr); | 259 | hwif->OUTBSYNC(drive, WIN_IDLEIMMEDIATE, |
260 | hwif->io_ports.command_addr); | ||
262 | 261 | ||
263 | rq->errors++; | 262 | rq->errors++; |
264 | 263 | ||
@@ -431,14 +430,15 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) | |||
431 | idescsi_input_buffers(drive, pc, | 430 | idescsi_input_buffers(drive, pc, |
432 | temp); | 431 | temp); |
433 | else | 432 | else |
434 | drive->hwif->atapi_input_bytes(drive, pc->cur_pos, temp); | 433 | hwif->input_data(drive, NULL, |
434 | pc->cur_pos, temp); | ||
435 | printk(KERN_ERR "ide-scsi: transferred" | 435 | printk(KERN_ERR "ide-scsi: transferred" |
436 | " %d of %d bytes\n", | 436 | " %d of %d bytes\n", |
437 | temp, bcount); | 437 | temp, bcount); |
438 | } | 438 | } |
439 | pc->xferred += temp; | 439 | pc->xferred += temp; |
440 | pc->cur_pos += temp; | 440 | pc->cur_pos += temp; |
441 | ide_atapi_discard_data(drive, bcount - temp); | 441 | ide_pad_transfer(drive, 0, bcount - temp); |
442 | ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry); | 442 | ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry); |
443 | return ide_started; | 443 | return ide_started; |
444 | } | 444 | } |
@@ -452,15 +452,13 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) | |||
452 | if (pc->sg) | 452 | if (pc->sg) |
453 | idescsi_input_buffers(drive, pc, bcount); | 453 | idescsi_input_buffers(drive, pc, bcount); |
454 | else | 454 | else |
455 | hwif->atapi_input_bytes(drive, pc->cur_pos, | 455 | hwif->input_data(drive, NULL, pc->cur_pos, bcount); |
456 | bcount); | ||
457 | } else { | 456 | } else { |
458 | pc->flags |= PC_FLAG_WRITING; | 457 | pc->flags |= PC_FLAG_WRITING; |
459 | if (pc->sg) | 458 | if (pc->sg) |
460 | idescsi_output_buffers(drive, pc, bcount); | 459 | idescsi_output_buffers(drive, pc, bcount); |
461 | else | 460 | else |
462 | hwif->atapi_output_bytes(drive, pc->cur_pos, | 461 | hwif->output_data(drive, NULL, pc->cur_pos, bcount); |
463 | bcount); | ||
464 | } | 462 | } |
465 | /* Update the current position */ | 463 | /* Update the current position */ |
466 | pc->xferred += bcount; | 464 | pc->xferred += bcount; |
@@ -493,8 +491,10 @@ static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive) | |||
493 | BUG_ON(HWGROUP(drive)->handler != NULL); | 491 | BUG_ON(HWGROUP(drive)->handler != NULL); |
494 | /* Set the interrupt routine */ | 492 | /* Set the interrupt routine */ |
495 | ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry); | 493 | ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry); |
494 | |||
496 | /* Send the actual packet */ | 495 | /* Send the actual packet */ |
497 | drive->hwif->atapi_output_bytes(drive, scsi->pc->c, 12); | 496 | hwif->output_data(drive, NULL, scsi->pc->c, 12); |
497 | |||
498 | if (pc->flags & PC_FLAG_DMA_OK) { | 498 | if (pc->flags & PC_FLAG_DMA_OK) { |
499 | pc->flags |= PC_FLAG_DMA_IN_PROGRESS; | 499 | pc->flags |= PC_FLAG_DMA_IN_PROGRESS; |
500 | hwif->dma_ops->dma_start(drive); | 500 | hwif->dma_ops->dma_start(drive); |
@@ -574,7 +574,7 @@ static ide_startstop_t idescsi_issue_pc(ide_drive_t *drive, | |||
574 | return ide_started; | 574 | return ide_started; |
575 | } else { | 575 | } else { |
576 | /* Issue the packet command */ | 576 | /* Issue the packet command */ |
577 | hwif->OUTB(WIN_PACKETCMD, hwif->io_ports.command_addr); | 577 | ide_execute_pkt_cmd(drive); |
578 | return idescsi_transfer_pc(drive); | 578 | return idescsi_transfer_pc(drive); |
579 | } | 579 | } |
580 | } | 580 | } |