Commit 90193770 authored by Henry Ptasinski's avatar Henry Ptasinski Committed by Greg Kroah-Hartman
Browse files

staging: brcm80211: move functions only used by brcmsmac out of utils



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: default avatarBrett Rudley <brudley@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 192f25a2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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>
+43 −0
Original line number Diff line number Diff line
@@ -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;
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <linux/pci.h>
#include <aiutils.h>
#include <wlc_pmu.h>
#include <bcmnvram.h>

#include <bcmdevs.h>
#include <sbhnddma.h>
+1 −0
Original line number Diff line number Diff line
@@ -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>
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@

#include <bcmdefs.h>
#include <bcmutils.h>
#include <bcmnvram.h>
#include <aiutils.h>
#include <bcmdevs.h>
#include <sbhnddma.h>
Loading