1/*
2 *  RouterBoot definitions
3 *
4 *  Copyright (C) 2012 Gabor Juhos <juhosg@openwrt.org>
5 *
6 *  This program is free software; you can redistribute it and/or modify it
7 *  under the terms of the GNU General Public License version 2 as published
8 *  by the Free Software Foundation.
9 */
10
11#ifndef _ATH79_ROUTERBOOT_H_
12#define _ATH79_ROUTERBOOT_H_
13
14struct rb_info {
15	unsigned int hard_cfg_offs;
16	unsigned int hard_cfg_size;
17	void *hard_cfg_data;
18	unsigned int soft_cfg_offs;
19
20	const char *board_name;
21	u32 hw_options;
22};
23
24#ifdef CONFIG_ATH79_ROUTERBOOT
25const struct rb_info *rb_init_info(void *data, unsigned int size);
26void *rb_get_wlan_data(void);
27void *rb_get_ext_wlan_data(u16 id);
28
29int routerboot_find_tag(u8 *buf, unsigned int buflen, u16 tag_id,
30			u8 **tag_data, u16 *tag_len);
31int routerboot_find_magic(u8 *buf, unsigned int buflen, u32 *offset, bool hard);
32#else
33static inline const struct rb_info *
34rb_init_info(void *data, unsigned int size)
35{
36	return NULL;
37}
38
39static inline void *rb_get_wlan_data(void)
40{
41	return NULL;
42}
43
44static inline void *rb_get_wlan_data(u16 id)
45{
46	return NULL;
47}
48
49static inline int
50routerboot_find_tag(u8 *buf, unsigned int buflen, u16 tag_id,
51		    u8 **tag_data, u16 *tag_len)
52{
53	return -ENOENT;
54}
55
56static inline int
57routerboot_find_magic(u8 *buf, unsigned int buflen, u32 *offset, bool hard)
58{
59	return -ENOENT;
60}
61#endif
62
63#endif /* _ATH79_ROUTERBOOT_H_ */
64