diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-10-09 04:40:57 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:52:52 -0400 |
commit | 3b04ddde02cf1b6f14f2697da5c20eca5715017f (patch) | |
tree | 9da1341a5a399a507b5ea6bf5a3047506b8d8f8f /net/ax25/ax25_ip.c | |
parent | b95cce3576813ac3f86bafa6b5daaaaf7574b0fe (diff) |
[NET]: Move hardware header operations out of netdevice.
Since hardware header operations are part of the protocol class
not the device instance, make them into a separate object and
save memory.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ax25/ax25_ip.c')
-rw-r--r-- | net/ax25/ax25_ip.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/net/ax25/ax25_ip.c b/net/ax25/ax25_ip.c index 930e4918037f..f047a57aa95c 100644 --- a/net/ax25/ax25_ip.c +++ b/net/ax25/ax25_ip.c | |||
@@ -46,7 +46,9 @@ | |||
46 | 46 | ||
47 | #ifdef CONFIG_INET | 47 | #ifdef CONFIG_INET |
48 | 48 | ||
49 | int ax25_hard_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned len) | 49 | int ax25_hard_header(struct sk_buff *skb, struct net_device *dev, |
50 | unsigned short type, const void *daddr, | ||
51 | const void *saddr, unsigned len) | ||
50 | { | 52 | { |
51 | unsigned char *buff; | 53 | unsigned char *buff; |
52 | 54 | ||
@@ -215,7 +217,9 @@ put: | |||
215 | 217 | ||
216 | #else /* INET */ | 218 | #else /* INET */ |
217 | 219 | ||
218 | int ax25_hard_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, void *daddr, void *saddr, unsigned len) | 220 | int ax25_hard_header(struct sk_buff *skb, struct net_device *dev, |
221 | unsigned short type, const void *daddr, | ||
222 | const void *saddr, unsigned len) | ||
219 | { | 223 | { |
220 | return -AX25_HEADER_LEN; | 224 | return -AX25_HEADER_LEN; |
221 | } | 225 | } |
@@ -227,5 +231,12 @@ int ax25_rebuild_header(struct sk_buff *skb) | |||
227 | 231 | ||
228 | #endif | 232 | #endif |
229 | 233 | ||
234 | const struct header_ops ax25_header_ops = { | ||
235 | .create = ax25_hard_header, | ||
236 | .rebuild = ax25_rebuild_header, | ||
237 | }; | ||
238 | |||
230 | EXPORT_SYMBOL(ax25_hard_header); | 239 | EXPORT_SYMBOL(ax25_hard_header); |
231 | EXPORT_SYMBOL(ax25_rebuild_header); | 240 | EXPORT_SYMBOL(ax25_rebuild_header); |
241 | EXPORT_SYMBOL(ax25_header_ops); | ||
242 | |||