=================================================================== RCS file: /cvs/prex-old/dev/include/driver.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- prex-old/dev/include/driver.h 2008/06/03 10:38:41 1.1 +++ prex-old/dev/include/driver.h 2008/08/08 13:37:11 1.2 @@ -54,6 +54,9 @@ #define NULL_DEVICE ((device_t)0) #define NULL_TASK ((task_t)0) +#ifndef CONFIG_AUTOCONF + + /* * Driver structure * @@ -65,6 +68,57 @@ const int order; /* Initialize order */ int (*init)(void); /* Initialize routine */ }; +#else /* CONFIG_AUTOCONF */ + +#define CONFIG_XNAMELEN 16 /* maximum name for device (name+unit) */ + +/* + * Generic information that is held for every attached device. + */ +struct device { + void *dv_data; /* private data */ + int dv_unit; /* unit number (starting from 0) */ + char *dv_xname; /* name */ + unsigned long dv_flags; + + struct device *dv_parent; /* parent device */ +}; + +/* + * Data structure that describes device driver. + */ +struct driver { + char *dr_name; /* abstract name for a device */ + int dr_datasize;/* sizeof private data structure */ + + int (*dr_match)(struct device *parent, void *aux); + int (*dr_attach)(struct device *parent, struct device *self, void *aux); + int (*dr_detach)(struct device *parent, struct device *self, void *aux); + /* XXX dr_search() ? */ + int dr_nunits; /* number of attached units */ +}; + +/* + * Autoconf prototypes. + */ +void config_attach_rootdev(void); +int config_search_children(struct device *self, void *aux); +struct driver *config_find_driver(const char *name); +struct device *config_alloc_device(struct driver *drv); +void config_free_device(struct device *dev); + +/* + * Attachment information. + */ +struct attachment { + const char *at_childname; + const char *at_parentname; + const int at_parentunit; /* -1 for ALL */ + const char *at_helpername; + const unsigned long at_flags; +}; + +#endif /* !CONFIG_AUTOCONF */ /* * Device I/O table