Lines Matching refs:dev

72 xenbus_watch_path(struct xenbus_device *dev, const char *path,
87 xenbus_dev_fatal(dev, err, "adding watch on %s", path);
95 xenbus_watch_path2(struct xenbus_device *dev, const char *path,
108 err = xenbus_watch_path(dev, state, watch, callback);
126 xenbus_switch_state(struct xenbus_device *dev, xenbus_transaction_t xbt,
132 err = xenbus_scanf(xbt, dev->nodename, "state", "%d", &current_state);
143 err = xenbus_printf(xbt, dev->nodename, "state", "%d", state);
145 xenbus_dev_fatal(dev, err, "writing new state");
157 error_path(struct xenbus_device *dev)
161 path_buffer = kmem_alloc(strlen("error/") + strlen(dev->nodename) +
165 (void) strcpy(path_buffer + strlen("error/"), dev->nodename);
171 common_dev_error(struct xenbus_device *dev, int err, const char *fmt,
186 dev->has_error = 1;
188 path_buffer = error_path(dev);
192 dev->nodename, printf_buffer);
198 dev->nodename, printf_buffer);
211 xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...)
216 common_dev_error(dev, err, fmt, ap);
222 xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...)
227 common_dev_error(dev, err, fmt, ap);
230 (void) xenbus_switch_state(dev, XBT_NULL, XenbusStateClosing);
235 xenbus_dev_ok(struct xenbus_device *dev)
237 if (dev->has_error) {
238 if (xenbus_rm(NULL, dev->nodename, "error") != 0)
240 dev->nodename);
242 dev->has_error = 0;
247 xenbus_grant_ring(struct xenbus_device *dev, unsigned long ring_mfn)
249 int err = gnttab_grant_foreign_access(dev->otherend_id, ring_mfn, 0);
251 xenbus_dev_fatal(dev, err, "granting access to ring page");
257 xenbus_alloc_evtchn(struct xenbus_device *dev, int *port)
261 err = xen_alloc_unbound_evtchn(dev->otherend_id, port);
263 xenbus_dev_fatal(dev, err, "allocating event channel");