bcm47xx_nvram.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * This program is free software; you can redistribute it and/or modify it
  3. * under the terms of the GNU General Public License as published by the
  4. * Free Software Foundation; either version 2 of the License, or (at your
  5. * option) any later version.
  6. */
  7. #ifndef __BCM47XX_NVRAM_H
  8. #define __BCM47XX_NVRAM_H
  9. #include <linux/types.h>
  10. #include <linux/kernel.h>
  11. #include <linux/vmalloc.h>
  12. #ifdef CONFIG_BCM47XX_NVRAM
  13. int bcm47xx_nvram_init_from_mem(u32 base, u32 lim);
  14. int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len);
  15. int bcm47xx_nvram_gpio_pin(const char *name);
  16. char *bcm47xx_nvram_get_contents(size_t *val_len);
  17. static inline void bcm47xx_nvram_release_contents(char *nvram)
  18. {
  19. vfree(nvram);
  20. };
  21. #else
  22. static inline int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
  23. {
  24. return -ENOTSUPP;
  25. };
  26. static inline int bcm47xx_nvram_getenv(const char *name, char *val,
  27. size_t val_len)
  28. {
  29. return -ENOTSUPP;
  30. };
  31. static inline int bcm47xx_nvram_gpio_pin(const char *name)
  32. {
  33. return -ENOTSUPP;
  34. };
  35. static inline char *bcm47xx_nvram_get_contents(size_t *val_len)
  36. {
  37. return NULL;
  38. };
  39. static inline void bcm47xx_nvram_release_contents(char *nvram)
  40. {
  41. };
  42. #endif
  43. #endif /* __BCM47XX_NVRAM_H */