version 1.1, 2008/06/03 10:38:41 |
version 1.2, 2008/08/08 13:37:11 |
|
|
#define NULL_DEVICE ((device_t)0) |
#define NULL_DEVICE ((device_t)0) |
#define NULL_TASK ((task_t)0) |
#define NULL_TASK ((task_t)0) |
|
|
|
#ifndef CONFIG_AUTOCONF |
|
|
|
|
/* |
/* |
* Driver structure |
* Driver structure |
* |
* |
|
|
const int order; /* Initialize order */ |
const int order; /* Initialize order */ |
int (*init)(void); /* Initialize routine */ |
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 |
* Device I/O table |