diff --git a/drivers/staging/brcm80211/brcmsmac/nicpci.c b/drivers/staging/brcm80211/brcmsmac/nicpci.c index 5a127d253d02606bfa5c7245ce214d2bf6fa903f..18b844a8d2fb370fb67098c2f5dad01cf7cb6146 100644 --- a/drivers/staging/brcm80211/brcmsmac/nicpci.c +++ b/drivers/staging/brcm80211/brcmsmac/nicpci.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/staging/brcm80211/brcmsmac/nvram.c b/drivers/staging/brcm80211/brcmsmac/nvram.c index 0e93a55d728e91c2721194f1ed15719aa2cd0079..830e30f39966e668607608fc9749f188d9c5ed72 100644 --- a/drivers/staging/brcm80211/brcmsmac/nvram.c +++ b/drivers/staging/brcm80211/brcmsmac/nvram.c @@ -108,6 +108,49 @@ static char *findvar(char *vars, char *lim, const char *name) 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; diff --git a/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c index 8fc1bef5c0a2cedccd4910239387a4713b06fb40..a28633c97699f7a78310115afd97023b5cb36111 100644 --- a/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c +++ b/drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff --git a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c index 9f2e5a294c7ef43dfc93854e790a167ef44360c0..2dd7c7b5ae5e81379303e2cde526aa7b3defa1e5 100644 --- a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c +++ b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_antsel.c b/drivers/staging/brcm80211/brcmsmac/wlc_antsel.c index a8037e999cdd8505063aa751cb3ada69c3e71f9c..3d9485ac2a9563c9616cf62e883fee01e1b3dbdc 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_antsel.c +++ b/drivers/staging/brcm80211/brcmsmac/wlc_antsel.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c b/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c index 91d366dd18c09ba1cfc6babd7dfef86c60e46b41..cf0d2bf7b902867b33ee6f3c27a4ac53e5c60ddd 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c +++ b/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_channel.c b/drivers/staging/brcm80211/brcmsmac/wlc_channel.c index bde82bd277da5faf4b13b0d6a5c1d5e396f90163..fe3e3927cbfb73e4f35174059890f3d17ee6c453 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_channel.c +++ b/drivers/staging/brcm80211/brcmsmac/wlc_channel.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_main.c b/drivers/staging/brcm80211/brcmsmac/wlc_main.c index 4d8fa34c60e1e89a273f20c3ac2817ac7d65954c..3eaabe9c1f00ddb661650bbd71229dec4e36f701 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_main.c +++ b/drivers/staging/brcm80211/brcmsmac/wlc_main.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_pmu.c b/drivers/staging/brcm80211/brcmsmac/wlc_pmu.c index 5b1697a2d899b8acbdf1b144c54ef353e0863a6b..82986bd1ccfacd4aebd670e9a44e473b9c37294f 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_pmu.c +++ b/drivers/staging/brcm80211/brcmsmac/wlc_pmu.c @@ -21,6 +21,7 @@ #include #include #include +#include #include "wlc_pmu.h" /* diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_stf.c b/drivers/staging/brcm80211/brcmsmac/wlc_stf.c index aa8d42deb269ad8dc502b138cd4768627d68cfb0..c4f58172182d61d724c417b17dd3e7795b5549cf 100644 --- a/drivers/staging/brcm80211/brcmsmac/wlc_stf.c +++ b/drivers/staging/brcm80211/brcmsmac/wlc_stf.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "wlc_types.h" diff --git a/drivers/staging/brcm80211/include/bcmnvram.h b/drivers/staging/brcm80211/include/bcmnvram.h index e194131a750ec4907b1db4f196b6fa4ef1e86dd8..e58151c0ec443724f931d7bb09703360caf98146 100644 --- a/drivers/staging/brcm80211/include/bcmnvram.h +++ b/drivers/staging/brcm80211/include/bcmnvram.h @@ -147,6 +147,10 @@ u8 nvram_calc_crc(struct nvram_header *nvh); #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" diff --git a/drivers/staging/brcm80211/include/bcmutils.h b/drivers/staging/brcm80211/include/bcmutils.h index d83a50451878a7427f953b42a315753f13ab2a61..905e3cef7a4c967ce7251809cca2337b06198805 100644 --- a/drivers/staging/brcm80211/include/bcmutils.h +++ b/drivers/staging/brcm80211/include/bcmutils.h @@ -141,9 +141,6 @@ extern struct sk_buff *pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out); 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 diff --git a/drivers/staging/brcm80211/util/bcmutils.c b/drivers/staging/brcm80211/util/bcmutils.c index 95214cf27710074cc1ef686edc4c2e7964fcaed1..0c21e43e3add1cce810502efcf9cdc38baeb27dd 100644 --- a/drivers/staging/brcm80211/util/bcmutils.c +++ b/drivers/staging/brcm80211/util/bcmutils.c @@ -353,53 +353,6 @@ int bcm_ether_atoe(char *p, u8 *ea) 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)