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 /drivers/net/hamradio/6pack.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 'drivers/net/hamradio/6pack.c')
-rw-r--r-- | drivers/net/hamradio/6pack.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c index 0a847326a5e4..ecd156def039 100644 --- a/drivers/net/hamradio/6pack.c +++ b/drivers/net/hamradio/6pack.c | |||
@@ -288,7 +288,8 @@ static int sp_close(struct net_device *dev) | |||
288 | 288 | ||
289 | /* Return the frame type ID */ | 289 | /* Return the frame type ID */ |
290 | static int sp_header(struct sk_buff *skb, struct net_device *dev, | 290 | static int sp_header(struct sk_buff *skb, struct net_device *dev, |
291 | unsigned short type, void *daddr, void *saddr, unsigned len) | 291 | unsigned short type, const void *daddr, |
292 | const void *saddr, unsigned len) | ||
292 | { | 293 | { |
293 | #ifdef CONFIG_INET | 294 | #ifdef CONFIG_INET |
294 | if (type != htons(ETH_P_AX25)) | 295 | if (type != htons(ETH_P_AX25)) |
@@ -323,6 +324,11 @@ static int sp_rebuild_header(struct sk_buff *skb) | |||
323 | #endif | 324 | #endif |
324 | } | 325 | } |
325 | 326 | ||
327 | static const struct header_ops sp_header_ops = { | ||
328 | .create = sp_header, | ||
329 | .rebuild = sp_rebuild_header, | ||
330 | }; | ||
331 | |||
326 | static void sp_setup(struct net_device *dev) | 332 | static void sp_setup(struct net_device *dev) |
327 | { | 333 | { |
328 | /* Finish setting up the DEVICE info. */ | 334 | /* Finish setting up the DEVICE info. */ |
@@ -331,14 +337,15 @@ static void sp_setup(struct net_device *dev) | |||
331 | dev->open = sp_open_dev; | 337 | dev->open = sp_open_dev; |
332 | dev->destructor = free_netdev; | 338 | dev->destructor = free_netdev; |
333 | dev->stop = sp_close; | 339 | dev->stop = sp_close; |
334 | dev->hard_header = sp_header; | 340 | |
335 | dev->get_stats = sp_get_stats; | 341 | dev->get_stats = sp_get_stats; |
336 | dev->set_mac_address = sp_set_mac_address; | 342 | dev->set_mac_address = sp_set_mac_address; |
337 | dev->hard_header_len = AX25_MAX_HEADER_LEN; | 343 | dev->hard_header_len = AX25_MAX_HEADER_LEN; |
344 | dev->header_ops = &sp_header_ops; | ||
345 | |||
338 | dev->addr_len = AX25_ADDR_LEN; | 346 | dev->addr_len = AX25_ADDR_LEN; |
339 | dev->type = ARPHRD_AX25; | 347 | dev->type = ARPHRD_AX25; |
340 | dev->tx_queue_len = 10; | 348 | dev->tx_queue_len = 10; |
341 | dev->rebuild_header = sp_rebuild_header; | ||
342 | dev->tx_timeout = NULL; | 349 | dev->tx_timeout = NULL; |
343 | 350 | ||
344 | /* Only activated in AX.25 mode */ | 351 | /* Only activated in AX.25 mode */ |