mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
ethmngr: reset port before configuration
This commit is contained in:
parent
f6966c07af
commit
158927eb5f
1 changed files with 9 additions and 0 deletions
|
|
@ -40,6 +40,12 @@ get_port_number() {
|
|||
done
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
reset_port() {
|
||||
local ifname="$1"
|
||||
ethctl $ifname phy-reset >/dev/null
|
||||
}
|
||||
|
||||
# arg1: port ifname, ex: eth0
|
||||
# arg2: port enabled, ex: 1
|
||||
power_updown() {
|
||||
|
|
@ -86,6 +92,9 @@ set_port_settings() {
|
|||
phycaps="$(ethctl $ifname media-type ${pyhendpoint:+ port $pyhendpoint} | awk -F'PHY Capabilities: ' '{print$2}')"
|
||||
numofcaps="$(echo $phycaps | tr '|' ' ' | wc -w)"
|
||||
|
||||
# Reset the port before setting new params
|
||||
reset_port $ifname
|
||||
|
||||
if [ "$numofcaps" == "1" ]; then
|
||||
logger -t "port-management" "$ifname is capable of $phycaps only; not setting speed/duplex"
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue