fallback_table.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include <linux/types.h>
  3. #include <linux/kconfig.h>
  4. #include <linux/list.h>
  5. #include <linux/slab.h>
  6. #include <linux/security.h>
  7. #include <linux/highmem.h>
  8. #include <linux/umh.h>
  9. #include <linux/sysctl.h>
  10. #include "fallback.h"
  11. #include "firmware.h"
  12. /*
  13. * firmware fallback configuration table
  14. */
  15. /* Module or buit-in */
  16. #ifdef CONFIG_FW_LOADER_USER_HELPER
  17. static unsigned int zero;
  18. static unsigned int one = 1;
  19. struct 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. };
  24. EXPORT_SYMBOL_GPL(fw_fallback_config);
  25. struct ctl_table firmware_config_table[] = {
  26. {
  27. .procname = "force_sysfs_fallback",
  28. .data = &fw_fallback_config.force_sysfs_fallback,
  29. .maxlen = sizeof(unsigned int),
  30. .mode = 0644,
  31. .proc_handler = proc_douintvec_minmax,
  32. .extra1 = &zero,
  33. .extra2 = &one,
  34. },
  35. {
  36. .procname = "ignore_sysfs_fallback",
  37. .data = &fw_fallback_config.ignore_sysfs_fallback,
  38. .maxlen = sizeof(unsigned int),
  39. .mode = 0644,
  40. .proc_handler = proc_douintvec_minmax,
  41. .extra1 = &zero,
  42. .extra2 = &one,
  43. },
  44. { }
  45. };
  46. EXPORT_SYMBOL_GPL(firmware_config_table);
  47. #endif