@@ -2249,6 +2249,18 @@ static inline void *netdev_priv(const struct net_device *dev)
return (char *)dev + ALIGN(sizeof(struct net_device), NETDEV_ALIGN);
}
+/**
+ * priv_to_netdev - get the net_device from private data
+ * @priv: net_device private data
+ *
+ * Get the address of network device associated with this private data.
+ */
+static inline struct net_device *priv_to_netdev(void *priv)
+{
+ priv = (char *)priv - ALIGN(sizeof(struct net_device), NETDEV_ALIGN);
+ return (struct net_device *)priv;
+}
+
/* Set the sysfs physical device reference for the network logical device
* if set prior to registration will cause a symlink during initialization.
*/