aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-07-16 17:53:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-16 17:53:54 -0400
commit42fdd144a40f3afaccaa7ea538268bad3596439e (patch)
tree9986c7f04682408fe1ad983297b0576f68387a68 /include
parent4314652bb41df08ad65bd25176ba1dfd24b14a51 (diff)
parent64a8f00ff19508b3962c8a932375dbae88bee4d6 (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: (76 commits) IDE: Report errors during drive reset back to user space Update documentation of HDIO_DRIVE_RESET ioctl IDE: Remove unused code IDE: Fix HDIO_DRIVE_RESET handling hd.c: remove the #include <linux/mc146818rtc.h> update the BLK_DEV_HD help text move ide/legacy/hd.c to drivers/block/ ide/legacy/hd.c: use late_initcall() remove BLK_DEV_HD_ONLY ide: endian annotations in ide-floppy.c ide-floppy: zero out the whole struct ide_atapi_pc on init ide-floppy: fold idefloppy_create_test_unit_ready_cmd into idefloppy_open ide-cd: move request prep chunk from cdrom_do_newpc_cont to rq issue path ide-cd: move request prep from cdrom_start_rw_cont to rq issue path ide-cd: move request prep from cdrom_start_seek_continuation to rq issue path ide-cd: fold cdrom_start_seek into ide_cd_do_request ide-cd: simplify request issuing path ide-cd: mv ide_do_rw_cdrom ide_cd_do_request ide-cd: cdrom_start_seek: remove unused argument block ide-cd: ide_do_rw_cdrom: add the catch-all bad request case to the if-else block ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/ide.h74
1 files changed, 44 insertions, 30 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index ac4eeb2932ef..4726126f5a59 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -139,6 +139,12 @@ struct ide_io_ports {
139#define WAIT_MIN_SLEEP (2*HZ/100) /* 20msec - minimum sleep time */ 139#define WAIT_MIN_SLEEP (2*HZ/100) /* 20msec - minimum sleep time */
140 140
141/* 141/*
142 * Op codes for special requests to be handled by ide_special_rq().
143 * Values should be in the range of 0x20 to 0x3f.
144 */
145#define REQ_DRIVE_RESET 0x20
146
147/*
142 * Check for an interrupt and acknowledge the interrupt status 148 * Check for an interrupt and acknowledge the interrupt status
143 */ 149 */
144struct hwif_s; 150struct hwif_s;
@@ -171,7 +177,7 @@ typedef struct hw_regs_s {
171 int irq; /* our irq number */ 177 int irq; /* our irq number */
172 ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ 178 ide_ack_intr_t *ack_intr; /* acknowledge interrupt */
173 hwif_chipset_t chipset; 179 hwif_chipset_t chipset;
174 struct device *dev; 180 struct device *dev, *parent;
175} hw_regs_t; 181} hw_regs_t;
176 182
177void ide_init_port_data(struct hwif_s *, unsigned int); 183void ide_init_port_data(struct hwif_s *, unsigned int);
@@ -405,8 +411,8 @@ typedef struct ide_drive_s {
405struct ide_port_info; 411struct ide_port_info;
406 412
407struct ide_port_ops { 413struct ide_port_ops {
408 /* host specific initialization of devices on a port */ 414 /* host specific initialization of a device */
409 void (*port_init_devs)(struct hwif_s *); 415 void (*init_dev)(ide_drive_t *);
410 /* routine to program host for PIO mode */ 416 /* routine to program host for PIO mode */
411 void (*set_pio_mode)(ide_drive_t *, const u8); 417 void (*set_pio_mode)(ide_drive_t *, const u8);
412 /* routine to program host for DMA mode */ 418 /* routine to program host for DMA mode */
@@ -565,8 +571,6 @@ typedef struct hwgroup_s {
565 unsigned int sleeping : 1; 571 unsigned int sleeping : 1;
566 /* BOOL: polling active & poll_timeout field valid */ 572 /* BOOL: polling active & poll_timeout field valid */
567 unsigned int polling : 1; 573 unsigned int polling : 1;
568 /* BOOL: in a polling reset situation. Must not trigger another reset yet */
569 unsigned int resetting : 1;
570 574
571 /* current drive */ 575 /* current drive */
572 ide_drive_t *drive; 576 ide_drive_t *drive;
@@ -786,7 +790,6 @@ struct ide_driver_s {
786 ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); 790 ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t);
787 int (*end_request)(ide_drive_t *, int, int); 791 int (*end_request)(ide_drive_t *, int, int);
788 ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); 792 ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8);
789 ide_startstop_t (*abort)(ide_drive_t *, struct request *rq);
790 struct device_driver gen_driver; 793 struct device_driver gen_driver;
791 int (*probe)(ide_drive_t *); 794 int (*probe)(ide_drive_t *);
792 void (*remove)(ide_drive_t *); 795 void (*remove)(ide_drive_t *);
@@ -801,18 +804,6 @@ struct ide_driver_s {
801 804
802int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); 805int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long);
803 806
804/*
805 * ide_hwifs[] is the master data structure used to keep track
806 * of just about everything in ide.c. Whenever possible, routines
807 * should be using pointers to a drive (ide_drive_t *) or
808 * pointers to a hwif (ide_hwif_t *), rather than indexing this
809 * structure directly (the allocation/layout may change!).
810 *
811 */
812#ifndef _IDE_C
813extern ide_hwif_t ide_hwifs[]; /* master data repository */
814#endif
815
816extern int ide_vlb_clk; 807extern int ide_vlb_clk;
817extern int ide_pci_clk; 808extern int ide_pci_clk;
818 809
@@ -840,10 +831,6 @@ ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8);
840 831
841ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat); 832ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat);
842 833
843ide_startstop_t __ide_abort(ide_drive_t *, struct request *);
844
845extern ide_startstop_t ide_abort(ide_drive_t *, const char *);
846
847extern void ide_fix_driveid(struct hd_driveid *); 834extern void ide_fix_driveid(struct hd_driveid *);
848 835
849extern void ide_fixstring(u8 *, const int, const int); 836extern void ide_fixstring(u8 *, const int, const int);
@@ -1271,16 +1258,43 @@ static inline int ide_dev_is_sata(struct hd_driveid *id)
1271u64 ide_get_lba_addr(struct ide_taskfile *, int); 1258u64 ide_get_lba_addr(struct ide_taskfile *, int);
1272u8 ide_dump_status(ide_drive_t *, const char *, u8); 1259u8 ide_dump_status(ide_drive_t *, const char *, u8);
1273 1260
1274typedef struct ide_pio_timings_s { 1261struct ide_timing {
1275 int setup_time; /* Address setup (ns) minimum */ 1262 u8 mode;
1276 int active_time; /* Active pulse (ns) minimum */ 1263 u8 setup; /* t1 */
1277 int cycle_time; /* Cycle time (ns) minimum = */ 1264 u16 act8b; /* t2 for 8-bit io */
1278 /* active + recovery (+ setup for some chips) */ 1265 u16 rec8b; /* t2i for 8-bit io */
1279} ide_pio_timings_t; 1266 u16 cyc8b; /* t0 for 8-bit io */
1267 u16 active; /* t2 or tD */
1268 u16 recover; /* t2i or tK */
1269 u16 cycle; /* t0 */
1270 u16 udma; /* t2CYCTYP/2 */
1271};
1272
1273enum {
1274 IDE_TIMING_SETUP = (1 << 0),
1275 IDE_TIMING_ACT8B = (1 << 1),
1276 IDE_TIMING_REC8B = (1 << 2),
1277 IDE_TIMING_CYC8B = (1 << 3),
1278 IDE_TIMING_8BIT = IDE_TIMING_ACT8B | IDE_TIMING_REC8B |
1279 IDE_TIMING_CYC8B,
1280 IDE_TIMING_ACTIVE = (1 << 4),
1281 IDE_TIMING_RECOVER = (1 << 5),
1282 IDE_TIMING_CYCLE = (1 << 6),
1283 IDE_TIMING_UDMA = (1 << 7),
1284 IDE_TIMING_ALL = IDE_TIMING_SETUP | IDE_TIMING_8BIT |
1285 IDE_TIMING_ACTIVE | IDE_TIMING_RECOVER |
1286 IDE_TIMING_CYCLE | IDE_TIMING_UDMA,
1287};
1288
1289struct ide_timing *ide_timing_find_mode(u8);
1290u16 ide_pio_cycle_time(ide_drive_t *, u8);
1291void ide_timing_merge(struct ide_timing *, struct ide_timing *,
1292 struct ide_timing *, unsigned int);
1293int ide_timing_compute(ide_drive_t *, u8, struct ide_timing *, int, int);
1294
1295int ide_scan_pio_blacklist(char *);
1280 1296
1281unsigned int ide_pio_cycle_time(ide_drive_t *, u8);
1282u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); 1297u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8);
1283extern const ide_pio_timings_t ide_pio_timings[6];
1284 1298
1285int ide_set_pio_mode(ide_drive_t *, u8); 1299int ide_set_pio_mode(ide_drive_t *, u8);
1286int ide_set_dma_mode(ide_drive_t *, u8); 1300int ide_set_dma_mode(ide_drive_t *, u8);