[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
11
net/802/fc.c
11
net/802/fc.c
@@ -35,7 +35,7 @@
|
||||
|
||||
static int fc_header(struct sk_buff *skb, struct net_device *dev,
|
||||
unsigned short type,
|
||||
void *daddr, void *saddr, unsigned len)
|
||||
const void *daddr, const void *saddr, unsigned len)
|
||||
{
|
||||
struct fch_hdr *fch;
|
||||
int hdr_len;
|
||||
@@ -95,11 +95,14 @@ static int fc_rebuild_header(struct sk_buff *skb)
|
||||
#endif
|
||||
}
|
||||
|
||||
static const struct header_ops fc_header_ops = {
|
||||
.create = fc_header,
|
||||
.rebuild = fc_rebuild_header,
|
||||
};
|
||||
|
||||
static void fc_setup(struct net_device *dev)
|
||||
{
|
||||
dev->hard_header = fc_header;
|
||||
dev->rebuild_header = fc_rebuild_header;
|
||||
|
||||
dev->header_ops = &fc_header_ops;
|
||||
dev->type = ARPHRD_IEEE802;
|
||||
dev->hard_header_len = FC_HLEN;
|
||||
dev->mtu = 2024;
|
||||
|
Reference in New Issue
Block a user