xenbus_probe.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /******************************************************************************
  2. * xenbus_probe.h
  3. *
  4. * Talks to Xen Store to figure out what devices we have.
  5. *
  6. * Copyright (C) 2005 Rusty Russell, IBM Corporation
  7. * Copyright (C) 2005 XenSource Ltd.
  8. *
  9. * This program is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU General Public License version 2
  11. * as published by the Free Software Foundation; or, when distributed
  12. * separately from the Linux kernel or incorporated into other
  13. * software packages, subject to the following license:
  14. *
  15. * Permission is hereby granted, free of charge, to any person obtaining a copy
  16. * of this source file (the "Software"), to deal in the Software without
  17. * restriction, including without limitation the rights to use, copy, modify,
  18. * merge, publish, distribute, sublicense, and/or sell copies of the Software,
  19. * and to permit persons to whom the Software is furnished to do so, subject to
  20. * the following conditions:
  21. *
  22. * The above copyright notice and this permission notice shall be included in
  23. * all copies or substantial portions of the Software.
  24. *
  25. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  26. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  27. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  28. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  29. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  30. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  31. * IN THE SOFTWARE.
  32. */
  33. #ifndef _XENBUS_PROBE_H
  34. #define _XENBUS_PROBE_H
  35. #define XEN_BUS_ID_SIZE 20
  36. struct xen_bus_type
  37. {
  38. char *root;
  39. unsigned int levels;
  40. int (*get_bus_id)(char bus_id[XEN_BUS_ID_SIZE], const char *nodename);
  41. int (*probe)(struct xen_bus_type *bus, const char *type,
  42. const char *dir);
  43. void (*otherend_changed)(struct xenbus_watch *watch, const char **vec,
  44. unsigned int len);
  45. struct bus_type bus;
  46. };
  47. extern int xenbus_match(struct device *_dev, struct device_driver *_drv);
  48. extern int xenbus_dev_probe(struct device *_dev);
  49. extern int xenbus_dev_remove(struct device *_dev);
  50. extern int xenbus_register_driver_common(struct xenbus_driver *drv,
  51. struct xen_bus_type *bus,
  52. struct module *owner,
  53. const char *mod_name);
  54. extern int xenbus_probe_node(struct xen_bus_type *bus,
  55. const char *type,
  56. const char *nodename);
  57. extern int xenbus_probe_devices(struct xen_bus_type *bus);
  58. extern void xenbus_dev_changed(const char *node, struct xen_bus_type *bus);
  59. extern void xenbus_dev_shutdown(struct device *_dev);
  60. extern int xenbus_dev_suspend(struct device *dev);
  61. extern int xenbus_dev_resume(struct device *dev);
  62. extern int xenbus_dev_cancel(struct device *dev);
  63. extern void xenbus_otherend_changed(struct xenbus_watch *watch,
  64. const char **vec, unsigned int len,
  65. int ignore_on_shutdown);
  66. extern int xenbus_read_otherend_details(struct xenbus_device *xendev,
  67. char *id_node, char *path_node);
  68. #endif