sim/netdev: Update IFF_RUNNING flag by netdev_carrier_on and netdev_carrier_off

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2021-12-21 16:21:07 +08:00 committed by Gustavo Henrique Nihei
parent 19e748f278
commit b03886415f

View File

@ -283,11 +283,13 @@ static int netdriver_ifup(FAR struct net_driver_s *dev)
{
netdev_ifup(dev->d_ipaddr);
work_queue(LPWORK, &g_timer_work, netdriver_timer_work, dev, CLK_TCK);
netdev_carrier_on(dev);
return OK;
}
static int netdriver_ifdown(FAR struct net_driver_s *dev)
{
netdev_carrier_off(dev);
work_cancel(LPWORK, &g_timer_work);
netdev_ifdown();
return OK;