aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/lapbether.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2009-04-05 02:14:15 -0400
committerLen Brown <len.brown@intel.com>2009-04-05 02:14:15 -0400
commit478c6a43fcbc6c11609f8cee7c7b57223907754f (patch)
treea7f7952099da60d33032aed6de9c0c56c9f8779e /drivers/net/wan/lapbether.c
parent8a3f257c704e02aee9869decd069a806b45be3f1 (diff)
parent6bb597507f9839b13498781e481f5458aea33620 (diff)
Merge branch 'linus' into release
Conflicts: arch/x86/kernel/cpu/cpufreq/longhaul.c Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/net/wan/lapbether.c')
-rw-r--r--drivers/net/wan/lapbether.c39
1 files changed, 16 insertions, 23 deletions
diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index 5b61b3eef45f..2dd78d20eb05 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -55,7 +55,6 @@ struct lapbethdev {
55 struct list_head node; 55 struct list_head node;
56 struct net_device *ethdev; /* link to ethernet device */ 56 struct net_device *ethdev; /* link to ethernet device */
57 struct net_device *axdev; /* lapbeth device (lapb#) */ 57 struct net_device *axdev; /* lapbeth device (lapb#) */
58 struct net_device_stats stats; /* some statistics */
59}; 58};
60 59
61static LIST_HEAD(lapbeth_devices); 60static LIST_HEAD(lapbeth_devices);
@@ -107,10 +106,9 @@ static int lapbeth_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
107 if (!netif_running(lapbeth->axdev)) 106 if (!netif_running(lapbeth->axdev))
108 goto drop_unlock; 107 goto drop_unlock;
109 108
110 lapbeth->stats.rx_packets++;
111
112 len = skb->data[0] + skb->data[1] * 256; 109 len = skb->data[0] + skb->data[1] * 256;
113 lapbeth->stats.rx_bytes += len; 110 dev->stats.rx_packets++;
111 dev->stats.rx_bytes += len;
114 112
115 skb_pull(skb, 2); /* Remove the length bytes */ 113 skb_pull(skb, 2); /* Remove the length bytes */
116 skb_trim(skb, len); /* Set the length of the data */ 114 skb_trim(skb, len); /* Set the length of the data */
@@ -210,8 +208,8 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb)
210 *ptr++ = size % 256; 208 *ptr++ = size % 256;
211 *ptr++ = size / 256; 209 *ptr++ = size / 256;
212 210
213 lapbeth->stats.tx_packets++; 211 ndev->stats.tx_packets++;
214 lapbeth->stats.tx_bytes += size; 212 ndev->stats.tx_bytes += size;
215 213
216 skb->dev = dev = lapbeth->ethdev; 214 skb->dev = dev = lapbeth->ethdev;
217 215
@@ -255,15 +253,6 @@ static void lapbeth_disconnected(struct net_device *dev, int reason)
255} 253}
256 254
257/* 255/*
258 * Statistics
259 */
260static struct net_device_stats *lapbeth_get_stats(struct net_device *dev)
261{
262 struct lapbethdev *lapbeth = netdev_priv(dev);
263 return &lapbeth->stats;
264}
265
266/*
267 * Set AX.25 callsign 256 * Set AX.25 callsign
268 */ 257 */
269static int lapbeth_set_mac_address(struct net_device *dev, void *addr) 258static int lapbeth_set_mac_address(struct net_device *dev, void *addr)
@@ -314,14 +303,17 @@ static int lapbeth_close(struct net_device *dev)
314 303
315/* ------------------------------------------------------------------------ */ 304/* ------------------------------------------------------------------------ */
316 305
306static const struct net_device_ops lapbeth_netdev_ops = {
307 .ndo_open = lapbeth_open,
308 .ndo_stop = lapbeth_close,
309 .ndo_start_xmit = lapbeth_xmit,
310 .ndo_set_mac_address = lapbeth_set_mac_address,
311};
312
317static void lapbeth_setup(struct net_device *dev) 313static void lapbeth_setup(struct net_device *dev)
318{ 314{
319 dev->hard_start_xmit = lapbeth_xmit; 315 dev->netdev_ops = &lapbeth_netdev_ops;
320 dev->open = lapbeth_open;
321 dev->stop = lapbeth_close;
322 dev->destructor = free_netdev; 316 dev->destructor = free_netdev;
323 dev->set_mac_address = lapbeth_set_mac_address;
324 dev->get_stats = lapbeth_get_stats;
325 dev->type = ARPHRD_X25; 317 dev->type = ARPHRD_X25;
326 dev->hard_header_len = 3; 318 dev->hard_header_len = 3;
327 dev->mtu = 1000; 319 dev->mtu = 1000;
@@ -421,8 +413,8 @@ static int lapbeth_device_event(struct notifier_block *this,
421 413
422/* ------------------------------------------------------------------------ */ 414/* ------------------------------------------------------------------------ */
423 415
424static struct packet_type lapbeth_packet_type = { 416static struct packet_type lapbeth_packet_type __read_mostly = {
425 .type = __constant_htons(ETH_P_DEC), 417 .type = cpu_to_be16(ETH_P_DEC),
426 .func = lapbeth_rcv, 418 .func = lapbeth_rcv,
427}; 419};
428 420
@@ -430,7 +422,8 @@ static struct notifier_block lapbeth_dev_notifier = {
430 .notifier_call = lapbeth_device_event, 422 .notifier_call = lapbeth_device_event,
431}; 423};
432 424
433static char banner[] __initdata = KERN_INFO "LAPB Ethernet driver version 0.02\n"; 425static const char banner[] __initconst =
426 KERN_INFO "LAPB Ethernet driver version 0.02\n";
434 427
435static int __init lapbeth_init_driver(void) 428static int __init lapbeth_init_driver(void)
436{ 429{