1#ifndef __LINUX_KMOD_H__
2#define __LINUX_KMOD_H__
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22#include <linux/umh.h>
23#include <linux/gfp.h>
24#include <linux/stddef.h>
25#include <linux/errno.h>
26#include <linux/compiler.h>
27#include <linux/workqueue.h>
28#include <linux/sysctl.h>
29
30#define KMOD_PATH_LEN 256
31
32#ifdef CONFIG_MODULES
33extern char modprobe_path[];
34
35
36extern __printf(2, 3)
37int __request_module(bool wait, const char *name, ...);
38#define request_module(mod...) __request_module(true, mod)
39#define request_module_nowait(mod...) __request_module(false, mod)
40#define try_then_request_module(x, mod...) \
41 ((x) ?: (__request_module(true, mod), (x)))
42#else
43static inline int request_module(const char *name, ...) { return -ENOSYS; }
44static inline int request_module_nowait(const char *name, ...) { return -ENOSYS; }
45#define try_then_request_module(x, mod...) (x)
46#endif
47
48#endif
49