Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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 |
Abhay Salunke | 6e3eaab | 2005-09-06 15:17:13 -0700 | [diff] [blame] | 6 | #define FW_ACTION_NOHOTPLUG 0 |
| 7 | #define FW_ACTION_HOTPLUG 1 |
| 8 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | struct firmware { |
| 10 | size_t size; |
| 11 | u8 *data; |
| 12 | }; |
James Bottomley | fbab976 | 2008-03-07 08:57:54 -0600 | [diff] [blame] | 13 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | struct device; |
James Bottomley | fbab976 | 2008-03-07 08:57:54 -0600 | [diff] [blame] | 15 | |
| 16 | #if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | int request_firmware(const struct firmware **fw, const char *name, |
| 18 | struct device *device); |
| 19 | int request_firmware_nowait( |
Kay Sievers | 312c004 | 2005-11-16 09:00:00 +0100 | [diff] [blame] | 20 | struct module *module, int uevent, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | const char *name, struct device *device, void *context, |
| 22 | void (*cont)(const struct firmware *fw, void *context)); |
| 23 | |
| 24 | void release_firmware(const struct firmware *fw); |
James Bottomley | fbab976 | 2008-03-07 08:57:54 -0600 | [diff] [blame] | 25 | #else |
| 26 | static inline int request_firmware(const struct firmware **fw, |
| 27 | const char *name, |
| 28 | struct device *device) |
| 29 | { |
| 30 | return -EINVAL; |
| 31 | } |
| 32 | static inline int request_firmware_nowait( |
| 33 | struct module *module, int uevent, |
| 34 | const char *name, struct device *device, void *context, |
| 35 | void (*cont)(const struct firmware *fw, void *context)) |
| 36 | { |
| 37 | return -EINVAL; |
| 38 | } |
| 39 | |
| 40 | static inline void release_firmware(const struct firmware *fw) |
| 41 | { |
| 42 | } |
| 43 | #endif |
| 44 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | #endif |