diff options
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7f0ed423a360..ce2a1f5f9a1e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -769,7 +769,8 @@ struct netdev_phys_port_id { | |||
769 | * (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX) | 769 | * (can also return NETDEV_TX_LOCKED iff NETIF_F_LLTX) |
770 | * Required can not be NULL. | 770 | * Required can not be NULL. |
771 | * | 771 | * |
772 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb); | 772 | * u16 (*ndo_select_queue)(struct net_device *dev, struct sk_buff *skb, |
773 | * void *accel_priv); | ||
773 | * Called to decide which queue to when device supports multiple | 774 | * Called to decide which queue to when device supports multiple |
774 | * transmit queues. | 775 | * transmit queues. |
775 | * | 776 | * |
@@ -990,7 +991,8 @@ struct net_device_ops { | |||
990 | netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb, | 991 | netdev_tx_t (*ndo_start_xmit) (struct sk_buff *skb, |
991 | struct net_device *dev); | 992 | struct net_device *dev); |
992 | u16 (*ndo_select_queue)(struct net_device *dev, | 993 | u16 (*ndo_select_queue)(struct net_device *dev, |
993 | struct sk_buff *skb); | 994 | struct sk_buff *skb, |
995 | void *accel_priv); | ||
994 | void (*ndo_change_rx_flags)(struct net_device *dev, | 996 | void (*ndo_change_rx_flags)(struct net_device *dev, |
995 | int flags); | 997 | int flags); |
996 | void (*ndo_set_rx_mode)(struct net_device *dev); | 998 | void (*ndo_set_rx_mode)(struct net_device *dev); |
@@ -1255,7 +1257,7 @@ struct net_device { | |||
1255 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ | 1257 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ |
1256 | unsigned char addr_assign_type; /* hw address assignment type */ | 1258 | unsigned char addr_assign_type; /* hw address assignment type */ |
1257 | unsigned char addr_len; /* hardware address length */ | 1259 | unsigned char addr_len; /* hardware address length */ |
1258 | unsigned char neigh_priv_len; | 1260 | unsigned short neigh_priv_len; |
1259 | unsigned short dev_id; /* Used to differentiate devices | 1261 | unsigned short dev_id; /* Used to differentiate devices |
1260 | * that share the same link | 1262 | * that share the same link |
1261 | * layer address | 1263 | * layer address |
@@ -1529,7 +1531,8 @@ static inline void netdev_for_each_tx_queue(struct net_device *dev, | |||
1529 | } | 1531 | } |
1530 | 1532 | ||
1531 | struct netdev_queue *netdev_pick_tx(struct net_device *dev, | 1533 | struct netdev_queue *netdev_pick_tx(struct net_device *dev, |
1532 | struct sk_buff *skb); | 1534 | struct sk_buff *skb, |
1535 | void *accel_priv); | ||
1533 | u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); | 1536 | u16 __netdev_pick_tx(struct net_device *dev, struct sk_buff *skb); |
1534 | 1537 | ||
1535 | /* | 1538 | /* |
@@ -1819,6 +1822,7 @@ int dev_close(struct net_device *dev); | |||
1819 | void dev_disable_lro(struct net_device *dev); | 1822 | void dev_disable_lro(struct net_device *dev); |
1820 | int dev_loopback_xmit(struct sk_buff *newskb); | 1823 | int dev_loopback_xmit(struct sk_buff *newskb); |
1821 | int dev_queue_xmit(struct sk_buff *skb); | 1824 | int dev_queue_xmit(struct sk_buff *skb); |
1825 | int dev_queue_xmit_accel(struct sk_buff *skb, void *accel_priv); | ||
1822 | int register_netdevice(struct net_device *dev); | 1826 | int register_netdevice(struct net_device *dev); |
1823 | void unregister_netdevice_queue(struct net_device *dev, struct list_head *head); | 1827 | void unregister_netdevice_queue(struct net_device *dev, struct list_head *head); |
1824 | void unregister_netdevice_many(struct list_head *head); | 1828 | void unregister_netdevice_many(struct list_head *head); |
@@ -1912,6 +1916,15 @@ static inline int dev_parse_header(const struct sk_buff *skb, | |||
1912 | return dev->header_ops->parse(skb, haddr); | 1916 | return dev->header_ops->parse(skb, haddr); |
1913 | } | 1917 | } |
1914 | 1918 | ||
1919 | static inline int dev_rebuild_header(struct sk_buff *skb) | ||
1920 | { | ||
1921 | const struct net_device *dev = skb->dev; | ||
1922 | |||
1923 | if (!dev->header_ops || !dev->header_ops->rebuild) | ||
1924 | return 0; | ||
1925 | return dev->header_ops->rebuild(skb); | ||
1926 | } | ||
1927 | |||
1915 | typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); | 1928 | typedef int gifconf_func_t(struct net_device * dev, char __user * bufptr, int len); |
1916 | int register_gifconf(unsigned int family, gifconf_func_t *gifconf); | 1929 | int register_gifconf(unsigned int family, gifconf_func_t *gifconf); |
1917 | static inline int unregister_gifconf(unsigned int family) | 1930 | static inline int unregister_gifconf(unsigned int family) |
@@ -2417,7 +2430,7 @@ int dev_change_carrier(struct net_device *, bool new_carrier); | |||
2417 | int dev_get_phys_port_id(struct net_device *dev, | 2430 | int dev_get_phys_port_id(struct net_device *dev, |
2418 | struct netdev_phys_port_id *ppid); | 2431 | struct netdev_phys_port_id *ppid); |
2419 | int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | 2432 | int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, |
2420 | struct netdev_queue *txq, void *accel_priv); | 2433 | struct netdev_queue *txq); |
2421 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); | 2434 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); |
2422 | 2435 | ||
2423 | extern int netdev_budget; | 2436 | extern int netdev_budget; |
@@ -3008,6 +3021,19 @@ static inline void netif_set_gso_max_size(struct net_device *dev, | |||
3008 | dev->gso_max_size = size; | 3021 | dev->gso_max_size = size; |
3009 | } | 3022 | } |
3010 | 3023 | ||
3024 | static inline void skb_gso_error_unwind(struct sk_buff *skb, __be16 protocol, | ||
3025 | int pulled_hlen, u16 mac_offset, | ||
3026 | int mac_len) | ||
3027 | { | ||
3028 | skb->protocol = protocol; | ||
3029 | skb->encapsulation = 1; | ||
3030 | skb_push(skb, pulled_hlen); | ||
3031 | skb_reset_transport_header(skb); | ||
3032 | skb->mac_header = mac_offset; | ||
3033 | skb->network_header = skb->mac_header + mac_len; | ||
3034 | skb->mac_len = mac_len; | ||
3035 | } | ||
3036 | |||
3011 | static inline bool netif_is_macvlan(struct net_device *dev) | 3037 | static inline bool netif_is_macvlan(struct net_device *dev) |
3012 | { | 3038 | { |
3013 | return dev->priv_flags & IFF_MACVLAN; | 3039 | return dev->priv_flags & IFF_MACVLAN; |