routerboot.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #ifndef _ATH79_ROUTERBOOT_H_
  11. #define _ATH79_ROUTERBOOT_H_
  12. struct rb_info {
  13. unsigned int hard_cfg_offs;
  14. unsigned int hard_cfg_size;
  15. void *hard_cfg_data;
  16. unsigned int soft_cfg_offs;
  17. const char *board_name;
  18. u32 hw_options;
  19. };
  20. #ifdef CONFIG_ATH79_ROUTERBOOT
  21. const struct rb_info *rb_init_info(void *data, unsigned int size);
  22. void *rb_get_wlan_data(void);
  23. void *rb_get_ext_wlan_data(u16 id);
  24. int routerboot_find_tag(u8 *buf, unsigned int buflen, u16 tag_id,
  25. u8 **tag_data, u16 *tag_len);
  26. int routerboot_find_magic(u8 *buf, unsigned int buflen, u32 *offset, bool hard);
  27. #else
  28. static inline const struct rb_info *
  29. rb_init_info(void *data, unsigned int size)
  30. {
  31. return NULL;
  32. }
  33. static inline void *rb_get_wlan_data(void)
  34. {
  35. return NULL;
  36. }
  37. static inline void *rb_get_wlan_data(u16 id)
  38. {
  39. return NULL;
  40. }
  41. static inline int
  42. routerboot_find_tag(u8 *buf, unsigned int buflen, u16 tag_id,
  43. u8 **tag_data, u16 *tag_len)
  44. {
  45. return -ENOENT;
  46. }
  47. static inline int
  48. routerboot_find_magic(u8 *buf, unsigned int buflen, u32 *offset, bool hard)
  49. {
  50. return -ENOENT;
  51. }
  52. #endif
  53. #endif /* _ATH79_ROUTERBOOT_H_ */