1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * An inteface for configuring a hardware via u-boot environment.
5 * Copyright (c) 2009 MontaVista Software, Inc.
6 * Copyright 2011 Freescale Semiconductor, Inc.
8 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
14 #include <linux/types.h>
15 #include <linux/errno.h>
17 #ifdef CONFIG_HWCONFIG
19 extern int hwconfig_f(const char *opt, char *buf);
20 extern const char *hwconfig_arg_f(const char *opt, size_t *arglen, char *buf);
21 extern int hwconfig_arg_cmp_f(const char *opt, const char *arg, char *buf);
22 extern int hwconfig_sub_f(const char *opt, const char *subopt, char *buf);
23 extern const char *hwconfig_subarg_f(const char *opt, const char *subopt,
24 size_t *subarglen, char *buf);
25 extern int hwconfig_subarg_cmp_f(const char *opt, const char *subopt,
26 const char *subarg, char *buf);
29 static inline int hwconfig_f(const char *opt, char *buf)
34 static inline const char *hwconfig_arg_f(const char *opt, size_t *arglen,
41 static inline int hwconfig_arg_cmp_f(const char *opt, const char *arg,
47 static inline int hwconfig_sub_f(const char *opt, const char *subopt, char *buf)
52 static inline const char *hwconfig_subarg_f(const char *opt, const char *subopt,
53 size_t *subarglen, char *buf)
59 static inline int hwconfig_subarg_cmp_f(const char *opt, const char *subopt,
60 const char *subarg, char *buf)
65 #endif /* CONFIG_HWCONFIG */
67 static inline int hwconfig(const char *opt)
69 return hwconfig_f(opt, NULL);
72 static inline const char *hwconfig_arg(const char *opt, size_t *arglen)
74 return hwconfig_arg_f(opt, arglen, NULL);
77 static inline int hwconfig_arg_cmp(const char *opt, const char *arg)
79 return hwconfig_arg_cmp_f(opt, arg, NULL);
82 static inline int hwconfig_sub(const char *opt, const char *subopt)
84 return hwconfig_sub_f(opt, subopt, NULL);
87 static inline const char *hwconfig_subarg(const char *opt, const char *subopt,
90 return hwconfig_subarg_f(opt, subopt, subarglen, NULL);
93 static inline int hwconfig_subarg_cmp(const char *opt, const char *subopt,
96 return hwconfig_subarg_cmp_f(opt, subopt, subarg, NULL);
99 #endif /* _HWCONFIG_H */