Changeset View
Changeset View
Standalone View
Standalone View
stable/10/sys/xen/xenbus/xenbusb.c
Show First 20 Lines • Show All 555 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
static void | static void | ||||
xenbusb_devices_changed(struct xs_watch *watch, const char **vec, | xenbusb_devices_changed(struct xs_watch *watch, const char **vec, | ||||
unsigned int len) | unsigned int len) | ||||
{ | { | ||||
struct xenbusb_softc *xbs; | struct xenbusb_softc *xbs; | ||||
device_t dev; | device_t dev; | ||||
char *node; | char *node; | ||||
char *bus; | |||||
char *type; | char *type; | ||||
char *id; | char *id; | ||||
char *p; | char *p; | ||||
u_int component; | u_int component; | ||||
xbs = (struct xenbusb_softc *)watch->callback_data; | xbs = (struct xenbusb_softc *)watch->callback_data; | ||||
dev = xbs->xbs_dev; | dev = xbs->xbs_dev; | ||||
if (len <= XS_WATCH_PATH) { | if (len <= XS_WATCH_PATH) { | ||||
device_printf(dev, "xenbusb_devices_changed: " | device_printf(dev, "xenbusb_devices_changed: " | ||||
"Short Event Data.\n"); | "Short Event Data.\n"); | ||||
return; | return; | ||||
} | } | ||||
node = strdup(vec[XS_WATCH_PATH], M_XENBUS); | node = strdup(vec[XS_WATCH_PATH], M_XENBUS); | ||||
p = strchr(node, '/'); | p = strchr(node, '/'); | ||||
if (p == NULL) | if (p == NULL) | ||||
goto out; | goto out; | ||||
bus = node; | |||||
*p = 0; | *p = 0; | ||||
type = p + 1; | type = p + 1; | ||||
p = strchr(type, '/'); | p = strchr(type, '/'); | ||||
if (p == NULL) | if (p == NULL) | ||||
goto out; | goto out; | ||||
*p++ = 0; | *p++ = 0; | ||||
▲ Show 20 Lines • Show All 381 Lines • Show Last 20 Lines |