brcm47xx: fix detection of Asus RT-N16
authorHauke Mehrtens <hauke@hauke-m.de>
Mon, 4 Feb 2013 22:49:05 +0000 (22:49 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Mon, 4 Feb 2013 22:49:05 +0000 (22:49 +0000)
This fixes #12936.

SVN-Revision: 35492

target/linux/brcm47xx/patches-3.6/260-MIPS-BCM47XX-add-board-detection.patch

index 06dbd0216a6f677a7ad01322f1b69ebc4a9a6929..18a3b1afec0e09464b5a7645e33e34d7694c77d5 100644 (file)
@@ -8,7 +8,7 @@
  obj-$(CONFIG_BCM47XX_SSB)     += wgt634u.o
 --- /dev/null
 +++ b/arch/mips/bcm47xx/board.c
-@@ -0,0 +1,218 @@
+@@ -0,0 +1,219 @@
 +#include <linux/export.h>
 +#include <linux/string.h>
 +#include <bcm47xx_board.h>
@@ -39,6 +39,7 @@
 +};
 +
 +static const struct bcm47xx_board_type_list bcm47xx_board_list_hardware_version[] = {
++      {{BCM47XX_BOARD_ASUS_RTN16, "Asus RT-N16"}, "RT-N16-",},
 +      {{BCM47XX_BOARD_ASUS_WL330GE, "Asus WL330GE"}, "WL330GE-",},
 +      {{BCM47XX_BOARD_ASUS_WL500GPV1, "Asus WL500GPV1"}, "WL500gp-",},
 +      {{BCM47XX_BOARD_ASUS_WL500GPV2, "Asus WL500GPV2"}, "WL500GPV2-",},
 +
 +      if (bcm47xx_nvram_getenv("model_no", buf1, sizeof(buf1)) >= 0) {
 +              for (e = bcm47xx_board_list_model_no; e->value1; e++) {
-+                      if (!strcmp(buf1, e->value1))
++                      if (strstarts(buf1, e->value1))
 +                              return &e->board;
 +              }
 +      }
 +
 +      if (bcm47xx_nvram_getenv("hardware_version", buf1, sizeof(buf1)) >= 0) {
 +              for (e = bcm47xx_board_list_hardware_version; e->value1; e++) {
-+                      if (!strcmp(buf1, e->value1))
++                      if (strstarts(buf1, e->value1))
 +                              return &e->board;
 +              }
 +      }