sh: convert /proc/cpu/aligmnent, /proc/cpu/kernel_alignment to seq_file
[safe/jmp/linux-2.6] / net / atm / lec.c
index 66c57c1..b2d6445 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * lec.c: Lan Emulation driver 
+ * lec.c: Lan Emulation driver
  *
  * Marko Kiiskila <mkiiskila@yahoo.com>
  */
@@ -21,7 +21,6 @@
 #include <net/dst.h>
 #include <linux/proc_fs.h>
 #include <linux/spinlock.h>
-#include <linux/proc_fs.h>
 #include <linux/seq_file.h>
 
 /* TokenRing if needed */
@@ -35,7 +34,6 @@
 
 /* Proxy LEC knows about bridging */
 #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
-#include <linux/if_bridge.h>
 #include "../bridge/br_private.h"
 
 static unsigned char bridge_ula_lec[] = { 0x01, 0x80, 0xc2, 0x00, 0x00 };
@@ -49,12 +47,6 @@ static unsigned char bridge_ula_lec[] = { 0x01, 0x80, 0xc2, 0x00, 0x00 };
 #include "lec_arpc.h"
 #include "resources.h"
 
-#if 0
-#define DPRINTK printk
-#else
-#define DPRINTK(format,args...)
-#endif
-
 #define DUMP_PACKETS 0         /*
                                 * 0 = None,
                                 * 1 = 30 first bytes
@@ -67,41 +59,41 @@ static unsigned char bridge_ula_lec[] = { 0x01, 0x80, 0xc2, 0x00, 0x00 };
                                 */
 
 static int lec_open(struct net_device *dev);
-static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev);
+static netdev_tx_t lec_start_xmit(struct sk_buff *skb,
+                                 struct net_device *dev);
 static int lec_close(struct net_device *dev);
-static struct net_device_stats *lec_get_stats(struct net_device *dev);
 static void lec_init(struct net_device *dev);
 static struct lec_arp_table *lec_arp_find(struct lec_priv *priv,
-                                         unsigned char *mac_addr);
+                                         const unsigned char *mac_addr);
 static int lec_arp_remove(struct lec_priv *priv,
                          struct lec_arp_table *to_remove);
 /* LANE2 functions */
