• Home
  • Raw
  • Download

Lines Matching +full:forced +full:- +full:comms

5  * Copyright (C) 2005 Mike Wray, Hewlett-Packard
60 #include <xen/xen-ops.h>
86 for (; *arr->devicetype != '\0'; arr++) { in match_device()
87 if (!strcmp(arr->devicetype, dev->devicetype)) in match_device()
97 if (!drv->ids) in xenbus_match()
100 return match_device(drv->ids, to_xenbus_device(_dev)) != NULL; in xenbus_match()
107 kfree(dev->otherend); in free_otherend_details()
108 dev->otherend = NULL; in free_otherend_details()
114 if (dev->otherend_watch.node) { in free_otherend_watch()
115 unregister_xenbus_watch(&dev->otherend_watch); in free_otherend_watch()
116 kfree(dev->otherend_watch.node); in free_otherend_watch()
117 dev->otherend_watch.node = NULL; in free_otherend_watch()
124 struct xenbus_driver *drv = to_xenbus_driver(dev->dev.driver); in talk_to_otherend()
129 return drv->read_otherend_details(dev); in talk_to_otherend()
137 container_of(dev->dev.bus, struct xen_bus_type, bus); in watch_otherend()
139 return xenbus_watch_pathfmt(dev, &dev->otherend_watch, in watch_otherend()
140 bus->otherend_will_handle, in watch_otherend()
141 bus->otherend_changed, in watch_otherend()
142 "%s/%s", dev->otherend, "state"); in watch_otherend()
149 int err = xenbus_gather(XBT_NIL, xendev->nodename, in xenbus_read_otherend_details()
150 id_node, "%i", &xendev->otherend_id, in xenbus_read_otherend_details()
151 path_node, NULL, &xendev->otherend, in xenbus_read_otherend_details()
156 xendev->nodename); in xenbus_read_otherend_details()
159 if (strlen(xendev->otherend) == 0 || in xenbus_read_otherend_details()
160 !xenbus_exists(XBT_NIL, xendev->otherend, "")) { in xenbus_read_otherend_details()
161 xenbus_dev_fatal(xendev, -ENOENT, in xenbus_read_otherend_details()
164 xendev->nodename); in xenbus_read_otherend_details()
166 return -ENOENT; in xenbus_read_otherend_details()
179 struct xenbus_driver *drv = to_xenbus_driver(dev->dev.driver); in xenbus_otherend_changed()
184 if (!dev->otherend || in xenbus_otherend_changed()
185 strncmp(dev->otherend, path, strlen(dev->otherend))) { in xenbus_otherend_changed()
186 dev_dbg(&dev->dev, "Ignoring watch at %s\n", path); in xenbus_otherend_changed()
190 state = xenbus_read_driver_state(dev->otherend); in xenbus_otherend_changed()
192 dev_dbg(&dev->dev, "state is %d, (%s), %s, %s\n", in xenbus_otherend_changed()
193 state, xenbus_strstate(state), dev->otherend_watch.node, path); in xenbus_otherend_changed()
205 if (drv->otherend_changed) in xenbus_otherend_changed()
206 drv->otherend_changed(dev, state); in xenbus_otherend_changed()
217 return sprintf(buf, "%d\n", atomic_read(&dev->name)); \
232 return sprintf(buf, "%d\n", dev->spurious_threshold); in spurious_threshold_show()
247 dev->spurious_threshold = val; in spurious_threshold_store()
271 struct xenbus_driver *drv = to_xenbus_driver(_dev->driver); in xenbus_dev_probe()
275 DPRINTK("%s", dev->nodename); in xenbus_dev_probe()
277 if (!drv->probe) { in xenbus_dev_probe()
278 err = -ENODEV; in xenbus_dev_probe()
282 id = match_device(drv->ids, dev); in xenbus_dev_probe()
284 err = -ENODEV; in xenbus_dev_probe()
290 dev_warn(&dev->dev, "talk_to_otherend on %s failed.\n", in xenbus_dev_probe()
291 dev->nodename); in xenbus_dev_probe()
295 if (!try_module_get(drv->driver.owner)) { in xenbus_dev_probe()
296 dev_warn(&dev->dev, "failed to acquire module reference on '%s'\n", in xenbus_dev_probe()
297 drv->driver.name); in xenbus_dev_probe()
298 err = -ESRCH; in xenbus_dev_probe()
302 down(&dev->reclaim_sem); in xenbus_dev_probe()
303 err = drv->probe(dev, id); in xenbus_dev_probe()
304 up(&dev->reclaim_sem); in xenbus_dev_probe()
310 dev_warn(&dev->dev, "watch_otherend on %s failed.\n", in xenbus_dev_probe()
311 dev->nodename); in xenbus_dev_probe()
315 dev->spurious_threshold = 1; in xenbus_dev_probe()
316 if (sysfs_create_group(&dev->dev.kobj, &xenbus_group)) in xenbus_dev_probe()
317 dev_warn(&dev->dev, "sysfs_create_group on %s failed.\n", in xenbus_dev_probe()
318 dev->nodename); in xenbus_dev_probe()
322 module_put(drv->driver.owner); in xenbus_dev_probe()
324 xenbus_dev_error(dev, err, "xenbus_dev_probe on %s", dev->nodename); in xenbus_dev_probe()
332 struct xenbus_driver *drv = to_xenbus_driver(_dev->driver); in xenbus_dev_remove()
334 DPRINTK("%s", dev->nodename); in xenbus_dev_remove()
336 sysfs_remove_group(&dev->dev.kobj, &xenbus_group); in xenbus_dev_remove()
340 if (drv->remove) { in xenbus_dev_remove()
341 down(&dev->reclaim_sem); in xenbus_dev_remove()
342 drv->remove(dev); in xenbus_dev_remove()
343 up(&dev->reclaim_sem); in xenbus_dev_remove()
346 module_put(drv->driver.owner); in xenbus_dev_remove()
351 * If the toolstack has forced the device state to closing then set in xenbus_dev_remove()
353 * Similarly, if the driver does not support re-bind, set the in xenbus_dev_remove()
356 if (!drv->allow_rebind || in xenbus_dev_remove()
357 xenbus_read_driver_state(dev->nodename) == XenbusStateClosing) in xenbus_dev_remove()
366 drv->driver.name = drv->name ? drv->name : drv->ids[0].devicetype; in xenbus_register_driver_common()
367 drv->driver.bus = &bus->bus; in xenbus_register_driver_common()
368 drv->driver.owner = owner; in xenbus_register_driver_common()
369 drv->driver.mod_name = mod_name; in xenbus_register_driver_common()
371 return driver_register(&drv->driver); in xenbus_register_driver_common()
377 driver_unregister(&drv->driver); in xenbus_unregister_driver()
391 if (!strcmp(xendev->nodename, info->nodename)) { in cmp_dev()
392 info->dev = xendev; in cmp_dev()
412 int len = strlen(info->nodename); in cleanup_dev()
414 DPRINTK("%s", info->nodename); in cleanup_dev()
416 /* Match the info->nodename path, or any subdirectory of that path. */ in cleanup_dev()
417 if (strncmp(xendev->nodename, info->nodename, len)) in cleanup_dev()
421 if ((strlen(xendev->nodename) > len) && (xendev->nodename[len] != '/')) in cleanup_dev()
424 info->dev = xendev; in cleanup_dev()
437 device_unregister(&info.dev->dev); in xenbus_cleanup_devices()
438 put_device(&info.dev->dev); in xenbus_cleanup_devices()
452 return sprintf(buf, "%s\n", to_xenbus_device(dev)->nodename); in nodename_show()
459 return sprintf(buf, "%s\n", to_xenbus_device(dev)->devicetype); in devtype_show()
466 return sprintf(buf, "%s:%s\n", dev->bus->name, in modalias_show()
467 to_xenbus_device(dev)->devicetype); in modalias_show()
475 xenbus_strstate(to_xenbus_device(dev)->state)); in state_show()
518 return -ENOMEM; in xenbus_probe_node()
520 xendev->state = XenbusStateInitialising; in xenbus_probe_node()
526 xendev->nodename = tmpstring; in xenbus_probe_node()
530 xendev->devicetype = tmpstring; in xenbus_probe_node()
531 init_completion(&xendev->down); in xenbus_probe_node()
533 xendev->dev.bus = &bus->bus; in xenbus_probe_node()
534 xendev->dev.release = xenbus_dev_release; in xenbus_probe_node()
536 err = bus->get_bus_id(devname, xendev->nodename); in xenbus_probe_node()
540 dev_set_name(&xendev->dev, "%s", devname); in xenbus_probe_node()
541 sema_init(&xendev->reclaim_sem, 1); in xenbus_probe_node()
544 err = device_register(&xendev->dev); in xenbus_probe_node()
546 put_device(&xendev->dev); in xenbus_probe_node()
565 dir = xenbus_directory(XBT_NIL, bus->root, type, &dir_n); in xenbus_probe_device_type()
570 err = bus->probe(bus, type, dir[i]); in xenbus_probe_device_type()
585 dir = xenbus_directory(XBT_NIL, bus->root, "", &dir_n); in xenbus_probe_devices()
618 len--; in strsep_len()
620 return (len == 0) ? i : -ERANGE; in strsep_len()
635 xenbus_cleanup_devices(node, &bus->bus); in xenbus_dev_changed()
642 type[XEN_BUS_ID_SIZE-1] = '\0'; in xenbus_dev_changed()
644 rootlen = strsep_len(node, '/', bus->levels); in xenbus_dev_changed()
651 dev = xenbus_device_find(root, &bus->bus); in xenbus_dev_changed()
655 put_device(&dev->dev); in xenbus_dev_changed()
668 DPRINTK("%s", xdev->nodename); in xenbus_dev_suspend()
670 if (dev->driver == NULL) in xenbus_dev_suspend()
672 drv = to_xenbus_driver(dev->driver); in xenbus_dev_suspend()
673 if (drv->suspend) in xenbus_dev_suspend()
674 err = drv->suspend(xdev); in xenbus_dev_suspend()
688 DPRINTK("%s", xdev->nodename); in xenbus_dev_resume()
690 if (dev->driver == NULL) in xenbus_dev_resume()
692 drv = to_xenbus_driver(dev->driver); in xenbus_dev_resume()
699 xdev->state = XenbusStateInitialising; in xenbus_dev_resume()
701 if (drv->resume) { in xenbus_dev_resume()
702 err = drv->resume(xdev); in xenbus_dev_resume()
736 ret = nb->notifier_call(nb, 0, NULL); in register_xenstore_notifier()
815 return -ENODEV; in xenbus_probe_initcall()
830 * thread which will wait for xenstored or a xenstore-stubdom to be in xenbus_probe_initcall()
875 int err = -ENOMEM; in xenstored_local_init()
892 if (err == -ENOSYS) in xenstored_local_init()
921 xen_store_evtchn = xen_start_info->store_evtchn; in xenbus_resume_cb()
952 return -ENODEV; in xenbus_init()
962 if (xen_pv_domain() && !xen_start_info->store_evtchn) in xenbus_init()
964 if (xen_pv_domain() && xen_start_info->store_evtchn) in xenbus_init()
975 xen_store_evtchn = xen_start_info->store_evtchn; in xenbus_init()
976 xen_store_gfn = xen_start_info->store_mfn; in xenbus_init()
998 err = -ENOENT; in xenbus_init()
1004 /* Avoid truncation on 32-bit. */ in xenbus_init()
1009 err = -EINVAL; in xenbus_init()
1017 if (xen_store_interface->connection != XENSTORE_CONNECTED) in xenbus_init()
1047 pr_warn("Error initializing xenstore comms: %i\n", err); in xenbus_init()