aboutsummaryrefslogtreecommitdiffstats
path: root/net/802/fc.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-10-09 04:40:57 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:52:52 -0400
commit3b04ddde02cf1b6f14f2697da5c20eca5715017f (patch)
tree9da1341a5a399a507b5ea6bf5a3047506b8d8f8f /net/802/fc.c
parentb95cce3576813ac3f86bafa6b5daaaaf7574b0fe (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/802/fc.c')
-rw-r--r--net/802/fc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/net/802/fc.c b/net/802/fc.c
index 675d9ba8e591..cb3475ea6fda 100644
--- a/net/802/fc.c
+++ b/net/802/fc.c
@@ -35,7 +35,7 @@
35 35
36static int fc_header(struct sk_buff *skb, struct net_device *dev, 36static int fc_header(struct sk_buff *skb, struct net_device *dev,
37 unsigned short type, 37 unsigned short type,
38 void *daddr, void *saddr, unsigned len) 38 const void *daddr, const void *saddr, unsigned len)
39{ 39{
40 struct fch_hdr *fch; 40 struct fch_hdr *fch;
41 int hdr_len; 41 int hdr_len;
@@ -95,11 +95,14 @@ static int fc_rebuild_header(struct sk_buff *skb)
95#endif 95#endif
96} 96}
97 97
98static const struct header_ops fc_header_ops = {
99 .create = fc_header,
100 .rebuild = fc_rebuild_header,
101};
102
98static void fc_setup(struct net_device *dev) 103static void fc_setup(struct net_device *dev)
99{ 104{
100 dev->hard_header = fc_header; 105 dev->header_ops = &fc_header_ops;
101 dev->rebuild_header = fc_rebuild_header;
102
103 dev->type = ARPHRD_IEEE802; 106 dev->type = ARPHRD_IEEE802;
104 dev->hard_header_len = FC_HLEN; 107 dev->hard_header_len = FC_HLEN;
105 dev->mtu = 2024; 108 dev->mtu = 2024;