xref: /linux/drivers/base/firmware_loader/fallback_table.c (revision ceb18132248d95b2c68e30c3df78e69175c4452f)
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 /* Module or buit-in */
205d6d1dddSLuis R. Rodriguez #ifdef CONFIG_FW_LOADER_USER_HELPER
215d6d1dddSLuis R. Rodriguez 
22*ceb18132SLuis R. Rodriguez static unsigned int zero;
23*ceb18132SLuis R. Rodriguez static unsigned int one = 1;
24*ceb18132SLuis R. Rodriguez 
255d6d1dddSLuis R. Rodriguez struct firmware_fallback_config fw_fallback_config = {
265d6d1dddSLuis R. Rodriguez 	.force_sysfs_fallback = IS_ENABLED(CONFIG_FW_LOADER_USER_HELPER_FALLBACK),
275d6d1dddSLuis R. Rodriguez 	.loading_timeout = 60,
285d6d1dddSLuis R. Rodriguez 	.old_timeout = 60,
295d6d1dddSLuis R. Rodriguez };
305d6d1dddSLuis R. Rodriguez EXPORT_SYMBOL_GPL(fw_fallback_config);
315d6d1dddSLuis R. Rodriguez 
32*ceb18132SLuis R. Rodriguez struct ctl_table firmware_config_table[] = {
33*ceb18132SLuis R. Rodriguez 	{
34*ceb18132SLuis R. Rodriguez 		.procname	= "force_sysfs_fallback",
35*ceb18132SLuis R. Rodriguez 		.data		= &fw_fallback_config.force_sysfs_fallback,
36*ceb18132SLuis R. Rodriguez 		.maxlen         = sizeof(unsigned int),
37*ceb18132SLuis R. Rodriguez 		.mode           = 0644,
38*ceb18132SLuis R. Rodriguez 		.proc_handler   = proc_douintvec_minmax,
39*ceb18132SLuis R. Rodriguez 		.extra1		= &zero,
40*ceb18132SLuis R. Rodriguez 		.extra2		= &one,
41*ceb18132SLuis R. Rodriguez 	},
42*ceb18132SLuis R. Rodriguez 	{ }
43*ceb18132SLuis R. Rodriguez };
44*ceb18132SLuis R. Rodriguez EXPORT_SYMBOL_GPL(firmware_config_table);
45*ceb18132SLuis R. Rodriguez 
465d6d1dddSLuis R. Rodriguez #endif
47