aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/cycx_x25.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/wan/cycx_x25.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/wan/cycx_x25.c')
-rw-r--r--drivers/net/wan/cycx_x25.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/drivers/net/wan/cycx_x25.c b/drivers/net/wan/cycx_x25.c
index 46e053106d4d..8a1778cf98d1 100644
--- a/drivers/net/wan/cycx_x25.c
+++ b/drivers/net/wan/cycx_x25.c
@@ -131,14 +131,15 @@ static int cycx_wan_update(struct wan_device *wandev),
131 cycx_wan_del_if(struct wan_device *wandev, struct net_device *dev); 131 cycx_wan_del_if(struct wan_device *wandev, struct net_device *dev);
132 132
133/* Network device interface */ 133/* Network device interface */
134static int cycx_netdevice_init(struct net_device *dev), 134static int cycx_netdevice_init(struct net_device *dev);
135 cycx_netdevice_open(struct net_device *dev), 135static int cycx_netdevice_open(struct net_device *dev);
136 cycx_netdevice_stop(struct net_device *dev), 136static int cycx_netdevice_stop(struct net_device *dev);
137 cycx_netdevice_hard_header(struct sk_buff *skb, 137static int cycx_netdevice_hard_header(struct sk_buff *skb,
138 struct net_device *dev, u16 type, 138 struct net_device *dev, u16 type,
139 void *daddr, void *saddr, unsigned len), 139 const void *daddr, const void *saddr,
140 cycx_netdevice_rebuild_header(struct sk_buff *skb), 140 unsigned len);
141 cycx_netdevice_hard_start_xmit(struct sk_buff *skb, 141static int cycx_netdevice_rebuild_header(struct sk_buff *skb);
142static int cycx_netdevice_hard_start_xmit(struct sk_buff *skb,
142 struct net_device *dev); 143 struct net_device *dev);
143 144
144static struct net_device_stats * 145static struct net_device_stats *
@@ -468,7 +469,14 @@ static int cycx_wan_del_if(struct wan_device *wandev, struct net_device *dev)
468 return 0; 469 return 0;
469} 470}
470 471
472
471/* Network Device Interface */ 473/* Network Device Interface */
474
475static const struct header_ops cycx_header_ops = {
476 .create = cycx_netdevice_hard_header,
477 .rebuild = cycx_netdevice_rebuild_header,
478};
479
472/* Initialize Linux network interface. 480/* Initialize Linux network interface.
473 * 481 *
474 * This routine is called only once for each interface, during Linux network 482 * This routine is called only once for each interface, during Linux network
@@ -483,8 +491,8 @@ static int cycx_netdevice_init(struct net_device *dev)
483 /* Initialize device driver entry points */ 491 /* Initialize device driver entry points */
484 dev->open = cycx_netdevice_open; 492 dev->open = cycx_netdevice_open;
485 dev->stop = cycx_netdevice_stop; 493 dev->stop = cycx_netdevice_stop;
486 dev->hard_header = cycx_netdevice_hard_header; 494 dev->header_ops = &cycx_header_ops;
487 dev->rebuild_header = cycx_netdevice_rebuild_header; 495
488 dev->hard_start_xmit = cycx_netdevice_hard_start_xmit; 496 dev->hard_start_xmit = cycx_netdevice_hard_start_xmit;
489 dev->get_stats = cycx_netdevice_get_stats; 497 dev->get_stats = cycx_netdevice_get_stats;
490 498
@@ -554,7 +562,8 @@ static int cycx_netdevice_stop(struct net_device *dev)
554 * Return: media header length. */ 562 * Return: media header length. */
555static int cycx_netdevice_hard_header(struct sk_buff *skb, 563static int cycx_netdevice_hard_header(struct sk_buff *skb,
556 struct net_device *dev, u16 type, 564 struct net_device *dev, u16 type,
557 void *daddr, void *saddr, unsigned len) 565 const void *daddr, const void *saddr,
566 unsigned len)
558{ 567{
559 skb->protocol = type; 568 skb->protocol = type;
560 569