diff options
author | Rafał Miłecki <zajec5@gmail.com> | 2015-04-23 11:31:54 +0000 |
---|---|---|
committer | Rafał Miłecki <zajec5@gmail.com> | 2015-04-23 11:31:54 +0000 |
commit | 2d8d0aa3529a78e2d74cda928fb167e5d3c73ac5 (patch) | |
tree | fe7bb924c8a8d42f720b493840b06a800d0f569c /target/linux/brcm47xx/patches-4.0/030-10-MIPS-BCM47xx-Keep-ID-entries-for-non-standard-device.patch | |
parent | 912768cf9d2b336edfb0a72f79c38738a1591ba1 (diff) | |
download | upstream-2d8d0aa3529a78e2d74cda928fb167e5d3c73ac5.tar.gz upstream-2d8d0aa3529a78e2d74cda928fb167e5d3c73ac5.tar.bz2 upstream-2d8d0aa3529a78e2d74cda928fb167e5d3c73ac5.zip |
brcm47xx: add patches for kernel 4.0
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@45570 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm47xx/patches-4.0/030-10-MIPS-BCM47xx-Keep-ID-entries-for-non-standard-device.patch')
-rw-r--r-- | target/linux/brcm47xx/patches-4.0/030-10-MIPS-BCM47xx-Keep-ID-entries-for-non-standard-device.patch | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-4.0/030-10-MIPS-BCM47xx-Keep-ID-entries-for-non-standard-device.patch b/target/linux/brcm47xx/patches-4.0/030-10-MIPS-BCM47xx-Keep-ID-entries-for-non-standard-device.patch new file mode 100644 index 0000000000..1f7233b807 --- /dev/null +++ b/target/linux/brcm47xx/patches-4.0/030-10-MIPS-BCM47xx-Keep-ID-entries-for-non-standard-device.patch @@ -0,0 +1,101 @@ +From 7515c6f1da334184c3ece06e6f61461086d8e2b1 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com> +Date: Wed, 1 Apr 2015 18:18:01 +0200 +Subject: [PATCH] MIPS: BCM47xx: Keep ID entries for non-standard devices + together +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Rafał Miłecki <zajec5@gmail.com> +Cc: linux-mips@linux-mips.org +Cc: Hauke Mehrtens <hauke@hauke-m.de> +Patchwork: https://patchwork.linux-mips.org/patch/9655/ +Signed-off-by: Ralf Baechle <ralf@linux-mips.org> +--- + arch/mips/bcm47xx/board.c | 48 ++++++++++++++++++++--------------------------- + 1 file changed, 20 insertions(+), 28 deletions(-) + +diff --git a/arch/mips/bcm47xx/board.c b/arch/mips/bcm47xx/board.c +index d4a5a51..f936dcc 100644 +--- a/arch/mips/bcm47xx/board.c ++++ b/arch/mips/bcm47xx/board.c +@@ -40,20 +40,6 @@ struct bcm47xx_board_type_list1 bcm47xx_board_list_model_name[] __initconst = { + { {0}, NULL}, + }; + +-/* model_no */ +-static const +-struct bcm47xx_board_type_list1 bcm47xx_board_list_model_no[] __initconst = { +- {{BCM47XX_BOARD_ASUS_WL700GE, "Asus WL700"}, "WL700"}, +- { {0}, NULL}, +-}; +- +-/* machine_name */ +-static const +-struct bcm47xx_board_type_list1 bcm47xx_board_list_machine_name[] __initconst = { +- {{BCM47XX_BOARD_LINKSYS_WRTSL54GS, "Linksys WRTSL54GS"}, "WRTSL54GS"}, +- { {0}, NULL}, +-}; +- + /* hardware_version */ + static const + struct bcm47xx_board_type_list1 bcm47xx_board_list_hardware_version[] __initconst = { +@@ -202,6 +188,18 @@ struct bcm47xx_board_type_list2 bcm47xx_board_list_board_type_rev[] __initconst + { {0}, NULL}, + }; + ++/* ++ * Some devices don't use any common NVRAM entry for identification and they ++ * have only one model specific variable. ++ * They don't deserve own arrays, let's group them there using key-value array. ++ */ ++static const ++struct bcm47xx_board_type_list2 bcm47xx_board_list_key_value[] __initconst = { ++ {{BCM47XX_BOARD_ASUS_WL700GE, "Asus WL700"}, "model_no", "WL700"}, ++ {{BCM47XX_BOARD_LINKSYS_WRTSL54GS, "Linksys WRTSL54GS"}, "machine_name", "WRTSL54GS"}, ++ { {0}, NULL}, ++}; ++ + static const + struct bcm47xx_board_type bcm47xx_board_unknown[] __initconst = { + {BCM47XX_BOARD_UNKNOWN, "Unknown Board"}, +@@ -225,20 +223,6 @@ static __init const struct bcm47xx_board_type *bcm47xx_board_get_nvram(void) + } + } + +- if (bcm47xx_nvram_getenv("model_no", buf1, sizeof(buf1)) >= 0) { +- for (e1 = bcm47xx_board_list_model_no; e1->value1; e1++) { +- if (strstarts(buf1, e1->value1)) +- return &e1->board; +- } +- } +- +- if (bcm47xx_nvram_getenv("machine_name", buf1, sizeof(buf1)) >= 0) { +- for (e1 = bcm47xx_board_list_machine_name; e1->value1; e1++) { +- if (strstarts(buf1, e1->value1)) +- return &e1->board; +- } +- } +- + if (bcm47xx_nvram_getenv("hardware_version", buf1, sizeof(buf1)) >= 0) { + for (e1 = bcm47xx_board_list_hardware_version; e1->value1; e1++) { + if (strstarts(buf1, e1->value1)) +@@ -314,6 +298,14 @@ static __init const struct bcm47xx_board_type *bcm47xx_board_get_nvram(void) + return &e2->board; + } + } ++ ++ for (e2 = bcm47xx_board_list_key_value; e2->value1; e2++) { ++ if (bcm47xx_nvram_getenv(e2->value1, buf1, sizeof(buf1)) >= 0) { ++ if (!strcmp(buf1, e2->value2)) ++ return &e2->board; ++ } ++ } ++ + return bcm47xx_board_unknown; + } + +-- +1.8.4.5 + |