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/mac80211/ieee80211.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/mac80211/ieee80211.c')
-rw-r--r-- | net/mac80211/ieee80211.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index 0cdcf0d0c6ca..57ec8880bb1a 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c | |||
@@ -228,7 +228,6 @@ void ieee80211_if_mgmt_setup(struct net_device *dev) | |||
228 | dev->open = ieee80211_mgmt_open; | 228 | dev->open = ieee80211_mgmt_open; |
229 | dev->stop = ieee80211_mgmt_stop; | 229 | dev->stop = ieee80211_mgmt_stop; |
230 | dev->type = ARPHRD_IEEE80211_PRISM; | 230 | dev->type = ARPHRD_IEEE80211_PRISM; |
231 | dev->hard_header_parse = header_parse_80211; | ||
232 | dev->uninit = ieee80211_if_reinit; | 231 | dev->uninit = ieee80211_if_reinit; |
233 | dev->destructor = ieee80211_if_free; | 232 | dev->destructor = ieee80211_if_free; |
234 | } | 233 | } |
@@ -546,10 +545,19 @@ static void ieee80211_set_multicast_list(struct net_device *dev) | |||
546 | netif_tx_unlock(local->mdev); | 545 | netif_tx_unlock(local->mdev); |
547 | } | 546 | } |
548 | 547 | ||
548 | static const struct header_ops ieee80211_header_ops = { | ||
549 | .create = eth_header, | ||
550 | .parse = header_parse_80211, | ||
551 | .rebuild = eth_rebuild_header, | ||
552 | .cache = eth_header_cache, | ||
553 | .cache_update = eth_header_cache_update, | ||
554 | }; | ||
555 | |||
549 | /* Must not be called for mdev and apdev */ | 556 | /* Must not be called for mdev and apdev */ |
550 | void ieee80211_if_setup(struct net_device *dev) | 557 | void ieee80211_if_setup(struct net_device *dev) |
551 | { | 558 | { |
552 | ether_setup(dev); | 559 | ether_setup(dev); |
560 | dev->header_ops = &ieee80211_header_ops; | ||
553 | dev->hard_start_xmit = ieee80211_subif_start_xmit; | 561 | dev->hard_start_xmit = ieee80211_subif_start_xmit; |
554 | dev->wireless_handlers = &ieee80211_iw_handler_def; | 562 | dev->wireless_handlers = &ieee80211_iw_handler_def; |
555 | dev->set_multicast_list = ieee80211_set_multicast_list; | 563 | dev->set_multicast_list = ieee80211_set_multicast_list; |
@@ -1197,7 +1205,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
1197 | mdev->open = ieee80211_master_open; | 1205 | mdev->open = ieee80211_master_open; |
1198 | mdev->stop = ieee80211_master_stop; | 1206 | mdev->stop = ieee80211_master_stop; |
1199 | mdev->type = ARPHRD_IEEE80211; | 1207 | mdev->type = ARPHRD_IEEE80211; |
1200 | mdev->hard_header_parse = header_parse_80211; | 1208 | mdev->header_ops = &ieee80211_header_ops; |
1201 | 1209 | ||
1202 | sdata->type = IEEE80211_IF_TYPE_AP; | 1210 | sdata->type = IEEE80211_IF_TYPE_AP; |
1203 | sdata->dev = mdev; | 1211 | sdata->dev = mdev; |