-static void lane2_associate_ind(struct net_device *dev, u8 *mac_address,
-                               u8 *tlvs, u32 sizeoftlvs);
-static int lane2_resolve(struct net_device *dev, u8 *dst_mac, int force,
+static void lane2_associate_ind(struct net_device *dev, const u8 *mac_address,
+                               const u8 *tlvs, u32 sizeoftlvs);
+static int lane2_resolve(struct net_device *dev, const u8 *dst_mac, int force,
                         u8 **tlvs, u32 *sizeoftlvs);
-static int lane2_associate_req(struct net_device *dev, u8 *lan_dst,
-                              u8 *tlvs, u32 sizeoftlvs);
+static int lane2_associate_req(struct net_device *dev, const u8 *lan_dst,
+                              const u8 *tlvs, u32 sizeoftlvs);
 
-static int lec_addr_delete(struct lec_priv *priv, unsigned char *atm_addr,
+static int lec_addr_delete(struct lec_priv *priv, const unsigned char *atm_addr,
                           unsigned long permanent);
 static void lec_arp_check_empties(struct lec_priv *priv,
                                  struct atm_vcc *vcc, struct sk_buff *skb);
 static void lec_arp_destroy(struct lec_priv *priv);
 static void lec_arp_init(struct lec_priv *priv);
 static struct atm_vcc *lec_arp_resolve(struct lec_priv *priv,
-                                      unsigned char *mac_to_find,
+                                      const unsigned char *mac_to_find,
                                       int is_rdesc,
                                       struct lec_arp_table **ret_entry);
-static void lec_arp_update(struct lec_priv *priv, unsigned char *mac_addr,
-                          unsigned char *atm_addr, unsigned long remoteflag,
+static void lec_arp_update(struct lec_priv *priv, const unsigned char *mac_addr,
+                          const unsigned char *atm_addr, unsigned long remoteflag,
                           unsigned int targetless_le_arp);
 static void lec_flush_complete(struct lec_priv *priv, unsigned long tran_id);
 static int lec_mcast_make(struct lec_priv *priv, struct atm_vcc *vcc);
 static void lec_set_flush_tran_id(struct lec_priv *priv,
-                                 unsigned char *atm_addr,
+                                 const unsigned char *atm_addr,
                                  unsigned long tran_id);
-static void lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,
+static void lec_vcc_added(struct lec_priv *priv, const struct atmlec_ioc *ioc_data,
                          struct atm_vcc *vcc,
                          void (*old_push) (struct atm_vcc *vcc,
                                            struct sk_buff *skb));
@@ -159,7 +151,7 @@ static void lec_handle_bridge(struct sk_buff *skb, struct net_device *dev)
                buff += 4;
                mesg->content.normal.flag = *buff & 0x01;       /* 0x01 is topology change */
 
-               priv = (struct lec_priv *)dev->priv;
+               priv = netdev_priv(dev);
                atm_force_charge(priv->lecd, skb2->truesize);
                sk = sk_atm(priv->lecd);
                skb_queue_tail(&sk->sk_receive_queue, skb2);
@@ -183,7 +175,7 @@ static void lec_handle_bridge(struct sk_buff *skb, struct net_device *dev)
 static unsigned char *get_tr_dst(unsigned char *packet, unsigned char *rdesc)
 {
        struct trh_hdr *trh;
-       int riflen, num_rdsc;
+       unsigned int riflen, num_rdsc;
 
        trh = (struct trh_hdr *)packet;
        if (trh->daddr[0] & (uint8_t) 0x80)
@@ -204,9 +196,9 @@ static unsigned char *get_tr_dst(unsigned char *packet, unsigned char *rdesc)
        memset(rdesc, 0, ETH_ALEN);
        /* offset 4 comes from LAN destination field in LE control frames */
        if (trh->rcf & htons((uint16_t) TR_RCF_DIR_BIT))
-               memcpy(&rdesc[4], &trh->rseg[num_rdsc - 2], sizeof(uint16_t));
+               memcpy(&rdesc[4], &trh->rseg[num_rdsc - 2], sizeof(__be16));
        else {
-               memcpy(&rdesc[4], &trh->rseg[1], sizeof(uint16_t));
+               memcpy(&rdesc[4], &trh->rseg[1], sizeof(__be16));
                rdesc[5] = ((ntohs(trh->rseg[0]) & 0x000f) | (rdesc[5] & 0xf0));
        }
 
@@ -225,28 +217,28 @@ static unsigned char *get_tr_dst(unsigned char *packet, unsigned char *rdesc)
 
 static int lec_open(struct net_device *dev)
 {
-       struct lec_priv *priv = (struct lec_priv *)dev->priv;
-
        netif_start_queue(dev);
-       memset(&priv->stats, 0, sizeof(struct net_device_stats));
+       memset(&dev->stats, 0, sizeof(struct net_device_stats));
 
        return 0;
 }
 
-static __inline__ void
-lec_send(struct atm_vcc *vcc, struct sk_buff *skb, struct lec_priv *priv)
+static void
+lec_send(struct atm_vcc *vcc, struct sk_buff *skb)
 {
+       struct net_device *dev = skb->dev;
+
        ATM_SKB(skb)->vcc = vcc;
        ATM_SKB(skb)->atm_options = vcc->atm_options;
 
        atomic_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
        if (vcc->send(vcc, skb) < 0) {
-               priv->stats.tx_dropped++;
+               dev->stats.tx_dropped++;
                return;
        }
 
-       priv->stats.tx_packets++;
-       priv->stats.tx_bytes += skb->len;
+       dev->stats.tx_packets++;
+       dev->stats.tx_bytes += skb->len;
 }
 
 static void lec_tx_timeout(struct net_device *dev)
@@ -256,10 +248,11 @@ static void lec_tx_timeout(struct net_device *dev)
        netif_wake_queue(dev);
 }
 
-static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
+static netdev_tx_t lec_start_xmit(struct sk_buff *skb,
+                                 struct net_device *dev)
 {
        struct sk_buff *skb2;
-       struct lec_priv *priv = (struct lec_priv *)dev->priv;
+       struct lec_priv *priv = netdev_priv(dev);
        struct lecdatahdr_8023 *lec_h;
        struct atm_vcc *vcc;
        struct lec_arp_table *entry;
@@ -274,17 +267,18 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
        int i = 0;
 #endif /* DUMP_PACKETS >0 */
 
-       DPRINTK("lec_start_xmit called\n");
+       pr_debug("lec_start_xmit called\n");
        if (!priv->lecd) {
                printk("%s:No lecd attached\n", dev->name);
-               priv->stats.tx_errors++;
+               dev->stats.tx_errors++;
                netif_stop_queue(dev);
-               return -EUNATCH;
+               kfree_skb(skb);
+               return NETDEV_TX_OK;
        }
 
-       DPRINTK("skbuff head:%lx data:%lx tail:%lx end:%lx\n",
-               (long)skb->head, (long)skb->data, (long)skb->tail,
-               (long)skb->end);
+       pr_debug("skbuff head:%lx data:%lx tail:%lx end:%lx\n",
+               (long)skb->head, (long)skb->data, (long)skb_tail_pointer(skb),
+               (long)skb_end_pointer(skb));
 #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
        if (memcmp(skb->data, bridge_ula_lec, sizeof(bridge_ula_lec)) == 0)
                lec_handle_bridge(skb, dev);
@@ -293,11 +287,11 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
        /* Make sure we have room for lec_id */
        if (skb_headroom(skb) < 2) {
 
-               DPRINTK("lec_start_xmit: reallocating skb\n");
+               pr_debug("lec_start_xmit: reallocating skb\n");
                skb2 = skb_realloc_headroom(skb, LEC_HEADER_LEN);
                kfree_skb(skb);
                if (skb2 == NULL)
-                       return 0;
+                       return NETDEV_TX_OK;
                skb = skb2;
        }
        skb_push(skb, 2);
@@ -315,7 +309,7 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
                skb2 = skb_realloc_headroom(skb, LEC_HEADER_LEN);
                kfree_skb(skb);
                if (skb2 == NULL)
-                       return 0;
+                       return NETDEV_TX_OK;
                skb = skb2;
        }
 #endif
@@ -352,8 +346,8 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
                                               GFP_ATOMIC);
                        dev_kfree_skb(skb);
                        if (skb2 == NULL) {
-                               priv->stats.tx_dropped++;
-                               return 0;
+                               dev->stats.tx_dropped++;
+                               return NETDEV_TX_OK;
                        }
                        skb = skb2;
                }
@@ -374,26 +368,20 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
 #endif
        entry = NULL;
        vcc = lec_arp_resolve(priv, dst, is_rdesc, &entry);
-       DPRINTK("%s:vcc:%p vcc_flags:%x, entry:%p\n", dev->name,
+       pr_debug("%s:vcc:%p vcc_flags:%lx, entry:%p\n", dev->name,
                vcc, vcc ? vcc->flags : 0, entry);
        if (!vcc || !test_bit(ATM_VF_READY, &vcc->flags)) {
                if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) {
-                       DPRINTK("%s:lec_start_xmit: queuing packet, ",
+                       pr_debug("%s:lec_start_xmit: queuing packet, ",
                                dev->name);
-                       DPRINTK("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n",
-                               lec_h->h_dest[0], lec_h->h_dest[1],
-                               lec_h->h_dest[2], lec_h->h_dest[3],
-                               lec_h->h_dest[4], lec_h->h_dest[5]);
+                       pr_debug("MAC address %pM\n", lec_h->h_dest);
                        skb_queue_tail(&entry->tx_wait, skb);
                } else {
-                       DPRINTK
+                       pr_debug
                            ("%s:lec_start_xmit: tx queue full or no arp entry, dropping, ",
                             dev->name);
-                       DPRINTK("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n",
-                               lec_h->h_dest[0], lec_h->h_dest[1],
-                               lec_h->h_dest[2], lec_h->h_dest[3],
-                               lec_h->h_dest[4], lec_h->h_dest[5]);
-                       priv->stats.tx_dropped++;
+                       pr_debug("MAC address %pM\n", lec_h->h_dest);
+                       dev->stats.tx_dropped++;
                        dev_kfree_skb(skb);
                }
                goto out;
@@ -403,14 +391,12 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
 #endif /* DUMP_PACKETS > 0 */
 
        while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) {
-               DPRINTK("lec.c: emptying tx queue, ");
-               DPRINTK("MAC address 0x%02x:%02x:%02x:%02x:%02x:%02x\n",
-                       lec_h->h_dest[0], lec_h->h_dest[1], lec_h->h_dest[2],
-                       lec_h->h_dest[3], lec_h->h_dest[4], lec_h->h_dest[5]);
-               lec_send(vcc, skb2, priv);
+               pr_debug("lec.c: emptying tx queue, ");
+               pr_debug("MAC address %pM\n", lec_h->h_dest);
+               lec_send(vcc, skb2);
        }
 
-       lec_send(vcc, skb, priv);
+       lec_send(vcc, skb);
 
        if (!atm_may_send(vcc, 0)) {
                struct lec_vcc_priv *vpriv = LEC_VCC_PRIV(vcc);
@@ -432,7 +418,7 @@ out:
        if (entry)
                lec_arp_put(entry);
        dev->trans_start = jiffies;
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /* The inverse routine to net_open(). */
@@ -442,20 +428,11 @@ static int lec_close(struct net_device *dev)
        return 0;
 }
 
-/*
- * Get the current statistics.
- * This may be called with the card open or closed.
- */
-static struct net_device_stats *lec_get_stats(struct net_device *dev)
-{
-       return &((struct lec_priv *)dev->priv)->stats;
-}
-
 static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
 {
        unsigned long flags;
        struct net_device *dev = (struct net_device *)vcc->proto_data;
-       struct lec_priv *priv = (struct lec_priv *)dev->priv;
+       struct lec_priv *priv = netdev_priv(dev);
        struct atmlec_msg *mesg;
        struct lec_arp_table *entry;
        int i;
@@ -465,7 +442,7 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
        mesg = (struct atmlec_msg *)skb->data;
        tmp = skb->data;
        tmp += sizeof(struct atmlec_msg);
-       DPRINTK("%s: msg from zeppelin:%d\n", dev->name, mesg->type);
+       pr_debug("%s: msg from zeppelin:%d\n", dev->name, mesg->type);
        switch (mesg->type) {
        case l_set_mac_addr:
                for (i = 0; i < 6; i++) {
@@ -501,9 +478,9 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
                               mesg->content.normal.atm_addr,
                               mesg->content.normal.flag,
                               mesg->content.normal.targetless_le_arp);
-               DPRINTK("lec: in l_arp_update\n");
+               pr_debug("lec: in l_arp_update\n");
                if (mesg->sizeoftlvs != 0) {    /* LANE2 3.1.5 */
-                       DPRINTK("lec: LANE2 3.1.5, got tlvs, size %d\n",
+                       pr_debug("lec: LANE2 3.1.5, got tlvs, size %d\n",
                                mesg->sizeoftlvs);
                        lane2_associate_ind(dev, mesg->content.normal.mac_addr,
                                            tmp, mesg->sizeoftlvs);
@@ -527,7 +504,7 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
                priv->lane2_ops = NULL;
                if (priv->lane_version > 1)
                        priv->lane2_ops = &lane2_ops;
-               if (dev->change_mtu(dev, mesg->content.config.mtu))
+               if (dev_set_mtu(dev, mesg->content.config.mtu))
                        printk("%s: change_mtu to %d failed\n", dev->name,
                               mesg->content.config.mtu);
                priv->is_proxy = mesg->content.config.is_proxy;
@@ -543,48 +520,34 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
        case l_should_bridge:
 #if defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE)
                {
-                       struct net_bridge_fdb_entry *f;
-
-                       DPRINTK
-                           ("%s: bridge zeppelin asks about 0x%02x:%02x:%02x:%02x:%02x:%02x\n",
-                            dev->name, mesg->content.proxy.mac_addr[0],
-                            mesg->content.proxy.mac_addr[1],
-                            mesg->content.proxy.mac_addr[2],
-                            mesg->content.proxy.mac_addr[3],
-                            mesg->content.proxy.mac_addr[4],
-                            mesg->content.proxy.mac_addr[5]);
-
-                       if (br_fdb_get_hook == NULL || dev->br_port == NULL)
+                       pr_debug("%s: bridge zeppelin asks about %pM\n",
+                                dev->name, mesg->content.proxy.mac_addr);
+
+                       if (br_fdb_test_addr_hook == NULL)
                                break;
 
-                       f = br_fdb_get_hook(dev->br_port->br,
-                                           mesg->content.proxy.mac_addr);
-                       if (f != NULL && f->dst->dev != dev
-                           && f->dst->state == BR_STATE_FORWARDING) {
+                       if (br_fdb_test_addr_hook(dev,
+                                       mesg->content.proxy.mac_addr)) {
                                /* hit from bridge table, send LE_ARP_RESPONSE */
                                struct sk_buff *skb2;
                                struct sock *sk;
 
-                               DPRINTK
+                               pr_debug
                                    ("%s: entry found, responding to zeppelin\n",
                                     dev->name);
                                skb2 =
                                    alloc_skb(sizeof(struct atmlec_msg),
                                              GFP_ATOMIC);
-                               if (skb2 == NULL) {
-                                       br_fdb_put_hook(f);
+                               if (skb2 == NULL)
                                        break;
-                               }
                                skb2->len = sizeof(struct atmlec_msg);
-                               memcpy(skb2->data, mesg,
-                                      sizeof(struct atmlec_msg));
+                               skb_copy_to_linear_data(skb2, mesg,
+                                                       sizeof(*mesg));
                                atm_force_charge(priv->lecd, skb2->truesize);
                                sk = sk_atm(priv->lecd);
                                skb_queue_tail(&sk->sk_receive_queue, skb2);
                                sk->sk_data_ready(sk, skb2->len);
                        }
-                       if (f != NULL)
-                               br_fdb_put_hook(f);
                }
 #endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */
                break;
@@ -601,7 +564,7 @@ static void lec_atm_close(struct atm_vcc *vcc)
 {
        struct sk_buff *skb;
        struct net_device *dev = (struct net_device *)vcc->proto_data;
-       struct lec_priv *priv = (struct lec_priv *)dev->priv;
+       struct lec_priv *priv = netdev_priv(dev);
 
        priv->lecd = NULL;
        /* Do something needful? */
@@ -630,7 +593,7 @@ static struct atm_dev lecatm_dev = {
        .ops = &lecdev_ops,
        .type = "lec",
        .number = 999,          /* dummy device number */
-       .lock = SPIN_LOCK_UNLOCKED
+       .lock = __SPIN_LOCK_UNLOCKED(lecatm_dev.lock)
 };
 
 /*
@@ -639,7 +602,7 @@ static struct atm_dev lecatm_dev = {
  */
 static int
 send_to_lecd(struct lec_priv *priv, atmlec_msg_type type,
-            unsigned char *mac_addr, unsigned char *atm_addr,
+            const unsigned char *mac_addr, const unsigned char *atm_addr,
             struct sk_buff *data)
 {
        struct sock *sk;
@@ -671,7 +634,7 @@ send_to_lecd(struct lec_priv *priv, atmlec_msg_type type,
        sk->sk_data_ready(sk, skb->len);
 
        if (data != NULL) {
-               DPRINTK("lec: about to send %d bytes of data\n", data->len);
+               pr_debug("lec: about to send %d bytes of data\n", data->len);
                atm_force_charge(priv->lecd, data->truesize);
                skb_queue_tail(&sk->sk_receive_queue, data);
                sk->sk_data_ready(sk, skb->len);
@@ -698,22 +661,23 @@ static void lec_set_multicast_list(struct net_device *dev)
        return;
 }
 
+static const struct net_device_ops lec_netdev_ops = {
+       .ndo_open               = lec_open,
+       .ndo_stop               = lec_close,
+       .ndo_start_xmit         = lec_start_xmit,
+       .ndo_change_mtu         = lec_change_mtu,
+       .ndo_tx_timeout         = lec_tx_timeout,
+       .ndo_set_multicast_list = lec_set_multicast_list,
+};
+
+
 static void lec_init(struct net_device *dev)
 {
-       dev->change_mtu = lec_change_mtu;
-       dev->open = lec_open;
-       dev->stop = lec_close;
-       dev->hard_start_xmit = lec_start_xmit;
-       dev->tx_timeout = lec_tx_timeout;
-
-       dev->get_stats = lec_get_stats;
-       dev->set_multicast_list = lec_set_multicast_list;
-       dev->do_ioctl = NULL;
+       dev->netdev_ops = &lec_netdev_ops;
        printk("%s: Initialized!\n", dev->name);
-       return;
 }
 
-static unsigned char lec_ctrl_magic[] = {
+static const unsigned char lec_ctrl_magic[] = {
        0xff,
        0x00,
        0x01,
@@ -733,7 +697,7 @@ static void lec_push(struct atm_vcc *vcc, struct sk_buff *skb)
 {
        unsigned long flags;
        struct net_device *dev = (struct net_device *)vcc->proto_data;
-       struct lec_priv *priv = (struct lec_priv *)dev->priv;
+       struct lec_priv *priv = netdev_priv(dev);
 
 #if DUMP_PACKETS >0
        int i = 0;
@@ -743,7 +707,7 @@ static void lec_push(struct atm_vcc *vcc, struct sk_buff *skb)
               vcc->vpi, vcc->vci);
 #endif
        if (!skb) {
-               DPRINTK("%s: null skb\n", dev->name);
+               pr_debug("%s: null skb\n", dev->name);
                lec_vcc_close(priv, vcc);
                return;
        }
@@ -767,7 +731,7 @@ static void lec_push(struct atm_vcc *vcc, struct sk_buff *skb)
        if (memcmp(skb->data, lec_ctrl_magic, 4) == 0) {        /* Control frame, to daemon */
                struct sock *sk = sk_atm(vcc);
 
-               DPRINTK("%s: To daemon\n", dev->name);
+               pr_debug("%s: To daemon\n", dev->name);
                skb_queue_tail(&sk->sk_receive_queue, skb);
                sk->sk_data_ready(sk, skb->len);
        } else {                /* Data frame, queue to protocol handlers */
@@ -775,13 +739,13 @@ static void lec_push(struct atm_vcc *vcc, struct sk_buff *skb)
                unsigned char *src, *dst;
 
                atm_return(vcc, skb->truesize);
-               if (*(uint16_t *) skb->data == htons(priv->lecid) ||
+               if (*(__be16 *) skb->data == htons(priv->lecid) ||
                    !priv->lecd || !(dev->flags & IFF_UP)) {
                        /*
                         * Probably looping back, or if lecd is missing,
                         * lecd has gone down
                         */
-                       DPRINTK("Ignoring frame...\n");
+                       pr_debug("Ignoring frame...\n");
                        dev_kfree_skb(skb);
                        return;
                }
@@ -825,7 +789,6 @@ static void lec_push(struct atm_vcc *vcc, struct sk_buff *skb)
                if (!hlist_empty(&priv->lec_arp_empty_ones)) {
                        lec_arp_check_empties(priv, vcc, skb);
                }
-               skb->dev = dev;
                skb_pull(skb, 2);       /* skip lec_id */
 #ifdef CONFIG_TR
                if (priv->is_trdev)
@@ -833,8 +796,8 @@ static void lec_push(struct atm_vcc *vcc, struct sk_buff *skb)
                else
 #endif
                        skb->protocol = eth_type_trans(skb, dev);
-               priv->stats.rx_packets++;
-               priv->stats.rx_bytes += skb->len;
+               dev->stats.rx_packets++;
+               dev->stats.rx_bytes += skb->len;
                memset(ATM_SKB(skb), 0, sizeof(struct atm_skb_data));
                netif_rx(skb);
        }
@@ -881,7 +844,7 @@ static int lec_vcc_attach(struct atm_vcc *vcc, void __user *arg)
        vpriv->old_pop = vcc->pop;
        vcc->user_back = vpriv;
        vcc->pop = lec_pop;
-       lec_vcc_added(dev_lec[ioc_data.dev_num]->priv,
+       lec_vcc_added(netdev_priv(dev_lec[ioc_data.dev_num]),
                      &ioc_data, vcc, vcc->push);
        vcc->proto_data = dev_lec[ioc_data.dev_num];
        vcc->push = lec_push;
@@ -893,7 +856,8 @@ static int lec_mcast_attach(struct atm_vcc *vcc, int arg)
        if (arg < 0 || arg >= MAX_LEC_ITF || !dev_lec[arg])
                return -EINVAL;
        vcc->proto_data = dev_lec[arg];
-       return (lec_mcast_make((struct lec_priv *)dev_lec[arg]->priv, vcc));
+       return lec_mcast_make((struct lec_priv *)netdev_priv(dev_lec[arg]),
+                               vcc);
 }
 
 /* Initialize device. */
@@ -935,11 +899,11 @@ static int lecd_attach(struct atm_vcc *vcc, int arg)
                        return -EINVAL;
                }
 
-               priv = dev_lec[i]->priv;
+               priv = netdev_priv(dev_lec[i]);
                priv->is_trdev = is_trdev;
                lec_init(dev_lec[i]);
        } else {
-               priv = dev_lec[i]->priv;
+               priv = netdev_priv(dev_lec[i]);
                if (priv->lecd)
                        return -EADDRINUSE;
        }
@@ -973,9 +937,9 @@ static int lecd_attach(struct atm_vcc *vcc, int arg)
 }
 
 #ifdef CONFIG_PROC_FS
-static char *lec_arp_get_status_string(unsigned char status)
+static const char *lec_arp_get_status_string(unsigned char status)
 {
-       static char *lec_arp_status_string[] = {
+       static const char *const lec_arp_status_string[] = {
                "ESI_UNKNOWN       ",
                "ESI_ARP_PENDING   ",
                "ESI_VC_PENDING    ",
@@ -1029,7 +993,7 @@ static void *lec_tbl_walk(struct lec_state *state, struct hlist_head *tbl,
 
        if (!e)
                e = tbl->first;
-       if (e == (void *)1) {
+       if (e == SEQ_START_TOKEN) {
                e = tbl->first;
                --*l;
        }
@@ -1100,7 +1064,8 @@ static void *lec_itf_walk(struct lec_state *state, loff_t *l)
        void *v;
 
        dev = state->dev ? state->dev : dev_lec[state->itf];
-       v = (dev && dev->priv) ? lec_priv_walk(state, l, dev->priv) : NULL;
+       v = (dev && netdev_priv(dev)) ?
+               lec_priv_walk(state, l, netdev_priv(dev)) : NULL;
        if (!v && dev) {
                dev_put(dev);
                /* Partial state reset for the next time we get called */
@@ -1131,9 +1096,9 @@ static void *lec_seq_start(struct seq_file *seq, loff_t *pos)
        state->locked = NULL;
        state->arp_table = 0;
        state->misc_table = 0;
-       state->node = (void *)1;
+       state->node = SEQ_START_TOKEN;
 
-       return *pos ? lec_get_idx(state, *pos) : (void *)1;
+       return *pos ? lec_get_idx(state, *pos) : SEQ_START_TOKEN;
 }
 
 static void lec_seq_stop(struct seq_file *seq, void *v)
@@ -1158,11 +1123,12 @@ static void *lec_seq_next(struct seq_file *seq, void *v, loff_t *pos)
 
 static int lec_seq_show(struct seq_file *seq, void *v)
 {
-       static char lec_banner[] = "Itf  MAC          ATM destination"
+       static const char lec_banner[] =
+           "Itf  MAC          ATM destination"
            "                          Status            Flags "
            "VPI/VCI Recv VPI/VCI\n";
 
-       if (v == (void *)1)
+       if (v == SEQ_START_TOKEN)
                seq_puts(seq, lec_banner);
        else {
                struct lec_state *state = seq->private;
@@ -1175,7 +1141,7 @@ static int lec_seq_show(struct seq_file *seq, void *v)
        return 0;
 }
 
-static struct seq_operations lec_seq_ops = {
+static const struct seq_operations lec_seq_ops = {
        .start = lec_seq_start,
        .next = lec_seq_next,
        .stop = lec_seq_stop,
@@ -1184,40 +1150,15 @@ static struct seq_operations lec_seq_ops = {
 
 static int lec_seq_open(struct inode *inode, struct file *file)
 {
-       struct lec_state *state;
-       struct seq_file *seq;
-       int rc = -EAGAIN;
-
-       state = kmalloc(sizeof(*state), GFP_KERNEL);
-       if (!state) {
-               rc = -ENOMEM;
-               goto out;
-       }
-
-       rc = seq_open(file, &lec_seq_ops);
-       if (rc)
-               goto out_kfree;
-       seq = file->private_data;
-       seq->private = state;
-out:
-       return rc;
-
-out_kfree:
-       kfree(state);
-       goto out;
-}
-
-static int lec_seq_release(struct inode *inode, struct file *file)
-{
-       return seq_release_private(inode, file);
+       return seq_open_private(file, &lec_seq_ops, sizeof(struct lec_state));
 }
 
-static struct file_operations lec_seq_fops = {
+static const struct file_operations lec_seq_fops = {
        .owner = THIS_MODULE,
        .open = lec_seq_open,
        .read = seq_read,
        .llseek = seq_lseek,
-       .release = lec_seq_release,
+       .release = seq_release_private,
 };
 #endif
 
@@ -1264,9 +1205,11 @@ static int __init lane_module_init(void)
 #ifdef CONFIG_PROC_FS
        struct proc_dir_entry *p;
 
-       p = create_proc_entry("lec", S_IRUGO, atm_proc_root);
-       if (p)
-               p->proc_fops = &lec_seq_fops;
+       p = proc_create("lec", S_IRUGO, atm_proc_root, &lec_seq_fops);
+       if (!p) {
+               printk(KERN_ERR "Unable to initialize /proc/net/atm/lec\n");
+               return -ENOMEM;
+       }
 #endif
 
        register_atm_ioctl(&lane_ioctl_ops);
@@ -1285,7 +1228,7 @@ static void __exit lane_module_cleanup(void)
 
        for (i = 0; i < MAX_LEC_ITF; i++) {
                if (dev_lec[i] != NULL) {
-                       priv = (struct lec_priv *)dev_lec[i]->priv;
+                       priv = netdev_priv(dev_lec[i]);
                        unregister_netdev(dev_lec[i]);
                        free_netdev(dev_lec[i]);
                        dev_lec[i] = NULL;
@@ -1305,11 +1248,11 @@ module_exit(lane_module_cleanup);
  * lec will be used.
  * If dst_mac == NULL, targetless LE_ARP will be sent
  */
-static int lane2_resolve(struct net_device *dev, u8 *dst_mac, int force,
+static int lane2_resolve(struct net_device *dev, const u8 *dst_mac, int force,
                         u8 **tlvs, u32 *sizeoftlvs)
 {
        unsigned long flags;
-       struct lec_priv *priv = (struct lec_priv *)dev->priv;
+       struct lec_priv *priv = netdev_priv(dev);
        struct lec_arp_table *table;
        struct sk_buff *skb;
        int retval;
@@ -1321,11 +1264,10 @@ static int lane2_resolve(struct net_device *dev, u8 *dst_mac, int force,
                if (table == NULL)
                        return -1;
 
-               *tlvs = kmalloc(table->sizeoftlvs, GFP_ATOMIC);
+               *tlvs = kmemdup(table->tlvs, table->sizeoftlvs, GFP_ATOMIC);
                if (*tlvs == NULL)
                        return -1;
 
-               memcpy(*tlvs, table->tlvs, table->sizeoftlvs);
                *sizeoftlvs = table->sizeoftlvs;
 
                return 0;
@@ -1339,7 +1281,7 @@ static int lane2_resolve(struct net_device *dev, u8 *dst_mac, int force,
                if (skb == NULL)
                        return -1;
                skb->len = *sizeoftlvs;
-               memcpy(skb->data, *tlvs, *sizeoftlvs);
+               skb_copy_to_linear_data(skb, *tlvs, *sizeoftlvs);
                retval = send_to_lecd(priv, l_arp_xmt, dst_mac, NULL, skb);
        }
        return retval;
@@ -1352,29 +1294,28 @@ static int lane2_resolve(struct net_device *dev, u8 *dst_mac, int force,
  * Returns 1 for success, 0 for failure (out of memory)
  *
  */
-static int lane2_associate_req(struct net_device *dev, u8 *lan_dst,
-                              u8 *tlvs, u32 sizeoftlvs)
+static int lane2_associate_req(struct net_device *dev, const u8 *lan_dst,
+                              const u8 *tlvs, u32 sizeoftlvs)
 {
        int retval;
        struct sk_buff *skb;
-       struct lec_priv *priv = (struct lec_priv *)dev->priv;
+       struct lec_priv *priv = netdev_priv(dev);
 
        if (compare_ether_addr(lan_dst, dev->dev_addr))
                return (0);     /* not our mac address */
 
        kfree(priv->tlvs);      /* NULL if there was no previous association */
 
-       priv->tlvs = kmalloc(sizeoftlvs, GFP_KERNEL);
+       priv->tlvs = kmemdup(tlvs, sizeoftlvs, GFP_KERNEL);
        if (priv->tlvs == NULL)
                return (0);
        priv->sizeoftlvs = sizeoftlvs;
-       memcpy(priv->tlvs, tlvs, sizeoftlvs);
 
        skb = alloc_skb(sizeoftlvs, GFP_ATOMIC);
        if (skb == NULL)
                return 0;
        skb->len = sizeoftlvs;
-       memcpy(skb->data, tlvs, sizeoftlvs);
+       skb_copy_to_linear_data(skb, tlvs, sizeoftlvs);
        retval = send_to_lecd(priv, l_associate_req, NULL, NULL, skb);
        if (retval != 0)
                printk("lec.c: lane2_associate_req() failed\n");
@@ -1389,13 +1330,13 @@ static int lane2_associate_req(struct net_device *dev, u8 *lan_dst,
  * LANE2: 3.1.5, LE_ASSOCIATE.indication
  *
  */
-static void lane2_associate_ind(struct net_device *dev, u8 *mac_addr,
-                               u8 *tlvs, u32 sizeoftlvs)
+static void lane2_associate_ind(struct net_device *dev, const u8 *mac_addr,
+                               const u8 *tlvs, u32 sizeoftlvs)
 {
 #if 0
        int i = 0;
 #endif
-       struct lec_priv *priv = (struct lec_priv *)dev->priv;
+       struct lec_priv *priv = netdev_priv(dev);
 #if 0                          /*
                                 * Why have the TLVs in LE_ARP entries
                                 * since we do not use them? When you
@@ -1409,12 +1350,10 @@ static void lane2_associate_ind(struct net_device *dev, u8 *mac_addr,
 
        kfree(entry->tlvs);
 
-       entry->tlvs = kmalloc(sizeoftlvs, GFP_KERNEL);
+       entry->tlvs = kmemdup(tlvs, sizeoftlvs, GFP_KERNEL);
        if (entry->tlvs == NULL)
                return;
-
        entry->sizeoftlvs = sizeoftlvs;
-       memcpy(entry->tlvs, tlvs, sizeoftlvs);
 #endif
 #if 0
        printk("lec.c: lane2_associate_ind()\n");
@@ -1441,7 +1380,6 @@ static void lane2_associate_ind(struct net_device *dev, u8 *mac_addr,
  */
 
 #include <linux/types.h>
-#include <linux/sched.h>
 #include <linux/timer.h>
 #include <asm/param.h>
 #include <asm/atomic.h>
@@ -1449,19 +1387,19 @@ static void lane2_associate_ind(struct net_device *dev, u8 *mac_addr,
 #include <net/route.h>
 
 #if 0
-#define DPRINTK(format,args...)
+#define pr_debug(format,args...)
 /*
-#define DPRINTK printk
+#define pr_debug printk
 */
 #endif
 #define DEBUG_ARP_TABLE 0
 
 #define LEC_ARP_REFRESH_INTERVAL (3*HZ)
 
-static void lec_arp_check_expire(void *data);
+static void lec_arp_check_expire(struct work_struct *work);
 static void lec_arp_expire_arp(unsigned long data);
 
-/* 
+/*
  * Arp table funcs
  */
 
@@ -1477,11 +1415,11 @@ static void lec_arp_init(struct lec_priv *priv)
        for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) {
                INIT_HLIST_HEAD(&priv->lec_arp_tables[i]);
        }
-        INIT_HLIST_HEAD(&priv->lec_arp_empty_ones);
-        INIT_HLIST_HEAD(&priv->lec_no_forward);
-        INIT_HLIST_HEAD(&priv->mcast_fwds);
+       INIT_HLIST_HEAD(&priv->lec_arp_empty_ones);
+       INIT_HLIST_HEAD(&priv->lec_no_forward);
+       INIT_HLIST_HEAD(&priv->mcast_fwds);
        spin_lock_init(&priv->lec_arp_lock);
-       INIT_WORK(&priv->lec_arp_work, lec_arp_check_expire, priv);
+       INIT_DELAYED_WORK(&priv->lec_arp_work, lec_arp_check_expire);
        schedule_delayed_work(&priv->lec_arp_work, LEC_ARP_REFRESH_INTERVAL);
 }
 
@@ -1520,7 +1458,7 @@ lec_arp_add(struct lec_priv *priv, struct lec_arp_table *entry)
        tmp = &priv->lec_arp_tables[HASH(entry->mac_addr[ETH_ALEN - 1])];
        hlist_add_head(&entry->next, tmp);
 
-       DPRINTK("LEC_ARP: Added entry:%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n",
+       pr_debug("LEC_ARP: Added entry:%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n",
                0xff & entry->mac_addr[0], 0xff & entry->mac_addr[1],
                0xff & entry->mac_addr[2], 0xff & entry->mac_addr[3],
                0xff & entry->mac_addr[4], 0xff & entry->mac_addr[5]);
@@ -1562,7 +1500,7 @@ lec_arp_remove(struct lec_priv *priv, struct lec_arp_table *to_remove)
        }
        skb_queue_purge(&to_remove->tx_wait);   /* FIXME: good place for this? */
 
-       DPRINTK("LEC_ARP: Removed entry:%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n",
+       pr_debug("LEC_ARP: Removed entry:%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n",
                0xff & to_remove->mac_addr[0], 0xff & to_remove->mac_addr[1],
                0xff & to_remove->mac_addr[2], 0xff & to_remove->mac_addr[3],
                0xff & to_remove->mac_addr[4], 0xff & to_remove->mac_addr[5]);
@@ -1570,7 +1508,7 @@ lec_arp_remove(struct lec_priv *priv, struct lec_arp_table *to_remove)
 }
 
 #if DEBUG_ARP_TABLE
-static char *get_status_string(unsigned char st)
+static const char *get_status_string(unsigned char st)
 {
        switch (st) {
        case ESI_UNKNOWN:
@@ -1774,17 +1712,17 @@ static void lec_arp_destroy(struct lec_priv *priv)
        spin_unlock_irqrestore(&priv->lec_arp_lock, flags);
 }
 
-/* 
+/*
  * Find entry by mac_address
  */
 static struct lec_arp_table *lec_arp_find(struct lec_priv *priv,
-                                         unsigned char *mac_addr)
+                                         const unsigned char *mac_addr)
 {
        struct hlist_node *node;
        struct hlist_head *head;
        struct lec_arp_table *entry;
 
-       DPRINTK("LEC_ARP: lec_arp_find :%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n",
+       pr_debug("LEC_ARP: lec_arp_find :%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x\n",
                mac_addr[0] & 0xff, mac_addr[1] & 0xff, mac_addr[2] & 0xff,
                mac_addr[3] & 0xff, mac_addr[4] & 0xff, mac_addr[5] & 0xff);
 
@@ -1798,7 +1736,7 @@ static struct lec_arp_table *lec_arp_find(struct lec_priv *priv,
 }
 
 static struct lec_arp_table *make_entry(struct lec_priv *priv,
-                                       unsigned char *mac_addr)
+                                       const unsigned char *mac_addr)
 {
        struct lec_arp_table *to_return;
 
@@ -1809,9 +1747,8 @@ static struct lec_arp_table *make_entry(struct lec_priv *priv,
        }
        memcpy(to_return->mac_addr, mac_addr, ETH_ALEN);
        INIT_HLIST_NODE(&to_return->next);
-       init_timer(&to_return->timer);
-       to_return->timer.function = lec_arp_expire_arp;
-       to_return->timer.data = (unsigned long)to_return;
+       setup_timer(&to_return->timer, lec_arp_expire_arp,
+                       (unsigned long)to_return);
        to_return->last_used = jiffies;
        to_return->priv = priv;
        skb_queue_head_init(&to_return->tx_wait);
@@ -1826,7 +1763,7 @@ static void lec_arp_expire_arp(unsigned long data)
 
        entry = (struct lec_arp_table *)data;
 
-       DPRINTK("lec_arp_expire_arp\n");
+       pr_debug("lec_arp_expire_arp\n");
        if (entry->status == ESI_ARP_PENDING) {
                if (entry->no_tries <= entry->priv->max_retry_count) {
                        if (entry->is_rdesc)
@@ -1850,7 +1787,7 @@ static void lec_arp_expire_vcc(unsigned long data)
 
        del_timer(&to_remove->timer);
 
-       DPRINTK("LEC_ARP %p %p: lec_arp_expire_vcc vpi:%d vci:%d\n",
+       pr_debug("LEC_ARP %p %p: lec_arp_expire_vcc vpi:%d vci:%d\n",
                to_remove, priv,
                to_remove->vcc ? to_remove->recv_vcc->vpi : 0,
                to_remove->vcc ? to_remove->recv_vcc->vci : 0);
@@ -1879,17 +1816,18 @@ static void lec_arp_expire_vcc(unsigned long data)
  *       to ESI_FORWARD_DIRECT. This causes the flush period to end
  *       regardless of the progress of the flush protocol.
  */
-static void lec_arp_check_expire(void *data)
+static void lec_arp_check_expire(struct work_struct *work)
 {
        unsigned long flags;
-       struct lec_priv *priv = data;
+       struct lec_priv *priv =
+               container_of(work, struct lec_priv, lec_arp_work.work);
        struct hlist_node *node, *next;
        struct lec_arp_table *entry;
        unsigned long now;
        unsigned long time_to_check;
        int i;
 
-       DPRINTK("lec_arp_check_expire %p\n", priv);
+       pr_debug("lec_arp_check_expire %p\n", priv);
        now = jiffies;
 restart:
        spin_lock_irqsave(&priv->lec_arp_lock, flags);
@@ -1901,13 +1839,13 @@ restart:
                        else
                                time_to_check = priv->aging_time;
 
-                       DPRINTK("About to expire: %lx - %lx > %lx\n",
+                       pr_debug("About to expire: %lx - %lx > %lx\n",
                                now, entry->last_used, time_to_check);
                        if (time_after(now, entry->last_used + time_to_check)
                            && !(entry->flags & LEC_PERMANENT_FLAG)
                            && !(entry->mac_addr[0] & 0x01)) {  /* LANE2: 7.1.20 */
                                /* Remove entry */
-                               DPRINTK("LEC:Entry timed out\n");
+                               pr_debug("LEC:Entry timed out\n");
                                lec_arp_remove(priv, entry);
                                lec_arp_put(entry);
                        } else {
@@ -1936,7 +1874,7 @@ restart:
                                        lec_arp_hold(entry);
                                        spin_unlock_irqrestore(&priv->lec_arp_lock, flags);
                                        while ((skb = skb_dequeue(&entry->tx_wait)) != NULL)
-                                               lec_send(vcc, skb, entry->priv);
+                                               lec_send(vcc, skb);
                                        entry->last_used = jiffies;
                                        entry->status = ESI_FORWARD_DIRECT;
                                        lec_arp_put(entry);
@@ -1952,10 +1890,10 @@ restart:
 
 /*
  * Try to find vcc where mac_address is attached.
- * 
+ *
  */
 static struct atm_vcc *lec_arp_resolve(struct lec_priv *priv,
-                                      unsigned char *mac_to_find, int is_rdesc,
+                                      const unsigned char *mac_to_find, int is_rdesc,
                                       struct lec_arp_table **ret_entry)
 {
        unsigned long flags;
@@ -1966,7 +1904,6 @@ static struct atm_vcc *lec_arp_resolve(struct lec_priv *priv,
                switch (priv->lane_version) {
                case 1:
                        return priv->mcast_vcc;
-                       break;
                case 2: /* LANE2 wants arp for multicast addresses */
                        if (!compare_ether_addr(mac_to_find, bus_mac))
                                return priv->mcast_vcc;
@@ -2005,7 +1942,7 @@ static struct atm_vcc *lec_arp_resolve(struct lec_priv *priv,
                    entry->packets_flooded <
                    priv->maximum_unknown_frame_count) {
                        entry->packets_flooded++;
-                       DPRINTK("LEC_ARP: Flooding..\n");
+                       pr_debug("LEC_ARP: Flooding..\n");
                        found = priv->mcast_vcc;
                        goto out;
                }
@@ -2016,13 +1953,13 @@ static struct atm_vcc *lec_arp_resolve(struct lec_priv *priv,
                 */
                lec_arp_hold(entry);
                *ret_entry = entry;
-               DPRINTK("lec: entry->status %d entry->vcc %p\n", entry->status,
+               pr_debug("lec: entry->status %d entry->vcc %p\n", entry->status,
                        entry->vcc);
                found = NULL;
        } else {
                /* No matching entry was found */
                entry = make_entry(priv, mac_to_find);
-               DPRINTK("LEC_ARP: Making entry\n");
+               pr_debug("LEC_ARP: Making entry\n");
                if (!entry) {
                        found = priv->mcast_vcc;
                        goto out;
@@ -2051,7 +1988,7 @@ out:
 }
 
 static int
-lec_addr_delete(struct lec_priv *priv, unsigned char *atm_addr,
+lec_addr_delete(struct lec_priv *priv, const unsigned char *atm_addr,
                unsigned long permanent)
 {
        unsigned long flags;
@@ -2059,7 +1996,7 @@ lec_addr_delete(struct lec_priv *priv, unsigned char *atm_addr,
        struct lec_arp_table *entry;
        int i;
 
-       DPRINTK("lec_addr_delete\n");
+       pr_debug("lec_addr_delete\n");
        spin_lock_irqsave(&priv->lec_arp_lock, flags);
        for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) {
                hlist_for_each_entry_safe(entry, node, next, &priv->lec_arp_tables[i], next) {
@@ -2078,11 +2015,11 @@ lec_addr_delete(struct lec_priv *priv, unsigned char *atm_addr,
 }
 
 /*
- * Notifies:  Response to arp_request (atm_addr != NULL) 
+ * Notifies:  Response to arp_request (atm_addr != NULL)
  */
 static void
-lec_arp_update(struct lec_priv *priv, unsigned char *mac_addr,
-              unsigned char *atm_addr, unsigned long remoteflag,
+lec_arp_update(struct lec_priv *priv, const unsigned char *mac_addr,
+              const unsigned char *atm_addr, unsigned long remoteflag,
               unsigned int targetless_le_arp)
 {
        unsigned long flags;
@@ -2090,8 +2027,8 @@ lec_arp_update(struct lec_priv *priv, unsigned char *mac_addr,
        struct lec_arp_table *entry, *tmp;
        int i;
 
-       DPRINTK("lec:%s", (targetless_le_arp) ? "targetless " : " ");
-       DPRINTK("lec_arp_update mac:%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\n",
+       pr_debug("lec:%s", (targetless_le_arp) ? "targetless " : " ");
+       pr_debug("lec_arp_update mac:%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\n",
                mac_addr[0], mac_addr[1], mac_addr[2], mac_addr[3],
                mac_addr[4], mac_addr[5]);
 
@@ -2128,7 +2065,7 @@ lec_arp_update(struct lec_priv *priv, unsigned char *mac_addr,
                                        entry->flags |= LEC_REMOTE_FLAG;
                                else
                                        entry->flags &= ~LEC_REMOTE_FLAG;
-                               DPRINTK("After update\n");
+                               pr_debug("After update\n");
                                dump_arp_table(priv);
                                goto out;
                        }
@@ -2172,17 +2109,17 @@ lec_arp_update(struct lec_priv *priv, unsigned char *mac_addr,
                entry->status = ESI_VC_PENDING;
                send_to_lecd(priv, l_svc_setup, entry->mac_addr, atm_addr, NULL);
        }
-       DPRINTK("After update2\n");
+       pr_debug("After update2\n");
        dump_arp_table(priv);
 out:
        spin_unlock_irqrestore(&priv->lec_arp_lock, flags);
 }
 
 /*
- * Notifies: Vcc setup ready 
+ * Notifies: Vcc setup ready
  */
 static void
-lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,
+lec_vcc_added(struct lec_priv *priv, const struct atmlec_ioc *ioc_data,
              struct atm_vcc *vcc,
              void (*old_push) (struct atm_vcc *vcc, struct sk_buff *skb))
 {
@@ -2195,7 +2132,7 @@ lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,
        if (ioc_data->receive == 2) {
                /* Vcc for Multicast Forward. No timer, LANEv2 7.1.20 and 2.3.5.3 */
 
-               DPRINTK("LEC_ARP: Attaching mcast forward\n");
+               pr_debug("LEC_ARP: Attaching mcast forward\n");
 #if 0
                entry = lec_arp_find(priv, bus_mac);
                if (!entry) {
@@ -2220,7 +2157,7 @@ lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,
                 * Vcc which we don't want to make default vcc,
                 * attach it anyway.
                 */
-               DPRINTK
+               pr_debug
                    ("LEC_ARP:Attaching data direct, not default: "
                     "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\n",
                     ioc_data->atm_addr[0], ioc_data->atm_addr[1],
@@ -2248,7 +2185,7 @@ lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,
                dump_arp_table(priv);
                goto out;
        }
-       DPRINTK
+       pr_debug
            ("LEC_ARP:Attaching data direct, default: "
             "%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x\n",
             ioc_data->atm_addr[0], ioc_data->atm_addr[1],
@@ -2266,8 +2203,8 @@ lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,
                        if (memcmp
                            (ioc_data->atm_addr, entry->atm_addr,
                             ATM_ESA_LEN) == 0) {
-                               DPRINTK("LEC_ARP: Attaching data direct\n");
-                               DPRINTK("Currently -> Vcc: %d, Rvcc:%d\n",
+                               pr_debug("LEC_ARP: Attaching data direct\n");
+                               pr_debug("Currently -> Vcc: %d, Rvcc:%d\n",
                                        entry->vcc ? entry->vcc->vci : 0,
                                        entry->recv_vcc ? entry->recv_vcc->
                                        vci : 0);
@@ -2309,7 +2246,7 @@ lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,
                }
        }
        if (found_entry) {
-               DPRINTK("After vcc was added\n");
+               pr_debug("After vcc was added\n");
                dump_arp_table(priv);
                goto out;
        }
@@ -2329,7 +2266,7 @@ lec_vcc_added(struct lec_priv *priv, struct atmlec_ioc *ioc_data,
        entry->timer.expires = jiffies + priv->vcc_timeout_period;
        entry->timer.function = lec_arp_expire_vcc;
        add_timer(&entry->timer);
-       DPRINTK("After vcc was added\n");
+       pr_debug("After vcc was added\n");
        dump_arp_table(priv);
 out:
        spin_unlock_irqrestore(&priv->lec_arp_lock, flags);
@@ -2342,7 +2279,7 @@ static void lec_flush_complete(struct lec_priv *priv, unsigned long tran_id)
        struct lec_arp_table *entry;
        int i;
 
-       DPRINTK("LEC:lec_flush_complete %lx\n", tran_id);
+       pr_debug("LEC:lec_flush_complete %lx\n", tran_id);
 restart:
        spin_lock_irqsave(&priv->lec_arp_lock, flags);
        for (i = 0; i < LEC_ARP_TABLE_SIZE; i++) {
@@ -2355,11 +2292,11 @@ restart:
                                lec_arp_hold(entry);
                                spin_unlock_irqrestore(&priv->lec_arp_lock, flags);
                                while ((skb = skb_dequeue(&entry->tx_wait)) != NULL)
-                                       lec_send(vcc, skb, entry->priv);
+                                       lec_send(vcc, skb);
                                entry->last_used = jiffies;
                                entry->status = ESI_FORWARD_DIRECT;
                                lec_arp_put(entry);
-                               DPRINTK("LEC_ARP: Flushed\n");
+                               pr_debug("LEC_ARP: Flushed\n");
                                goto restart;
                        }
                }
@@ -2370,7 +2307,7 @@ restart:
 
 static void
 lec_set_flush_tran_id(struct lec_priv *priv,
-                     unsigned char *atm_addr, unsigned long tran_id)
+                     const unsigned char *atm_addr, unsigned long tran_id)
 {
        unsigned long flags;
        struct hlist_node *node;
@@ -2382,8 +2319,8 @@ lec_set_flush_tran_id(struct lec_priv *priv,
                hlist_for_each_entry(entry, node, &priv->lec_arp_tables[i], next) {
                        if (!memcmp(atm_addr, entry->atm_addr, ATM_ESA_LEN)) {
                                entry->flush_tran_id = tran_id;
-                               DPRINTK("Set flush transaction id to %lx for %p\n",
-                                       tran_id, entry);
+                               pr_debug("Set flush transaction id to %lx for %p\n",
+                                       tran_id, entry);
                        }
                }
        spin_unlock_irqrestore(&priv->lec_arp_lock, flags);
@@ -2433,7 +2370,7 @@ static void lec_vcc_close(struct lec_priv *priv, struct atm_vcc *vcc)
        struct lec_arp_table *entry;
        int i;
 
-       DPRINTK("LEC_ARP: lec_vcc_close vpi:%d vci:%d\n", vcc->vpi, vcc->vci);
+       pr_debug("LEC_ARP: lec_vcc_close vpi:%d vci:%d\n", vcc->vpi, vcc->vci);
        dump_arp_table(priv);
 
        spin_lock_irqsave(&priv->lec_arp_lock, flags);
@@ -2516,7 +2453,7 @@ lec_arp_check_empties(struct lec_priv *priv,
                        goto out;
                }
        }
-       DPRINTK("LEC_ARP: Arp_check_empties: entry not found!\n");
+       pr_debug("LEC_ARP: Arp_check_empties: entry not found!\n");
 out:
        spin_unlock_irqrestore(&priv->lec_arp_lock, flags);
 }