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/wireless/strip.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/wireless/strip.c')
-rw-r--r-- | drivers/net/wireless/strip.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c index 404cd1512312..4bd14b331862 100644 --- a/drivers/net/wireless/strip.c +++ b/drivers/net/wireless/strip.c | |||
@@ -1631,8 +1631,8 @@ static void strip_IdleTask(unsigned long parameter) | |||
1631 | */ | 1631 | */ |
1632 | 1632 | ||
1633 | static int strip_header(struct sk_buff *skb, struct net_device *dev, | 1633 | static int strip_header(struct sk_buff *skb, struct net_device *dev, |
1634 | unsigned short type, void *daddr, void *saddr, | 1634 | unsigned short type, const void *daddr, |
1635 | unsigned len) | 1635 | const void *saddr, unsigned len) |
1636 | { | 1636 | { |
1637 | struct strip *strip_info = netdev_priv(dev); | 1637 | struct strip *strip_info = netdev_priv(dev); |
1638 | STRIP_Header *header = (STRIP_Header *) skb_push(skb, sizeof(STRIP_Header)); | 1638 | STRIP_Header *header = (STRIP_Header *) skb_push(skb, sizeof(STRIP_Header)); |
@@ -2497,6 +2497,11 @@ static int strip_close_low(struct net_device *dev) | |||
2497 | return 0; | 2497 | return 0; |
2498 | } | 2498 | } |
2499 | 2499 | ||
2500 | static const struct header_ops strip_header_ops = { | ||
2501 | .create = strip_header, | ||
2502 | .rebuild = strip_rebuild_header, | ||
2503 | }; | ||
2504 | |||
2500 | /* | 2505 | /* |
2501 | * This routine is called by DDI when the | 2506 | * This routine is called by DDI when the |
2502 | * (dynamically assigned) device is registered | 2507 | * (dynamically assigned) device is registered |
@@ -2531,8 +2536,8 @@ static void strip_dev_setup(struct net_device *dev) | |||
2531 | dev->open = strip_open_low; | 2536 | dev->open = strip_open_low; |
2532 | dev->stop = strip_close_low; | 2537 | dev->stop = strip_close_low; |
2533 | dev->hard_start_xmit = strip_xmit; | 2538 | dev->hard_start_xmit = strip_xmit; |
2534 | dev->hard_header = strip_header; | 2539 | dev->header_ops = &strip_header_ops; |
2535 | dev->rebuild_header = strip_rebuild_header; | 2540 | |
2536 | dev->set_mac_address = strip_set_mac_address; | 2541 | dev->set_mac_address = strip_set_mac_address; |
2537 | dev->get_stats = strip_get_stats; | 2542 | dev->get_stats = strip_get_stats; |
2538 | dev->change_mtu = strip_change_mtu; | 2543 | dev->change_mtu = strip_change_mtu; |