kobject_uevent.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * kobject_uevent.h - list of kobject user events that can be generated
  3. *
  4. * Copyright (C) 2004 IBM Corp.
  5. * Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com>
  6. *
  7. * This file is released under the GPLv2.
  8. *
  9. */
  10. #ifndef _KOBJECT_EVENT_H_
  11. #define _KOBJECT_EVENT_H_
  12. #define HOTPLUG_PATH_LEN 256
  13. /* path to the hotplug userspace helper executed on an event */
  14. extern char hotplug_path[];
  15. /*
  16. * If you add an action here, you must also add the proper string to the
  17. * lib/kobject_uevent.c file.
  18. */
  19. typedef int __bitwise kobject_action_t;
  20. enum kobject_action {
  21. KOBJ_ADD = (__force kobject_action_t) 0x01, /* add event, for hotplug */
  22. KOBJ_REMOVE = (__force kobject_action_t) 0x02, /* remove event, for hotplug */
  23. KOBJ_CHANGE = (__force kobject_action_t) 0x03, /* a sysfs attribute file has changed */
  24. KOBJ_MOUNT = (__force kobject_action_t) 0x04, /* mount event for block devices */
  25. KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices */
  26. KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* offline event for hotplug devices */
  27. KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* online event for hotplug devices */
  28. };
  29. #ifdef CONFIG_KOBJECT_UEVENT
  30. int kobject_uevent(struct kobject *kobj,
  31. enum kobject_action action,
  32. struct attribute *attr);
  33. int kobject_uevent_atomic(struct kobject *kobj,
  34. enum kobject_action action,
  35. struct attribute *attr);
  36. #else
  37. static inline int kobject_uevent(struct kobject *kobj,
  38. enum kobject_action action,
  39. struct attribute *attr)
  40. {
  41. return 0;
  42. }
  43. static inline int kobject_uevent_atomic(struct kobject *kobj,
  44. enum kobject_action action,
  45. struct attribute *attr)
  46. {
  47. return 0;
  48. }
  49. #endif
  50. #endif