From: Andy P. <at...@us...> - 2002-04-11 14:36:49
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio In directory usw-pr-cvs1:/tmp/cvs-serv30336/net/hamradio Modified Files: 6pack.c baycom_epp.c baycom_par.c baycom_ser_fdx.c baycom_ser_hdx.c bpqether.c dmascc.c hdlcdrv.c mkiss.c scc.c yam.c Log Message: synch 2.4.15 commit 50 Index: 6pack.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/6pack.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- 6pack.c 25 Feb 2001 23:15:00 -0000 1.1.1.2 +++ 6pack.c 11 Apr 2002 12:37:47 -0000 1.2 @@ -699,10 +699,10 @@ /* Initialize 6pack control device -- register 6pack line discipline */ -static const char msg_banner[] __initdata = KERN_INFO "AX.25: 6pack driver, " SIXPACK_VERSION " (dynamic channels, max=%d)\n"; -static const char msg_invparm[] __initdata = KERN_ERR "6pack: sixpack_maxdev parameter too large.\n"; -static const char msg_nomem[] __initdata = KERN_ERR "6pack: can't allocate sixpack_ctrls[] array! No 6pack available.\n"; -static const char msg_regfail[] __initdata = KERN_ERR "6pack: can't register line discipline (err = %d)\n"; +static char msg_banner[] __initdata = KERN_INFO "AX.25: 6pack driver, " SIXPACK_VERSION " (dynamic channels, max=%d)\n"; +static char msg_invparm[] __initdata = KERN_ERR "6pack: sixpack_maxdev parameter too large.\n"; +static char msg_nomem[] __initdata = KERN_ERR "6pack: can't allocate sixpack_ctrls[] array! No 6pack available.\n"; +static char msg_regfail[] __initdata = KERN_ERR "6pack: can't register line discipline (err = %d)\n"; static int __init sixpack_init_driver(void) { @@ -711,10 +711,6 @@ /* Do sanity checks on maximum device parameter. */ if (sixpack_maxdev < 4) sixpack_maxdev = 4; - if (sixpack_maxdev * sizeof(void*) >= KMALLOC_MAXSIZE) { - printk(msg_invparm); - return -ENFILE; - } printk(msg_banner, sixpack_maxdev); @@ -797,8 +793,6 @@ memcpy(dev->broadcast, ax25_bcast, AX25_ADDR_LEN); /* Only activated in AX.25 mode */ memcpy(dev->dev_addr, ax25_test, AX25_ADDR_LEN); /* "" "" "" "" */ - - dev_init_buffers(dev); /* New-style flags. */ dev->flags = 0; Index: baycom_epp.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/baycom_epp.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- baycom_epp.c 14 Jan 2001 17:39:25 -0000 1.1.1.1 +++ baycom_epp.c 11 Apr 2002 12:37:47 -0000 1.2 @@ -246,11 +246,6 @@ /* --------------------------------------------------------------------- */ -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#define max(a, b) (((a) > (b)) ? (a) : (b)) - -/* --------------------------------------------------------------------- */ - #define KISS_VERBOSE /* --------------------------------------------------------------------- */ @@ -615,7 +610,7 @@ while (cnt > 0) { switch (bc->hdlctx.state) { case tx_keyup: - i = min(cnt, bc->hdlctx.flags); + i = min_t(int, cnt, bc->hdlctx.flags); cnt -= i; bc->hdlctx.flags -= i; if (bc->hdlctx.flags <= 0) @@ -638,7 +633,7 @@ break; } } - i = min(cnt, bc->hdlctx.bufcnt); + i = min_t(int, cnt, bc->hdlctx.bufcnt); bc->hdlctx.bufcnt -= i; cnt -= i; if (i != pp->ops->epp_write_data(pp, bc->hdlctx.bufptr, i, 0)) @@ -652,7 +647,7 @@ bc->hdlctx.state = tx_data; break; } - i = min(cnt, bc->hdlctx.flags); + i = min_t(int, cnt, bc->hdlctx.flags); if (i) { cnt -= i; bc->hdlctx.flags -= i; @@ -669,7 +664,7 @@ default: /* fall through */ if (bc->hdlctx.calibrate <= 0) return 0; - i = min(cnt, bc->hdlctx.calibrate); + i = min_t(int, cnt, bc->hdlctx.calibrate); cnt -= i; bc->hdlctx.calibrate -= i; memset(tmp, 0, sizeof(tmp)); @@ -1379,8 +1374,6 @@ dev->get_stats = baycom_get_stats; /* Fill in the fields of the device structure */ - dev_init_buffers(dev); - bc->skb = NULL; #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) Index: baycom_par.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/baycom_par.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- baycom_par.c 14 Jan 2001 17:38:46 -0000 1.1.1.1 +++ baycom_par.c 11 Apr 2002 12:37:47 -0000 1.2 @@ -157,11 +157,6 @@ /* --------------------------------------------------------------------- */ -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#define max(a, b) (((a) > (b)) ? (a) : (b)) - -/* --------------------------------------------------------------------- */ - static void __inline__ baycom_int_freq(struct baycom_state *bc) { #ifdef BAYCOM_DEBUG @@ -569,7 +564,7 @@ static int __init baycom_par_setup(char *str) { - static unsigned nr_dev = 0; + static unsigned nr_dev; int ints[2]; if (nr_dev >= NR_PORTS) Index: baycom_ser_fdx.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/baycom_ser_fdx.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- baycom_ser_fdx.c 14 Jan 2001 17:38:49 -0000 1.1.1.1 +++ baycom_ser_fdx.c 11 Apr 2002 12:37:47 -0000 1.2 @@ -152,11 +152,6 @@ /* --------------------------------------------------------------------- */ -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#define max(a, b) (((a) > (b)) ? (a) : (b)) - -/* --------------------------------------------------------------------- */ - static void inline baycom_int_freq(struct baycom_state *bc) { #ifdef BAYCOM_DEBUG @@ -689,7 +684,7 @@ static int __init baycom_ser_fdx_setup(char *str) { - static unsigned nr_dev = 0; + static unsigned nr_dev; int ints[4]; if (nr_dev >= NR_PORTS) Index: baycom_ser_hdx.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/baycom_ser_hdx.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- baycom_ser_hdx.c 14 Jan 2001 17:38:52 -0000 1.1.1.1 +++ baycom_ser_hdx.c 11 Apr 2002 12:37:47 -0000 1.2 @@ -143,11 +143,6 @@ /* --------------------------------------------------------------------- */ -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#define max(a, b) (((a) > (b)) ? (a) : (b)) - -/* --------------------------------------------------------------------- */ - static void inline baycom_int_freq(struct baycom_state *bc) { #ifdef BAYCOM_DEBUG @@ -729,7 +724,7 @@ static int __init baycom_ser_hdx_setup(char *str) { - static unsigned nr_dev = 0; + static unsigned nr_dev; int ints[3]; if (nr_dev >= NR_PORTS) Index: bpqether.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/bpqether.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- bpqether.c 14 Jan 2001 17:38:54 -0000 1.1.1.1 +++ bpqether.c 11 Apr 2002 12:37:47 -0000 1.2 @@ -87,7 +87,7 @@ #include <linux/bpqether.h> -static const char banner[] __initdata = KERN_INFO "AX.25: bpqether driver version 004\n"; +static char banner[] __initdata = KERN_INFO "AX.25: bpqether driver version 004\n"; static unsigned char ax25_bcast[AX25_ADDR_LEN] = {'Q' << 1, 'S' << 1, 'T' << 1, ' ' << 1, ' ' << 1, ' ' << 1, '0' << 1}; @@ -166,7 +166,7 @@ */ static int bpq_check_devices(struct net_device *dev) { - struct bpqdev *bpq, *bpq_prev; + struct bpqdev *bpq, *bpq_prev, *bpq_next; int result = 0; unsigned long flags; @@ -175,7 +175,8 @@ bpq_prev = NULL; - for (bpq = bpq_devices; bpq != NULL; bpq = bpq->next) { + for (bpq = bpq_devices; bpq != NULL; bpq = bpq_next) { + bpq_next = bpq->next; if (!dev_get(bpq->ethname)) { if (bpq_prev) bpq_prev->next = bpq->next; @@ -192,8 +193,8 @@ unregister_netdevice(&bpq->axdev); kfree(bpq); } - - bpq_prev = bpq; + else + bpq_prev = bpq; } restore_flags(flags); @@ -529,8 +530,6 @@ kfree(bpq); return -EIO; } - - dev_init_buffers(dev); dev->hard_start_xmit = bpq_xmit; dev->open = bpq_open; Index: dmascc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/dmascc.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- dmascc.c 14 Jan 2001 17:39:19 -0000 1.1.1.1 +++ dmascc.c 11 Apr 2002 12:37:47 -0000 1.2 @@ -294,7 +294,7 @@ /* Global variables */ -static struct scc_info *first = NULL; +static struct scc_info *first; static unsigned long rand; @@ -593,7 +593,6 @@ dev->tx_queue_len = 64; memcpy(dev->broadcast, ax25_broadcast, 7); memcpy(dev->dev_addr, ax25_test, 7); - dev_init_buffers(dev); rtnl_lock(); if (register_netdevice(dev)) { printk("dmascc: could not register %s\n", dev->name); Index: hdlcdrv.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/hdlcdrv.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- hdlcdrv.c 25 Feb 2001 23:15:00 -0000 1.1.1.2 +++ hdlcdrv.c 11 Apr 2002 12:37:47 -0000 1.2 @@ -95,11 +95,6 @@ #define PARAM_RETURN 255 /* --------------------------------------------------------------------- */ - -#define min(a, b) (((a) < (b)) ? (a) : (b)) -#define max(a, b) (((a) > (b)) ? (a) : (b)) - -/* --------------------------------------------------------------------- */ /* * the CRC routines are stolen from WAMPES * by Dieter Deyke @@ -791,7 +786,6 @@ dev->get_stats = hdlcdrv_get_stats; /* Fill in the fields of the device structure */ - dev_init_buffers(dev); s->skb = NULL; Index: mkiss.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/mkiss.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- mkiss.c 25 Feb 2001 23:15:00 -0000 1.1.1.2 +++ mkiss.c 11 Apr 2002 12:37:47 -0000 1.2 @@ -54,7 +54,7 @@ #include <linux/tcp.h> #endif -static const char banner[] __initdata = KERN_INFO "mkiss: AX.25 Multikiss, Hans Albas PE1AYX\n"; +static char banner[] __initdata = KERN_INFO "mkiss: AX.25 Multikiss, Hans Albas PE1AYX\n"; #define NR_MKISS 4 #define MKISS_SERIAL_TYPE_NORMAL 1 @@ -934,8 +934,6 @@ memcpy(dev->broadcast, ax25_bcast, AX25_ADDR_LEN); memcpy(dev->dev_addr, ax25_test, AX25_ADDR_LEN); - - dev_init_buffers(dev); /* New-style flags. */ dev->flags = 0; Index: scc.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/scc.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- scc.c 25 Feb 2001 23:15:00 -0000 1.1.1.2 +++ scc.c 11 Apr 2002 12:37:47 -0000 1.2 @@ -184,7 +184,7 @@ #include <linux/kernel.h> #include <linux/proc_fs.h> -static const char banner[] __initdata = KERN_INFO "AX.25: Z8530 SCC driver version "VERSION".dl1bke\n"; +static char banner[] __initdata = KERN_INFO "AX.25: Z8530 SCC driver version "VERSION".dl1bke\n"; static void t_dwait(unsigned long); static void t_txdelay(unsigned long); @@ -214,9 +214,9 @@ static int scc_net_set_mac_address(struct net_device *dev, void *addr); static struct net_device_stats * scc_net_get_stats(struct net_device *dev); -static unsigned char *SCC_DriverName = "scc"; +static unsigned char SCC_DriverName[] = "scc"; -static struct irqflags { unsigned char used : 1; } Ivec[16]; +static struct irqflags { unsigned char used : 1; } Ivec[NR_IRQS]; static struct scc_channel SCC_Info[2 * SCC_MAXCHIPS]; /* information per channel */ @@ -582,7 +582,7 @@ if (skb != NULL) dev_kfree_skb_irq(skb); - scc->rx_buff = NULL; + scc->rx_buff = skb = NULL; } if(status & END_FR && skb != NULL) /* end of frame */ @@ -689,7 +689,7 @@ break; } - /* This looks wierd and it is. At least the BayCom USCC doesn't + /* This looks weird and it is. At least the BayCom USCC doesn't * use the Interrupt Daisy Chain, thus we'll have to start * all over again to be sure not to miss an interrupt from * (any of) the other chip(s)... @@ -1484,7 +1484,7 @@ printk(KERN_INFO "Init Z8530 driver: %u channels, IRQ", Nchips*2); flag=" "; - for (k = 0; k < 16; k++) + for (k = 0; k < NR_IRQS; k++) if (Ivec[k].used) { printk("%s%d", flag, k); @@ -1574,8 +1574,6 @@ static int scc_net_init(struct net_device *dev) { - dev_init_buffers(dev); - dev->tx_queue_len = 16; /* should be enough... */ dev->open = scc_net_open; @@ -1766,6 +1764,9 @@ if (hwcfg.irq == 2) hwcfg.irq = 9; + if (hwcfg.irq <0 || hwcfg.irq > NR_IRQS) + return -EINVAL; + if (!Ivec[hwcfg.irq].used && hwcfg.irq) { if (request_irq(hwcfg.irq, scc_isr, SA_INTERRUPT, "AX.25 SCC", NULL)) @@ -1774,8 +1775,8 @@ Ivec[hwcfg.irq].used = 1; } - if (hwcfg.vector_latch) { - if (!request_region(Vector_Latch, 1, "scc vector latch")) + if (hwcfg.vector_latch && !Vector_Latch) { + if (!request_region(hwcfg.vector_latch, 1, "scc vector latch")) printk(KERN_WARNING "z8530drv: warning, cannot reserve vector latch port 0x%lx\n, disabled.", hwcfg.vector_latch); else Vector_Latch = hwcfg.vector_latch; @@ -2164,7 +2165,7 @@ } } - for (k=0; k < 16 ; k++) + for (k=0; k < NR_IRQS ; k++) if (Ivec[k].used) free_irq(k, NULL); if (Vector_Latch) Index: yam.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/yam.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- yam.c 25 Feb 2001 23:15:00 -0000 1.1.1.2 +++ yam.c 11 Apr 2002 12:37:47 -0000 1.2 @@ -35,6 +35,9 @@ * 0.6 F6FBB 25.08.98 Added 1200Bds format * 0.7 F6FBB 12.09.98 Added to the kernel configuration * 0.8 F6FBB 14.10.98 Fixed slottime/persistance timing bug + * OK1ZIA 2.09.01 Fixed "kfree_skb on hard IRQ" + * using dev_kfree_skb_any(). (important in 2.4 kernel) + * */ /*****************************************************************************/ @@ -81,7 +84,7 @@ /* --------------------------------------------------------------------- */ static const char yam_drvname[] = "yam"; -static const char yam_drvinfo[] __initdata = KERN_INFO "YAM driver version 0.8 by F1OAT/F6FBB\n"; +static char yam_drvinfo[] __initdata = KERN_INFO "YAM driver version 0.8 by F1OAT/F6FBB\n"; /* --------------------------------------------------------------------- */ @@ -649,16 +652,16 @@ yp->tx_state = TX_DATA; if (skb->data[0] != 0) { /* do_kiss_params(s, skb->data, skb->len); */ - dev_kfree_skb(skb); + dev_kfree_skb_any(skb); break; } yp->tx_len = skb->len - 1; /* strip KISS byte */ if (yp->tx_len >= YAM_MAX_FRAME || yp->tx_len < 2) { - dev_kfree_skb(skb); + dev_kfree_skb_any(skb); break; } memcpy(yp->tx_buf, skb->data + 1, yp->tx_len); - dev_kfree_skb(skb); + dev_kfree_skb_any(skb); yp->tx_count = 0; yp->tx_crcl = 0x21; yp->tx_crch = 0xf3; @@ -858,7 +861,7 @@ return -EIO; } outb(0, IER(dev->base_addr)); - if (request_irq(dev->irq, yam_interrupt, SA_INTERRUPT | SA_SHIRQ, dev->name, NULL)) { + if (request_irq(dev->irq, yam_interrupt, SA_INTERRUPT | SA_SHIRQ, dev->name, dev)) { printk(KERN_ERR "%s: irq %d busy\n", dev->name, dev->irq); return -EBUSY; } @@ -896,7 +899,7 @@ outb(0, IER(dev->base_addr)); outb(1, MCR(dev->base_addr)); /* Remove IRQ handler if last */ - free_irq(dev->irq, NULL); + free_irq(dev->irq,dev); release_region(dev->base_addr, YAM_EXTENT); netif_stop_queue(dev); while ((skb = skb_dequeue(&yp->send_queue))) @@ -1071,7 +1074,6 @@ dev->hard_start_xmit = yam_send_packet; dev->get_stats = yam_get_stats; - dev_init_buffers(dev); skb_queue_head_init(&yp->send_queue); #if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) |