Messages in this thread Patch in this message |  | | | Date | Sat, 9 Aug 1997 15:04:37 +0100 (WET DST) | | From | Klaus Lichtenwalder <> | | Subject | 2.0.30-3-Linus: Updated isdn patch for Elsa PCMCIA Modem |
| |
Hi, the following patch is an updated patch to my first patch for the Elsa PCMCIA ISDN Card. It's done in correspondence with Dave "Mr. PCMCIA" Hinds. The difference to the already applied patch is: - you don't need to make special arrangements compiling the HiSax stuff in the kernel tree only to include the .o files into a pcmcia module in the pcmcia tree (yes, it's as ugly as I described it) - the HiSax module gets installed in every case, as it can test the presence of the pcmcia adapter only after the pcmcia control module took care of setting irq and mem-base. - It's now longer in use than the first patch by more people and showed its principle correctness... (well...)
The patch for the pcmcia tree, if someone is interested, is at <URL:http://www.webforum.de/elsa.html>, against pcmcia-2.9.5, but it should merge in earlier and later versions, I guess.
Klaus
________________________________________________________________________ Klaus Lichtenwalder, Dipl. Inform., PGP Key: email to key@Four11.com Lichtenwalder@ACM.org, http://www.wp.com/Klaus, fax: +49-89-91072699 Need a (virtual) vacation? Go check: http://www.bavaria.com Unsolicited e-mail advertising and spam will not be tolerateddiff -urN linux/drivers/isdn-orig/hisax/Makefile linux/drivers/isdn/hisax/Makefile --- linux/drivers/isdn-orig/hisax/Makefile Fri Jun 13 18:48:36 1997 +++ linux/drivers/isdn/hisax/Makefile Thu May 29 13:12:06 1997 @@ -35,6 +35,7 @@ ifeq ($(CONFIG_HISAX_ELSA_PCMCIA),y) O_OBJS += elsa.o + OX_OBJS += elsa_wrap.o endif ifeq ($(CONFIG_HISAX_IX1MICROR2),y) diff -urN linux/drivers/isdn-orig/hisax/config.c linux/drivers/isdn/hisax/config.c --- linux/drivers/isdn-orig/hisax/config.c Fri Jun 13 18:48:36 1997 +++ linux/drivers/isdn/hisax/config.c Fri Jun 13 19:09:29 1997 @@ -249,7 +249,15 @@ } #ifdef MODULE -#define HiSax_init init_module +# ifdef CONFIG_HISAX_ELSA_PCMCIA +void register_elsa_symbols(void); +int init_module(void) { + register_elsa_symbols(); + return 0; +} +# else +# define HiSax_init init_module +# endif #else void HiSax_setup(char *str, int *ints) @@ -297,8 +305,12 @@ } #endif -int -HiSax_init(void) +#ifdef CONFIG_HISAX_ELSA_PCMCIA + +int HiSax_init(void* pcm_iob, int pcm_irq, int* busy_flag, int prot) +#else +int HiSax_init(void) +#endif { int i; char tmp[64], rev[64]; @@ -325,6 +337,22 @@ #ifdef MODULE if (id) /* If id= string used */ HiSax_id = id; +#ifdef CONFIG_HISAX_ELSA_PCMCIA + for (i = 0; i < 16; i++) { + cards[i].para[0] = irq[i]; + cards[i].para[1] = io[i]; + cards[i].typ = type[i]; + if (protocol[i]) { + cards[i].protocol = protocol[i]; + nzproto++; + } + } + cards[0].para[0] = pcm_irq; + cards[0].para[1] = (int)pcm_iob; + cards[0].protocol = prot; + cards[0].typ = 7; + nzproto = 1; +#else for (i = 0; i < 16; i++) { cards[i].typ = type[i]; if (protocol[i]) { @@ -376,6 +404,7 @@ } } +#endif if (!nzproto) { printk(KERN_WARNING "HiSax: Warning - no protocol specified\n"); printk(KERN_WARNING "HiSax: Note! module load syntax has changed.\n"); @@ -394,7 +423,13 @@ CallcNew(); Isdnl2New(); - if (HiSax_inithardware()) { +#ifdef CONFIG_HISAX_ELSA_PCMCIA + HiSax_inithardware(busy_flag); /* unconditionally if PCMCIA */ + printk(KERN_NOTICE "HiSax: module installed\n"); + return (0); +#else + if (HiSax_inithardware()) + { /* Install only, if at least one card found */ /* No symbols to export, hide all symbols */ @@ -412,6 +447,7 @@ CallcFree(); return -EIO; } +#endif } #ifdef MODULE @@ -423,3 +459,4 @@ } #endif + diff -urN linux/drivers/isdn-orig/hisax/elsa.c linux/drivers/isdn/hisax/elsa.c --- linux/drivers/isdn-orig/hisax/elsa.c Fri Jun 13 18:48:36 1997 +++ linux/drivers/isdn/hisax/elsa.c Fri Jun 13 19:01:49 1997 @@ -279,7 +279,8 @@ to--; } if (!to) - printk(KERN_WARNING "Elsa: waitforCEC timeout\n"); + printk(KERN_WARNING "Elsa: waitforCEC timeout (%x)\n", + adr); } @@ -888,11 +889,16 @@ u_char val; sp = (struct IsdnCardState *) irq2dev_map[intno]; - if (!sp) { printk(KERN_WARNING "Elsa: Spurious interrupt!\n"); return; } +#ifdef CONFIG_HISAX_ELSA_PCMCIA + if (*(sp->busy_flag) == 1) { + printk(KERN_WARNING "Elsa: card not available!\n"); + return; + } +#endif #ifdef CONFIG_HISAX_ELSA_PCC INT_RESTART: if (!TimerRun(sp)) { @@ -1414,7 +1420,8 @@ "Unknown ELSA subtype %d\n", sp->subtyp); return (0); } - + +#ifndef CONFIG_HISAX_ELSA_PCMCIA if (check_region((sp->cfg_reg), bytecnt)) { printk(KERN_WARNING "HiSax: %s config port %x-%x already in use\n", @@ -1422,7 +1429,9 @@ sp->cfg_reg, sp->cfg_reg + bytecnt); return (0); - } else { + } else +#endif + { request_region(sp->cfg_reg, bytecnt, "elsa isdn"); } diff -urN linux/drivers/isdn-orig/hisax/elsa_wrap.c linux/drivers/isdn/hisax/elsa_wrap.c --- linux/drivers/isdn-orig/hisax/elsa_wrap.c Thu Jan 1 00:00:00 1970 +++ linux/drivers/isdn/hisax/elsa_wrap.c Thu May 29 13:16:50 1997 @@ -0,0 +1,25 @@ +#include <linux/config.h> +#include <linux/module.h> +#include <linux/version.h> + + +int elsa_init_module(void*, int, int*, int); + +extern int HiSax_init(void*, int, int*, int); +extern void cleanup_module(void); + +static struct symbol_table hisax_syms = { +#include <linux/symtab_begin.h> + X(elsa_init_module), +#include <linux/symtab_end.h> +}; + + +void register_elsa_symbols() { + register_symtab(&hisax_syms); +} + +int elsa_init_module(void* io, int req_irq, int* b_flag, int prot) { + int retval = HiSax_init(io, req_irq, b_flag, prot); + return retval; +} diff -urN linux/drivers/isdn-orig/hisax/hisax.h linux/drivers/isdn/hisax/hisax.h --- linux/drivers/isdn-orig/hisax/hisax.h Fri Jun 13 18:48:36 1997 +++ linux/drivers/isdn/hisax/hisax.h Sun Jun 8 17:42:05 1997 @@ -45,6 +45,9 @@ * * */ +#ifdef CONFIG_HISAX_ELSA_PCMCIA +# define __NO_VERSION__ +#endif #include <linux/module.h> #include <linux/config.h> #include <linux/version.h> @@ -406,6 +409,9 @@ char *dlogspace; int debug; unsigned int CallFlags; +#ifdef CONFIG_HISAX_ELSA_PCMCIA + int *busy_flag; +#endif }; #define MON0_RX 1 @@ -483,7 +489,11 @@ void l2up(struct PStack *st, u_char pr, struct sk_buff *skb); void acceptph(struct PStack *st, struct sk_buff *skb); void setstack_isdnl2(struct PStack *st, char *debug_id); +#ifdef CONFIG_HISAX_ELSA_PCMCIA +int HiSax_inithardware(int*); +#else int HiSax_inithardware(void); +#endif void HiSax_closehardware(void); void setstack_HiSax(struct PStack *st, struct IsdnCardState *sp); diff -urN linux/drivers/isdn-orig/hisax/isdnl1.c linux/drivers/isdn/hisax/isdnl1.c --- linux/drivers/isdn-orig/hisax/isdnl1.c Fri Jun 13 18:48:36 1997 +++ linux/drivers/isdn/hisax/isdnl1.c Thu May 29 13:26:55 1997 @@ -871,7 +871,11 @@ } static int +#ifdef CONFIG_HISAX_ELSA_PCMCIA +checkcard(int cardnr, char *id, int* busy_flag) +#else checkcard(int cardnr, char *id) +#endif { long flags; int ret = 0; @@ -892,6 +896,9 @@ sp->cardnr = cardnr; sp->cfg_reg = 0; sp->protocol = card->protocol; +#ifdef CONFIG_HISAX_ELSA_PCMCIA + sp->busy_flag = busy_flag; +#endif if ((card->typ > 0) && (card->typ < 31)) { if (!((1 << card->typ) & SUPORTED_CARDS)) { @@ -1085,7 +1092,11 @@ } int +#ifdef CONFIG_HISAX_ELSA_PCMCIA +HiSax_inithardware(int* busy_flag) +#else HiSax_inithardware(void) +#endif { int foundcards = 0; int i = 0; @@ -1115,7 +1126,12 @@ else sprintf(ids, "%s%d", id, i); } - if (checkcard(i, ids)) { +#ifdef CONFIG_HISAX_ELSA_PCMCIA + if (checkcard(i, ids, busy_flag)) +#else + if (checkcard(i, ids)) +#endif + { foundcards++; i++; } else {
|  |