netdev/carrier: monitor the driver status
This commit is contained in:
parent
10acadb64b
commit
9131ae1f1f
@ -51,6 +51,7 @@
|
||||
#include <nuttx/net/netdev.h>
|
||||
|
||||
#include "netdev/netdev.h"
|
||||
#include "netlink/netlink.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
@ -76,6 +77,7 @@ int netdev_carrier_on(FAR struct net_driver_s *dev)
|
||||
if (dev)
|
||||
{
|
||||
dev->d_flags |= IFF_RUNNING;
|
||||
netlink_device_notify(dev);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@ -102,6 +104,7 @@ int netdev_carrier_off(FAR struct net_driver_s *dev)
|
||||
if (dev)
|
||||
{
|
||||
dev->d_flags &= ~IFF_RUNNING;
|
||||
netlink_device_notify(dev);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
@ -89,6 +89,7 @@
|
||||
#include "igmp/igmp.h"
|
||||
#include "icmpv6/icmpv6.h"
|
||||
#include "route/route.h"
|
||||
#include "netlink/netlink.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
@ -1761,6 +1762,10 @@ void netdev_ifup(FAR struct net_driver_s *dev)
|
||||
/* Mark the interface as up */
|
||||
|
||||
dev->d_flags |= IFF_UP;
|
||||
|
||||
/* Update the driver status */
|
||||
|
||||
netlink_device_notify(dev);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1783,6 +1788,10 @@ void netdev_ifdown(FAR struct net_driver_s *dev)
|
||||
/* Mark the interface as down */
|
||||
|
||||
dev->d_flags &= ~IFF_UP;
|
||||
|
||||
/* Update the driver status */
|
||||
|
||||
netlink_device_notify(dev);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user