network/netdev: introduce .is_ready_to_create() entry in netdev vtable

This commit is contained in:
Yu Watanabe
2021-12-12 13:41:39 +09:00
parent d2a58f0edb
commit 562729d744
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -628,6 +628,9 @@ static bool netdev_is_ready_to_create(NetDev *netdev, Link *link) {
if (link->set_link_messages > 0)
return false;
if (NETDEV_VTABLE(netdev)->is_ready_to_create)
return NETDEV_VTABLE(netdev)->is_ready_to_create(netdev, link);
return true;
}
+3
View File
@@ -153,6 +153,9 @@ typedef struct NetDevVTable {
/* specifies if netdev is independent, or a master device or a stacked device */
NetDevCreateType create_type;
/* This is used for stacked netdev. Return true when the underlying link is ready. */
int (*is_ready_to_create)(NetDev *netdev, Link *link);
/* create netdev, if not done via rtnl */
int (*create)(NetDev *netdev);