diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:23 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:23 -0400 |
commit | f74c91413ec6140ee0553180c5f56fdd27c22a2e (patch) | |
tree | 75ba3f7000ba290dc19b1523b12ab95dc5c7b1ea /include/linux/ide.h | |
parent | 50672e5d7486c9ab312432cbe180ac071f1de8e0 (diff) |
ide: add warm-plug support for IDE devices (take 2)
* Add 'struct class ide_port_class' ('ide_port' class) and a 'struct
device *portdev' ('ide_port' class device) in ide_hwif_t.
* Register 'ide_port' class in ide_init() and unregister it in
cleanup_module().
* Create ->portdev in ide_register_port () and unregister it in
ide_unregister().
* Add "delete_devices" class device attribute for unregistering IDE devices
on a port and "scan" one for probing+registering IDE devices on a port.
* Add ide_sysfs_register_port() helper for registering "delete_devices"
and "scan" attributes with ->portdev. Call it in ide_device_add_all().
* Document IDE warm-plug support in Documentation/ide/warm-plug-howto.txt.
v2:
* Convert patch from using 'struct class_device' to use 'struct device'.
(thanks to Kay Sievers for doing it)
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'include/linux/ide.h')
-rw-r--r-- | include/linux/ide.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index e43570a1920..9cebf305408 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -579,7 +579,9 @@ typedef struct hwif_s { | |||
579 | unsigned mmio : 1; /* host uses MMIO */ | 579 | unsigned mmio : 1; /* host uses MMIO */ |
580 | unsigned straight8 : 1; /* Alan's straight 8 check */ | 580 | unsigned straight8 : 1; /* Alan's straight 8 check */ |
581 | 581 | ||
582 | struct device gendev; | 582 | struct device gendev; |
583 | struct device *portdev; | ||
584 | |||
583 | struct completion gendev_rel_comp; /* To deal with device release() */ | 585 | struct completion gendev_rel_comp; /* To deal with device release() */ |
584 | 586 | ||
585 | void *hwif_data; /* extra hwif data */ | 587 | void *hwif_data; /* extra hwif data */ |
@@ -1275,6 +1277,7 @@ extern struct mutex ide_cfg_mtx; | |||
1275 | #define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable_in_hardirq(); } while (0) | 1277 | #define local_irq_set(flags) do { local_save_flags((flags)); local_irq_enable_in_hardirq(); } while (0) |
1276 | 1278 | ||
1277 | extern struct bus_type ide_bus_type; | 1279 | extern struct bus_type ide_bus_type; |
1280 | extern struct class *ide_port_class; | ||
1278 | 1281 | ||
1279 | /* check if CACHE FLUSH (EXT) command is supported (bits defined in ATA-6) */ | 1282 | /* check if CACHE FLUSH (EXT) command is supported (bits defined in ATA-6) */ |
1280 | #define ide_id_has_flush_cache(id) ((id)->cfs_enable_2 & 0x3000) | 1283 | #define ide_id_has_flush_cache(id) ((id)->cfs_enable_2 & 0x3000) |