#include <linux/pci.h>
#include <bcmdefs.h>
#include <bcmutils.h>
+#include <bcmnvram.h>
#include <aiutils.h>
#include <hndsoc.h>
#include <bcmdevs.h>
return NULL;
}
+/*
+ * Search the name=value vars for a specific one and return its value.
+ * Returns NULL if not found.
+ */
+char *getvar(char *vars, const char *name)
+{
+ char *s;
+ int len;
+
+ if (!name)
+ return NULL;
+
+ len = strlen(name);
+ if (len == 0)
+ return NULL;
+
+ /* first look in vars[] */
+ for (s = vars; s && *s;) {
+ if ((memcmp(s, name, len) == 0) && (s[len] == '='))
+ return &s[len + 1];
+
+ while (*s++)
+ ;
+ }
+ /* then query nvram */
+ return nvram_get(name);
+}
+
+/*
+ * Search the vars for a specific one and return its value as
+ * an integer. Returns 0 if not found.
+ */
+int getintvar(char *vars, const char *name)
+{
+ char *val;
+
+ val = getvar(vars, name);
+ if (val == NULL)
+ return 0;
+
+ return simple_strtoul(val, NULL, 0);
+}
+
char *nvram_get(const char *name)
{
char *v = NULL;
#include <linux/pci.h>
#include <aiutils.h>
#include <wlc_pmu.h>
+#include <bcmnvram.h>
#include <bcmdevs.h>
#include <sbhnddma.h>
#include <bcmdefs.h>
#include <bcmwifi.h>
#include <bcmutils.h>
+#include <bcmnvram.h>
#include <pcicfg.h>
#include <wlioctl.h>
#include <sbhnddma.h>
#include <bcmdefs.h>
#include <bcmutils.h>
+#include <bcmnvram.h>
#include <aiutils.h>
#include <bcmdevs.h>
#include <sbhnddma.h>
#include <bcmsrom.h>
#include <bcmotp.h>
#include <bcmutils.h>
+#include <bcmnvram.h>
#include <wlioctl.h>
#include <sbconfig.h>
#include <sbchipc.h>
#include <bcmdefs.h>
#include <bcmutils.h>
+#include <bcmnvram.h>
#include <aiutils.h>
#include <sbhnddma.h>
#include <wlioctl.h>
#include <bcmdevs.h>
#include <bcmutils.h>
#include <bcmwifi.h>
+#include <bcmnvram.h>
#include <aiutils.h>
#include <pcicfg.h>
#include <bcmsrom.h>
#include <bcmdevs.h>
#include <sbchipc.h>
#include <bcmutils.h>
+#include <bcmnvram.h>
#include "wlc_pmu.h"
/*
#include <aiutils.h>
#include <wlioctl.h>
#include <bcmwifi.h>
+#include <bcmnvram.h>
#include <sbhnddma.h>
#include "wlc_types.h"
#endif /* _LANGUAGE_ASSEMBLY */
+/* variable access */
+extern char *getvar(char *vars, const char *name);
+extern int getintvar(char *vars, const char *name);
+
/* The NVRAM version number stored as an NVRAM variable */
#define NVRAM_SOFTWARE_VERSION "1"
struct ipv4_addr;
extern char *bcm_ip_ntoa(struct ipv4_addr *ia, char *buf);
-/* variable access */
- extern char *getvar(char *vars, const char *name);
- extern int getintvar(char *vars, const char *name);
#ifdef BCMDBG
extern void prpkt(const char *msg, struct sk_buff *p0);
#else
return i == 6;
}
-/*
- * Search the name=value vars for a specific one and return its value.
- * Returns NULL if not found.
- */
-char *getvar(char *vars, const char *name)
-{
- char *s;
- int len;
-
- if (!name)
- return NULL;
-
- len = strlen(name);
- if (len == 0)
- return NULL;
-
- /* first look in vars[] */
- for (s = vars; s && *s;) {
- if ((memcmp(s, name, len) == 0) && (s[len] == '='))
- return &s[len + 1];
-
- while (*s++)
- ;
- }
-#ifdef BRCM_FULLMAC
- return NULL;
-#else
- /* then query nvram */
- return nvram_get(name);
-#endif
-}
-
-/*
- * Search the vars for a specific one and return its value as
- * an integer. Returns 0 if not found.
- */
-int getintvar(char *vars, const char *name)
-{
- char *val;
-
- val = getvar(vars, name);
- if (val == NULL)
- return 0;
-
- return simple_strtoul(val, NULL, 0);
-}
-
#if defined(BCMDBG)
/* pretty hex print a pkt buffer chain */
void prpkt(const char *msg, struct sk_buff *p0)