From: Andy P. <at...@us...> - 2002-04-10 18:39:59
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/isdn/act2000 In directory usw-pr-cvs1:/tmp/cvs-serv1502/isdn/act2000 Modified Files: act2000.h act2000_isa.c act2000_isa.h capi.c capi.h module.c Log Message: synch 2.4.15 commit 49 Index: act2000.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/act2000/act2000.h,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- act2000.h 25 Feb 2001 23:15:10 -0000 1.1.1.2 +++ act2000.h 10 Apr 2002 15:32:22 -0000 1.2 @@ -2,34 +2,18 @@ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * - * Copyright 1998 by Fritz Elfert (fr...@is...) - * Thanks to Friedemann Baitinger and IBM Germany - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Author Fritz Elfert + * Copyright by Fritz Elfert <fr...@is...> + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Thanks to Friedemann Baitinger and IBM Germany * */ #ifndef act2000_h #define act2000_h - -#ifdef __KERNEL__ -/* Kernel includes */ - -#include <linux/module.h> -#include <linux/version.h> -#endif #define ACT2000_IOCTL_SETPORT 1 #define ACT2000_IOCTL_GETPORT 2 Index: act2000_isa.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/act2000/act2000_isa.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- act2000_isa.c 14 Jan 2001 18:42:57 -0000 1.1.1.1 +++ act2000_isa.c 10 Apr 2002 15:32:22 -0000 1.2 @@ -2,22 +2,13 @@ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version). * - * Copyright 1998 by Fritz Elfert (fr...@is...) - * Thanks to Friedemann Baitinger and IBM Germany - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Author Fritz Elfert + * Copyright by Fritz Elfert <fr...@is...> + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Thanks to Friedemann Baitinger and IBM Germany * */ @@ -26,16 +17,7 @@ #include "act2000_isa.h" #include "capi.h" -static act2000_card *irq2card_map[16] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -static int act2000_isa_irqs[] = -{ - 3, 5, 7, 10, 11, 12, 15 -}; -#define ISA_NRIRQS (sizeof(act2000_isa_irqs)/sizeof(int)) +static act2000_card *irq2card_map[16]; static void act2000_isa_delay(long t) @@ -82,13 +64,9 @@ act2000_isa_detect(unsigned short portbase) { int ret = 0; - unsigned long flags; - save_flags(flags); - cli(); if (!check_region(portbase, ISA_REGION)) ret = act2000_isa_reset(portbase); - restore_flags(flags); return ret; } @@ -167,9 +145,6 @@ int act2000_isa_config_irq(act2000_card * card, short irq) { - int i; - unsigned long flags; - if (card->flags & ACT2000_FLAGS_IVALID) { free_irq(card->irq, NULL); irq2card_map[card->irq] = NULL; @@ -178,30 +153,13 @@ outb(ISA_COR_IRQOFF, ISA_PORT_COR); if (!irq) return 0; - save_flags(flags); - cli(); - if (irq == -1) { - /* Auto select */ - for (i = 0; i < ISA_NRIRQS; i++) { - if (!request_irq(act2000_isa_irqs[i], &act2000_isa_interrupt, 0, card->regname, NULL)) { - card->irq = act2000_isa_irqs[i]; - irq2card_map[card->irq] = card; - card->flags |= ACT2000_FLAGS_IVALID; - break; - } - } - } else { - /* Fixed irq */ - if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, NULL)) { - card->irq = irq; - irq2card_map[card->irq] = card; - card->flags |= ACT2000_FLAGS_IVALID; - } - } - restore_flags(flags); - if (!card->flags & ACT2000_FLAGS_IVALID) { + + if (!request_irq(irq, &act2000_isa_interrupt, 0, card->regname, NULL)) { + card->irq = irq; + irq2card_map[card->irq] = card; + card->flags |= ACT2000_FLAGS_IVALID; printk(KERN_WARNING - "act2000: Could not request irq\n"); + "act2000: Could not request irq %d\n",irq); return -EBUSY; } else { act2000_isa_select_irq(card); @@ -451,7 +409,7 @@ int act2000_isa_download(act2000_card * card, act2000_ddef * cb) { - int length; + unsigned int length; int ret; int l; int c; @@ -464,9 +422,8 @@ if (!act2000_isa_reset(card->port)) return -ENXIO; act2000_isa_delay(HZ / 2); - if ((ret = verify_area(VERIFY_READ, (void *) cb, sizeof(cblock)))) - return ret; - copy_from_user(&cblock, (char *) cb, sizeof(cblock)); + if(copy_from_user(&cblock, (char *) cb, sizeof(cblock))) + return -EFAULT; length = cblock.length; p = cblock.buffer; if ((ret = verify_area(VERIFY_READ, (void *) p, length))) Index: act2000_isa.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/act2000/act2000_isa.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- act2000_isa.h 14 Jan 2001 18:42:59 -0000 1.1.1.1 +++ act2000_isa.h 10 Apr 2002 15:32:22 -0000 1.2 @@ -2,22 +2,13 @@ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000 (ISA-Version). * - * Copyright 1998 by Fritz Elfert (fr...@is...) - * Thanks to Friedemann Baitinger and IBM Germany - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Author Fritz Elfert + * Copyright by Fritz Elfert <fr...@is...> + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Thanks to Friedemann Baitinger and IBM Germany * */ Index: capi.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/act2000/capi.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- capi.c 14 Jan 2001 18:43:03 -0000 1.1.1.1 +++ capi.c 10 Apr 2002 15:32:22 -0000 1.2 @@ -1,24 +1,15 @@ /* $Id$ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. - * CAPI encoder/decoder + * CAPI encoder/decoder * - * Copyright 1998 by Fritz Elfert (fr...@is...) - * Thanks to Friedemann Baitinger and IBM Germany - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Author Fritz Elfert + * Copyright by Fritz Elfert <fr...@is...> + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Thanks to Friedemann Baitinger and IBM Germany * */ @@ -124,7 +115,7 @@ m->hdr.cmd.cmd = c; \ m->hdr.cmd.subcmd = s; \ m->hdr.msgnum = actcapi_nextsmsg(card); \ - } \ + } else m = NULL;\ } #define ACTCAPI_CHKSKB if (!skb) { \ Index: capi.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/act2000/capi.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- capi.h 14 Jan 2001 18:43:04 -0000 1.1.1.1 +++ capi.h 10 Apr 2002 15:32:22 -0000 1.2 @@ -2,22 +2,13 @@ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * - * Copyright 1998 by Fritz Elfert (fr...@is...) - * Thanks to Friedemann Baitinger and IBM Germany - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. + * Author Fritz Elfert + * Copyright by Fritz Elfert <fr...@is...> + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Thanks to Friedemann Baitinger and IBM Germany * */ @@ -44,7 +35,7 @@ char *description; } actcapi_msgdsc; -/* CAPI Adress */ +/* CAPI Address */ typedef struct actcapi_addr { __u8 len; /* Length of element */ __u8 tnp; /* Type/Numbering Plan */ Index: module.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/isdn/act2000/module.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- module.c 14 Jan 2001 18:43:08 -0000 1.1.1.1 +++ module.c 10 Apr 2002 15:32:22 -0000 1.2 @@ -2,28 +2,21 @@ * * ISDN lowlevel-module for the IBM ISDN-S0 Active 2000. * - * Copyright 1998 by Fritz Elfert (fr...@is...) - * Thanks to Friedemann Baitinger and IBM Germany - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * Author Fritz Elfert + * Copyright by Fritz Elfert <fr...@is...> + * + * This software may be used and distributed according to the terms + * of the GNU General Public License, incorporated herein by reference. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Thanks to Friedemann Baitinger and IBM Germany * */ #include "act2000.h" #include "act2000_isa.h" #include "capi.h" +#include <linux/module.h> +#include <linux/init.h> static unsigned short act2000_isa_ports[] = { @@ -37,15 +30,15 @@ /* Parameters to be set by insmod */ static int act_bus = 0; static int act_port = -1; /* -1 = Autoprobe */ -static int act_irq = -1; /* -1 = Autoselect */ +static int act_irq = -1; static char *act_id = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; -MODULE_DESCRIPTION( "Driver for IBM Active 2000 ISDN card"); +MODULE_DESCRIPTION( "ISDN4Linux: Driver for IBM Active 2000 ISDN card"); MODULE_AUTHOR( "Fritz Elfert"); -MODULE_SUPPORTED_DEVICE( "ISDN subsystem"); +MODULE_LICENSE( "GPL"); MODULE_PARM_DESC(act_bus, "BusType of first card, 1=ISA, 2=MCA, 3=PCMCIA, currently only ISA"); MODULE_PARM_DESC(membase, "Base port address of first card"); -MODULE_PARM_DESC(act_irq, "IRQ of first card (-1 = grab next free IRQ)"); +MODULE_PARM_DESC(act_irq, "IRQ of first card"); MODULE_PARM_DESC(act_id, "ID-String of first card"); MODULE_PARM(act_bus, "i"); MODULE_PARM(act_port, "i"); @@ -820,12 +813,7 @@ #define DRIVERNAME "IBM Active 2000 ISDN driver" -#ifdef MODULE -#define act2000_init init_module -#endif - -int -act2000_init(void) +static int __init act2000_init(void) { printk(KERN_INFO "%s\n", DRIVERNAME); if (!cards) @@ -837,9 +825,7 @@ return 0; } -#ifdef MODULE -void -cleanup_module(void) +static void __exit act2000_exit(void) { act2000_card *card = cards; act2000_card *last; @@ -858,34 +844,5 @@ printk(KERN_INFO "%s unloaded\n", DRIVERNAME); } -#else -void -act2000_setup(char *str, int *ints) -{ - int i, j, argc, port, irq, bus; - - argc = ints[0]; - i = 1; - if (argc) - while (argc) { - port = irq = -1; - bus = 0; - if (argc) { - bus = ints[i]; - i++; - argc--; - } - if (argc) { - port = ints[i]; - i++; - argc--; - } - if (argc) { - irq = ints[i]; - i++; - argc--; - } - act2000_addcard(bus, port, irq, act_id); - } -} -#endif +module_init(act2000_init); +module_exit(act2000_exit); |