firmware.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef _LINUX_FIRMWARE_H
  2. #define _LINUX_FIRMWARE_H
  3. #include <linux/module.h>
  4. #include <linux/types.h>
  5. #define FIRMWARE_NAME_MAX 30
  6. #define FW_ACTION_NOHOTPLUG 0
  7. #define FW_ACTION_HOTPLUG 1
  8. struct firmware {
  9. size_t size;
  10. u8 *data;
  11. };
  12. struct device;
  13. #if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
  14. int request_firmware(const struct firmware **fw, const char *name,
  15. struct device *device);
  16. int request_firmware_nowait(
  17. struct module *module, int uevent,
  18. const char *name, struct device *device, void *context,
  19. void (*cont)(const struct firmware *fw, void *context));
  20. void release_firmware(const struct firmware *fw);
  21. #else
  22. static inline int request_firmware(const struct firmware **fw,
  23. const char *name,
  24. struct device *device)
  25. {
  26. return -EINVAL;
  27. }
  28. static inline int request_firmware_nowait(
  29. struct module *module, int uevent,
  30. const char *name, struct device *device, void *context,
  31. void (*cont)(const struct firmware *fw, void *context))
  32. {
  33. return -EINVAL;
  34. }
  35. static inline void release_firmware(const struct firmware *fw)
  36. {
  37. }
  38. #endif
  39. #endif