aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/hamradio/mkiss.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-10-09 04:40:57 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:52:52 -0400
commit3b04ddde02cf1b6f14f2697da5c20eca5715017f (patch)
tree9da1341a5a399a507b5ea6bf5a3047506b8d8f8f /drivers/net/hamradio/mkiss.c
parentb95cce3576813ac3f86bafa6b5daaaaf7574b0fe (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/hamradio/mkiss.c')
-rw-r--r--drivers/net/hamradio/mkiss.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
index d08fbc396648..9e43c47691ca 100644
--- a/drivers/net/hamradio/mkiss.c
+++ b/drivers/net/hamradio/mkiss.c
@@ -578,8 +578,9 @@ static int ax_open_dev(struct net_device *dev)
578#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) 578#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
579 579
580/* Return the frame type ID */ 580/* Return the frame type ID */
581static int ax_header(struct sk_buff *skb, struct net_device *dev, unsigned short type, 581static int ax_header(struct sk_buff *skb, struct net_device *dev,
582 void *daddr, void *saddr, unsigned len) 582 unsigned short type, const void *daddr,
583 const void *saddr, unsigned len)
583{ 584{
584#ifdef CONFIG_INET 585#ifdef CONFIG_INET
585 if (type != htons(ETH_P_AX25)) 586 if (type != htons(ETH_P_AX25))
@@ -670,6 +671,11 @@ static struct net_device_stats *ax_get_stats(struct net_device *dev)
670 return &ax->stats; 671 return &ax->stats;
671} 672}
672 673
674static const struct header_ops ax_header_ops = {
675 .create = ax_header,
676 .rebuild = ax_rebuild_header,
677};
678
673static void ax_setup(struct net_device *dev) 679static void ax_setup(struct net_device *dev)
674{ 680{
675 /* Finish setting up the DEVICE info. */ 681 /* Finish setting up the DEVICE info. */
@@ -683,8 +689,8 @@ static void ax_setup(struct net_device *dev)
683 dev->addr_len = 0; 689 dev->addr_len = 0;
684 dev->type = ARPHRD_AX25; 690 dev->type = ARPHRD_AX25;
685 dev->tx_queue_len = 10; 691 dev->tx_queue_len = 10;
686 dev->hard_header = ax_header; 692 dev->header_ops = &ax_header_ops;
687 dev->rebuild_header = ax_rebuild_header; 693
688 694
689 memcpy(dev->broadcast, &ax25_bcast, AX25_ADDR_LEN); 695 memcpy(dev->broadcast, &ax25_bcast, AX25_ADDR_LEN);
690 memcpy(dev->dev_addr, &ax25_defaddr, AX25_ADDR_LEN); 696 memcpy(dev->dev_addr, &ax25_defaddr, AX25_ADDR_LEN);