staging: brcm80211: move functions only used by brcmsmac out of utils
authorHenry Ptasinski <henryp@broadcom.com>
Mon, 9 May 2011 14:33:09 +0000 (16:33 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 10 May 2011 18:07:18 +0000 (11:07 -0700)
The functions gitvar() and getintvar() are only used by brcmsmac, so move them
out of the bcmutils.c file, which is shared by both brcmsmac and brcmfmac.

Cc: devel@linuxdriverproject.org
Cc: linux-wireless@vger.kernel.org
Reviewed-by: Brett Rudley <brudley@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
13 files changed:
drivers/staging/brcm80211/brcmsmac/nicpci.c
drivers/staging/brcm80211/brcmsmac/nvram.c
drivers/staging/brcm80211/brcmsmac/phy/wlc_phy_lcn.c
drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
drivers/staging/brcm80211/brcmsmac/wlc_antsel.c
drivers/staging/brcm80211/brcmsmac/wlc_bmac.c
drivers/staging/brcm80211/brcmsmac/wlc_channel.c
drivers/staging/brcm80211/brcmsmac/wlc_main.c
drivers/staging/brcm80211/brcmsmac/wlc_pmu.c
drivers/staging/brcm80211/brcmsmac/wlc_stf.c
drivers/staging/brcm80211/include/bcmnvram.h
drivers/staging/brcm80211/include/bcmutils.h
drivers/staging/brcm80211/util/bcmutils.c

index 5a127d253d02606bfa5c7245ce214d2bf6fa903f..18b844a8d2fb370fb67098c2f5dad01cf7cb6146 100644 (file)
@@ -19,6 +19,7 @@
 #include <linux/pci.h>
 #include <bcmdefs.h>
 #include <bcmutils.h>
+#include <bcmnvram.h>
 #include <aiutils.h>
 #include <hndsoc.h>
 #include <bcmdevs.h>
index 0e93a55d728e91c2721194f1ed15719aa2cd0079..830e30f39966e668607608fc9749f188d9c5ed72 100644 (file)
@@ -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;
index 8fc1bef5c0a2cedccd4910239387a4713b06fb40..a28633c97699f7a78310115afd97023b5cb36111 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/pci.h>
 #include <aiutils.h>
 #include <wlc_pmu.h>
+#include <bcmnvram.h>
 
 #include <bcmdevs.h>
 #include <sbhnddma.h>
index 9f2e5a294c7ef43dfc93854e790a167ef44360c0..2dd7c7b5ae5e81379303e2cde526aa7b3defa1e5 100644 (file)
@@ -30,6 +30,7 @@
 #include <bcmdefs.h>
 #include <bcmwifi.h>
 #include <bcmutils.h>
+#include <bcmnvram.h>
 #include <pcicfg.h>
 #include <wlioctl.h>
 #include <sbhnddma.h>
index a8037e999cdd8505063aa751cb3ada69c3e71f9c..3d9485ac2a9563c9616cf62e883fee01e1b3dbdc 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <bcmdefs.h>
 #include <bcmutils.h>
+#include <bcmnvram.h>
 #include <aiutils.h>
 #include <bcmdevs.h>
 #include <sbhnddma.h>
index 91d366dd18c09ba1cfc6babd7dfef86c60e46b41..cf0d2bf7b902867b33ee6f3c27a4ac53e5c60ddd 100644 (file)
@@ -29,6 +29,7 @@
 #include <bcmsrom.h>
 #include <bcmotp.h>
 #include <bcmutils.h>
+#include <bcmnvram.h>
 #include <wlioctl.h>
 #include <sbconfig.h>
 #include <sbchipc.h>
index bde82bd277da5faf4b13b0d6a5c1d5e396f90163..fe3e3927cbfb73e4f35174059890f3d17ee6c453 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <bcmdefs.h>
 #include <bcmutils.h>
+#include <bcmnvram.h>
 #include <aiutils.h>
 #include <sbhnddma.h>
 #include <wlioctl.h>
index 4d8fa34c60e1e89a273f20c3ac2817ac7d65954c..3eaabe9c1f00ddb661650bbd71229dec4e36f701 100644 (file)
@@ -23,6 +23,7 @@
 #include <bcmdevs.h>
 #include <bcmutils.h>
 #include <bcmwifi.h>
+#include <bcmnvram.h>
 #include <aiutils.h>
 #include <pcicfg.h>
 #include <bcmsrom.h>
index 5b1697a2d899b8acbdf1b144c54ef353e0863a6b..82986bd1ccfacd4aebd670e9a44e473b9c37294f 100644 (file)
@@ -21,6 +21,7 @@
 #include <bcmdevs.h>
 #include <sbchipc.h>
 #include <bcmutils.h>
+#include <bcmnvram.h>
 #include "wlc_pmu.h"
 
 /*
index aa8d42deb269ad8dc502b138cd4768627d68cfb0..c4f58172182d61d724c417b17dd3e7795b5549cf 100644 (file)
@@ -24,6 +24,7 @@
 #include <aiutils.h>
 #include <wlioctl.h>
 #include <bcmwifi.h>
+#include <bcmnvram.h>
 #include <sbhnddma.h>
 
 #include "wlc_types.h"
index e194131a750ec4907b1db4f196b6fa4ef1e86dd8..e58151c0ec443724f931d7bb09703360caf98146 100644 (file)
@@ -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"
 
index d83a50451878a7427f953b42a315753f13ab2a61..905e3cef7a4c967ce7251809cca2337b06198805 100644 (file)
@@ -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
index 95214cf27710074cc1ef686edc4c2e7964fcaed1..0c21e43e3add1cce810502efcf9cdc38baeb27dd 100644 (file)
@@ -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)