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/loopback.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/loopback.c')
-rw-r--r-- | drivers/net/loopback.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index f11120b7a3b2..b6d4ae3ad506 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -221,22 +221,17 @@ static void loopback_dev_free(struct net_device *dev) | |||
221 | } | 221 | } |
222 | 222 | ||
223 | /* | 223 | /* |
224 | * The loopback device is special. There is only one instance and | 224 | * The loopback device is special. There is only one instance. |
225 | * it is statically allocated. Don't do this for other devices. | ||
226 | */ | 225 | */ |
227 | static void loopback_setup(struct net_device *dev) | 226 | static void loopback_setup(struct net_device *dev) |
228 | { | 227 | { |
229 | dev->get_stats = &get_stats; | 228 | dev->get_stats = &get_stats; |
230 | dev->mtu = (16 * 1024) + 20 + 20 + 12; | 229 | dev->mtu = (16 * 1024) + 20 + 20 + 12; |
231 | dev->hard_start_xmit = loopback_xmit; | 230 | dev->hard_start_xmit = loopback_xmit; |
232 | dev->hard_header = eth_header; | ||
233 | dev->hard_header_cache = eth_header_cache; | ||
234 | dev->header_cache_update = eth_header_cache_update; | ||
235 | dev->hard_header_len = ETH_HLEN; /* 14 */ | 231 | dev->hard_header_len = ETH_HLEN; /* 14 */ |
236 | dev->addr_len = ETH_ALEN; /* 6 */ | 232 | dev->addr_len = ETH_ALEN; /* 6 */ |
237 | dev->tx_queue_len = 0; | 233 | dev->tx_queue_len = 0; |
238 | dev->type = ARPHRD_LOOPBACK; /* 0x0001*/ | 234 | dev->type = ARPHRD_LOOPBACK; /* 0x0001*/ |
239 | dev->rebuild_header = eth_rebuild_header; | ||
240 | dev->flags = IFF_LOOPBACK; | 235 | dev->flags = IFF_LOOPBACK; |
241 | dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | 236 | dev->features = NETIF_F_SG | NETIF_F_FRAGLIST |
242 | #ifdef LOOPBACK_TSO | 237 | #ifdef LOOPBACK_TSO |
@@ -247,6 +242,7 @@ static void loopback_setup(struct net_device *dev) | |||
247 | | NETIF_F_LLTX | 242 | | NETIF_F_LLTX |
248 | | NETIF_F_NETNS_LOCAL, | 243 | | NETIF_F_NETNS_LOCAL, |
249 | dev->ethtool_ops = &loopback_ethtool_ops; | 244 | dev->ethtool_ops = &loopback_ethtool_ops; |
245 | dev->header_ops = ð_header_ops; | ||
250 | dev->init = loopback_dev_init; | 246 | dev->init = loopback_dev_init; |
251 | dev->destructor = loopback_dev_free; | 247 | dev->destructor = loopback_dev_free; |
252 | } | 248 | } |