1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/types.h>
4 #include <linux/kconfig.h>
5 #include <linux/list.h>
6 #include <linux/slab.h>
7 #include <linux/export.h>
8 #include <linux/security.h>
9 #include <linux/highmem.h>
10 #include <linux/umh.h>
11 #include <linux/sysctl.h>
17 * firmware fallback configuration table
20 struct firmware_fallback_config fw_fallback_config
= {
21 .force_sysfs_fallback
= IS_ENABLED(CONFIG_FW_LOADER_USER_HELPER_FALLBACK
),
22 .loading_timeout
= 60,
25 EXPORT_SYMBOL_NS_GPL(fw_fallback_config
, FIRMWARE_LOADER_PRIVATE
);
28 static struct ctl_table firmware_config_table
[] = {
30 .procname
= "force_sysfs_fallback",
31 .data
= &fw_fallback_config
.force_sysfs_fallback
,
32 .maxlen
= sizeof(unsigned int),
34 .proc_handler
= proc_douintvec_minmax
,
35 .extra1
= SYSCTL_ZERO
,
39 .procname
= "ignore_sysfs_fallback",
40 .data
= &fw_fallback_config
.ignore_sysfs_fallback
,
41 .maxlen
= sizeof(unsigned int),
43 .proc_handler
= proc_douintvec_minmax
,
44 .extra1
= SYSCTL_ZERO
,
49 static struct ctl_table_header
*firmware_config_sysct_table_header
;
50 int register_firmware_config_sysctl(void)
52 firmware_config_sysct_table_header
=
53 register_sysctl("kernel/firmware_config",
54 firmware_config_table
);
55 if (!firmware_config_sysct_table_header
)
59 EXPORT_SYMBOL_NS_GPL(register_firmware_config_sysctl
, FIRMWARE_LOADER_PRIVATE
);
61 void unregister_firmware_config_sysctl(void)
63 unregister_sysctl_table(firmware_config_sysct_table_header
);
64 firmware_config_sysct_table_header
= NULL
;
66 EXPORT_SYMBOL_NS_GPL(unregister_firmware_config_sysctl
, FIRMWARE_LOADER_PRIVATE
);
68 #endif /* CONFIG_SYSCTL */