fix kmod-switch compile on brcm-2.4 (#1461)

SVN-Revision: 6565
master
Felix Fietkau 18 years ago
parent dcfbd5f656
commit 80840457a5
  1. 2
      package/switch/Makefile
  2. 22
      package/switch/src/switch-adm.c

@ -36,7 +36,7 @@ define Build/Prepare
endef endef
ifeq ($(BOARD),brcm) ifeq ($(BOARD),brcm)
BUILDFLAGS := -DBROADCOM -DBCMDRIVER BUILDFLAGS := -DBROADCOM -DBCMDRIVER -I$(LINUX_DIR)/arch/mips/bcm947xx/include
else else
ifeq ($(BOARD),brcm47xx) ifeq ($(BOARD),brcm47xx)
BUILDFLAGS := -DBROADCOM BUILDFLAGS := -DBROADCOM

@ -75,7 +75,7 @@ MODULE_PARM(force, "i");
#define atoi(str) simple_strtoul(((str != NULL) ? str : ""), NULL, 0) #define atoi(str) simple_strtoul(((str != NULL) ? str : ""), NULL, 0)
#if defined(BCMGPIO2) || defined(BCMGPIO) #ifdef BROADCOM
extern char *nvram_get(char *name); extern char *nvram_get(char *name);
/* Return gpio pin number assigned to the named pin */ /* Return gpio pin number assigned to the named pin */
@ -86,7 +86,7 @@ extern char *nvram_get(char *name);
* *
* 'def_pin' is returned if there is no such variable found. * 'def_pin' is returned if there is no such variable found.
*/ */
static unsigned int getgpiopin(char *pin_name, unsigned int def_pin) static unsigned int get_gpiopin(char *pin_name, unsigned int def_pin)
{ {
char name[] = "gpioXXXX"; char name[] = "gpioXXXX";
char *val; char *val;
@ -496,25 +496,25 @@ static int detect_adm(void)
{ {
int ret = 0; int ret = 0;
#if defined(BCMGPIO2) || defined(BCMGPIO) #ifdef BROADCOM
int boardflags = atoi(nvram_get("boardflags")); int boardflags = atoi(nvram_get("boardflags"));
int boardnum = atoi(nvram_get("boardnum")); int boardnum = atoi(nvram_get("boardnum"));
if (boardnum == 44) { /* Trendware TEW-411BRP+ */ if (boardnum == 44) { /* Trendware TEW-411BRP+ */
ret = 1; ret = 1;
eecs = getgpiopin("adm_eecs", 2); eecs = get_gpiopin("adm_eecs", 2);
eesk = getgpiopin("adm_eesk", 3); eesk = get_gpiopin("adm_eesk", 3);
eedi = getgpiopin("adm_eedi", 4); eedi = get_gpiopin("adm_eedi", 4);
eerc = getgpiopin("adm_rc", 5); eerc = get_gpiopin("adm_rc", 5);
} else if ((boardflags & 0x80) || force) { } else if ((boardflags & 0x80) || force) {
ret = 1; ret = 1;
eecs = getgpiopin("adm_eecs", 2); eecs = get_gpiopin("adm_eecs", 2);
eesk = getgpiopin("adm_eesk", 3); eesk = get_gpiopin("adm_eesk", 3);
eedi = getgpiopin("adm_eedi", 4); eedi = get_gpiopin("adm_eedi", 4);
eerc = getgpiopin("adm_rc", 0); eerc = get_gpiopin("adm_rc", 0);
} else if ((strcmp(nvram_get("boardtype") ?: "", "bcm94710dev") == 0) && } else if ((strcmp(nvram_get("boardtype") ?: "", "bcm94710dev") == 0) &&
(strncmp(nvram_get("boardnum") ?: "", "42", 2) == 0)) { (strncmp(nvram_get("boardnum") ?: "", "42", 2) == 0)) {

Loading…
Cancel
Save