diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-17 12:09:14 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-17 12:09:14 -0400 |
commit | 806f80a6fc203ad0bde84e5a9e94572617d2ae45 (patch) | |
tree | 20c684323e6e9f24af96df84008f06425a67ec6a /include | |
parent | 79cb380397c834a35952d8497651d93b543ef968 (diff) |
ide: add generic ATA/ATAPI disk driver
* Add struct ide_disk_ops containing protocol specific methods.
* Add 'struct ide_disk_ops *' to ide_drive_t.
* Convert ide-{disk,floppy} drivers to use struct ide_disk_ops.
* Merge ide-{disk,floppy} drivers into generic ide-gd driver.
While at it:
- ide_disk_init_capacity() -> ide_disk_get_capacity()
Acked-by: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ide.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index 488808891acb..89e53cfbc787 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -461,6 +461,23 @@ struct ide_acpi_drive_link; | |||
461 | struct ide_acpi_hwif_link; | 461 | struct ide_acpi_hwif_link; |
462 | #endif | 462 | #endif |
463 | 463 | ||
464 | struct ide_drive_s; | ||
465 | |||
466 | struct ide_disk_ops { | ||
467 | int (*check)(struct ide_drive_s *, const char *); | ||
468 | int (*get_capacity)(struct ide_drive_s *); | ||
469 | void (*setup)(struct ide_drive_s *); | ||
470 | void (*flush)(struct ide_drive_s *); | ||
471 | int (*init_media)(struct ide_drive_s *, struct gendisk *); | ||
472 | int (*set_doorlock)(struct ide_drive_s *, struct gendisk *, | ||
473 | int); | ||
474 | ide_startstop_t (*do_request)(struct ide_drive_s *, struct request *, | ||
475 | sector_t); | ||
476 | int (*end_request)(struct ide_drive_s *, int, int); | ||
477 | int (*ioctl)(struct ide_drive_s *, struct inode *, | ||
478 | struct file *, unsigned int, unsigned long); | ||
479 | }; | ||
480 | |||
464 | /* ATAPI device flags */ | 481 | /* ATAPI device flags */ |
465 | enum { | 482 | enum { |
466 | IDE_AFLAG_DRQ_INTERRUPT = (1 << 0), | 483 | IDE_AFLAG_DRQ_INTERRUPT = (1 << 0), |
@@ -594,6 +611,8 @@ struct ide_drive_s { | |||
594 | #endif | 611 | #endif |
595 | struct hwif_s *hwif; /* actually (ide_hwif_t *) */ | 612 | struct hwif_s *hwif; /* actually (ide_hwif_t *) */ |
596 | 613 | ||
614 | const struct ide_disk_ops *disk_ops; | ||
615 | |||
597 | unsigned long dev_flags; | 616 | unsigned long dev_flags; |
598 | 617 | ||
599 | unsigned long sleep; /* sleep until this time */ | 618 | unsigned long sleep; /* sleep until this time */ |