mirror of
https://github.com/apache/nuttx.git
synced 2026-03-26 18:23:50 +08:00
netdev_driver: add carrier_on to xxx_ifup where carrier_on is absent
since the judgment for network card selection was changed from IS_UP to IS_RUNNING, drivers that lack carrier_on need to add the carrier_on operation; otherwise, network access issues will occur. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
@@ -680,6 +680,7 @@ static int xbeenet_ifup(FAR struct net_driver_s *dev)
|
||||
|
||||
priv->xd_bifup = true;
|
||||
ret = OK;
|
||||
netdev_carrier_on(dev);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -720,6 +721,9 @@ static int xbeenet_ifdown(FAR struct net_driver_s *dev)
|
||||
|
||||
priv->xd_bifup = false;
|
||||
leave_critical_section(flags);
|
||||
|
||||
netdev_carrier_off(dev);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1777,6 +1777,7 @@ static int spirit_ifup(FAR struct net_driver_s *dev)
|
||||
/* We are up! */
|
||||
|
||||
priv->ifup = true;
|
||||
netdev_carrier_on(dev);
|
||||
}
|
||||
|
||||
return OK;
|
||||
@@ -1875,6 +1876,7 @@ static int spirit_ifdown(FAR struct net_driver_s *dev)
|
||||
}
|
||||
|
||||
priv->ifup = false;
|
||||
netdev_carrier_off(dev);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user