diff options
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 57 |
1 files changed, 21 insertions, 36 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index fe864885c1ed..cec0657d0d32 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/dmaengine.h> | 30 | #include <linux/dmaengine.h> |
31 | #include <linux/hrtimer.h> | 31 | #include <linux/hrtimer.h> |
32 | #include <linux/dma-mapping.h> | 32 | #include <linux/dma-mapping.h> |
33 | #include <linux/netdev_features.h> | ||
33 | 34 | ||
34 | /* Don't change this without changing skb_csum_unnecessary! */ | 35 | /* Don't change this without changing skb_csum_unnecessary! */ |
35 | #define CHECKSUM_NONE 0 | 36 | #define CHECKSUM_NONE 0 |
@@ -87,7 +88,6 @@ | |||
87 | * at device setup time. | 88 | * at device setup time. |
88 | * NETIF_F_HW_CSUM - it is clever device, it is able to checksum | 89 | * NETIF_F_HW_CSUM - it is clever device, it is able to checksum |
89 | * everything. | 90 | * everything. |
90 | * NETIF_F_NO_CSUM - loopback or reliable single hop media. | ||
91 | * NETIF_F_IP_CSUM - device is dumb. It is able to csum only | 91 | * NETIF_F_IP_CSUM - device is dumb. It is able to csum only |
92 | * TCP/UDP over IPv4. Sigh. Vendors like this | 92 | * TCP/UDP over IPv4. Sigh. Vendors like this |
93 | * way by an unknown reason. Though, see comment above | 93 | * way by an unknown reason. Though, see comment above |
@@ -218,6 +218,9 @@ enum { | |||
218 | 218 | ||
219 | /* device driver supports TX zero-copy buffers */ | 219 | /* device driver supports TX zero-copy buffers */ |
220 | SKBTX_DEV_ZEROCOPY = 1 << 4, | 220 | SKBTX_DEV_ZEROCOPY = 1 << 4, |
221 | |||
222 | /* generate wifi status information (where possible) */ | ||
223 | SKBTX_WIFI_STATUS = 1 << 5, | ||
221 | }; | 224 | }; |
222 | 225 | ||
223 | /* | 226 | /* |
@@ -352,6 +355,8 @@ typedef unsigned char *sk_buff_data_t; | |||
352 | * @ooo_okay: allow the mapping of a socket to a queue to be changed | 355 | * @ooo_okay: allow the mapping of a socket to a queue to be changed |
353 | * @l4_rxhash: indicate rxhash is a canonical 4-tuple hash over transport | 356 | * @l4_rxhash: indicate rxhash is a canonical 4-tuple hash over transport |
354 | * ports. | 357 | * ports. |
358 | * @wifi_acked_valid: wifi_acked was set | ||
359 | * @wifi_acked: whether frame was acked on wifi or not | ||
355 | * @dma_cookie: a cookie to one of several possible DMA operations | 360 | * @dma_cookie: a cookie to one of several possible DMA operations |
356 | * done by skb DMA functions | 361 | * done by skb DMA functions |
357 | * @secmark: security marking | 362 | * @secmark: security marking |
@@ -445,10 +450,11 @@ struct sk_buff { | |||
445 | #endif | 450 | #endif |
446 | __u8 ooo_okay:1; | 451 | __u8 ooo_okay:1; |
447 | __u8 l4_rxhash:1; | 452 | __u8 l4_rxhash:1; |
453 | __u8 wifi_acked_valid:1; | ||
454 | __u8 wifi_acked:1; | ||
455 | /* 10/12 bit hole (depending on ndisc_nodetype presence) */ | ||
448 | kmemcheck_bitfield_end(flags2); | 456 | kmemcheck_bitfield_end(flags2); |
449 | 457 | ||
450 | /* 0/13 bit hole */ | ||
451 | |||
452 | #ifdef CONFIG_NET_DMA | 458 | #ifdef CONFIG_NET_DMA |
453 | dma_cookie_t dma_cookie; | 459 | dma_cookie_t dma_cookie; |
454 | #endif | 460 | #endif |
@@ -540,6 +546,7 @@ extern void consume_skb(struct sk_buff *skb); | |||
540 | extern void __kfree_skb(struct sk_buff *skb); | 546 | extern void __kfree_skb(struct sk_buff *skb); |
541 | extern struct sk_buff *__alloc_skb(unsigned int size, | 547 | extern struct sk_buff *__alloc_skb(unsigned int size, |
542 | gfp_t priority, int fclone, int node); | 548 | gfp_t priority, int fclone, int node); |
549 | extern struct sk_buff *build_skb(void *data); | ||
543 | static inline struct sk_buff *alloc_skb(unsigned int size, | 550 | static inline struct sk_buff *alloc_skb(unsigned int size, |
544 | gfp_t priority) | 551 | gfp_t priority) |
545 | { | 552 | { |
@@ -1662,38 +1669,6 @@ static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, | |||
1662 | } | 1669 | } |
1663 | 1670 | ||
1664 | /** | 1671 | /** |
1665 | * __netdev_alloc_page - allocate a page for ps-rx on a specific device | ||
1666 | * @dev: network device to receive on | ||
1667 | * @gfp_mask: alloc_pages_node mask | ||
1668 | * | ||
1669 | * Allocate a new page. dev currently unused. | ||
1670 | * | ||
1671 | * %NULL is returned if there is no free memory. | ||
1672 | */ | ||
1673 | static inline struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask) | ||
1674 | { | ||
1675 | return alloc_pages_node(NUMA_NO_NODE, gfp_mask, 0); | ||
1676 | } | ||
1677 | |||
1678 | /** | ||
1679 | * netdev_alloc_page - allocate a page for ps-rx on a specific device | ||
1680 | * @dev: network device to receive on | ||
1681 | * | ||
1682 | * Allocate a new page. dev currently unused. | ||
1683 | * | ||
1684 | * %NULL is returned if there is no free memory. | ||
1685 | */ | ||
1686 | static inline struct page *netdev_alloc_page(struct net_device *dev) | ||
1687 | { | ||
1688 | return __netdev_alloc_page(dev, GFP_ATOMIC); | ||
1689 | } | ||
1690 | |||
1691 | static inline void netdev_free_page(struct net_device *dev, struct page *page) | ||
1692 | { | ||
1693 | __free_page(page); | ||
1694 | } | ||
1695 | |||
1696 | /** | ||
1697 | * skb_frag_page - retrieve the page refered to by a paged fragment | 1672 | * skb_frag_page - retrieve the page refered to by a paged fragment |
1698 | * @frag: the paged fragment | 1673 | * @frag: the paged fragment |
1699 | * | 1674 | * |
@@ -2105,7 +2080,8 @@ extern void skb_split(struct sk_buff *skb, | |||
2105 | extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, | 2080 | extern int skb_shift(struct sk_buff *tgt, struct sk_buff *skb, |
2106 | int shiftlen); | 2081 | int shiftlen); |
2107 | 2082 | ||
2108 | extern struct sk_buff *skb_segment(struct sk_buff *skb, u32 features); | 2083 | extern struct sk_buff *skb_segment(struct sk_buff *skb, |
2084 | netdev_features_t features); | ||
2109 | 2085 | ||
2110 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | 2086 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, |
2111 | int len, void *buffer) | 2087 | int len, void *buffer) |
@@ -2263,6 +2239,15 @@ static inline void skb_tx_timestamp(struct sk_buff *skb) | |||
2263 | sw_tx_timestamp(skb); | 2239 | sw_tx_timestamp(skb); |
2264 | } | 2240 | } |
2265 | 2241 | ||
2242 | /** | ||
2243 | * skb_complete_wifi_ack - deliver skb with wifi status | ||
2244 | * | ||
2245 | * @skb: the original outgoing packet | ||
2246 | * @acked: ack status | ||
2247 | * | ||
2248 | */ | ||
2249 | void skb_complete_wifi_ack(struct sk_buff *skb, bool acked); | ||
2250 | |||
2266 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); | 2251 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); |
2267 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); | 2252 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); |
2268 | 2253 | ||