ar71xx: simplify model detection for TP-Link Pharos devices

This also makes the detection more flexible, as it doesn't need to check
for each model explicitly.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
This commit is contained in:
Matthias Schiffer 2016-12-11 17:54:49 +01:00
parent b305b8c386
commit fcf54f79d2
No known key found for this signature in database
GPG key ID: 16EF3F64CB201D9C

View file

@ -350,27 +350,10 @@ tplink_pharos_get_model_string() {
tplink_pharos_board_detect() { tplink_pharos_board_detect() {
local model_string="$(tplink_pharos_get_model_string | tr -d '\r')" local model_string="$(tplink_pharos_get_model_string | tr -d '\r')"
local oIFS="$IFS"; IFS=":"; set -- $model_string; IFS="$oIFS" local oIFS="$IFS"; IFS=":"; set -- $model_string; IFS="$oIFS"
local model
case "$1" in local model="${1%%\(*}"
'CPE210(TP-LINK|UN|N300-2)')
model='TP-Link CPE210'
;;
'CPE220(TP-LINK|UN|N300-2)')
model='TP-Link CPE220'
;;
'CPE510(TP-LINK|UN|N300-5)')
model='TP-Link CPE510'
;;
'CPE520(TP-LINK|UN|N300-5)')
model='TP-Link CPE520'
;;
'EAP120(TP-LINK|UN|N300-2)')
model='TP-Link EAP120'
;;
esac
[ -n "$model" ] && AR71XX_MODEL="$model v$2" AR71XX_MODEL="TP-Link $model v$2"
} }
gl_inet_board_detect() { gl_inet_board_detect() {