aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/realtek/base-files
diff options
context:
space:
mode:
authorPaul Spooren <mail@aparcar.org>2022-07-30 20:25:32 +0200
committerSander Vanheule <sander@svanheule.net>2022-08-13 19:15:46 +0200
commitead7e5b4c3a4043aa97cec6b08ae2f70f54834d3 (patch)
treeaec4e235e9bbb7cb0cd6a8863551ed8f53b1208a /target/linux/realtek/base-files
parent67efb6a66146ac80986de928197b8116b2421779 (diff)
downloadupstream-ead7e5b4c3a4043aa97cec6b08ae2f70f54834d3.tar.gz
upstream-ead7e5b4c3a4043aa97cec6b08ae2f70f54834d3.tar.bz2
upstream-ead7e5b4c3a4043aa97cec6b08ae2f70f54834d3.zip
realtek: skip SFP ports in PoE setup
The function `ucidef_set_poe` receives a list of ports to add to the PoE array. Since switches have many ports the varibale `lan_list` is passed instead of writing every single lan port. However, this list includes partly SFP ports which are unrelated to PoE. This commits adds the option to add a third parameter to manually exclide interfaces, usually the last two. Signed-off-by: Paul Spooren <mail@aparcar.org> [Replace glob by regex to be more specific about matching characters] Signed-off-by: Sander Vanheule <sander@svanheule.net>
Diffstat (limited to 'target/linux/realtek/base-files')
-rw-r--r--target/linux/realtek/base-files/etc/board.d/02_network11
1 files changed, 7 insertions, 4 deletions
diff --git a/target/linux/realtek/base-files/etc/board.d/02_network b/target/linux/realtek/base-files/etc/board.d/02_network
index 5356bcac65..87d772cf84 100644
--- a/target/linux/realtek/base-files/etc/board.d/02_network
+++ b/target/linux/realtek/base-files/etc/board.d/02_network
@@ -8,6 +8,9 @@ ucidef_set_poe() {
json_add_string "budget" "$1"
json_select_array ports
for port in $2; do
+ if [ -n "$3" -a -n "$(expr "$3" : "\(.\+[[:space:]]\)\{0,1\}$port\([[:space:]].*\|\$\)")" ]; then
+ continue # skip ports passed via $3
+ fi
json_add_string "" "$port"
done
json_select ..
@@ -57,13 +60,13 @@ done
case $board in
netgear,gs110tpp-v1)
- ucidef_set_poe 130 "$lan_list"
+ ucidef_set_poe 130 "$lan_list" "lan9 lan10"
;;
netgear,gs310tp-v1)
- ucidef_set_poe 55 "$lan_list"
+ ucidef_set_poe 55 "$lan_list" "lan9 lan10"
;;
zyxel,gs1900-10hp)
- ucidef_set_poe 77 "$lan_list"
+ ucidef_set_poe 77 "$lan_list" "lan9 lan10"
;;
zyxel,gs1900-8hp-v1|\
zyxel,gs1900-8hp-v2)
@@ -71,7 +74,7 @@ zyxel,gs1900-8hp-v2)
;;
zyxel,gs1900-24hp-v1|\
zyxel,gs1900-24hp-v2)
- ucidef_set_poe 170 "$lan_list"
+ ucidef_set_poe 170 "$lan_list" "lan25 lan26"
;;
esac