1 #ifndef __LINUX_NETDEVICE_WRAPPER_H
2 #define __LINUX_NETDEVICE_WRAPPER_H 1
4 #include_next <linux/netdevice.h>
9 #define to_net_dev(class) container_of(class, struct net_device, class_dev)
12 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,26)
14 struct net *dev_net(const struct net_device *dev)
18 #endif /* linux kernel < 2.6.26 */
20 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
21 #define proc_net init_net.proc_net
24 #ifndef for_each_netdev
25 /* Linux before 2.6.22 didn't have for_each_netdev at all. */
26 #define for_each_netdev(net, d) for (d = dev_base; d; d = d->next)
27 #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
28 /* Linux 2.6.24 added a network namespace pointer to the macro. */
29 #undef for_each_netdev
30 #define for_each_netdev(net,d) list_for_each_entry(d, &dev_base_head, dev_list)