]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/hamradio/baycom_epp.c
Merge branch 'r8169-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/romieu...
[linux-2.6-omap-h63xx.git] / drivers / net / hamradio / baycom_epp.c
index 153b6dc80af4c38bebcca28a4cf8afc6a4209124..00bc7fbb6b374687ebd45f79a84cee5ad472bcaa 100644 (file)
@@ -52,6 +52,7 @@
 #include <linux/hdlcdrv.h>
 #include <linux/baycom.h>
 #include <linux/jiffies.h>
+#include <linux/random.h>
 #include <net/ax25.h> 
 #include <asm/uaccess.h>
 
@@ -319,13 +320,7 @@ static int eppconfig(struct baycom_state *bc)
        sprintf(portarg, "%ld", bc->pdev->port->base);
        printk(KERN_DEBUG "%s: %s -s -p %s -m %s\n", bc_drvname, eppconfig_path, portarg, modearg);
 
-       return call_usermodehelper(eppconfig_path, argv, envp, 1);
-}
-
-/* ---------------------------------------------------------------------- */
-
-static void epp_interrupt(int irq, void *dev_id)
-{
+       return call_usermodehelper(eppconfig_path, argv, envp, UMH_WAIT_PROC);
 }
 
 /* ---------------------------------------------------------------------- */
@@ -433,16 +428,6 @@ static void encode_hdlc(struct baycom_state *bc)
 
 /* ---------------------------------------------------------------------- */
 
-static unsigned short random_seed;
-
-static inline unsigned short random_num(void)
-{
-       random_seed = 28629 * random_seed + 157;
-       return random_seed;
-}
-
-/* ---------------------------------------------------------------------- */
-
 static int transmit(struct baycom_state *bc, int cnt, unsigned char stat)
 {
        struct parport *pp = bc->pdev->port;
@@ -464,7 +449,7 @@ static int transmit(struct baycom_state *bc, int cnt, unsigned char stat)
                        if ((--bc->hdlctx.slotcnt) > 0)
                                return 0;
                        bc->hdlctx.slotcnt = bc->ch_params.slottime;
-                       if ((random_num() % 256) > bc->ch_params.ppersist)
+                       if ((random32() % 256) > bc->ch_params.ppersist)
                                return 0;
                }
        }
@@ -880,7 +865,7 @@ static int epp_open(struct net_device *dev)
        }
        memset(&bc->modem, 0, sizeof(bc->modem));
         bc->pdev = parport_register_device(pp, dev->name, NULL, epp_wakeup, 
-                                       epp_interrupt, PARPORT_DEV_EXCL, dev);
+                                          NULL, PARPORT_DEV_EXCL, dev);
        parport_put_port(pp);
         if (!bc->pdev) {
                 printk(KERN_ERR "%s: cannot register parport at 0x%lx\n", bc_drvname, pp->base);
@@ -974,7 +959,7 @@ static int epp_close(struct net_device *dev)
        unsigned char tmp[1];
 
        bc->work_running = 0;
-       flush_scheduled_work();
+       cancel_delayed_work_sync(&bc->run_work);
        bc->stat = EPP_DCDBIT;
        tmp[0] = 0;
        pp->ops->epp_write_addr(pp, tmp, 1, 0);
@@ -1168,8 +1153,7 @@ static void baycom_probe(struct net_device *dev)
        /* Fill in the fields of the device structure */
        bc->skb = NULL;
        
-       dev->hard_header = ax25_hard_header;
-       dev->rebuild_header = ax25_rebuild_header;
+       dev->header_ops = &ax25_header_ops;
        dev->set_mac_address = baycom_set_mac_address;
        
        dev->type = ARPHRD_AX25;           /* AF_AX25 device */