diff options
Diffstat (limited to 'drivers/ide')
-rw-r--r-- | drivers/ide/cris/ide-cris.c | 52 | ||||
-rw-r--r-- | drivers/ide/ide-cd.c | 14 | ||||
-rw-r--r-- | drivers/ide/ide-floppy.c | 18 | ||||
-rw-r--r-- | drivers/ide/ide-io.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-iops.c | 68 | ||||
-rw-r--r-- | drivers/ide/ide-probe.c | 2 | ||||
-rw-r--r-- | drivers/ide/ide-tape.c | 13 | ||||
-rw-r--r-- | drivers/ide/ide-taskfile.c | 4 | ||||
-rw-r--r-- | drivers/ide/legacy/falconide.c | 36 | ||||
-rw-r--r-- | drivers/ide/legacy/q40ide.c | 36 |
10 files changed, 95 insertions, 150 deletions
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c index aa263df76569..72ff63ed5f2b 100644 --- a/drivers/ide/cris/ide-cris.c +++ b/drivers/ide/cris/ide-cris.c | |||
@@ -673,12 +673,8 @@ cris_ide_inb(unsigned long reg) | |||
673 | return (unsigned char)cris_ide_inw(reg); | 673 | return (unsigned char)cris_ide_inw(reg); |
674 | } | 674 | } |
675 | 675 | ||
676 | static void cris_ide_input_data(ide_drive_t *, struct request *, | 676 | static void cris_input_data(ide_drive_t *, struct request *, void *, unsigned); |
677 | void *, unsigned int); | 677 | static void cris_output_data(ide_drive_t *, struct request *, void *, unsigned); |
678 | static void cris_ide_output_data(ide_drive_t *, struct request *, | ||
679 | void *, unsigned int); | ||
680 | static void cris_atapi_input_bytes(ide_drive_t *drive, void *, unsigned int); | ||
681 | static void cris_atapi_output_bytes(ide_drive_t *drive, void *, unsigned int); | ||
682 | 678 | ||
683 | static void cris_dma_host_set(ide_drive_t *drive, int on) | 679 | static void cris_dma_host_set(ide_drive_t *drive, int on) |
684 | { | 680 | { |
@@ -816,10 +812,9 @@ static int __init init_e100_ide(void) | |||
816 | ide_init_port_data(hwif, hwif->index); | 812 | ide_init_port_data(hwif, hwif->index); |
817 | ide_init_port_hw(hwif, &hw); | 813 | ide_init_port_hw(hwif, &hw); |
818 | 814 | ||
819 | hwif->ata_input_data = &cris_ide_input_data; | 815 | hwif->input_data = cris_input_data; |
820 | hwif->ata_output_data = &cris_ide_output_data; | 816 | hwif->output_data = cris_output_data; |
821 | hwif->atapi_input_bytes = &cris_atapi_input_bytes; | 817 | |
822 | hwif->atapi_output_bytes = &cris_atapi_output_bytes; | ||
823 | hwif->OUTB = &cris_ide_outb; | 818 | hwif->OUTB = &cris_ide_outb; |
824 | hwif->OUTW = &cris_ide_outw; | 819 | hwif->OUTW = &cris_ide_outw; |
825 | hwif->OUTBSYNC = &cris_ide_outbsync; | 820 | hwif->OUTBSYNC = &cris_ide_outbsync; |
@@ -849,17 +844,16 @@ static int __init init_e100_ide(void) | |||
849 | static cris_dma_descr_type mydescr __attribute__ ((__aligned__(16))); | 844 | static cris_dma_descr_type mydescr __attribute__ ((__aligned__(16))); |
850 | 845 | ||
851 | /* | 846 | /* |
852 | * The following routines are mainly used by the ATAPI drivers. | 847 | * This is used for most PIO data transfers *from* the IDE interface |
853 | * | 848 | * |
854 | * These routines will round up any request for an odd number of bytes, | 849 | * These routines will round up any request for an odd number of bytes, |
855 | * so if an odd bytecount is specified, be sure that there's at least one | 850 | * so if an odd bytecount is specified, be sure that there's at least one |
856 | * extra byte allocated for the buffer. | 851 | * extra byte allocated for the buffer. |
857 | */ | 852 | */ |
858 | static void | 853 | static void cris_input_data(ide_drive_t *drive, struct request *rq, |
859 | cris_atapi_input_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount) | 854 | void *buffer, unsigned int bytecount) |
860 | { | 855 | { |
861 | D(printk("atapi_input_bytes, buffer 0x%x, count %d\n", | 856 | D(printk("input_data, buffer 0x%x, count %d\n", buffer, bytecount)); |
862 | buffer, bytecount)); | ||
863 | 857 | ||
864 | if(bytecount & 1) { | 858 | if(bytecount & 1) { |
865 | printk("warning, odd bytecount in cdrom_in_bytes = %d.\n", bytecount); | 859 | printk("warning, odd bytecount in cdrom_in_bytes = %d.\n", bytecount); |
@@ -877,11 +871,13 @@ cris_atapi_input_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount | |||
877 | LED_DISK_READ(0); | 871 | LED_DISK_READ(0); |
878 | } | 872 | } |
879 | 873 | ||
880 | static void | 874 | /* |
881 | cris_atapi_output_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount) | 875 | * This is used for most PIO data transfers *to* the IDE interface |
876 | */ | ||
877 | static void cris_output_data(ide_drive_t *drive, struct request *rq, | ||
878 | void *buffer, unsigned int bytecount) | ||
882 | { | 879 | { |
883 | D(printk("atapi_output_bytes, buffer 0x%x, count %d\n", | 880 | D(printk("output_data, buffer 0x%x, count %d\n", buffer, bytecount)); |
884 | buffer, bytecount)); | ||
885 | 881 | ||
886 | if(bytecount & 1) { | 882 | if(bytecount & 1) { |
887 | printk("odd bytecount %d in atapi_out_bytes!\n", bytecount); | 883 | printk("odd bytecount %d in atapi_out_bytes!\n", bytecount); |
@@ -899,24 +895,6 @@ cris_atapi_output_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecoun | |||
899 | LED_DISK_WRITE(0); | 895 | LED_DISK_WRITE(0); |
900 | } | 896 | } |
901 | 897 | ||
902 | /* | ||
903 | * This is used for most PIO data transfers *from* the IDE interface | ||
904 | */ | ||
905 | static void cris_ide_input_data(ide_drive_t *drive, struct request *rq, | ||
906 | void *buffer, unsigned int wcount) | ||
907 | { | ||
908 | cris_atapi_input_bytes(drive, buffer, wcount << 2); | ||
909 | } | ||
910 | |||
911 | /* | ||
912 | * This is used for most PIO data transfers *to* the IDE interface | ||
913 | */ | ||
914 | static void cris_ide_output_data(ide_drive_t *drive, struct request *, | ||
915 | void *buffer, unsigned int wcount) | ||
916 | { | ||
917 | cris_atapi_output_bytes(drive, buffer, wcount << 2); | ||
918 | } | ||
919 | |||
920 | /* we only have one DMA channel on the chip for ATA, so we can keep these statically */ | 898 | /* we only have one DMA channel on the chip for ATA, so we can keep these statically */ |
921 | static cris_dma_descr_type ata_descrs[MAX_DMA_DESCRS] __attribute__ ((__aligned__(16))); | 899 | static cris_dma_descr_type ata_descrs[MAX_DMA_DESCRS] __attribute__ ((__aligned__(16))); |
922 | static unsigned int ata_tot_size; | 900 | static unsigned int ata_tot_size; |
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index b34fd2bde96f..095e50a93869 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -613,7 +613,7 @@ static ide_startstop_t cdrom_transfer_packet_command(ide_drive_t *drive, | |||
613 | cmd_len = ATAPI_MIN_CDB_BYTES; | 613 | cmd_len = ATAPI_MIN_CDB_BYTES; |
614 | 614 | ||
615 | /* send the command to the device */ | 615 | /* send the command to the device */ |
616 | HWIF(drive)->atapi_output_bytes(drive, rq->cmd, cmd_len); | 616 | hwif->output_data(drive, NULL, rq->cmd, cmd_len); |
617 | 617 | ||
618 | /* start the DMA if need be */ | 618 | /* start the DMA if need be */ |
619 | if (info->dma) | 619 | if (info->dma) |
@@ -629,7 +629,7 @@ static void ide_cd_pad_transfer(ide_drive_t *drive, xfer_func_t *xf, int len) | |||
629 | { | 629 | { |
630 | while (len > 0) { | 630 | while (len > 0) { |
631 | int dum = 0; | 631 | int dum = 0; |
632 | xf(drive, &dum, sizeof(dum)); | 632 | xf(drive, NULL, &dum, sizeof(dum)); |
633 | len -= sizeof(dum); | 633 | len -= sizeof(dum); |
634 | } | 634 | } |
635 | } | 635 | } |
@@ -639,7 +639,7 @@ static void ide_cd_drain_data(ide_drive_t *drive, int nsects) | |||
639 | while (nsects > 0) { | 639 | while (nsects > 0) { |
640 | static char dum[SECTOR_SIZE]; | 640 | static char dum[SECTOR_SIZE]; |
641 | 641 | ||
642 | drive->hwif->atapi_input_bytes(drive, dum, sizeof(dum)); | 642 | drive->hwif->input_data(drive, NULL, dum, sizeof(dum)); |
643 | nsects--; | 643 | nsects--; |
644 | } | 644 | } |
645 | } | 645 | } |
@@ -666,7 +666,7 @@ static int ide_cd_check_ireason(ide_drive_t *drive, struct request *rq, | |||
666 | printk(KERN_ERR "%s: %s: wrong transfer direction!\n", | 666 | printk(KERN_ERR "%s: %s: wrong transfer direction!\n", |
667 | drive->name, __func__); | 667 | drive->name, __func__); |
668 | 668 | ||
669 | xf = rw ? hwif->atapi_output_bytes : hwif->atapi_input_bytes; | 669 | xf = rw ? hwif->output_data : hwif->input_data; |
670 | ide_cd_pad_transfer(drive, xf, len); | 670 | ide_cd_pad_transfer(drive, xf, len); |
671 | } else if (rw == 0 && ireason == 1) { | 671 | } else if (rw == 0 && ireason == 1) { |
672 | /* | 672 | /* |
@@ -1019,10 +1019,10 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
1019 | 1019 | ||
1020 | if (ireason == 0) { | 1020 | if (ireason == 0) { |
1021 | write = 1; | 1021 | write = 1; |
1022 | xferfunc = HWIF(drive)->atapi_output_bytes; | 1022 | xferfunc = hwif->output_data; |
1023 | } else { | 1023 | } else { |
1024 | write = 0; | 1024 | write = 0; |
1025 | xferfunc = HWIF(drive)->atapi_input_bytes; | 1025 | xferfunc = hwif->input_data; |
1026 | } | 1026 | } |
1027 | 1027 | ||
1028 | /* transfer data */ | 1028 | /* transfer data */ |
@@ -1061,7 +1061,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive) | |||
1061 | if (blen > thislen) | 1061 | if (blen > thislen) |
1062 | blen = thislen; | 1062 | blen = thislen; |
1063 | 1063 | ||
1064 | xferfunc(drive, ptr, blen); | 1064 | xferfunc(drive, NULL, ptr, blen); |
1065 | 1065 | ||
1066 | thislen -= blen; | 1066 | thislen -= blen; |
1067 | len -= blen; | 1067 | len -= blen; |
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 489079b8ed03..e2bcd3af45db 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -231,6 +231,7 @@ static int idefloppy_end_request(ide_drive_t *drive, int uptodate, int nsecs) | |||
231 | static void ide_floppy_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | 231 | static void ide_floppy_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, |
232 | unsigned int bcount, int direction) | 232 | unsigned int bcount, int direction) |
233 | { | 233 | { |
234 | ide_hwif_t *hwif = drive->hwif; | ||
234 | struct request *rq = pc->rq; | 235 | struct request *rq = pc->rq; |
235 | struct req_iterator iter; | 236 | struct req_iterator iter; |
236 | struct bio_vec *bvec; | 237 | struct bio_vec *bvec; |
@@ -246,9 +247,9 @@ static void ide_floppy_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
246 | 247 | ||
247 | data = bvec_kmap_irq(bvec, &flags); | 248 | data = bvec_kmap_irq(bvec, &flags); |
248 | if (direction) | 249 | if (direction) |
249 | drive->hwif->atapi_output_bytes(drive, data, count); | 250 | hwif->output_data(drive, NULL, data, count); |
250 | else | 251 | else |
251 | drive->hwif->atapi_input_bytes(drive, data, count); | 252 | hwif->input_data(drive, NULL, data, count); |
252 | bvec_kunmap_irq(data, &flags); | 253 | bvec_kunmap_irq(data, &flags); |
253 | 254 | ||
254 | bcount -= count; | 255 | bcount -= count; |
@@ -503,12 +504,12 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive) | |||
503 | } | 504 | } |
504 | } | 505 | } |
505 | if (pc->flags & PC_FLAG_WRITING) | 506 | if (pc->flags & PC_FLAG_WRITING) |
506 | xferfunc = hwif->atapi_output_bytes; | 507 | xferfunc = hwif->output_data; |
507 | else | 508 | else |
508 | xferfunc = hwif->atapi_input_bytes; | 509 | xferfunc = hwif->input_data; |
509 | 510 | ||
510 | if (pc->buf) | 511 | if (pc->buf) |
511 | xferfunc(drive, pc->cur_pos, bcount); | 512 | xferfunc(drive, NULL, pc->cur_pos, bcount); |
512 | else | 513 | else |
513 | ide_floppy_io_buffers(drive, pc, bcount, | 514 | ide_floppy_io_buffers(drive, pc, bcount, |
514 | !!(pc->flags & PC_FLAG_WRITING)); | 515 | !!(pc->flags & PC_FLAG_WRITING)); |
@@ -548,8 +549,10 @@ static ide_startstop_t idefloppy_transfer_pc(ide_drive_t *drive) | |||
548 | 549 | ||
549 | /* Set the interrupt routine */ | 550 | /* Set the interrupt routine */ |
550 | ide_set_handler(drive, &idefloppy_pc_intr, IDEFLOPPY_WAIT_CMD, NULL); | 551 | ide_set_handler(drive, &idefloppy_pc_intr, IDEFLOPPY_WAIT_CMD, NULL); |
552 | |||
551 | /* Send the actual packet */ | 553 | /* Send the actual packet */ |
552 | HWIF(drive)->atapi_output_bytes(drive, floppy->pc->c, 12); | 554 | hwif->output_data(drive, NULL, floppy->pc->c, 12); |
555 | |||
553 | return ide_started; | 556 | return ide_started; |
554 | } | 557 | } |
555 | 558 | ||
@@ -569,7 +572,8 @@ static int idefloppy_transfer_pc2(ide_drive_t *drive) | |||
569 | idefloppy_floppy_t *floppy = drive->driver_data; | 572 | idefloppy_floppy_t *floppy = drive->driver_data; |
570 | 573 | ||
571 | /* Send the actual packet */ | 574 | /* Send the actual packet */ |
572 | HWIF(drive)->atapi_output_bytes(drive, floppy->pc->c, 12); | 575 | drive->hwif->output_data(drive, NULL, floppy->pc->c, 12); |
576 | |||
573 | /* Timeout for the packet command */ | 577 | /* Timeout for the packet command */ |
574 | return IDEFLOPPY_WAIT_CMD; | 578 | return IDEFLOPPY_WAIT_CMD; |
575 | } | 579 | } |
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 60078cf307fb..a17fc6430001 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -422,7 +422,7 @@ static void try_to_flush_leftover_data (ide_drive_t *drive) | |||
422 | u32 wcount = (i > 16) ? 16 : i; | 422 | u32 wcount = (i > 16) ? 16 : i; |
423 | 423 | ||
424 | i -= wcount; | 424 | i -= wcount; |
425 | drive->hwif->ata_input_data(drive, NULL, buffer, wcount); | 425 | drive->hwif->input_data(drive, NULL, buffer, wcount * 4); |
426 | } | 426 | } |
427 | } | 427 | } |
428 | 428 | ||
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c index 7ec7fa2aef96..fbbbb30ae964 100644 --- a/drivers/ide/ide-iops.c +++ b/drivers/ide/ide-iops.c | |||
@@ -191,36 +191,47 @@ static void ata_vlb_sync(ide_drive_t *drive, unsigned long port) | |||
191 | 191 | ||
192 | /* | 192 | /* |
193 | * This is used for most PIO data transfers *from* the IDE interface | 193 | * This is used for most PIO data transfers *from* the IDE interface |
194 | * | ||
195 | * These routines will round up any request for an odd number of bytes, | ||
196 | * so if an odd len is specified, be sure that there's at least one | ||
197 | * extra byte allocated for the buffer. | ||
194 | */ | 198 | */ |
195 | static void ata_input_data(ide_drive_t *drive, struct request *rq, | 199 | static void ata_input_data(ide_drive_t *drive, struct request *rq, |
196 | void *buffer, u32 wcount) | 200 | void *buf, unsigned int len) |
197 | { | 201 | { |
198 | ide_hwif_t *hwif = drive->hwif; | 202 | ide_hwif_t *hwif = drive->hwif; |
199 | struct ide_io_ports *io_ports = &hwif->io_ports; | 203 | struct ide_io_ports *io_ports = &hwif->io_ports; |
204 | unsigned long data_addr = io_ports->data_addr; | ||
200 | u8 io_32bit = drive->io_32bit; | 205 | u8 io_32bit = drive->io_32bit; |
201 | 206 | ||
207 | len++; | ||
208 | |||
202 | if (io_32bit) { | 209 | if (io_32bit) { |
203 | if (io_32bit & 2) { | 210 | if (io_32bit & 2) { |
204 | unsigned long flags; | 211 | unsigned long flags; |
205 | 212 | ||
206 | local_irq_save(flags); | 213 | local_irq_save(flags); |
207 | ata_vlb_sync(drive, io_ports->nsect_addr); | 214 | ata_vlb_sync(drive, io_ports->nsect_addr); |
208 | hwif->INSL(io_ports->data_addr, buffer, wcount); | 215 | hwif->INSL(data_addr, buf, len / 4); |
209 | local_irq_restore(flags); | 216 | local_irq_restore(flags); |
210 | } else | 217 | } else |
211 | hwif->INSL(io_ports->data_addr, buffer, wcount); | 218 | hwif->INSL(data_addr, buf, len / 4); |
219 | |||
220 | if ((len & 3) >= 2) | ||
221 | hwif->INSW(data_addr, (u8 *)buf + (len & ~3), 1); | ||
212 | } else | 222 | } else |
213 | hwif->INSW(io_ports->data_addr, buffer, wcount << 1); | 223 | hwif->INSW(data_addr, buf, len / 2); |
214 | } | 224 | } |
215 | 225 | ||
216 | /* | 226 | /* |
217 | * This is used for most PIO data transfers *to* the IDE interface | 227 | * This is used for most PIO data transfers *to* the IDE interface |
218 | */ | 228 | */ |
219 | static void ata_output_data(ide_drive_t *drive, struct request *rq, | 229 | static void ata_output_data(ide_drive_t *drive, struct request *rq, |
220 | void *buffer, u32 wcount) | 230 | void *buf, unsigned int len) |
221 | { | 231 | { |
222 | ide_hwif_t *hwif = drive->hwif; | 232 | ide_hwif_t *hwif = drive->hwif; |
223 | struct ide_io_ports *io_ports = &hwif->io_ports; | 233 | struct ide_io_ports *io_ports = &hwif->io_ports; |
234 | unsigned long data_addr = io_ports->data_addr; | ||
224 | u8 io_32bit = drive->io_32bit; | 235 | u8 io_32bit = drive->io_32bit; |
225 | 236 | ||
226 | if (io_32bit) { | 237 | if (io_32bit) { |
@@ -229,50 +240,21 @@ static void ata_output_data(ide_drive_t *drive, struct request *rq, | |||
229 | 240 | ||
230 | local_irq_save(flags); | 241 | local_irq_save(flags); |
231 | ata_vlb_sync(drive, io_ports->nsect_addr); | 242 | ata_vlb_sync(drive, io_ports->nsect_addr); |
232 | hwif->OUTSL(io_ports->data_addr, buffer, wcount); | 243 | hwif->OUTSL(data_addr, buf, len / 4); |
233 | local_irq_restore(flags); | 244 | local_irq_restore(flags); |
234 | } else | 245 | } else |
235 | hwif->OUTSL(io_ports->data_addr, buffer, wcount); | 246 | hwif->OUTSL(data_addr, buf, len / 4); |
236 | } else | ||
237 | hwif->OUTSW(io_ports->data_addr, buffer, wcount << 1); | ||
238 | } | ||
239 | |||
240 | /* | ||
241 | * The following routines are mainly used by the ATAPI drivers. | ||
242 | * | ||
243 | * These routines will round up any request for an odd number of bytes, | ||
244 | * so if an odd bytecount is specified, be sure that there's at least one | ||
245 | * extra byte allocated for the buffer. | ||
246 | */ | ||
247 | |||
248 | static void atapi_input_bytes(ide_drive_t *drive, void *buffer, u32 bytecount) | ||
249 | { | ||
250 | ide_hwif_t *hwif = HWIF(drive); | ||
251 | 247 | ||
252 | ++bytecount; | 248 | if ((len & 3) >= 2) |
253 | hwif->ata_input_data(drive, NULL, buffer, bytecount / 4); | 249 | hwif->OUTSW(data_addr, (u8 *)buf + (len & ~3), 1); |
254 | if ((bytecount & 0x03) >= 2) | 250 | } else |
255 | hwif->INSW(hwif->io_ports.data_addr, | 251 | hwif->OUTSW(data_addr, buf, len / 2); |
256 | (u8 *)buffer + (bytecount & ~0x03), 1); | ||
257 | } | ||
258 | |||
259 | static void atapi_output_bytes(ide_drive_t *drive, void *buffer, u32 bytecount) | ||
260 | { | ||
261 | ide_hwif_t *hwif = HWIF(drive); | ||
262 | |||
263 | ++bytecount; | ||
264 | hwif->ata_output_data(drive, NULL, buffer, bytecount / 4); | ||
265 | if ((bytecount & 0x03) >= 2) | ||
266 | hwif->OUTSW(hwif->io_ports.data_addr, | ||
267 | (u8 *)buffer + (bytecount & ~0x03), 1); | ||
268 | } | 252 | } |
269 | 253 | ||
270 | void default_hwif_transport(ide_hwif_t *hwif) | 254 | void default_hwif_transport(ide_hwif_t *hwif) |
271 | { | 255 | { |
272 | hwif->ata_input_data = ata_input_data; | 256 | hwif->input_data = ata_input_data; |
273 | hwif->ata_output_data = ata_output_data; | 257 | hwif->output_data = ata_output_data; |
274 | hwif->atapi_input_bytes = atapi_input_bytes; | ||
275 | hwif->atapi_output_bytes = atapi_output_bytes; | ||
276 | } | 258 | } |
277 | 259 | ||
278 | void ide_fix_driveid (struct hd_driveid *id) | 260 | void ide_fix_driveid (struct hd_driveid *id) |
@@ -656,7 +638,7 @@ int ide_driveid_update(ide_drive_t *drive) | |||
656 | local_irq_restore(flags); | 638 | local_irq_restore(flags); |
657 | return 0; | 639 | return 0; |
658 | } | 640 | } |
659 | hwif->ata_input_data(drive, NULL, id, SECTOR_WORDS); | 641 | hwif->input_data(drive, NULL, id, SECTOR_SIZE); |
660 | (void)ide_read_status(drive); /* clear drive IRQ */ | 642 | (void)ide_read_status(drive); /* clear drive IRQ */ |
661 | local_irq_enable(); | 643 | local_irq_enable(); |
662 | local_irq_restore(flags); | 644 | local_irq_restore(flags); |
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index e06a64605215..8f7d57660643 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -124,7 +124,7 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd) | |||
124 | 124 | ||
125 | id = drive->id; | 125 | id = drive->id; |
126 | /* read 512 bytes of id info */ | 126 | /* read 512 bytes of id info */ |
127 | hwif->ata_input_data(drive, NULL, id, SECTOR_WORDS); | 127 | hwif->input_data(drive, NULL, id, SECTOR_SIZE); |
128 | 128 | ||
129 | drive->id_read = 1; | 129 | drive->id_read = 1; |
130 | local_irq_enable(); | 130 | local_irq_enable(); |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index 29870c415110..f4f31238bbef 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -401,7 +401,7 @@ static void idetape_input_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
401 | count = min( | 401 | count = min( |
402 | (unsigned int)(bh->b_size - atomic_read(&bh->b_count)), | 402 | (unsigned int)(bh->b_size - atomic_read(&bh->b_count)), |
403 | bcount); | 403 | bcount); |
404 | HWIF(drive)->atapi_input_bytes(drive, bh->b_data + | 404 | drive->hwif->input_data(drive, NULL, bh->b_data + |
405 | atomic_read(&bh->b_count), count); | 405 | atomic_read(&bh->b_count), count); |
406 | bcount -= count; | 406 | bcount -= count; |
407 | atomic_add(count, &bh->b_count); | 407 | atomic_add(count, &bh->b_count); |
@@ -427,7 +427,7 @@ static void idetape_output_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc, | |||
427 | return; | 427 | return; |
428 | } | 428 | } |
429 | count = min((unsigned int)pc->b_count, (unsigned int)bcount); | 429 | count = min((unsigned int)pc->b_count, (unsigned int)bcount); |
430 | HWIF(drive)->atapi_output_bytes(drive, pc->b_data, count); | 430 | drive->hwif->output_data(drive, NULL, pc->b_data, count); |
431 | bcount -= count; | 431 | bcount -= count; |
432 | pc->b_data += count; | 432 | pc->b_data += count; |
433 | pc->b_count -= count; | 433 | pc->b_count -= count; |
@@ -880,16 +880,16 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive) | |||
880 | "data than expected - allowing transfer\n"); | 880 | "data than expected - allowing transfer\n"); |
881 | } | 881 | } |
882 | iobuf = &idetape_input_buffers; | 882 | iobuf = &idetape_input_buffers; |
883 | xferfunc = hwif->atapi_input_bytes; | 883 | xferfunc = hwif->input_data; |
884 | } else { | 884 | } else { |
885 | iobuf = &idetape_output_buffers; | 885 | iobuf = &idetape_output_buffers; |
886 | xferfunc = hwif->atapi_output_bytes; | 886 | xferfunc = hwif->output_data; |
887 | } | 887 | } |
888 | 888 | ||
889 | if (pc->bh) | 889 | if (pc->bh) |
890 | iobuf(drive, pc, bcount); | 890 | iobuf(drive, pc, bcount); |
891 | else | 891 | else |
892 | xferfunc(drive, pc->cur_pos, bcount); | 892 | xferfunc(drive, NULL, pc->cur_pos, bcount); |
893 | 893 | ||
894 | /* Update the current position */ | 894 | /* Update the current position */ |
895 | pc->xferred += bcount; | 895 | pc->xferred += bcount; |
@@ -979,7 +979,8 @@ static ide_startstop_t idetape_transfer_pc(ide_drive_t *drive) | |||
979 | hwif->dma_ops->dma_start(drive); | 979 | hwif->dma_ops->dma_start(drive); |
980 | #endif | 980 | #endif |
981 | /* Send the actual packet */ | 981 | /* Send the actual packet */ |
982 | HWIF(drive)->atapi_output_bytes(drive, pc->c, 12); | 982 | hwif->output_data(drive, NULL, pc->c, 12); |
983 | |||
983 | return ide_started; | 984 | return ide_started; |
984 | } | 985 | } |
985 | 986 | ||
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c index 7f6bfd314411..0321884f9d92 100644 --- a/drivers/ide/ide-taskfile.c +++ b/drivers/ide/ide-taskfile.c | |||
@@ -324,9 +324,9 @@ static void ide_pio_sector(ide_drive_t *drive, struct request *rq, | |||
324 | 324 | ||
325 | /* do the actual data transfer */ | 325 | /* do the actual data transfer */ |
326 | if (write) | 326 | if (write) |
327 | hwif->ata_output_data(drive, rq, buf, SECTOR_WORDS); | 327 | hwif->output_data(drive, rq, buf, SECTOR_SIZE); |
328 | else | 328 | else |
329 | hwif->ata_input_data(drive, rq, buf, SECTOR_WORDS); | 329 | hwif->input_data(drive, rq, buf, SECTOR_SIZE); |
330 | 330 | ||
331 | kunmap_atomic(buf, KM_BIO_SRC_IRQ); | 331 | kunmap_atomic(buf, KM_BIO_SRC_IRQ); |
332 | #ifdef CONFIG_HIGHMEM | 332 | #ifdef CONFIG_HIGHMEM |
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c index 32c044b17d45..83555ca513b5 100644 --- a/drivers/ide/legacy/falconide.c +++ b/drivers/ide/legacy/falconide.c | |||
@@ -44,34 +44,26 @@ | |||
44 | int falconide_intr_lock; | 44 | int falconide_intr_lock; |
45 | EXPORT_SYMBOL(falconide_intr_lock); | 45 | EXPORT_SYMBOL(falconide_intr_lock); |
46 | 46 | ||
47 | static void falconide_atapi_input_bytes(ide_drive_t *drive, void *buf, | 47 | static void falconide_input_data(ide_drive_t *drive, struct request *rq, |
48 | unsigned int len) | 48 | void *buf, unsigned int len) |
49 | { | 49 | { |
50 | insw_swapw(drive->hwif->io_ports.data_addr, buf, (len + 1) / 2); | 50 | unsigned long data_addr = drive->hwif->io_ports.data_addr; |
51 | } | ||
52 | |||
53 | static void falconide_atapi_output_bytes(ide_drive_t *drive, void *buf, | ||
54 | unsigned int len) | ||
55 | { | ||
56 | outsw_swapw(drive->hwif->io_ports.data_addr, buf, (len + 1) / 2); | ||
57 | } | ||
58 | 51 | ||
59 | static void falconide_ata_input_data(ide_drive_t *drive, struct request *rq, | ||
60 | void *buf, unsigned int wcount) | ||
61 | { | ||
62 | if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS) | 52 | if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS) |
63 | return insw(drive->hwif->io_ports.data_addr, buf, wcount * 2); | 53 | return insw(data_addr, buf, (len + 1) / 2); |
64 | 54 | ||
65 | falconide_atapi_input_bytes(drive, buf, wcount * 4); | 55 | insw_swapw(data_addr, buf, (len + 1) / 2); |
66 | } | 56 | } |
67 | 57 | ||
68 | static void falconide_ata_output_data(ide_drive_t *drive, struct request *rq, | 58 | static void falconide_output_data(ide_drive_t *drive, struct request *rq, |
69 | void *buf, unsigned int wcount) | 59 | void *buf, unsigned int len) |
70 | { | 60 | { |
61 | unsigned long data_addr = drive->hwif->io_ports.data_addr; | ||
62 | |||
71 | if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS) | 63 | if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS) |
72 | return outsw(drive->hwif->io_ports.data_addr, buf, wcount * 2); | 64 | return outsw(data_adr, buf, (len + 1) / 2); |
73 | 65 | ||
74 | falconide_atapi_output_bytes(drive, buf, wcount * 4); | 66 | outsw_swapw(data_addr, buf, (len + 1) / 2); |
75 | } | 67 | } |
76 | 68 | ||
77 | static void __init falconide_setup_ports(hw_regs_t *hw) | 69 | static void __init falconide_setup_ports(hw_regs_t *hw) |
@@ -121,10 +113,8 @@ static int __init falconide_init(void) | |||
121 | ide_init_port_hw(hwif, &hw); | 113 | ide_init_port_hw(hwif, &hw); |
122 | 114 | ||
123 | /* Atari has a byte-swapped IDE interface */ | 115 | /* Atari has a byte-swapped IDE interface */ |
124 | hwif->atapi_input_bytes = falconide_atapi_input_bytes; | 116 | hwif->input_data = falconide_input_data; |
125 | hwif->atapi_output_bytes = falconide_atapi_output_bytes; | 117 | hwif->output_data = falconide_output_data; |
126 | hwif->ata_input_data = falconide_ata_input_data; | ||
127 | hwif->ata_output_data = falconide_ata_output_data; | ||
128 | 118 | ||
129 | ide_get_lock(NULL, NULL); | 119 | ide_get_lock(NULL, NULL); |
130 | ide_device_add(idx, NULL); | 120 | ide_device_add(idx, NULL); |
diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c index deae3d2ca65e..6f535d00e638 100644 --- a/drivers/ide/legacy/q40ide.c +++ b/drivers/ide/legacy/q40ide.c | |||
@@ -72,34 +72,26 @@ static void q40_ide_setup_ports(hw_regs_t *hw, unsigned long base, | |||
72 | hw->ack_intr = ack_intr; | 72 | hw->ack_intr = ack_intr; |
73 | } | 73 | } |
74 | 74 | ||
75 | static void q40ide_atapi_input_bytes(ide_drive_t *drive, void *buf, | 75 | static void q40ide_input_data(ide_drive_t *drive, struct request *rq, |
76 | unsigned int len) | 76 | void *buf, unsigned int len) |
77 | { | 77 | { |
78 | insw_swapw(drive->hwif->io_ports.data_addr, buf, (len + 1) / 2); | 78 | unsigned long data_addr = drive->hwif->io_ports.data_addr; |
79 | } | ||
80 | |||
81 | static void q40ide_atapi_output_bytes(ide_drive_t *drive, void *buf, | ||
82 | unsigned int len) | ||
83 | { | ||
84 | outsw_swapw(drive->hwif->io_ports.data_addr, buf, (len + 1) / 2); | ||
85 | } | ||
86 | 79 | ||
87 | static void q40ide_ata_input_data(ide_drive_t *drive, struct request *rq, | ||
88 | void *buf, unsigned int wcount) | ||
89 | { | ||
90 | if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS) | 80 | if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS) |
91 | return insw(drive->hwif->io_ports.data_addr, buf, wcount * 2); | 81 | return insw(data_addr, buf, (len + 1) / 2); |
92 | 82 | ||
93 | q40ide_atapi_input_bytes(drive, buf, wcount * 4); | 83 | insw_swapw(data_addr, buf, (len + 1) / 2); |
94 | } | 84 | } |
95 | 85 | ||
96 | static void q40ide_ata_output_data(ide_drive_t *drive, struct request *rq, | 86 | static void q40ide_output_data(ide_drive_t *drive, struct request *rq, |
97 | void *buf, unsigned int wcount) | 87 | void *buf, unsigned int len) |
98 | { | 88 | { |
89 | unsigned long data_addr = drive->hwif->io_ports.data_addr; | ||
90 | |||
99 | if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS) | 91 | if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS) |
100 | return outsw(drive->hwif->io_ports.data_addr, buf, wcount * 2); | 92 | return outsw(data_addr, buf, (len + 1) / 2); |
101 | 93 | ||
102 | q40ide_atapi_output_bytes(drive, buf, wcount * 4); | 94 | outsw_swapw(data_addr, buf, (len + 1) / 2); |
103 | } | 95 | } |
104 | 96 | ||
105 | /* | 97 | /* |
@@ -152,10 +144,8 @@ static int __init q40ide_init(void) | |||
152 | ide_init_port_hw(hwif, &hw); | 144 | ide_init_port_hw(hwif, &hw); |
153 | 145 | ||
154 | /* Q40 has a byte-swapped IDE interface */ | 146 | /* Q40 has a byte-swapped IDE interface */ |
155 | hwif->atapi_input_bytes = q40ide_atapi_input_bytes; | 147 | hwif->input_data = q40ide_input_data; |
156 | hwif->atapi_output_bytes = q40ide_atapi_output_bytes; | 148 | hwif->output_data = q40ide_output_data; |
157 | hwif->ata_input_data = q40ide_ata_input_data; | ||
158 | hwif->ata_output_data = q40ide_ata_output_data; | ||
159 | 149 | ||
160 | idx[i] = hwif->index; | 150 | idx[i] = hwif->index; |
161 | } | 151 | } |