fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / isdn / i4l / isdn_net.c
index 69c6884..838b373 100644 (file)
@@ -22,7 +22,6 @@
  *           http://i4l.zabbadoz.net/i4l/cisco-hdlc.txt
  */
 
-#include <linux/config.h>
 #include <linux/isdn.h>
 #include <net/arp.h>
 #include <net/dst.h>
@@ -176,7 +175,7 @@ static __inline__ void isdn_net_zero_frame_cnt(isdn_net_local *lp)
 
 /* Prototypes */
 
-int isdn_net_force_dial_lp(isdn_net_local *);
+static int isdn_net_force_dial_lp(isdn_net_local *);
 static int isdn_net_start_xmit(struct sk_buff *, struct net_device *);
 
 static void isdn_net_ciscohdlck_connected(isdn_net_local *lp);
@@ -312,7 +311,7 @@ isdn_net_unbind_channel(isdn_net_local * lp)
  * Since this function is called every second, simply reset the
  * byte-counter of the interface after copying it to the cps-variable.
  */
-unsigned long last_jiffies = -HZ;
+static unsigned long last_jiffies = -HZ;
 
 void
 isdn_net_autohup(void)
@@ -985,9 +984,9 @@ void isdn_net_write_super(isdn_net_local *lp, struct sk_buff *skb)
 /*
  * called from tq_immediate
  */
-static void isdn_net_softint(void *private)
+static void isdn_net_softint(struct work_struct *work)
 {
-       isdn_net_local *lp = private;
+       isdn_net_local *lp = container_of(work, isdn_net_local, tqueue);
        struct sk_buff *skb;
 
        spin_lock_bh(&lp->xmit_lock);
@@ -1131,7 +1130,7 @@ isdn_net_adjust_hdr(struct sk_buff *skb, struct net_device *dev)
 }
 
 
-void isdn_net_tx_timeout(struct net_device * ndev)
+static void isdn_net_tx_timeout(struct net_device * ndev)
 {
        isdn_net_local *lp = (isdn_net_local *) ndev->priv;
 
@@ -1369,7 +1368,7 @@ isdn_net_type_trans(struct sk_buff *skb, struct net_device *dev)
 
        skb->mac.raw = skb->data;
        skb_pull(skb, ETH_HLEN);
-       eth = skb->mac.ethernet;
+       eth = eth_hdr(skb);
 
        if (*eth->h_dest & 1) {
                if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0)
@@ -1424,7 +1423,7 @@ isdn_net_ciscohdlck_alloc_skb(isdn_net_local *lp, int len)
 }
 
 /* cisco hdlck device private ioctls */
-int
+static int
 isdn_ciscohdlck_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
        isdn_net_local *lp = (isdn_net_local *) dev->priv;
@@ -1615,8 +1614,8 @@ isdn_net_ciscohdlck_slarp_send_reply(isdn_net_local *lp)
        struct sk_buff *skb;
        unsigned char *p;
        struct in_device *in_dev = NULL;
-       u32 addr = 0;           /* local ipv4 address */
-       u32 mask = 0;           /* local netmask */
+       __be32 addr = 0;                /* local ipv4 address */
+       __be32 mask = 0;                /* local netmask */
 
        if ((in_dev = lp->netdev->dev.ip_ptr) != NULL) {
                /* take primary(first) address of interface */
@@ -2460,7 +2459,7 @@ isdn_net_findif(char *name)
  * This is called from the userlevel-routine below or
  * from isdn_net_start_xmit().
  */
-int
+static int
 isdn_net_force_dial_lp(isdn_net_local * lp)
 {
        if ((!(lp->flags & ISDN_NET_CONNECTED)) && !lp->dialstate) {
@@ -2543,17 +2542,15 @@ isdn_net_new(char *name, struct net_device *master)
                printk(KERN_WARNING "isdn_net: interface %s already exists\n", name);
                return NULL;
        }
-       if (!(netdev = (isdn_net_dev *) kmalloc(sizeof(isdn_net_dev), GFP_KERNEL))) {
+       if (!(netdev = kzalloc(sizeof(isdn_net_dev), GFP_KERNEL))) {
                printk(KERN_WARNING "isdn_net: Could not allocate net-device\n");
                return NULL;
        }
-       memset(netdev, 0, sizeof(isdn_net_dev));
-       if (!(netdev->local = (isdn_net_local *) kmalloc(sizeof(isdn_net_local), GFP_KERNEL))) {
+       if (!(netdev->local = kzalloc(sizeof(isdn_net_local), GFP_KERNEL))) {
                printk(KERN_WARNING "isdn_net: Could not allocate device locals\n");
                kfree(netdev);
                return NULL;
        }
-       memset(netdev->local, 0, sizeof(isdn_net_local));
        if (name == NULL)
                strcpy(netdev->local->name, "         ");
        else
@@ -2597,7 +2594,7 @@ isdn_net_new(char *name, struct net_device *master)
        netdev->local->netdev = netdev;
        netdev->local->next = netdev->local;
 
-       INIT_WORK(&netdev->local->tqueue, (void *)(void *) isdn_net_softint, netdev->local);
+       INIT_WORK(&netdev->local->tqueue, isdn_net_softint);
        spin_lock_init(&netdev->local->xmit_lock);
 
        netdev->local->isdn_device = -1;
@@ -2951,7 +2948,7 @@ isdn_net_addphone(isdn_net_ioctl_phone * phone)
        isdn_net_phone *n;
 
        if (p) {
-               if (!(n = (isdn_net_phone *) kmalloc(sizeof(isdn_net_phone), GFP_KERNEL)))
+               if (!(n = kmalloc(sizeof(isdn_net_phone), GFP_KERNEL)))
                        return -ENOMEM;
                strcpy(n->num, phone->phone);
                n->next = p->local->phone[phone->outgoing & 1];