version 1.119, 2007/07/20 22:15:47 |
version 1.119.4.1, 2007/08/03 22:17:29 |
Line 102 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 102 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#include <sys/unistd.h> |
#include <sys/unistd.h> |
#include <sys/fcntl.h> |
#include <sys/fcntl.h> |
#include <sys/lockf.h> |
#include <sys/lockf.h> |
|
#include <sys/callout.h> |
|
|
#include <sys/disk.h> |
#include <sys/disk.h> |
|
|
Line 1076 config_devalloc(const device_t parent, c |
|
Line 1077 config_devalloc(const device_t parent, c |
|
char num[10]; |
char num[10]; |
device_t dev; |
device_t dev; |
const struct cfiattrdata *ia; |
const struct cfiattrdata *ia; |
|
pnp_device_t *pnp; |
|
|
cd = config_cfdriver_lookup(cf->cf_name); |
cd = config_cfdriver_lookup(cf->cf_name); |
if (cd == NULL) |
if (cd == NULL) |
Line 1118 config_devalloc(const device_t parent, c |
|
Line 1120 config_devalloc(const device_t parent, c |
|
M_ZERO | (cold ? M_NOWAIT : M_WAITOK)); |
M_ZERO | (cold ? M_NOWAIT : M_WAITOK)); |
if (!dev) |
if (!dev) |
panic("config_devalloc: memory allocation for device softc failed"); |
panic("config_devalloc: memory allocation for device softc failed"); |
|
|
|
pnp = device_pnp(dev); |
|
|
dev->dv_class = cd->cd_class; |
dev->dv_class = cd->cd_class; |
dev->dv_cfdata = cf; |
dev->dv_cfdata = cf; |
dev->dv_cfdriver = cd; |
dev->dv_cfdriver = cd; |
dev->dv_cfattach = ca; |
dev->dv_cfattach = ca; |
dev->dv_unit = myunit; |
dev->dv_unit = myunit; |
|
callout_init(&pnp->pnp_idle, 0); |
memcpy(dev->dv_xname, cd->cd_name, lname); |
memcpy(dev->dv_xname, cd->cd_name, lname); |
memcpy(dev->dv_xname + lname, xunit, lunit); |
memcpy(dev->dv_xname + lname, xunit, lunit); |
dev->dv_parent = parent; |
dev->dv_parent = parent; |
Line 1162 config_attach_loc(device_t parent, cfdat |
|
Line 1168 config_attach_loc(device_t parent, cfdat |
|
const int *locs, void *aux, cfprint_t print) |
const int *locs, void *aux, cfprint_t print) |
{ |
{ |
device_t dev; |
device_t dev; |
|
pnp_device_t *pnp; |
struct cftable *ct; |
struct cftable *ct; |
const char *drvname; |
const char *drvname; |
|
|
Line 1230 config_attach_loc(device_t parent, cfdat |
|
Line 1237 config_attach_loc(device_t parent, cfdat |
|
#ifdef __HAVE_DEVICE_REGISTER |
#ifdef __HAVE_DEVICE_REGISTER |
device_register(dev, aux); |
device_register(dev, aux); |
#endif |
#endif |
|
|
#if defined(SPLASHSCREEN) && defined(SPLASHSCREEN_PROGRESS) |
#if defined(SPLASHSCREEN) && defined(SPLASHSCREEN_PROGRESS) |
if (splash_progress_state) |
if (splash_progress_state) |
splash_progress_update(splash_progress_state); |
splash_progress_update(splash_progress_state); |
Line 1239 config_attach_loc(device_t parent, cfdat |
|
Line 1247 config_attach_loc(device_t parent, cfdat |
|
if (splash_progress_state) |
if (splash_progress_state) |
splash_progress_update(splash_progress_state); |
splash_progress_update(splash_progress_state); |
#endif |
#endif |
|
|
|
pnp = device_pnp(dev); |
|
if (pnp->pnp_power == NULL) |
|
aprint_error("%s: WARNING: power management not supported\n", |
|
device_xname(dev)); |
|
|
config_process_deferred(&deferred_config_queue, dev); |
config_process_deferred(&deferred_config_queue, dev); |
return (dev); |
return (dev); |
} |
} |
Line 1671 device_parent(device_t dev) |
|
Line 1685 device_parent(device_t dev) |
|
return (dev->dv_parent); |
return (dev->dv_parent); |
} |
} |
|
|
|
pnp_device_t * |
|
device_pnp(device_t dev) |
|
{ |
|
|
|
return (&dev->dv_pnp); |
|
} |
|
|
bool |
bool |
device_is_active(device_t dev) |
device_is_active(device_t dev) |
{ |
{ |