Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/subr_bus.c
Show First 20 Lines • Show All 2,711 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
void | void | ||||
device_verbose(device_t dev) | device_verbose(device_t dev) | ||||
{ | { | ||||
dev->flags &= ~DF_QUIET; | dev->flags &= ~DF_QUIET; | ||||
} | } | ||||
ssize_t | ssize_t | ||||
device_get_property(device_t dev, const char *prop, void *val, size_t sz) | device_get_property(device_t dev, const char *prop, void *val, size_t sz, | ||||
device_property_type_t type) | |||||
{ | { | ||||
device_t bus = device_get_parent(dev); | device_t bus = device_get_parent(dev); | ||||
return (BUS_GET_PROPERTY(bus, dev, prop, val, sz)); | switch (type) { | ||||
case DEVICE_PROP_ANY: | |||||
case DEVICE_PROP_BUFFER: | |||||
break; | |||||
case DEVICE_PROP_UINT32: | |||||
if (sz % 4 != 0) | |||||
return (-1); | |||||
break; | |||||
case DEVICE_PROP_UINT64: | |||||
if (sz % 8 != 0) | |||||
return (-1); | |||||
break; | |||||
default: | |||||
return (-1); | |||||
} | } | ||||
return (BUS_GET_PROPERTY(bus, dev, prop, val, sz, type)); | |||||
} | |||||
bool | bool | ||||
device_has_property(device_t dev, const char *prop) | device_has_property(device_t dev, const char *prop) | ||||
{ | { | ||||
return (device_get_property(dev, prop, NULL, 0) >= 0); | return (device_get_property(dev, prop, NULL, 0, DEVICE_PROP_ANY) >= 0); | ||||
} | } | ||||
/** | /** | ||||
* @brief Return non-zero if the DF_QUIET_CHIDLREN flag is set on the device | * @brief Return non-zero if the DF_QUIET_CHIDLREN flag is set on the device | ||||
*/ | */ | ||||
int | int | ||||
device_has_quiet_children(device_t dev) | device_has_quiet_children(device_t dev) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 3,343 Lines • Show Last 20 Lines |