hwconfig.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * An inteface for configuring a hardware via u-boot environment.
  3. *
  4. * Copyright (c) 2009 MontaVista Software, Inc.
  5. *
  6. * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. */
  13. #ifndef _HWCONFIG_H
  14. #define _HWCONFIG_H
  15. #include <linux/types.h>
  16. #include <asm/errno.h>
  17. #ifdef CONFIG_HWCONFIG
  18. extern int hwconfig(const char *opt);
  19. extern const char *hwconfig_arg(const char *opt, size_t *arglen);
  20. extern int hwconfig_arg_cmp(const char *opt, const char *arg);
  21. extern int hwconfig_sub(const char *opt, const char *subopt);
  22. extern const char *hwconfig_subarg(const char *opt, const char *subopt,
  23. size_t *subarglen);
  24. extern int hwconfig_subarg_cmp(const char *opt, const char *subopt,
  25. const char *subarg);
  26. #else
  27. static inline int hwconfig(const char *opt)
  28. {
  29. return -ENOSYS;
  30. }
  31. static inline const char *hwconfig_arg(const char *opt, size_t *arglen)
  32. {
  33. *arglen = 0;
  34. return "";
  35. }
  36. static inline int hwconfig_arg_cmp(const char *opt, const char *arg)
  37. {
  38. return -ENOSYS;
  39. }
  40. static inline int hwconfig_sub(const char *opt, const char *subopt)
  41. {
  42. return -ENOSYS;
  43. }
  44. static inline const char *hwconfig_subarg(const char *opt, const char *subopt,
  45. size_t *subarglen)
  46. {
  47. *subarglen = 0;
  48. return "";
  49. }
  50. static inline int hwconfig_subarg_cmp(const char *opt, const char *subopt,
  51. const char *subarg)
  52. {
  53. return -ENOSYS;
  54. }
  55. #endif /* CONFIG_HWCONFIG */
  56. #endif /* _HWCONFIG_H */