aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-01-27 01:54:32 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-01-27 01:54:32 -0500
commit1c7c2cdec3a6b2873439096983794a550d7ff65b (patch)
tree10ea67846407e9882d50e95a9db675140dd423eb /include
parent0444fa78751260b38f0db3418e001bf86593f05f (diff)
parent7267c3377443322588cddaf457cf106839a60463 (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: (63 commits) ide: remove REQ_TYPE_ATA_CMD ide: switch ide_cmd_ioctl() to use REQ_TYPE_ATA_TASKFILE requests ide: switch set_xfer_rate() to use REQ_TYPE_ATA_TASKFILE requests ide: fix final status check in drive_cmd_intr() ide: check BUSY and ERROR status bits before reading data in drive_cmd_intr() ide: don't enable local IRQs for PIO-in in driver_cmd_intr() (take 2) ide: convert "empty" REQ_TYPE_ATA_CMD requests to use REQ_TYPE_ATA_TASKFILE ide: initialize rq->cmd_type in ide_init_drive_cmd() callers ide: use wait_drive_not_busy() in drive_cmd_intr() (take 2) ide: kill DATA_READY define ide: task_end_request() fix ide: use rq->nr_sectors in task_end_request() ide: remove needless ->cursg clearing from task_end_request() ide: set IDE_TFLAG_IN_* flags before queuing/executing command ide-tape: fix handling of non-special requests in ->end_request method ide: fix final status check in task_in_intr() ide: clear HOB bit for REQ_TYPE_ATA_CMD requests in ide_end_drive_cmd() ide: fix ->io_32bit race in ide_taskfile_ioctl() cmd64x: remove /proc/ide/cmd64x ide: remove broken disk byte-swapping support ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/blkdev.h1
-rw-r--r--include/linux/ide.h61
2 files changed, 34 insertions, 28 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index bd20a4e8663a..49b7a4c31a6d 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -143,7 +143,6 @@ enum rq_cmd_type_bits {
143 * use REQ_TYPE_SPECIAL and use rq->cmd[0] with the range of driver 143 * use REQ_TYPE_SPECIAL and use rq->cmd[0] with the range of driver
144 * private REQ_LB opcodes to differentiate what type of request this is 144 * private REQ_LB opcodes to differentiate what type of request this is
145 */ 145 */
146 REQ_TYPE_ATA_CMD,
147 REQ_TYPE_ATA_TASKFILE, 146 REQ_TYPE_ATA_TASKFILE,
148 REQ_TYPE_ATA_PC, 147 REQ_TYPE_ATA_PC,
149}; 148};
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 1e4409937ec3..27cb39de2ae2 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -107,7 +107,6 @@ typedef unsigned char byte; /* used everywhere */
107#define BAD_W_STAT (BAD_R_STAT | WRERR_STAT) 107#define BAD_W_STAT (BAD_R_STAT | WRERR_STAT)
108#define BAD_STAT (BAD_R_STAT | DRQ_STAT) 108#define BAD_STAT (BAD_R_STAT | DRQ_STAT)
109#define DRIVE_READY (READY_STAT | SEEK_STAT) 109#define DRIVE_READY (READY_STAT | SEEK_STAT)
110#define DATA_READY (DRQ_STAT)
111 110
112#define BAD_CRC (ABRT_ERR | ICRC_ERR) 111#define BAD_CRC (ABRT_ERR | ICRC_ERR)
113 112
@@ -198,8 +197,11 @@ typedef struct hw_regs_s {
198} hw_regs_t; 197} hw_regs_t;
199 198
200struct hwif_s * ide_find_port(unsigned long); 199struct hwif_s * ide_find_port(unsigned long);
200void ide_init_port_data(struct hwif_s *, unsigned int);
201void ide_init_port_hw(struct hwif_s *, hw_regs_t *);
201 202
202int ide_register_hw(hw_regs_t *, void (*)(struct hwif_s *), int, 203struct ide_drive_s;
204int ide_register_hw(hw_regs_t *, void (*)(struct ide_drive_s *),
203 struct hwif_s **); 205 struct hwif_s **);
204 206
205void ide_setup_ports( hw_regs_t *hw, 207void ide_setup_ports( hw_regs_t *hw,
@@ -391,7 +393,6 @@ typedef struct ide_drive_s {
391 u8 state; /* retry state */ 393 u8 state; /* retry state */
392 u8 waiting_for_dma; /* dma currently in progress */ 394 u8 waiting_for_dma; /* dma currently in progress */
393 u8 unmask; /* okay to unmask other irqs */ 395 u8 unmask; /* okay to unmask other irqs */
394 u8 bswap; /* byte swap data */
395 u8 noflush; /* don't attempt flushes */ 396 u8 noflush; /* don't attempt flushes */
396 u8 dsc_overlap; /* DSC overlap */ 397 u8 dsc_overlap; /* DSC overlap */
397 u8 nice1; /* give potential excess bandwidth */ 398 u8 nice1; /* give potential excess bandwidth */
@@ -527,31 +528,26 @@ typedef struct hwif_s {
527 /* special host masking for drive selection */ 528 /* special host masking for drive selection */
528 void (*maskproc)(ide_drive_t *, int); 529 void (*maskproc)(ide_drive_t *, int);
529 /* check host's drive quirk list */ 530 /* check host's drive quirk list */
530 int (*quirkproc)(ide_drive_t *); 531 void (*quirkproc)(ide_drive_t *);
531 /* driver soft-power interface */ 532 /* driver soft-power interface */
532 int (*busproc)(ide_drive_t *, int); 533 int (*busproc)(ide_drive_t *, int);
533#endif 534#endif
534 u8 (*mdma_filter)(ide_drive_t *); 535 u8 (*mdma_filter)(ide_drive_t *);
535 u8 (*udma_filter)(ide_drive_t *); 536 u8 (*udma_filter)(ide_drive_t *);
536 537
537 void (*fixup)(struct hwif_s *);
538
539 void (*ata_input_data)(ide_drive_t *, void *, u32); 538 void (*ata_input_data)(ide_drive_t *, void *, u32);
540 void (*ata_output_data)(ide_drive_t *, void *, u32); 539 void (*ata_output_data)(ide_drive_t *, void *, u32);
541 540
542 void (*atapi_input_bytes)(ide_drive_t *, void *, u32); 541 void (*atapi_input_bytes)(ide_drive_t *, void *, u32);
543 void (*atapi_output_bytes)(ide_drive_t *, void *, u32); 542 void (*atapi_output_bytes)(ide_drive_t *, void *, u32);
544 543
544 void (*dma_host_set)(ide_drive_t *, int);
545 int (*dma_setup)(ide_drive_t *); 545 int (*dma_setup)(ide_drive_t *);
546 void (*dma_exec_cmd)(ide_drive_t *, u8); 546 void (*dma_exec_cmd)(ide_drive_t *, u8);
547 void (*dma_start)(ide_drive_t *); 547 void (*dma_start)(ide_drive_t *);
548 int (*ide_dma_end)(ide_drive_t *drive); 548 int (*ide_dma_end)(ide_drive_t *drive);
549 int (*ide_dma_on)(ide_drive_t *drive);
550 void (*dma_off_quietly)(ide_drive_t *drive);
551 int (*ide_dma_test_irq)(ide_drive_t *drive); 549 int (*ide_dma_test_irq)(ide_drive_t *drive);
552 void (*ide_dma_clear_irq)(ide_drive_t *drive); 550 void (*ide_dma_clear_irq)(ide_drive_t *drive);
553 void (*dma_host_on)(ide_drive_t *drive);
554 void (*dma_host_off)(ide_drive_t *drive);
555 void (*dma_lost_irq)(ide_drive_t *drive); 551 void (*dma_lost_irq)(ide_drive_t *drive);
556 void (*dma_timeout)(ide_drive_t *drive); 552 void (*dma_timeout)(ide_drive_t *drive);
557 553
@@ -874,14 +870,6 @@ extern int ide_do_drive_cmd(ide_drive_t *, struct request *, ide_action_t);
874 870
875extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); 871extern void ide_end_drive_cmd(ide_drive_t *, u8, u8);
876 872
877/*
878 * Issue ATA command and wait for completion.
879 * Use for implementing commands in kernel
880 *
881 * (ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, u8 sectors, u8 *buf)
882 */
883extern int ide_wait_cmd(ide_drive_t *, u8, u8, u8, u8, u8 *);
884
885enum { 873enum {
886 IDE_TFLAG_LBA48 = (1 << 0), 874 IDE_TFLAG_LBA48 = (1 << 0),
887 IDE_TFLAG_NO_SELECT_MASK = (1 << 1), 875 IDE_TFLAG_NO_SELECT_MASK = (1 << 1),
@@ -934,6 +922,14 @@ enum {
934 IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT | 922 IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT |
935 IDE_TFLAG_IN_LBA, 923 IDE_TFLAG_IN_LBA,
936 IDE_TFLAG_IN_DEVICE = (1 << 29), 924 IDE_TFLAG_IN_DEVICE = (1 << 29),
925 IDE_TFLAG_HOB = IDE_TFLAG_OUT_HOB |
926 IDE_TFLAG_IN_HOB,
927 IDE_TFLAG_TF = IDE_TFLAG_OUT_TF |
928 IDE_TFLAG_IN_TF,
929 IDE_TFLAG_DEVICE = IDE_TFLAG_OUT_DEVICE |
930 IDE_TFLAG_IN_DEVICE,
931 /* force 16-bit I/O operations */
932 IDE_TFLAG_IO_16BIT = (1 << 30),
937}; 933};
938 934
939struct ide_taskfile { 935struct ide_taskfile {
@@ -988,6 +984,10 @@ void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8);
988 984
989ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *); 985ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *);
990 986
987void task_end_request(ide_drive_t *, struct request *, u8);
988
989u8 wait_drive_not_busy(ide_drive_t *);
990
991int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16); 991int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16);
992int ide_no_data_taskfile(ide_drive_t *, ide_task_t *); 992int ide_no_data_taskfile(ide_drive_t *, ide_task_t *);
993 993
@@ -1015,10 +1015,9 @@ extern void do_ide_request(struct request_queue *);
1015 1015
1016void ide_init_disk(struct gendisk *, ide_drive_t *); 1016void ide_init_disk(struct gendisk *, ide_drive_t *);
1017 1017
1018extern int ideprobe_init(void);
1019
1020#ifdef CONFIG_IDEPCI_PCIBUS_ORDER 1018#ifdef CONFIG_IDEPCI_PCIBUS_ORDER
1021extern void ide_scan_pcibus(int scan_direction) __init; 1019extern int ide_scan_direction;
1020int __init ide_scan_pcibus(void);
1022extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner, const char *mod_name); 1021extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner, const char *mod_name);
1023#define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE, KBUILD_MODNAME) 1022#define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE, KBUILD_MODNAME)
1024#else 1023#else
@@ -1095,6 +1094,8 @@ enum {
1095 /* unmask IRQs */ 1094 /* unmask IRQs */
1096 IDE_HFLAG_UNMASK_IRQS = (1 << 25), 1095 IDE_HFLAG_UNMASK_IRQS = (1 << 25),
1097 IDE_HFLAG_ABUSE_SET_DMA_MODE = (1 << 26), 1096 IDE_HFLAG_ABUSE_SET_DMA_MODE = (1 << 26),
1097 /* host is CY82C693 */
1098 IDE_HFLAG_CY82C693 = (1 << 27),
1098}; 1099};
1099 1100
1100#ifdef CONFIG_BLK_DEV_OFFBOARD 1101#ifdef CONFIG_BLK_DEV_OFFBOARD
@@ -1109,7 +1110,6 @@ struct ide_port_info {
1109 void (*init_iops)(ide_hwif_t *); 1110 void (*init_iops)(ide_hwif_t *);
1110 void (*init_hwif)(ide_hwif_t *); 1111 void (*init_hwif)(ide_hwif_t *);
1111 void (*init_dma)(ide_hwif_t *, unsigned long); 1112 void (*init_dma)(ide_hwif_t *, unsigned long);
1112 void (*fixup)(ide_hwif_t *);
1113 ide_pci_enablebit_t enablebits[2]; 1113 ide_pci_enablebit_t enablebits[2];
1114 hwif_chipset_t chipset; 1114 hwif_chipset_t chipset;
1115 u8 extra; 1115 u8 extra;
@@ -1147,7 +1147,9 @@ static inline u8 ide_max_dma_mode(ide_drive_t *drive)
1147 return ide_find_dma_mode(drive, XFER_UDMA_6); 1147 return ide_find_dma_mode(drive, XFER_UDMA_6);
1148} 1148}
1149 1149
1150void ide_dma_off_quietly(ide_drive_t *);
1150void ide_dma_off(ide_drive_t *); 1151void ide_dma_off(ide_drive_t *);
1152void ide_dma_on(ide_drive_t *);
1151int ide_set_dma(ide_drive_t *); 1153int ide_set_dma(ide_drive_t *);
1152ide_startstop_t ide_dma_intr(ide_drive_t *); 1154ide_startstop_t ide_dma_intr(ide_drive_t *);
1153 1155
@@ -1158,10 +1160,7 @@ extern void ide_destroy_dmatable(ide_drive_t *);
1158extern int ide_release_dma(ide_hwif_t *); 1160extern int ide_release_dma(ide_hwif_t *);
1159extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int); 1161extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int);
1160 1162
1161void ide_dma_host_off(ide_drive_t *); 1163void ide_dma_host_set(ide_drive_t *, int);
1162void ide_dma_off_quietly(ide_drive_t *);
1163void ide_dma_host_on(ide_drive_t *);
1164extern int __ide_dma_on(ide_drive_t *);
1165extern int ide_dma_setup(ide_drive_t *); 1164extern int ide_dma_setup(ide_drive_t *);
1166extern void ide_dma_start(ide_drive_t *); 1165extern void ide_dma_start(ide_drive_t *);
1167extern int __ide_dma_end(ide_drive_t *); 1166extern int __ide_dma_end(ide_drive_t *);
@@ -1173,7 +1172,9 @@ extern void ide_dma_timeout(ide_drive_t *);
1173static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } 1172static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; }
1174static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } 1173static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; }
1175static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } 1174static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; }
1175static inline void ide_dma_off_quietly(ide_drive_t *drive) { ; }
1176static inline void ide_dma_off(ide_drive_t *drive) { ; } 1176static inline void ide_dma_off(ide_drive_t *drive) { ; }
1177static inline void ide_dma_on(ide_drive_t *drive) { ; }
1177static inline void ide_dma_verbose(ide_drive_t *drive) { ; } 1178static inline void ide_dma_verbose(ide_drive_t *drive) { ; }
1178static inline int ide_set_dma(ide_drive_t *drive) { return 1; } 1179static inline int ide_set_dma(ide_drive_t *drive) { return 1; }
1179#endif /* CONFIG_BLK_DEV_IDEDMA */ 1180#endif /* CONFIG_BLK_DEV_IDEDMA */
@@ -1203,8 +1204,9 @@ extern void ide_unregister (unsigned int index);
1203void ide_register_region(struct gendisk *); 1204void ide_register_region(struct gendisk *);
1204void ide_unregister_region(struct gendisk *); 1205void ide_unregister_region(struct gendisk *);
1205 1206
1206void ide_undecoded_slave(ide_hwif_t *); 1207void ide_undecoded_slave(ide_drive_t *);
1207 1208
1209int ide_device_add_all(u8 *idx);
1208int ide_device_add(u8 idx[4]); 1210int ide_device_add(u8 idx[4]);
1209 1211
1210static inline void *ide_get_hwifdata (ide_hwif_t * hwif) 1212static inline void *ide_get_hwifdata (ide_hwif_t * hwif)
@@ -1302,4 +1304,9 @@ static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive)
1302 return &hwif->drives[(drive->dn ^ 1) & 1]; 1304 return &hwif->drives[(drive->dn ^ 1) & 1];
1303} 1305}
1304 1306
1307static inline void ide_set_irq(ide_drive_t *drive, int on)
1308{
1309 drive->hwif->OUTB(drive->ctl | (on ? 0 : 2), IDE_CONTROL_REG);
1310}
1311
1305#endif /* _IDE_H */ 1312#endif /* _IDE_H */