aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ide.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r--include/linux/ide.h70
1 files changed, 39 insertions, 31 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 9918772bf274..ac4eeb2932ef 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -189,6 +189,21 @@ static inline void ide_std_init_ports(hw_regs_t *hw,
189 hw->io_ports.ctl_addr = ctl_addr; 189 hw->io_ports.ctl_addr = ctl_addr;
190} 190}
191 191
192/* for IDE PCI controllers in legacy mode, temporary */
193static inline int __ide_default_irq(unsigned long base)
194{
195 switch (base) {
196#ifdef CONFIG_IA64
197 case 0x1f0: return isa_irq_to_vector(14);
198 case 0x170: return isa_irq_to_vector(15);
199#else
200 case 0x1f0: return 14;
201 case 0x170: return 15;
202#endif
203 }
204 return 0;
205}
206
192#include <asm/ide.h> 207#include <asm/ide.h>
193 208
194#if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED) 209#if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED)
@@ -349,7 +364,6 @@ typedef struct ide_drive_s {
349 u8 wcache; /* status of write cache */ 364 u8 wcache; /* status of write cache */
350 u8 acoustic; /* acoustic management */ 365 u8 acoustic; /* acoustic management */
351 u8 media; /* disk, cdrom, tape, floppy, ... */ 366 u8 media; /* disk, cdrom, tape, floppy, ... */
352 u8 ctl; /* "normal" value for Control register */
353 u8 ready_stat; /* min status value for drive ready */ 367 u8 ready_stat; /* min status value for drive ready */
354 u8 mult_count; /* current multiple sector setting */ 368 u8 mult_count; /* current multiple sector setting */
355 u8 mult_req; /* requested multiple sector setting */ 369 u8 mult_req; /* requested multiple sector setting */
@@ -478,7 +492,7 @@ typedef struct hwif_s {
478 void (*ide_dma_clear_irq)(ide_drive_t *drive); 492 void (*ide_dma_clear_irq)(ide_drive_t *drive);
479 493
480 void (*OUTB)(u8 addr, unsigned long port); 494 void (*OUTB)(u8 addr, unsigned long port);
481 void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); 495 void (*OUTBSYNC)(struct hwif_s *hwif, u8 addr, unsigned long port);
482 496
483 u8 (*INB)(unsigned long port); 497 u8 (*INB)(unsigned long port);
484 498
@@ -517,7 +531,6 @@ typedef struct hwif_s {
517 unsigned serialized : 1; /* serialized all channel operation */ 531 unsigned serialized : 1; /* serialized all channel operation */
518 unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ 532 unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */
519 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ 533 unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */
520 unsigned mmio : 1; /* host uses MMIO */
521 534
522 struct device gendev; 535 struct device gendev;
523 struct device *portdev; 536 struct device *portdev;
@@ -589,12 +602,13 @@ enum {
589 PC_FLAG_SUPPRESS_ERROR = (1 << 1), 602 PC_FLAG_SUPPRESS_ERROR = (1 << 1),
590 PC_FLAG_WAIT_FOR_DSC = (1 << 2), 603 PC_FLAG_WAIT_FOR_DSC = (1 << 2),
591 PC_FLAG_DMA_OK = (1 << 3), 604 PC_FLAG_DMA_OK = (1 << 3),
592 PC_FLAG_DMA_RECOMMENDED = (1 << 4), 605 PC_FLAG_DMA_IN_PROGRESS = (1 << 4),
593 PC_FLAG_DMA_IN_PROGRESS = (1 << 5), 606 PC_FLAG_DMA_ERROR = (1 << 5),
594 PC_FLAG_DMA_ERROR = (1 << 6), 607 PC_FLAG_WRITING = (1 << 6),
595 PC_FLAG_WRITING = (1 << 7),
596 /* command timed out */ 608 /* command timed out */
597 PC_FLAG_TIMEDOUT = (1 << 8), 609 PC_FLAG_TIMEDOUT = (1 << 7),
610 PC_FLAG_ZIP_DRIVE = (1 << 8),
611 PC_FLAG_DRQ_INTERRUPT = (1 << 9),
598}; 612};
599 613
600struct ide_atapi_pc { 614struct ide_atapi_pc {
@@ -627,8 +641,8 @@ struct ide_atapi_pc {
627 * to change/removal later. 641 * to change/removal later.
628 */ 642 */
629 u8 pc_buf[256]; 643 u8 pc_buf[256];
630 void (*idefloppy_callback) (ide_drive_t *); 644
631 ide_startstop_t (*idetape_callback) (ide_drive_t *); 645 void (*callback)(ide_drive_t *);
632 646
633 /* idetape only */ 647 /* idetape only */
634 struct idetape_bh *bh; 648 struct idetape_bh *bh;
@@ -798,10 +812,6 @@ int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsig
798#ifndef _IDE_C 812#ifndef _IDE_C
799extern ide_hwif_t ide_hwifs[]; /* master data repository */ 813extern ide_hwif_t ide_hwifs[]; /* master data repository */
800#endif 814#endif
801extern int ide_noacpi;
802extern int ide_acpigtf;
803extern int ide_acpionboot;
804extern int noautodma;
805 815
806extern int ide_vlb_clk; 816extern int ide_vlb_clk;
807extern int ide_pci_clk; 817extern int ide_pci_clk;
@@ -842,25 +852,12 @@ int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long);
842 852
843extern ide_startstop_t ide_do_reset (ide_drive_t *); 853extern ide_startstop_t ide_do_reset (ide_drive_t *);
844 854
845extern void ide_init_drive_cmd (struct request *rq); 855extern void ide_do_drive_cmd(ide_drive_t *, struct request *);
846
847/*
848 * "action" parameter type for ide_do_drive_cmd() below.
849 */
850typedef enum {
851 ide_wait, /* insert rq at end of list, and wait for it */
852 ide_preempt, /* insert rq in front of current request */
853 ide_head_wait, /* insert rq in front of current request and wait for it */
854 ide_end /* insert rq at end of list, but don't wait for it */
855} ide_action_t;
856
857extern int ide_do_drive_cmd(ide_drive_t *, struct request *, ide_action_t);
858 856
859extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); 857extern void ide_end_drive_cmd(ide_drive_t *, u8, u8);
860 858
861enum { 859enum {
862 IDE_TFLAG_LBA48 = (1 << 0), 860 IDE_TFLAG_LBA48 = (1 << 0),
863 IDE_TFLAG_NO_SELECT_MASK = (1 << 1),
864 IDE_TFLAG_FLAGGED = (1 << 2), 861 IDE_TFLAG_FLAGGED = (1 << 2),
865 IDE_TFLAG_OUT_DATA = (1 << 3), 862 IDE_TFLAG_OUT_DATA = (1 << 3),
866 IDE_TFLAG_OUT_HOB_FEATURE = (1 << 4), 863 IDE_TFLAG_OUT_HOB_FEATURE = (1 << 4),
@@ -965,11 +962,23 @@ typedef struct ide_task_s {
965void ide_tf_dump(const char *, struct ide_taskfile *); 962void ide_tf_dump(const char *, struct ide_taskfile *);
966 963
967extern void SELECT_DRIVE(ide_drive_t *); 964extern void SELECT_DRIVE(ide_drive_t *);
965void SELECT_MASK(ide_drive_t *, int);
968 966
969extern int drive_is_ready(ide_drive_t *); 967extern int drive_is_ready(ide_drive_t *);
970 968
971void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); 969void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8);
972 970
971ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
972 ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry,
973 void (*update_buffers)(ide_drive_t *, struct ide_atapi_pc *),
974 void (*retry_pc)(ide_drive_t *), void (*dsc_handle)(ide_drive_t *),
975 void (*io_buffers)(ide_drive_t *, struct ide_atapi_pc *, unsigned int,
976 int));
977ide_startstop_t ide_transfer_pc(ide_drive_t *, struct ide_atapi_pc *,
978 ide_handler_t *, unsigned int, ide_expiry_t *);
979ide_startstop_t ide_issue_pc(ide_drive_t *, struct ide_atapi_pc *,
980 ide_handler_t *, unsigned int, ide_expiry_t *);
981
973ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); 982ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *);
974 983
975void task_end_request(ide_drive_t *, struct request *, u8); 984void task_end_request(ide_drive_t *, struct request *, u8);
@@ -981,8 +990,6 @@ int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long);
981int ide_cmd_ioctl(ide_drive_t *, unsigned int, unsigned long); 990int ide_cmd_ioctl(ide_drive_t *, unsigned int, unsigned long);
982int ide_task_ioctl(ide_drive_t *, unsigned int, unsigned long); 991int ide_task_ioctl(ide_drive_t *, unsigned int, unsigned long);
983 992
984extern int system_bus_clock(void);
985
986extern int ide_driveid_update(ide_drive_t *); 993extern int ide_driveid_update(ide_drive_t *);
987extern int ide_config_drive_speed(ide_drive_t *, u8); 994extern int ide_config_drive_speed(ide_drive_t *, u8);
988extern u8 eighty_ninty_three (ide_drive_t *); 995extern u8 eighty_ninty_three (ide_drive_t *);
@@ -1334,7 +1341,8 @@ static inline void ide_set_irq(ide_drive_t *drive, int on)
1334{ 1341{
1335 ide_hwif_t *hwif = drive->hwif; 1342 ide_hwif_t *hwif = drive->hwif;
1336 1343
1337 hwif->OUTB(drive->ctl | (on ? 0 : 2), hwif->io_ports.ctl_addr); 1344 hwif->OUTBSYNC(hwif, ATA_DEVCTL_OBS | (on ? 0 : 2),
1345 hwif->io_ports.ctl_addr);
1338} 1346}
1339 1347
1340static inline u8 ide_read_status(ide_drive_t *drive) 1348static inline u8 ide_read_status(ide_drive_t *drive)