aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-01 13:02:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-01 13:02:15 -0400
commitc09bca786ff941ed17c5f381c4eca5b106808c51 (patch)
tree9b79a2f2d3ac441551c9c367f22e2240040c4ef6 /include
parente76e5b2c663ac74ae6a542ac20795c625e36a5cd (diff)
parent5b6c942dd1f13835eff8105ec2aa859544a1498d (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: (59 commits) ide-floppy: do not complete rq's prematurely ide: be able to build pmac driver without IDE built-in ide-pmac: IDE cable detection on Apple PowerBook ide: inline SELECT_DRIVE() ide: turn selectproc() method into dev_select() method (take 5) MAINTAINERS: move old ide-{floppy,tape} entries to CREDITS (take 2) ide: move data register access out of tf_{read|load}() methods (take 2) ide: call {in|out}put_data() methods from tf_{read|load}() methods (take 2) ide-io-std: shorten ide_{in|out}put_data() ide: rename IDE_TFLAG_IN_[HOB_]FEATURE ide: turn set_irq() method into write_devctl() method ide: use ATA_HOB ide-disk: use ATA_ERR ide: add support for CFA specified transfer modes (take 3) ide-iops: only clear DMA words on setting DMA mode ide: identify data word 53 bit 1 doesn't cover words 62 and 63 (take 3) au1xxx-ide: auide_{in|out}sw() should be static ide-floppy: use ide_pio_bytes() ide-{floppy,tape}: fix padding for PIO transfers ide: remove CONFIG_BLK_DEV_IDEDOUBLER config option ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/ide.h56
1 files changed, 27 insertions, 29 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h
index d5d832271f44..a5d26f66ef78 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -265,7 +265,7 @@ enum {
265 IDE_TFLAG_WRITE = (1 << 12), 265 IDE_TFLAG_WRITE = (1 << 12),
266 IDE_TFLAG_CUSTOM_HANDLER = (1 << 13), 266 IDE_TFLAG_CUSTOM_HANDLER = (1 << 13),
267 IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 14), 267 IDE_TFLAG_DMA_PIO_FALLBACK = (1 << 14),
268 IDE_TFLAG_IN_HOB_FEATURE = (1 << 15), 268 IDE_TFLAG_IN_HOB_ERROR = (1 << 15),
269 IDE_TFLAG_IN_HOB_NSECT = (1 << 16), 269 IDE_TFLAG_IN_HOB_NSECT = (1 << 16),
270 IDE_TFLAG_IN_HOB_LBAL = (1 << 17), 270 IDE_TFLAG_IN_HOB_LBAL = (1 << 17),
271 IDE_TFLAG_IN_HOB_LBAM = (1 << 18), 271 IDE_TFLAG_IN_HOB_LBAM = (1 << 18),
@@ -273,10 +273,10 @@ enum {
273 IDE_TFLAG_IN_HOB_LBA = IDE_TFLAG_IN_HOB_LBAL | 273 IDE_TFLAG_IN_HOB_LBA = IDE_TFLAG_IN_HOB_LBAL |
274 IDE_TFLAG_IN_HOB_LBAM | 274 IDE_TFLAG_IN_HOB_LBAM |
275 IDE_TFLAG_IN_HOB_LBAH, 275 IDE_TFLAG_IN_HOB_LBAH,
276 IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_FEATURE | 276 IDE_TFLAG_IN_HOB = IDE_TFLAG_IN_HOB_ERROR |
277 IDE_TFLAG_IN_HOB_NSECT | 277 IDE_TFLAG_IN_HOB_NSECT |
278 IDE_TFLAG_IN_HOB_LBA, 278 IDE_TFLAG_IN_HOB_LBA,
279 IDE_TFLAG_IN_FEATURE = (1 << 20), 279 IDE_TFLAG_IN_ERROR = (1 << 20),
280 IDE_TFLAG_IN_NSECT = (1 << 21), 280 IDE_TFLAG_IN_NSECT = (1 << 21),
281 IDE_TFLAG_IN_LBAL = (1 << 22), 281 IDE_TFLAG_IN_LBAL = (1 << 22),
282 IDE_TFLAG_IN_LBAM = (1 << 23), 282 IDE_TFLAG_IN_LBAM = (1 << 23),
@@ -310,8 +310,12 @@ enum {
310 310
311struct ide_taskfile { 311struct ide_taskfile {
312 u8 hob_data; /* 0: high data byte (for TASKFILE IOCTL) */ 312 u8 hob_data; /* 0: high data byte (for TASKFILE IOCTL) */
313 /* 1-5: additional data to support LBA48 */
314 union {
315 u8 hob_error; /* read: error */
316 u8 hob_feature; /* write: feature */
317 };
313 318
314 u8 hob_feature; /* 1-5: additional data to support LBA48 */
315 u8 hob_nsect; 319 u8 hob_nsect;
316 u8 hob_lbal; 320 u8 hob_lbal;
317 u8 hob_lbam; 321 u8 hob_lbam;
@@ -352,6 +356,8 @@ struct ide_cmd {
352 356
353 unsigned int nbytes; 357 unsigned int nbytes;
354 unsigned int nleft; 358 unsigned int nleft;
359 unsigned int last_xfer_len;
360
355 struct scatterlist *cursg; 361 struct scatterlist *cursg;
356 unsigned int cursg_ofs; 362 unsigned int cursg_ofs;
357 363
@@ -375,7 +381,7 @@ enum {
375 * With each packet command, we allocate a buffer of IDE_PC_BUFFER_SIZE bytes. 381 * With each packet command, we allocate a buffer of IDE_PC_BUFFER_SIZE bytes.
376 * This is used for several packet commands (not for READ/WRITE commands). 382 * This is used for several packet commands (not for READ/WRITE commands).
377 */ 383 */
378#define IDE_PC_BUFFER_SIZE 256 384#define IDE_PC_BUFFER_SIZE 64
379#define ATAPI_WAIT_PC (60 * HZ) 385#define ATAPI_WAIT_PC (60 * HZ)
380 386
381struct ide_atapi_pc { 387struct ide_atapi_pc {
@@ -413,9 +419,6 @@ struct ide_atapi_pc {
413 struct idetape_bh *bh; 419 struct idetape_bh *bh;
414 char *b_data; 420 char *b_data;
415 421
416 struct scatterlist *sg;
417 unsigned int sg_cnt;
418
419 unsigned long timeout; 422 unsigned long timeout;
420}; 423};
421 424
@@ -456,11 +459,6 @@ enum {
456 IDE_AFLAG_TOCADDR_AS_BCD = (1 << 3), 459 IDE_AFLAG_TOCADDR_AS_BCD = (1 << 3),
457 /* TOC track numbers are in BCD. */ 460 /* TOC track numbers are in BCD. */
458 IDE_AFLAG_TOCTRACKS_AS_BCD = (1 << 4), 461 IDE_AFLAG_TOCTRACKS_AS_BCD = (1 << 4),
459 /*
460 * Drive does not provide data in multiples of SECTOR_SIZE
461 * when more than one interrupt is needed.
462 */
463 IDE_AFLAG_LIMIT_NFRAMES = (1 << 5),
464 /* Saved TOC information is current. */ 462 /* Saved TOC information is current. */
465 IDE_AFLAG_TOC_VALID = (1 << 6), 463 IDE_AFLAG_TOC_VALID = (1 << 6),
466 /* We think that the drive door is locked. */ 464 /* We think that the drive door is locked. */
@@ -605,7 +603,7 @@ struct ide_drive_s {
605 603
606 unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ 604 unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */
607 unsigned int cyl; /* "real" number of cyls */ 605 unsigned int cyl; /* "real" number of cyls */
608 unsigned int drive_data; /* used by set_pio_mode/selectproc */ 606 unsigned int drive_data; /* used by set_pio_mode/dev_select() */
609 unsigned int failures; /* current failure count */ 607 unsigned int failures; /* current failure count */
610 unsigned int max_failures; /* maximum allowed failure count */ 608 unsigned int max_failures; /* maximum allowed failure count */
611 u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ 609 u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */
@@ -661,9 +659,9 @@ struct ide_tp_ops {
661 void (*exec_command)(struct hwif_s *, u8); 659 void (*exec_command)(struct hwif_s *, u8);
662 u8 (*read_status)(struct hwif_s *); 660 u8 (*read_status)(struct hwif_s *);
663 u8 (*read_altstatus)(struct hwif_s *); 661 u8 (*read_altstatus)(struct hwif_s *);
662 void (*write_devctl)(struct hwif_s *, u8);
664 663
665 void (*set_irq)(struct hwif_s *, int); 664 void (*dev_select)(ide_drive_t *);
666
667 void (*tf_load)(ide_drive_t *, struct ide_cmd *); 665 void (*tf_load)(ide_drive_t *, struct ide_cmd *);
668 void (*tf_read)(ide_drive_t *, struct ide_cmd *); 666 void (*tf_read)(ide_drive_t *, struct ide_cmd *);
669 667
@@ -681,7 +679,6 @@ extern const struct ide_tp_ops default_tp_ops;
681 * @init_dev: host specific initialization of a device 679 * @init_dev: host specific initialization of a device
682 * @set_pio_mode: routine to program host for PIO mode 680 * @set_pio_mode: routine to program host for PIO mode
683 * @set_dma_mode: routine to program host for DMA mode 681 * @set_dma_mode: routine to program host for DMA mode
684 * @selectproc: tweaks hardware to select drive
685 * @reset_poll: chipset polling based on hba specifics 682 * @reset_poll: chipset polling based on hba specifics
686 * @pre_reset: chipset specific changes to default for device-hba resets 683 * @pre_reset: chipset specific changes to default for device-hba resets
687 * @resetproc: routine to reset controller after a disk reset 684 * @resetproc: routine to reset controller after a disk reset
@@ -698,7 +695,6 @@ struct ide_port_ops {
698 void (*init_dev)(ide_drive_t *); 695 void (*init_dev)(ide_drive_t *);
699 void (*set_pio_mode)(ide_drive_t *, const u8); 696 void (*set_pio_mode)(ide_drive_t *, const u8);
700 void (*set_dma_mode)(ide_drive_t *, const u8); 697 void (*set_dma_mode)(ide_drive_t *, const u8);
701 void (*selectproc)(ide_drive_t *);
702 int (*reset_poll)(ide_drive_t *); 698 int (*reset_poll)(ide_drive_t *);
703 void (*pre_reset)(ide_drive_t *); 699 void (*pre_reset)(ide_drive_t *);
704 void (*resetproc)(ide_drive_t *); 700 void (*resetproc)(ide_drive_t *);
@@ -719,8 +715,10 @@ struct ide_dma_ops {
719 int (*dma_end)(struct ide_drive_s *); 715 int (*dma_end)(struct ide_drive_s *);
720 int (*dma_test_irq)(struct ide_drive_s *); 716 int (*dma_test_irq)(struct ide_drive_s *);
721 void (*dma_lost_irq)(struct ide_drive_s *); 717 void (*dma_lost_irq)(struct ide_drive_s *);
718 /* below ones are optional */
719 int (*dma_check)(struct ide_drive_s *, struct ide_cmd *);
722 int (*dma_timer_expiry)(struct ide_drive_s *); 720 int (*dma_timer_expiry)(struct ide_drive_s *);
723 void (*dma_timeout)(struct ide_drive_s *); 721 void (*dma_clear)(struct ide_drive_s *);
724 /* 722 /*
725 * The following method is optional and only required to be 723 * The following method is optional and only required to be
726 * implemented for the SFF-8038i compatible controllers. 724 * implemented for the SFF-8038i compatible controllers.
@@ -1169,18 +1167,15 @@ void ide_tf_dump(const char *, struct ide_taskfile *);
1169void ide_exec_command(ide_hwif_t *, u8); 1167void ide_exec_command(ide_hwif_t *, u8);
1170u8 ide_read_status(ide_hwif_t *); 1168u8 ide_read_status(ide_hwif_t *);
1171u8 ide_read_altstatus(ide_hwif_t *); 1169u8 ide_read_altstatus(ide_hwif_t *);
1170void ide_write_devctl(ide_hwif_t *, u8);
1172 1171
1173void ide_set_irq(ide_hwif_t *, int); 1172void ide_dev_select(ide_drive_t *);
1174
1175void ide_tf_load(ide_drive_t *, struct ide_cmd *); 1173void ide_tf_load(ide_drive_t *, struct ide_cmd *);
1176void ide_tf_read(ide_drive_t *, struct ide_cmd *); 1174void ide_tf_read(ide_drive_t *, struct ide_cmd *);
1177 1175
1178void ide_input_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int); 1176void ide_input_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int);
1179void ide_output_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int); 1177void ide_output_data(ide_drive_t *, struct ide_cmd *, void *, unsigned int);
1180 1178
1181int ide_io_buffers(ide_drive_t *, struct ide_atapi_pc *, unsigned int, int);
1182
1183extern void SELECT_DRIVE(ide_drive_t *);
1184void SELECT_MASK(ide_drive_t *, int); 1179void SELECT_MASK(ide_drive_t *, int);
1185 1180
1186u8 ide_read_error(ide_drive_t *); 1181u8 ide_read_error(ide_drive_t *);
@@ -1226,6 +1221,8 @@ ide_startstop_t ide_issue_pc(ide_drive_t *, struct ide_cmd *);
1226 1221
1227ide_startstop_t do_rw_taskfile(ide_drive_t *, struct ide_cmd *); 1222ide_startstop_t do_rw_taskfile(ide_drive_t *, struct ide_cmd *);
1228 1223
1224void ide_pio_bytes(ide_drive_t *, struct ide_cmd *, unsigned int, unsigned int);
1225
1229void ide_finish_cmd(ide_drive_t *, struct ide_cmd *, u8); 1226void ide_finish_cmd(ide_drive_t *, struct ide_cmd *, u8);
1230 1227
1231int ide_raw_taskfile(ide_drive_t *, struct ide_cmd *, u8 *, u16); 1228int ide_raw_taskfile(ide_drive_t *, struct ide_cmd *, u8 *, u16);
@@ -1443,8 +1440,8 @@ ide_startstop_t ide_dma_intr(ide_drive_t *);
1443int ide_allocate_dma_engine(ide_hwif_t *); 1440int ide_allocate_dma_engine(ide_hwif_t *);
1444void ide_release_dma_engine(ide_hwif_t *); 1441void ide_release_dma_engine(ide_hwif_t *);
1445 1442
1446int ide_build_sglist(ide_drive_t *, struct ide_cmd *); 1443int ide_dma_prepare(ide_drive_t *, struct ide_cmd *);
1447void ide_destroy_dmatable(ide_drive_t *); 1444void ide_dma_unmap_sg(ide_drive_t *, struct ide_cmd *);
1448 1445
1449#ifdef CONFIG_BLK_DEV_IDEDMA_SFF 1446#ifdef CONFIG_BLK_DEV_IDEDMA_SFF
1450int config_drive_for_dma(ide_drive_t *); 1447int config_drive_for_dma(ide_drive_t *);
@@ -1462,7 +1459,6 @@ static inline int config_drive_for_dma(ide_drive_t *drive) { return 0; }
1462#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */ 1459#endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
1463 1460
1464void ide_dma_lost_irq(ide_drive_t *); 1461void ide_dma_lost_irq(ide_drive_t *);
1465void ide_dma_timeout(ide_drive_t *);
1466ide_startstop_t ide_dma_timeout_retry(ide_drive_t *, int); 1462ide_startstop_t ide_dma_timeout_retry(ide_drive_t *, int);
1467 1463
1468#else 1464#else
@@ -1478,8 +1474,10 @@ static inline void ide_check_dma_crc(ide_drive_t *drive) { ; }
1478static inline ide_startstop_t ide_dma_intr(ide_drive_t *drive) { return ide_stopped; } 1474static inline ide_startstop_t ide_dma_intr(ide_drive_t *drive) { return ide_stopped; }
1479static inline ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) { return ide_stopped; } 1475static inline ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) { return ide_stopped; }
1480static inline void ide_release_dma_engine(ide_hwif_t *hwif) { ; } 1476static inline void ide_release_dma_engine(ide_hwif_t *hwif) { ; }
1481static inline int ide_build_sglist(ide_drive_t *drive, 1477static inline int ide_dma_prepare(ide_drive_t *drive,
1482 struct ide_cmd *cmd) { return 0; } 1478 struct ide_cmd *cmd) { return 1; }
1479static inline void ide_dma_unmap_sg(ide_drive_t *drive,
1480 struct ide_cmd *cmd) { ; }
1483#endif /* CONFIG_BLK_DEV_IDEDMA */ 1481#endif /* CONFIG_BLK_DEV_IDEDMA */
1484 1482
1485#ifdef CONFIG_BLK_DEV_IDEACPI 1483#ifdef CONFIG_BLK_DEV_IDEACPI