xref: /linux/drivers/base/firmware_loader/fallback_table.c (revision 48ebea5026d692c5ab0a7d303f0fe1f8ba046e0f)
15d6d1dddSLuis R. Rodriguez // SPDX-License-Identifier: GPL-2.0
25d6d1dddSLuis R. Rodriguez 
35d6d1dddSLuis R. Rodriguez #include <linux/types.h>
45d6d1dddSLuis R. Rodriguez #include <linux/kconfig.h>
55d6d1dddSLuis R. Rodriguez #include <linux/list.h>
65d6d1dddSLuis R. Rodriguez #include <linux/slab.h>
75d6d1dddSLuis R. Rodriguez #include <linux/security.h>
85d6d1dddSLuis R. Rodriguez #include <linux/highmem.h>
95d6d1dddSLuis R. Rodriguez #include <linux/umh.h>
105d6d1dddSLuis R. Rodriguez #include <linux/sysctl.h>
115d6d1dddSLuis R. Rodriguez 
125d6d1dddSLuis R. Rodriguez #include "fallback.h"
135d6d1dddSLuis R. Rodriguez #include "firmware.h"
145d6d1dddSLuis R. Rodriguez 
155d6d1dddSLuis R. Rodriguez /*
165d6d1dddSLuis R. Rodriguez  * firmware fallback configuration table
175d6d1dddSLuis R. Rodriguez  */
185d6d1dddSLuis R. Rodriguez 
195d6d1dddSLuis R. Rodriguez struct firmware_fallback_config fw_fallback_config = {
205d6d1dddSLuis R. Rodriguez 	.force_sysfs_fallback = IS_ENABLED(CONFIG_FW_LOADER_USER_HELPER_FALLBACK),
215d6d1dddSLuis R. Rodriguez 	.loading_timeout = 60,
225d6d1dddSLuis R. Rodriguez 	.old_timeout = 60,
235d6d1dddSLuis R. Rodriguez };
24*48ebea50SLuis Chamberlain EXPORT_SYMBOL_NS_GPL(fw_fallback_config, FIRMWARE_LOADER_PRIVATE);
255d6d1dddSLuis R. Rodriguez 
26eec4844fSMatteo Croce #ifdef CONFIG_SYSCTL
27ceb18132SLuis R. Rodriguez struct ctl_table firmware_config_table[] = {
28ceb18132SLuis R. Rodriguez 	{
29ceb18132SLuis R. Rodriguez 		.procname	= "force_sysfs_fallback",
30ceb18132SLuis R. Rodriguez 		.data		= &fw_fallback_config.force_sysfs_fallback,
31ceb18132SLuis R. Rodriguez 		.maxlen         = sizeof(unsigned int),
32ceb18132SLuis R. Rodriguez 		.mode           = 0644,
33ceb18132SLuis R. Rodriguez 		.proc_handler   = proc_douintvec_minmax,
34eec4844fSMatteo Croce 		.extra1		= SYSCTL_ZERO,
35eec4844fSMatteo Croce 		.extra2		= SYSCTL_ONE,
36ceb18132SLuis R. Rodriguez 	},
372cd7a1c6SLuis R. Rodriguez 	{
382cd7a1c6SLuis R. Rodriguez 		.procname	= "ignore_sysfs_fallback",
392cd7a1c6SLuis R. Rodriguez 		.data		= &fw_fallback_config.ignore_sysfs_fallback,
402cd7a1c6SLuis R. Rodriguez 		.maxlen         = sizeof(unsigned int),
412cd7a1c6SLuis R. Rodriguez 		.mode           = 0644,
422cd7a1c6SLuis R. Rodriguez 		.proc_handler   = proc_douintvec_minmax,
43eec4844fSMatteo Croce 		.extra1		= SYSCTL_ZERO,
44eec4844fSMatteo Croce 		.extra2		= SYSCTL_ONE,
452cd7a1c6SLuis R. Rodriguez 	},
46ceb18132SLuis R. Rodriguez 	{ }
47ceb18132SLuis R. Rodriguez };
48eec4844fSMatteo Croce #endif
49