summaryrefslogtreecommitdiff
path: root/components/net/netdev/src
diff options
context:
space:
mode:
authorzylx <[email protected]>2019-06-21 14:36:25 +0800
committerzylx <[email protected]>2019-06-21 14:38:56 +0800
commite16f30df5bc351dd01237a24957f1dc3f6ec903a (patch)
tree66149fca168a422464d2b47a504e8cfb121a3761 /components/net/netdev/src
parent892e667d7e07f048cec03b367daa6752bc4edebd (diff)
[component] Synchronize AT and netdev components
Diffstat (limited to 'components/net/netdev/src')
-rw-r--r--components/net/netdev/src/netdev.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/components/net/netdev/src/netdev.c b/components/net/netdev/src/netdev.c
index 71b1ec7ccd..5f49a46f17 100644
--- a/components/net/netdev/src/netdev.c
+++ b/components/net/netdev/src/netdev.c
@@ -294,6 +294,20 @@ struct netdev *netdev_get_by_family(int family)
return RT_NULL;
}
+/**
+ * This function will get the family type from network interface device
+ *
+ * @param netdev network interface device object
+ *
+ * @return the network interface device family type
+ */
+int netdev_family_get(struct netdev *netdev)
+{
+ RT_ASSERT(netdev);
+
+ return ((struct sal_proto_family *)netdev->sal_user_data)->family;
+}
+
#endif /* RT_USING_SAL */
/**