bcm47xx_nvram.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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/errno.h>
  10. #include <linux/types.h>
  11. #include <linux/kernel.h>
  12. #include <linux/vmalloc.h>
  13. #ifdef CONFIG_BCM47XX_NVRAM
  14. int bcm47xx_nvram_init_from_mem(u32 base, u32 lim);
  15. int bcm47xx_nvram_getenv(const char *name, char *val, size_t val_len);
  16. int bcm47xx_nvram_gpio_pin(const char *name);
  17. char *bcm47xx_nvram_get_contents(size_t *val_len);
  18. static inline void bcm47xx_nvram_release_contents(char *nvram)
  19. {
  20. vfree(nvram);
  21. };
  22. #else
  23. static inline int bcm47xx_nvram_init_from_mem(u32 base, u32 lim)
  24. {
  25. return -ENOTSUPP;
  26. };
  27. static inline int bcm47xx_nvram_getenv(const char *name, char *val,
  28. size_t val_len)
  29. {
  30. return -ENOTSUPP;
  31. };
  32. static inline int bcm47xx_nvram_gpio_pin(const char *name)
  33. {
  34. return -ENOTSUPP;
  35. };
  36. static inline char *bcm47xx_nvram_get_contents(size_t *val_len)
  37. {
  38. return NULL;
  39. };
  40. static inline void bcm47xx_nvram_release_contents(char *nvram)
  41. {
  42. };
  43. #endif
  44. #endif /* __BCM47XX_NVRAM_H */