drivers: ethernet: stm32: stop hal before config
make sure the hal is stopped, before configuring the link. The phy can change the speed without notifying a link down in between. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
This commit is contained in:
parent
c8415cd76b
commit
242d348fca
1 changed files with 4 additions and 1 deletions
|
@ -1128,12 +1128,15 @@ static void phy_link_state_changed(const struct device *phy_dev, struct phy_link
|
|||
|
||||
ARG_UNUSED(phy_dev);
|
||||
|
||||
/* The hal also needs to be stopped before changing the MAC config.
|
||||
* The speed can change without receiving a link down callback before.
|
||||
*/
|
||||
eth_stm32_hal_stop(dev);
|
||||
if (state->is_up) {
|
||||
set_mac_config(dev, state);
|
||||
eth_stm32_hal_start(dev);
|
||||
net_eth_carrier_on(dev_data->iface);
|
||||
} else {
|
||||
eth_stm32_hal_stop(dev);
|
||||
net_eth_carrier_off(dev_data->iface);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue