[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>
This commit is contained in:
committed by
David S. Miller
parent
b95cce3576
commit
3b04ddde02
@@ -45,8 +45,8 @@
|
||||
*/
|
||||
|
||||
static int hippi_header(struct sk_buff *skb, struct net_device *dev,
|
||||
unsigned short type, void *daddr, void *saddr,
|
||||
unsigned len)
|
||||
unsigned short type,
|
||||
const void *daddr, const void *saddr, unsigned len)
|
||||
{
|
||||
struct hippi_hdr *hip = (struct hippi_hdr *)skb_push(skb, HIPPI_HLEN);
|
||||
struct hippi_cb *hcb = (struct hippi_cb *) skb->cb;
|
||||
@@ -182,16 +182,18 @@ static int hippi_neigh_setup_dev(struct net_device *dev, struct neigh_parms *p)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct header_ops hippi_header_ops = {
|
||||
.create = hippi_header,
|
||||
.rebuild = hippi_rebuild_header,
|
||||
};
|
||||
|
||||
|
||||
static void hippi_setup(struct net_device *dev)
|
||||
{
|
||||
dev->set_multicast_list = NULL;
|
||||
dev->change_mtu = hippi_change_mtu;
|
||||
dev->hard_header = hippi_header;
|
||||
dev->rebuild_header = hippi_rebuild_header;
|
||||
dev->header_ops = &hippi_header_ops;
|
||||
dev->set_mac_address = hippi_mac_addr;
|
||||
dev->hard_header_parse = NULL;
|
||||
dev->hard_header_cache = NULL;
|
||||
dev->header_cache_update = NULL;
|
||||
dev->neigh_setup = hippi_neigh_setup_dev;
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user