diff options
Diffstat (limited to 'include/linux/netdevice.h')
| -rw-r--r-- | include/linux/netdevice.h | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index a3fccc85b1a..e535700a3b7 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -263,6 +263,17 @@ struct netdev_hw_addr_list { | |||
| 263 | int count; | 263 | int count; |
| 264 | }; | 264 | }; |
| 265 | 265 | ||
| 266 | #define netdev_uc_count(dev) ((dev)->uc.count) | ||
| 267 | #define netdev_uc_empty(dev) ((dev)->uc.count == 0) | ||
| 268 | #define netdev_for_each_uc_addr(ha, dev) \ | ||
| 269 | list_for_each_entry(ha, &dev->uc.list, list) | ||
| 270 | |||
| 271 | #define netdev_mc_count(dev) ((dev)->mc_count) | ||
| 272 | #define netdev_mc_empty(dev) (netdev_mc_count(dev) == 0) | ||
| 273 | |||
| 274 | #define netdev_for_each_mc_addr(mclist, dev) \ | ||
| 275 | for (mclist = dev->mc_list; mclist; mclist = mclist->next) | ||
| 276 | |||
| 266 | struct hh_cache { | 277 | struct hh_cache { |
| 267 | struct hh_cache *hh_next; /* Next entry */ | 278 | struct hh_cache *hh_next; /* Next entry */ |
| 268 | atomic_t hh_refcnt; /* number of users */ | 279 | atomic_t hh_refcnt; /* number of users */ |
| @@ -621,30 +632,21 @@ struct net_device_ops { | |||
| 621 | struct net_device *dev); | 632 | struct net_device *dev); |
| 622 | u16 (*ndo_select_queue)(struct net_device *dev, | 633 | u16 (*ndo_select_queue)(struct net_device *dev, |
| 623 | struct sk_buff *skb); | 634 | struct sk_buff *skb); |
| 624 | #define HAVE_CHANGE_RX_FLAGS | ||
| 625 | void (*ndo_change_rx_flags)(struct net_device *dev, | 635 | void (*ndo_change_rx_flags)(struct net_device *dev, |
| 626 | int flags); | 636 | int flags); |
| 627 | #define HAVE_SET_RX_MODE | ||
| 628 | void (*ndo_set_rx_mode)(struct net_device *dev); | 637 | void (*ndo_set_rx_mode)(struct net_device *dev); |
| 629 | #define HAVE_MULTICAST | ||
| 630 | void (*ndo_set_multicast_list)(struct net_device *dev); | 638 | void (*ndo_set_multicast_list)(struct net_device *dev); |
| 631 | #define HAVE_SET_MAC_ADDR | ||
| 632 | int (*ndo_set_mac_address)(struct net_device *dev, | 639 | int (*ndo_set_mac_address)(struct net_device *dev, |
| 633 | void *addr); | 640 | void *addr); |
| 634 | #define HAVE_VALIDATE_ADDR | ||
| 635 | int (*ndo_validate_addr)(struct net_device *dev); | 641 | int (*ndo_validate_addr)(struct net_device *dev); |
| 636 | #define HAVE_PRIVATE_IOCTL | ||
| 637 | int (*ndo_do_ioctl)(struct net_device *dev, | 642 | int (*ndo_do_ioctl)(struct net_device *dev, |
| 638 | struct ifreq *ifr, int cmd); | 643 | struct ifreq *ifr, int cmd); |
| 639 | #define HAVE_SET_CONFIG | ||
| 640 | int (*ndo_set_config)(struct net_device *dev, | 644 | int (*ndo_set_config)(struct net_device *dev, |
| 641 | struct ifmap *map); | 645 | struct ifmap *map); |
| 642 | #define HAVE_CHANGE_MTU | ||
| 643 | int (*ndo_change_mtu)(struct net_device *dev, | 646 | int (*ndo_change_mtu)(struct net_device *dev, |
| 644 | int new_mtu); | 647 | int new_mtu); |
| 645 | int (*ndo_neigh_setup)(struct net_device *dev, | 648 | int (*ndo_neigh_setup)(struct net_device *dev, |
| 646 | struct neigh_parms *); | 649 | struct neigh_parms *); |
| 647 | #define HAVE_TX_TIMEOUT | ||
| 648 | void (*ndo_tx_timeout) (struct net_device *dev); | 650 | void (*ndo_tx_timeout) (struct net_device *dev); |
| 649 | 651 | ||
| 650 | struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); | 652 | struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); |
| @@ -656,7 +658,6 @@ struct net_device_ops { | |||
| 656 | void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, | 658 | void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, |
| 657 | unsigned short vid); | 659 | unsigned short vid); |
| 658 | #ifdef CONFIG_NET_POLL_CONTROLLER | 660 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 659 | #define HAVE_NETDEV_POLL | ||
| 660 | void (*ndo_poll_controller)(struct net_device *dev); | 661 | void (*ndo_poll_controller)(struct net_device *dev); |
| 661 | #endif | 662 | #endif |
| 662 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | 663 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) |
| @@ -1009,6 +1010,15 @@ static inline bool netdev_uses_dsa_tags(struct net_device *dev) | |||
| 1009 | return 0; | 1010 | return 0; |
| 1010 | } | 1011 | } |
| 1011 | 1012 | ||
| 1013 | #ifndef CONFIG_NET_NS | ||
| 1014 | static inline void skb_set_dev(struct sk_buff *skb, struct net_device *dev) | ||
| 1015 | { | ||
| 1016 | skb->dev = dev; | ||
| 1017 | } | ||
| 1018 | #else /* CONFIG_NET_NS */ | ||
| 1019 | void skb_set_dev(struct sk_buff *skb, struct net_device *dev); | ||
| 1020 | #endif | ||
| 1021 | |||
| 1012 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) | 1022 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) |
| 1013 | { | 1023 | { |
| 1014 | #ifdef CONFIG_NET_DSA_TAG_TRAILER | 1024 | #ifdef CONFIG_NET_DSA_TAG_TRAILER |
| @@ -1527,7 +1537,6 @@ extern int netif_rx(struct sk_buff *skb); | |||
| 1527 | extern int netif_rx_ni(struct sk_buff *skb); | 1537 | extern int netif_rx_ni(struct sk_buff *skb); |
| 1528 | #define HAVE_NETIF_RECEIVE_SKB 1 | 1538 | #define HAVE_NETIF_RECEIVE_SKB 1 |
| 1529 | extern int netif_receive_skb(struct sk_buff *skb); | 1539 | extern int netif_receive_skb(struct sk_buff *skb); |
| 1530 | extern void napi_gro_flush(struct napi_struct *napi); | ||
| 1531 | extern gro_result_t dev_gro_receive(struct napi_struct *napi, | 1540 | extern gro_result_t dev_gro_receive(struct napi_struct *napi, |
| 1532 | struct sk_buff *skb); | 1541 | struct sk_buff *skb); |
| 1533 | extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); | 1542 | extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); |
