diff options
author | Vlad Yasevich <vyasevic@redhat.com> | 2012-11-15 03:49:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-15 17:39:51 -0500 |
commit | f191a1d17f227032c159e5499809f545402b6dc6 (patch) | |
tree | 48fc87a0b34bd2da06fedcd7e5e3ed6b08f7a3ac /include | |
parent | c6b641a4c6b32f39db678c2441cb1ef824110d74 (diff) |
net: Remove code duplication between offload structures
Move the offload callbacks into its own structure.
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netdevice.h | 10 | ||||
-rw-r--r-- | include/net/protocol.h | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 61bc8483031f..e46c830c88d8 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1515,15 +1515,19 @@ struct packet_type { | |||
1515 | struct list_head list; | 1515 | struct list_head list; |
1516 | }; | 1516 | }; |
1517 | 1517 | ||
1518 | struct packet_offload { | 1518 | struct offload_callbacks { |
1519 | __be16 type; /* This is really htons(ether_type). */ | ||
1520 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | 1519 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, |
1521 | netdev_features_t features); | 1520 | netdev_features_t features); |
1522 | int (*gso_send_check)(struct sk_buff *skb); | 1521 | int (*gso_send_check)(struct sk_buff *skb); |
1523 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | 1522 | struct sk_buff **(*gro_receive)(struct sk_buff **head, |
1524 | struct sk_buff *skb); | 1523 | struct sk_buff *skb); |
1525 | int (*gro_complete)(struct sk_buff *skb); | 1524 | int (*gro_complete)(struct sk_buff *skb); |
1526 | struct list_head list; | 1525 | }; |
1526 | |||
1527 | struct packet_offload { | ||
1528 | __be16 type; /* This is really htons(ether_type). */ | ||
1529 | struct offload_callbacks callbacks; | ||
1530 | struct list_head list; | ||
1527 | }; | 1531 | }; |
1528 | 1532 | ||
1529 | #include <linux/notifier.h> | 1533 | #include <linux/notifier.h> |
diff --git a/include/net/protocol.h b/include/net/protocol.h index 2c90794c139d..047c0476c0a0 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #if IS_ENABLED(CONFIG_IPV6) | 29 | #if IS_ENABLED(CONFIG_IPV6) |
30 | #include <linux/ipv6.h> | 30 | #include <linux/ipv6.h> |
31 | #endif | 31 | #endif |
32 | #include <linux/netdevice.h> | ||
32 | 33 | ||
33 | /* This is one larger than the largest protocol value that can be | 34 | /* This is one larger than the largest protocol value that can be |
34 | * found in an ipv4 or ipv6 header. Since in both cases the protocol | 35 | * found in an ipv4 or ipv6 header. Since in both cases the protocol |
@@ -63,13 +64,8 @@ struct inet6_protocol { | |||
63 | #endif | 64 | #endif |
64 | 65 | ||
65 | struct net_offload { | 66 | struct net_offload { |
66 | int (*gso_send_check)(struct sk_buff *skb); | 67 | struct offload_callbacks callbacks; |
67 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | 68 | unsigned int flags; /* Flags used by IPv6 for now */ |
68 | netdev_features_t features); | ||
69 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | ||
70 | struct sk_buff *skb); | ||
71 | int (*gro_complete)(struct sk_buff *skb); | ||
72 | unsigned int flags; /* Flags used by IPv6 for now */ | ||
73 | }; | 69 | }; |
74 | /* This should be set for any extension header which is compatible with GSO. */ | 70 | /* This should be set for any extension header which is compatible with GSO. */ |
75 | #define INET6_PROTO_GSO_EXTHDR 0x1 | 71 | #define INET6_PROTO_GSO_EXTHDR 0x1 |