Path: blob/master/drivers/base/firmware_loader/fallback_table.c
26428 views
// SPDX-License-Identifier: GPL-2.012#include <linux/types.h>3#include <linux/kconfig.h>4#include <linux/list.h>5#include <linux/slab.h>6#include <linux/export.h>7#include <linux/security.h>8#include <linux/highmem.h>9#include <linux/umh.h>10#include <linux/sysctl.h>1112#include "fallback.h"13#include "firmware.h"1415/*16* firmware fallback configuration table17*/1819struct firmware_fallback_config fw_fallback_config = {20.force_sysfs_fallback = IS_ENABLED(CONFIG_FW_LOADER_USER_HELPER_FALLBACK),21.loading_timeout = 60,22.old_timeout = 60,23};24EXPORT_SYMBOL_NS_GPL(fw_fallback_config, "FIRMWARE_LOADER_PRIVATE");2526#ifdef CONFIG_SYSCTL27static const struct ctl_table firmware_config_table[] = {28{29.procname = "force_sysfs_fallback",30.data = &fw_fallback_config.force_sysfs_fallback,31.maxlen = sizeof(unsigned int),32.mode = 0644,33.proc_handler = proc_douintvec_minmax,34.extra1 = SYSCTL_ZERO,35.extra2 = SYSCTL_ONE,36},37{38.procname = "ignore_sysfs_fallback",39.data = &fw_fallback_config.ignore_sysfs_fallback,40.maxlen = sizeof(unsigned int),41.mode = 0644,42.proc_handler = proc_douintvec_minmax,43.extra1 = SYSCTL_ZERO,44.extra2 = SYSCTL_ONE,45},46};4748static struct ctl_table_header *firmware_config_sysct_table_header;49int register_firmware_config_sysctl(void)50{51firmware_config_sysct_table_header =52register_sysctl("kernel/firmware_config",53firmware_config_table);54if (!firmware_config_sysct_table_header)55return -ENOMEM;56return 0;57}58EXPORT_SYMBOL_NS_GPL(register_firmware_config_sysctl, "FIRMWARE_LOADER_PRIVATE");5960void unregister_firmware_config_sysctl(void)61{62unregister_sysctl_table(firmware_config_sysct_table_header);63firmware_config_sysct_table_header = NULL;64}65EXPORT_SYMBOL_NS_GPL(unregister_firmware_config_sysctl, "FIRMWARE_LOADER_PRIVATE");6667#endif /* CONFIG_SYSCTL */686970