aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 488c56e649b5..d3ea3de70a8a 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -42,6 +42,7 @@
42#include <linux/workqueue.h> 42#include <linux/workqueue.h>
43 43
44#include <net/net_namespace.h> 44#include <net/net_namespace.h>
45#include <net/dsa.h>
45 46
46struct vlan_group; 47struct vlan_group;
47struct ethtool_ops; 48struct ethtool_ops;
@@ -471,6 +472,8 @@ struct net_device
471 char name[IFNAMSIZ]; 472 char name[IFNAMSIZ];
472 /* device name hash chain */ 473 /* device name hash chain */
473 struct hlist_node name_hlist; 474 struct hlist_node name_hlist;
475 /* snmp alias */
476 char *ifalias;
474 477
475 /* 478 /*
476 * I/O specific fields 479 * I/O specific fields
@@ -605,6 +608,9 @@ struct net_device
605 608
606 /* Protocol specific pointers */ 609 /* Protocol specific pointers */
607 610
611#ifdef CONFIG_NET_DSA
612 void *dsa_ptr; /* dsa specific data */
613#endif
608 void *atalk_ptr; /* AppleTalk link */ 614 void *atalk_ptr; /* AppleTalk link */
609 void *ip_ptr; /* IPv4 specific data */ 615 void *ip_ptr; /* IPv4 specific data */
610 void *dn_ptr; /* DECnet specific data */ 616 void *dn_ptr; /* DECnet specific data */
@@ -796,6 +802,26 @@ void dev_net_set(struct net_device *dev, struct net *net)
796#endif 802#endif
797} 803}
798 804
805static inline bool netdev_uses_dsa_tags(struct net_device *dev)
806{
807#ifdef CONFIG_NET_DSA_TAG_DSA
808 if (dev->dsa_ptr != NULL)
809 return dsa_uses_dsa_tags(dev->dsa_ptr);
810#endif
811
812 return 0;
813}
814
815static inline bool netdev_uses_trailer_tags(struct net_device *dev)
816{
817#ifdef CONFIG_NET_DSA_TAG_TRAILER
818 if (dev->dsa_ptr != NULL)
819 return dsa_uses_trailer_tags(dev->dsa_ptr);
820#endif
821
822 return 0;
823}
824
799/** 825/**
800 * netdev_priv - access network device private data 826 * netdev_priv - access network device private data
801 * @dev: network device 827 * @dev: network device
@@ -1223,7 +1249,8 @@ extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
1223extern int dev_ethtool(struct net *net, struct ifreq *); 1249extern int dev_ethtool(struct net *net, struct ifreq *);
1224extern unsigned dev_get_flags(const struct net_device *); 1250extern unsigned dev_get_flags(const struct net_device *);
1225extern int dev_change_flags(struct net_device *, unsigned); 1251extern int dev_change_flags(struct net_device *, unsigned);
1226extern int dev_change_name(struct net_device *, char *); 1252extern int dev_change_name(struct net_device *, const char *);
1253extern int dev_set_alias(struct net_device *, const char *, size_t);
1227extern int dev_change_net_namespace(struct net_device *, 1254extern int dev_change_net_namespace(struct net_device *,
1228 struct net *, const char *); 1255 struct net *, const char *);
1229extern int dev_set_mtu(struct net_device *, int); 1256extern int dev_set_mtu(struct net_device *, int);
@@ -1667,7 +1694,7 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
1667extern int netdev_class_create_file(struct class_attribute *class_attr); 1694extern int netdev_class_create_file(struct class_attribute *class_attr);
1668extern void netdev_class_remove_file(struct class_attribute *class_attr); 1695extern void netdev_class_remove_file(struct class_attribute *class_attr);
1669 1696
1670extern char *netdev_drivername(struct net_device *dev, char *buffer, int len); 1697extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len);
1671 1698
1672extern void linkwatch_run_queue(void); 1699extern void linkwatch_run_queue(void);
1673 1700