aboutsummaryrefslogtreecommitdiffstats
path: root/net/802/fddi.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/fddi.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/fddi.c')
-rw-r--r--net/802/fddi.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/net/802/fddi.c b/net/802/fddi.c
index 91dde41b5481..0549317b9356 100644
--- a/net/802/fddi.c
+++ b/net/802/fddi.c
@@ -52,7 +52,7 @@
52 52
53static int fddi_header(struct sk_buff *skb, struct net_device *dev, 53static int fddi_header(struct sk_buff *skb, struct net_device *dev,
54 unsigned short type, 54 unsigned short type,
55 void *daddr, void *saddr, unsigned len) 55 const void *daddr, const void *saddr, unsigned len)
56{ 56{
57 int hl = FDDI_K_SNAP_HLEN; 57 int hl = FDDI_K_SNAP_HLEN;
58 struct fddihdr *fddi; 58 struct fddihdr *fddi;
@@ -175,11 +175,15 @@ static int fddi_change_mtu(struct net_device *dev, int new_mtu)
175 return(0); 175 return(0);
176} 176}
177 177
178static const struct header_ops fddi_header_ops = {
179 .create = fddi_header,
180 .rebuild = fddi_rebuild_header,
181};
182
178static void fddi_setup(struct net_device *dev) 183static void fddi_setup(struct net_device *dev)
179{ 184{
180 dev->change_mtu = fddi_change_mtu; 185 dev->change_mtu = fddi_change_mtu;
181 dev->hard_header = fddi_header; 186 dev->header_ops = &fddi_header_ops;
182 dev->rebuild_header = fddi_rebuild_header;
183 187
184 dev->type = ARPHRD_FDDI; 188 dev->type = ARPHRD_FDDI;
185 dev->hard_header_len = FDDI_K_SNAP_HLEN+3; /* Assume 802.2 SNAP hdr len + 3 pad bytes */ 189 dev->hard_header_len = FDDI_K_SNAP_HLEN+3; /* Assume 802.2 SNAP hdr len + 3 pad bytes */