components: net: lwip: port: add netdev callback on link status change setting
- set netdev callback on link status change in netdev_add() Signed-off-by: Jiading Xu <Jiading.Xu@hpmicro.com>
This commit is contained in:
parent
04cad7f9c6
commit
79457efc49
|
@ -421,6 +421,11 @@ static int netdev_add(struct netif *lwip_netif)
|
||||||
netdev->gw = lwip_netif->gw;
|
netdev->gw = lwip_netif->gw;
|
||||||
netdev->netmask = lwip_netif->netmask;
|
netdev->netmask = lwip_netif->netmask;
|
||||||
|
|
||||||
|
#ifdef NETDEV_USING_LINK_STATUS_CALLBACK
|
||||||
|
extern void netdev_status_change(struct netdev *netdev, enum netdev_cb_type type);
|
||||||
|
netdev_set_status_callback(netdev, netdev_status_change);
|
||||||
|
#endif
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,10 @@ if RT_USING_NETDEV
|
||||||
bool "Enable default netdev automatic change features"
|
bool "Enable default netdev automatic change features"
|
||||||
default y
|
default y
|
||||||
|
|
||||||
|
config NETDEV_USING_LINK_STATUS_CALLBACK
|
||||||
|
bool "Enable netdev callback on link status change"
|
||||||
|
default n
|
||||||
|
|
||||||
config NETDEV_USING_IPV6
|
config NETDEV_USING_IPV6
|
||||||
bool "Enable IPV6 protocol support"
|
bool "Enable IPV6 protocol support"
|
||||||
default n
|
default n
|
||||||
|
|
Loading…
Reference in New Issue