Skip to content
Snippets Groups Projects
Unverified Commit 09be087a authored by Roman Azarenko's avatar Roman Azarenko
Browse files

brcm63xx-arm: fix media type setting with autonegotiation disabled

Commit 7d1285b6 introduced an issue with setting media type for a particular port when
autonegotiation is disabled. In this case $subport ends up being undefined, resulting in an error in ethctl, which
leads to the appropriate media type not being set.

This change is designed to fix the above. Additionally cleaned up the conditionals a bit, so that media type is only
determined once and then reused regardless of whether "oncrossbar" is set or not.

Related to IOP-6415
Related to IOP-5001
parent b929c9c8
No related branches found
No related tags found
1 merge request!341brcm63xx-arm: fix media type setting with autonegotiation disabled
...@@ -43,7 +43,7 @@ set_port_settings() { ...@@ -43,7 +43,7 @@ set_port_settings() {
local autoneg=$5 local autoneg=$5
local eee=$6 local eee=$6
local pause=$7 local pause=$7
local crossbarports local crossbarports media_type
[ -d /sys/class/net/$ifname ] || return [ -d /sys/class/net/$ifname ] || return
...@@ -56,22 +56,20 @@ set_port_settings() { ...@@ -56,22 +56,20 @@ set_port_settings() {
[ "$duplex" == 0 ] && dplx="HD" || dplx="FD" [ "$duplex" == 0 ] && dplx="HD" || dplx="FD"
crossbar="$(echo `ethctl $ifname phy-crossbar` | awk -F' ' '{ print $2 $3 }')" crossbar="$(echo `ethctl $ifname phy-crossbar` | awk -F' ' '{ print $2 $3 }')"
if [ "$autoneg" = "on" ]; then
media_type="auto"
else
media_type="$speed$dplx"
fi
if [ "$crossbar" == "oncrossbar" ]; then if [ "$crossbar" == "oncrossbar" ]; then
crossbarports="$(echo `ethctl $ifname phy-crossbar` | awk -F':' '{ print $NF }')" crossbarports="$(echo `ethctl $ifname phy-crossbar` | awk -F':' '{ print $NF }')"
if [ "$autoneg" == "on" ]; then for subport in $crossbarports; do
for subport in $crossbarports; do ethctl $ifname media-type $media_type port $subport &>/dev/null
ethctl $ifname media-type auto port $subport &>/dev/null done
done
else
ethctl $ifname media-type $speed$dplx port $subport &>/dev/null
fi
else else
if [ "$autoneg" == "on" ]; then ethctl $ifname media-type $media_type &>/dev/null
ethctl $ifname media-type auto &>/dev/null
else
ethctl $ifname media-type $speed$dplx &>/dev/null
fi
fi fi
[ $eee -eq 1 ] && eee="on" || eee="off" [ $eee -eq 1 ] && eee="on" || eee="off"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment