diff options
| author | Martin Dalecki <dalecki@evision-ventures.com> | 2002-02-19 01:20:06 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@penguin.transmeta.com> | 2002-02-19 01:20:06 -0800 |
| commit | 69f0d4b02c7cd9e629d1a0150318abc4bd38238b (patch) | |
| tree | 820177318e9c20a710de650bae14a8dbbe0a4496 /include/linux/ide.h | |
| parent | 706afa066be0cc5879de7d0f4594a4a762897d22 (diff) | |
[PATCH] 2.5.5-pre1 IDE cleanup 9
1. Kill the ide-probe-mod by merging it with ide-mod. There is *really*
no reaons for having this stuff split up into two different
modules unless you wan't to create artificial module dependancies
and waste space of page boundaries during memmory allocation for the
modules
2. Kill the ide_module_t - which is unnecessary and presents a
"reimplementation" of module handling inside the ide driver. This
is achieved by attaching the initialization routine ot the
ide_driver_t, which will be gone next time, since there is no sane
reason apparently, which this couldn't be done during the
module-generic initialization of the corresponding driver module.
3. Kill unnecessary tagging of "subdriver" with IDE_SUBDRIVER_VERSION -
we have plenty of other mechanisms for module consistency checking.
And anyway the ide code didn't any consistence checks on this value
at all.
NOTE: The ide_(un)register_module() functions will be killed in next round.
Diffstat (limited to 'include/linux/ide.h')
| -rw-r--r-- | include/linux/ide.h | 57 |
1 files changed, 22 insertions, 35 deletions
diff --git a/include/linux/ide.h b/include/linux/ide.h index daa84dc1775f..b734a586cd45 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h @@ -99,8 +99,8 @@ typedef unsigned char byte; /* used everywhere */ #undef REALLY_FAST_IO #endif -#define HWIF(drive) ((ide_hwif_t *)((drive)->hwif)) -#define HWGROUP(drive) ((ide_hwgroup_t *)(HWIF(drive)->hwgroup)) +#define HWIF(drive) ((drive)->hwif) +#define HWGROUP(drive) (HWIF(drive)->hwgroup) /* * Definitions for accessing IDE controller registers @@ -371,7 +371,7 @@ struct ide_settings_s; typedef struct ide_drive_s { request_queue_t queue; /* request queue */ - struct ide_drive_s *next; /* circular list of hwgroup drives */ + struct ide_drive_s *next; /* circular list of hwgroup drives */ unsigned long sleep; /* sleep until this time */ unsigned long service_start; /* time we started last request */ unsigned long service_time; /* service time of last request */ @@ -531,7 +531,7 @@ typedef struct ide_pci_devid_s { typedef struct hwif_s { struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ - void *hwgroup; /* actually (ide_hwgroup_t *) */ + struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */ ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */ hw_regs_t hw; /* Hardware info */ ide_drive_t drives[MAX_DRIVES]; /* drive info */ @@ -702,10 +702,6 @@ read_proc_t proc_ide_read_geometry; /* * Subdrivers support. */ -#define IDE_SUBDRIVER_VERSION 1 - -typedef void (ide_setting_proc)(ide_drive_t *); - typedef struct ide_driver_s { const char *name; byte media; @@ -726,25 +722,15 @@ typedef struct ide_driver_s { unsigned long (*capacity)(ide_drive_t *); ide_startstop_t (*special)(ide_drive_t *); ide_proc_entry_t *proc; + int (*driver_init)(void); int (*driver_reinit)(ide_drive_t *); -} ide_driver_t; - -#define DRIVER(drive) ((ide_driver_t *)((drive)->driver)) - -/* - * IDE modules. - */ -#define IDE_CHIPSET_MODULE 0 /* not supported yet */ -#define IDE_PROBE_MODULE 1 -#define IDE_DRIVER_MODULE 2 + /* FIXME: Single linked list of drivers for iteration. + */ + struct ide_driver_s *next; +} ide_driver_t; -typedef struct ide_module_s { - int type; - int (*init)(void); - void *info; - struct ide_module_s *next; -} ide_module_t; +#define DRIVER(drive) ((drive)->driver) /* * ide_hwifs[] is the master data structure used to keep track @@ -755,9 +741,8 @@ typedef struct ide_module_s { * */ #ifndef _IDE_C -extern ide_hwif_t ide_hwifs[]; /* master data repository */ -extern ide_module_t *ide_modules; -extern ide_module_t *ide_probe; +extern struct hwif_s ide_hwifs[]; /* master data repository */ +extern struct ide_driver_s *ide_drivers; #endif extern int noautodma; @@ -1060,9 +1045,11 @@ extern ide_proc_entry_t generic_subdriver_entries[]; int ide_reinit_drive (ide_drive_t *drive); #ifdef _IDE_C -#ifdef CONFIG_BLK_DEV_IDE -int ideprobe_init (void); -#endif /* CONFIG_BLK_DEV_IDE */ +# ifdef CONFIG_BLK_DEV_IDE +/* Probe for devices attached to the systems host controllers. + */ +extern int ideprobe_init (void); +# endif #ifdef CONFIG_BLK_DEV_IDEDISK int idedisk_reinit (ide_drive_t *drive); int idedisk_init (void); @@ -1085,12 +1072,12 @@ int idescsi_init (void); #endif /* CONFIG_BLK_DEV_IDESCSI */ #endif /* _IDE_C */ -int ide_register_module (ide_module_t *module); -void ide_unregister_module (ide_module_t *module); +extern int ide_register_module (struct ide_driver_s *d); +extern void ide_unregister_module (struct ide_driver_s *d); ide_drive_t *ide_scan_devices (byte media, const char *name, ide_driver_t *driver, int n); -int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int version); -int ide_unregister_subdriver (ide_drive_t *drive); -int ide_replace_subdriver(ide_drive_t *drive, const char *driver); +extern int ide_register_subdriver(ide_drive_t *drive, ide_driver_t *driver); +extern int ide_unregister_subdriver(ide_drive_t *drive); +extern int ide_replace_subdriver(ide_drive_t *drive, const char *driver); #ifdef CONFIG_BLK_DEV_IDEPCI #define ON_BOARD 1 |
