diff options
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 31 |
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 | ||
46 | struct vlan_group; | 47 | struct vlan_group; |
47 | struct ethtool_ops; | 48 | struct 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 | ||
805 | static 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 | |||
815 | static 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 *); | |||
1223 | extern int dev_ethtool(struct net *net, struct ifreq *); | 1249 | extern int dev_ethtool(struct net *net, struct ifreq *); |
1224 | extern unsigned dev_get_flags(const struct net_device *); | 1250 | extern unsigned dev_get_flags(const struct net_device *); |
1225 | extern int dev_change_flags(struct net_device *, unsigned); | 1251 | extern int dev_change_flags(struct net_device *, unsigned); |
1226 | extern int dev_change_name(struct net_device *, char *); | 1252 | extern int dev_change_name(struct net_device *, const char *); |
1253 | extern int dev_set_alias(struct net_device *, const char *, size_t); | ||
1227 | extern int dev_change_net_namespace(struct net_device *, | 1254 | extern int dev_change_net_namespace(struct net_device *, |
1228 | struct net *, const char *); | 1255 | struct net *, const char *); |
1229 | extern int dev_set_mtu(struct net_device *, int); | 1256 | extern int dev_set_mtu(struct net_device *, int); |
@@ -1667,7 +1694,7 @@ extern void dev_seq_stop(struct seq_file *seq, void *v); | |||
1667 | extern int netdev_class_create_file(struct class_attribute *class_attr); | 1694 | extern int netdev_class_create_file(struct class_attribute *class_attr); |
1668 | extern void netdev_class_remove_file(struct class_attribute *class_attr); | 1695 | extern void netdev_class_remove_file(struct class_attribute *class_attr); |
1669 | 1696 | ||
1670 | extern char *netdev_drivername(struct net_device *dev, char *buffer, int len); | 1697 | extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len); |
1671 | 1698 | ||
1672 | extern void linkwatch_run_queue(void); | 1699 | extern void linkwatch_run_queue(void); |
1673 | 1700 | ||