123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992 |
- /* $Id: config.c,v 2.84.2.5 2004/02/11 13:21:33 keil Exp $
- *
- * Author Karsten Keil
- * Copyright by Karsten Keil <keil@isdn4linux.de>
- * by Kai Germaschewski <kai.germaschewski@gmx.de>
- *
- * This software may be used and distributed according to the terms
- * of the GNU General Public License, incorporated herein by reference.
- *
- * For changes and modifications please read
- * Documentation/isdn/HiSax.cert
- *
- * based on the teles driver from Jan den Ouden
- *
- */
- #include <linux/types.h>
- #include <linux/stddef.h>
- #include <linux/timer.h>
- #include <linux/init.h>
- #include "hisax.h"
- #include <linux/module.h>
- #include <linux/kernel_stat.h>
- #include <linux/workqueue.h>
- #include <linux/interrupt.h>
- #include <linux/slab.h>
- #define HISAX_STATUS_BUFSIZE 4096
- /*
- * This structure array contains one entry per card. An entry looks
- * like this:
- *
- * { type, protocol, p0, p1, p2, NULL }
- *
- * type
- * 1 Teles 16.0 p0=irq p1=membase p2=iobase
- * 2 Teles 8.0 p0=irq p1=membase
- * 3 Teles 16.3 p0=irq p1=iobase
- * 4 Creatix PNP p0=irq p1=IO0 (ISAC) p2=IO1 (HSCX)
- * 5 AVM A1 (Fritz) p0=irq p1=iobase
- * 6 ELSA PC [p0=iobase] or nothing (autodetect)
- * 7 ELSA Quickstep p0=irq p1=iobase
- * 8 Teles PCMCIA p0=irq p1=iobase
- * 9 ITK ix1-micro p0=irq p1=iobase
- * 10 ELSA PCMCIA p0=irq p1=iobase
- * 11 Eicon.Diehl Diva p0=irq p1=iobase
- * 12 Asuscom ISDNLink p0=irq p1=iobase
- * 13 Teleint p0=irq p1=iobase
- * 14 Teles 16.3c p0=irq p1=iobase
- * 15 Sedlbauer speed p0=irq p1=iobase
- * 15 Sedlbauer PC/104 p0=irq p1=iobase
- * 15 Sedlbauer speed pci no parameter
- * 16 USR Sportster internal p0=irq p1=iobase
- * 17 MIC card p0=irq p1=iobase
- * 18 ELSA Quickstep 1000PCI no parameter
- * 19 Compaq ISDN S0 ISA card p0=irq p1=IO0 (HSCX) p2=IO1 (ISAC) p3=IO2
- * 20 Travers Technologies NETjet-S PCI card
- * 21 TELES PCI no parameter
- * 22 Sedlbauer Speed Star p0=irq p1=iobase
- * 23 reserved
- * 24 Dr Neuhaus Niccy PnP/PCI card p0=irq p1=IO0 p2=IO1 (PnP only)
- * 25 Teles S0Box p0=irq p1=iobase (from isapnp setup)
- * 26 AVM A1 PCMCIA (Fritz) p0=irq p1=iobase
- * 27 AVM PnP/PCI p0=irq p1=iobase (PCI no parameter)
- * 28 Sedlbauer Speed Fax+ p0=irq p1=iobase (from isapnp setup)
- * 29 Siemens I-Surf p0=irq p1=iobase p2=memory (from isapnp setup)
- * 30 ACER P10 p0=irq p1=iobase (from isapnp setup)
- * 31 HST Saphir p0=irq p1=iobase
- * 32 Telekom A4T none
- * 33 Scitel Quadro p0=subcontroller (4*S0, subctrl 1...4)
- * 34 Gazel ISDN cards
- * 35 HFC 2BDS0 PCI none
- * 36 Winbond 6692 PCI none
- * 37 HFC 2BDS0 S+/SP p0=irq p1=iobase
- * 38 Travers Technologies NETspider-U PCI card
- * 39 HFC 2BDS0-SP PCMCIA p0=irq p1=iobase
- * 40 hotplug interface
- * 41 Formula-n enter:now ISDN PCI a/b none
- *
- * protocol can be either ISDN_PTYPE_EURO or ISDN_PTYPE_1TR6 or ISDN_PTYPE_NI1
- *
- *
- */
- const char *CardType[] = {
- "No Card", "Teles 16.0", "Teles 8.0", "Teles 16.3",
- "Creatix/Teles PnP", "AVM A1", "Elsa ML", "Elsa Quickstep",
- "Teles PCMCIA", "ITK ix1-micro Rev.2", "Elsa PCMCIA",
- "Eicon.Diehl Diva", "ISDNLink", "TeleInt", "Teles 16.3c",
- "Sedlbauer Speed Card", "USR Sportster", "ith mic Linux",
- "Elsa PCI", "Compaq ISA", "NETjet-S", "Teles PCI",
- "Sedlbauer Speed Star (PCMCIA)", "AMD 7930", "NICCY", "S0Box",
- "AVM A1 (PCMCIA)", "AVM Fritz PnP/PCI", "Sedlbauer Speed Fax +",
- "Siemens I-Surf", "Acer P10", "HST Saphir", "Telekom A4T",
- "Scitel Quadro", "Gazel", "HFC 2BDS0 PCI", "Winbond 6692",
- "HFC 2BDS0 SX", "NETspider-U", "HFC-2BDS0-SP PCMCIA",
- "Hotplug", "Formula-n enter:now PCI a/b",
- };
- #ifdef CONFIG_HISAX_ELSA
- #define DEFAULT_CARD ISDN_CTYPE_ELSA
- #define DEFAULT_CFG {0, 0, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_AVM_A1
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_A1
- #define DEFAULT_CFG {10, 0x340, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_AVM_A1_PCMCIA
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_A1_PCMCIA
- #define DEFAULT_CFG {11, 0x170, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_FRITZPCI
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_FRITZPCI
- #define DEFAULT_CFG {0, 0, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_16_3
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_16_3
- #define DEFAULT_CFG {15, 0x180, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_S0BOX
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_S0BOX
- #define DEFAULT_CFG {7, 0x378, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_16_0
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_16_0
- #define DEFAULT_CFG {15, 0xd0000, 0xd80, 0}
- #endif
- #ifdef CONFIG_HISAX_TELESPCI
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_TELESPCI
- #define DEFAULT_CFG {0, 0, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_IX1MICROR2
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_IX1MICROR2
- #define DEFAULT_CFG {5, 0x390, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_DIEHLDIVA
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_DIEHLDIVA
- #define DEFAULT_CFG {0, 0x0, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_ASUSCOM
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_ASUSCOM
- #define DEFAULT_CFG {5, 0x200, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_TELEINT
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_TELEINT
- #define DEFAULT_CFG {5, 0x300, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_SEDLBAUER
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_SEDLBAUER
- #define DEFAULT_CFG {11, 0x270, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_SPORTSTER
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_SPORTSTER
- #define DEFAULT_CFG {7, 0x268, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_MIC
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_MIC
- #define DEFAULT_CFG {12, 0x3e0, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_NETJET
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_NETJET_S
- #define DEFAULT_CFG {0, 0, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_HFCS
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_TELES3C
- #define DEFAULT_CFG {5, 0x500, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_HFC_PCI
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_HFC_PCI
- #define DEFAULT_CFG {0, 0, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_HFC_SX
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_HFC_SX
- #define DEFAULT_CFG {5, 0x2E0, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_NICCY
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_NICCY
- #define DEFAULT_CFG {0, 0x0, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_ISURF
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_ISURF
- #define DEFAULT_CFG {5, 0x100, 0xc8000, 0}
- #endif
- #ifdef CONFIG_HISAX_HSTSAPHIR
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_HSTSAPHIR
- #define DEFAULT_CFG {5, 0x250, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_BKM_A4T
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_BKM_A4T
- #define DEFAULT_CFG {0, 0x0, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_SCT_QUADRO
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_SCT_QUADRO
- #define DEFAULT_CFG {1, 0x0, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_GAZEL
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_GAZEL
- #define DEFAULT_CFG {15, 0x180, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_W6692
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_W6692
- #define DEFAULT_CFG {0, 0, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_NETJET_U
- #undef DEFAULT_CARD
- #undef DEFAULT_CFG
- #define DEFAULT_CARD ISDN_CTYPE_NETJET_U
- #define DEFAULT_CFG {0, 0, 0, 0}
- #endif
- #ifdef CONFIG_HISAX_1TR6
- #define DEFAULT_PROTO ISDN_PTYPE_1TR6
- #define DEFAULT_PROTO_NAME "1TR6"
- #endif
- #ifdef CONFIG_HISAX_NI1
- #undef DEFAULT_PROTO
- #define DEFAULT_PROTO ISDN_PTYPE_NI1
- #undef DEFAULT_PROTO_NAME
- #define DEFAULT_PROTO_NAME "NI1"
- #endif
- #ifdef CONFIG_HISAX_EURO
- #undef DEFAULT_PROTO
- #define DEFAULT_PROTO ISDN_PTYPE_EURO
- #undef DEFAULT_PROTO_NAME
- #define DEFAULT_PROTO_NAME "EURO"
- #endif
- #ifndef DEFAULT_PROTO
- #define DEFAULT_PROTO ISDN_PTYPE_UNKNOWN
- #define DEFAULT_PROTO_NAME "UNKNOWN"
- #endif
- #ifndef DEFAULT_CARD
- #define DEFAULT_CARD 0
- #define DEFAULT_CFG {0, 0, 0, 0}
- #endif
- #define FIRST_CARD { \
- DEFAULT_CARD, \
- DEFAULT_PROTO, \
- DEFAULT_CFG, \
- NULL, \
- }
- struct IsdnCard cards[HISAX_MAX_CARDS] = {
- FIRST_CARD,
- };
- #define HISAX_IDSIZE (HISAX_MAX_CARDS * 8)
- static char HiSaxID[HISAX_IDSIZE] = { 0, };
- static char *HiSax_id = HiSaxID;
- #ifdef MODULE
- /* Variables for insmod */
- static int type[HISAX_MAX_CARDS] = { 0, };
- static int protocol[HISAX_MAX_CARDS] = { 0, };
- static int io[HISAX_MAX_CARDS] = { 0, };
- #undef IO0_IO1
- #ifdef CONFIG_HISAX_16_3
- #define IO0_IO1
- #endif
- #ifdef CONFIG_HISAX_NICCY
- #undef IO0_IO1
- #define IO0_IO1
- #endif
- #ifdef IO0_IO1
- static int io0[HISAX_MAX_CARDS] = { 0, };
- static int io1[HISAX_MAX_CARDS] = { 0, };
- #endif
- static int irq[HISAX_MAX_CARDS] = { 0, };
- static int mem[HISAX_MAX_CARDS] = { 0, };
- static char *id = HiSaxID;
- MODULE_DESCRIPTION("ISDN4Linux: Driver for passive ISDN cards");
- MODULE_AUTHOR("Karsten Keil");
- MODULE_LICENSE("GPL");
- module_param_array(type, int, NULL, 0);
- module_param_array(protocol, int, NULL, 0);
- module_param_array(io, int, NULL, 0);
- module_param_array(irq, int, NULL, 0);
- module_param_array(mem, int, NULL, 0);
- module_param(id, charp, 0);
- #ifdef IO0_IO1
- module_param_array(io0, int, NULL, 0);
- module_param_array(io1, int, NULL, 0);
- #endif
- #endif /* MODULE */
- int nrcards;
- char *HiSax_getrev(const char *revision)
- {
- char *rev;
- char *p;
- if ((p = strchr(revision, ':'))) {
- rev = p + 2;
- p = strchr(rev, '$');
- *--p = 0;
- } else
- rev = "???";
- return rev;
- }
- static void __init HiSaxVersion(void)
- {
- char tmp[64];
- printk(KERN_INFO "HiSax: Linux Driver for passive ISDN cards\n");
- #ifdef MODULE
- printk(KERN_INFO "HiSax: Version 3.5 (module)\n");
- #else
- printk(KERN_INFO "HiSax: Version 3.5 (kernel)\n");
- #endif
- strcpy(tmp, l1_revision);
- printk(KERN_INFO "HiSax: Layer1 Revision %s\n", HiSax_getrev(tmp));
- strcpy(tmp, l2_revision);
- printk(KERN_INFO "HiSax: Layer2 Revision %s\n", HiSax_getrev(tmp));
- strcpy(tmp, tei_revision);
- printk(KERN_INFO "HiSax: TeiMgr Revision %s\n", HiSax_getrev(tmp));
- strcpy(tmp, l3_revision);
- printk(KERN_INFO "HiSax: Layer3 Revision %s\n", HiSax_getrev(tmp));
- strcpy(tmp, lli_revision);
- printk(KERN_INFO "HiSax: LinkLayer Revision %s\n",
- HiSax_getrev(tmp));
- }
- #ifndef MODULE
- #define MAX_ARG (HISAX_MAX_CARDS * 5)
- static int __init HiSax_setup(char *line)
- {
- int i, j, argc;
- int ints[MAX_ARG + 1];
- char *str;
- str = get_options(line, MAX_ARG, ints);
- argc = ints[0];
- printk(KERN_DEBUG "HiSax_setup: argc(%d) str(%s)\n", argc, str);
- i = 0;
- j = 1;
- while (argc && (i < HISAX_MAX_CARDS)) {
- cards[i].protocol = DEFAULT_PROTO;
- if (argc) {
- cards[i].typ = ints[j];
- j++;
- argc--;
- }
- if (argc) {
- cards[i].protocol = ints[j];
- j++;
- argc--;
- }
- if (argc) {
- cards[i].para[0] = ints[j];
- j++;
- argc--;
- }
- if (argc) {
- cards[i].para[1] = ints[j];
- j++;
- argc--;
- }
- if (argc) {
- cards[i].para[2] = ints[j];
- j++;
- argc--;
- }
- i++;
- }
- if (str && *str) {
- if (strlen(str) < HISAX_IDSIZE)
- strcpy(HiSaxID, str);
- else
- printk(KERN_WARNING "HiSax: ID too long!");
- } else
- strcpy(HiSaxID, "HiSax");
- HiSax_id = HiSaxID;
- return 1;
- }
- __setup("hisax=", HiSax_setup);
- #endif /* MODULES */
- #if CARD_TELES0
- extern int setup_teles0(struct IsdnCard *card);
- #endif
- #if CARD_TELES3
- extern int setup_teles3(struct IsdnCard *card);
- #endif
- #if CARD_S0BOX
- extern int setup_s0box(struct IsdnCard *card);
- #endif
- #if CARD_TELESPCI
- extern int setup_telespci(struct IsdnCard *card);
- #endif
- #if CARD_AVM_A1
- extern int setup_avm_a1(struct IsdnCard *card);
- #endif
- #if CARD_AVM_A1_PCMCIA
- extern int setup_avm_a1_pcmcia(struct IsdnCard *card);
- #endif
- #if CARD_FRITZPCI
- extern int setup_avm_pcipnp(struct IsdnCard *card);
- #endif
- #if CARD_ELSA
- extern int setup_elsa(struct IsdnCard *card);
- #endif
- #if CARD_IX1MICROR2
- extern int setup_ix1micro(struct IsdnCard *card);
- #endif
- #if CARD_DIEHLDIVA
- extern int setup_diva(struct IsdnCard *card);
- #endif
- #if CARD_ASUSCOM
- extern int setup_asuscom(struct IsdnCard *card);
- #endif
- #if CARD_TELEINT
- extern int setup_TeleInt(struct IsdnCard *card);
- #endif
- #if CARD_SEDLBAUER
- extern int setup_sedlbauer(struct IsdnCard *card);
- #endif
- #if CARD_SPORTSTER
- extern int setup_sportster(struct IsdnCard *card);
- #endif
- #if CARD_MIC
- extern int setup_mic(struct IsdnCard *card);
- #endif
- #if CARD_NETJET_S
- extern int setup_netjet_s(struct IsdnCard *card);
- #endif
- #if CARD_HFCS
- extern int setup_hfcs(struct IsdnCard *card);
- #endif
- #if CARD_HFC_PCI
- extern int setup_hfcpci(struct IsdnCard *card);
- #endif
- #if CARD_HFC_SX
- extern int setup_hfcsx(struct IsdnCard *card);
- #endif
- #if CARD_NICCY
- extern int setup_niccy(struct IsdnCard *card);
- #endif
- #if CARD_ISURF
- extern int setup_isurf(struct IsdnCard *card);
- #endif
- #if CARD_HSTSAPHIR
- extern int setup_saphir(struct IsdnCard *card);
- #endif
- #if CARD_BKM_A4T
- extern int setup_bkm_a4t(struct IsdnCard *card);
- #endif
- #if CARD_SCT_QUADRO
- extern int setup_sct_quadro(struct IsdnCard *card);
- #endif
- #if CARD_GAZEL
- extern int setup_gazel(struct IsdnCard *card);
- #endif
- #if CARD_W6692
- extern int setup_w6692(struct IsdnCard *card);
- #endif
- #if CARD_NETJET_U
- extern int setup_netjet_u(struct IsdnCard *card);
- #endif
- #if CARD_FN_ENTERNOW_PCI
- extern int setup_enternow_pci(struct IsdnCard *card);
- #endif
- /*
- * Find card with given driverId
- */
- static inline struct IsdnCardState *hisax_findcard(int driverid)
- {
- int i;
- for (i = 0; i < nrcards; i++)
- if (cards[i].cs)
- if (cards[i].cs->myid == driverid)
- return cards[i].cs;
- return NULL;
- }
- /*
- * Find card with given card number
- */
- #if 0
- struct IsdnCardState *hisax_get_card(int cardnr)
- {
- if ((cardnr <= nrcards) && (cardnr > 0))
- if (cards[cardnr - 1].cs)
- return cards[cardnr - 1].cs;
- return NULL;
- }
- #endif /* 0 */
- static int HiSax_readstatus(u_char __user *buf, int len, int id, int channel)
- {
- int count, cnt;
- u_char __user *p = buf;
- struct IsdnCardState *cs = hisax_findcard(id);
- if (cs) {
- if (len > HISAX_STATUS_BUFSIZE) {
- printk(KERN_WARNING
- "HiSax: status overflow readstat %d/%d\n",
- len, HISAX_STATUS_BUFSIZE);
- }
- count = cs->status_end - cs->status_read + 1;
- if (count >= len)
- count = len;
- if (copy_to_user(p, cs->status_read, count))
- return -EFAULT;
- cs->status_read += count;
- if (cs->status_read > cs->status_end)
- cs->status_read = cs->status_buf;
- p += count;
- count = len - count;
- while (count) {
- if (count > HISAX_STATUS_BUFSIZE)
- cnt = HISAX_STATUS_BUFSIZE;
- else
- cnt = count;
- if (copy_to_user(p, cs->status_read, cnt))
- return -EFAULT;
- p += cnt;
- cs->status_read += cnt % HISAX_STATUS_BUFSIZE;
- count -= cnt;
- }
- return len;
- } else {
- printk(KERN_ERR
- "HiSax: if_readstatus called with invalid driverId!\n");
- return -ENODEV;
- }
- }
- int jiftime(char *s, long mark)
- {
- s += 8;
- *s-- = '\0';
- *s-- = mark % 10 + '0';
- mark /= 10;
- *s-- = mark % 10 + '0';
- mark /= 10;
- *s-- = '.';
- *s-- = mark % 10 + '0';
- mark /= 10;
- *s-- = mark % 6 + '0';
- mark /= 6;
- *s-- = ':';
- *s-- = mark % 10 + '0';
- mark /= 10;
- *s-- = mark % 10 + '0';
- return 8;
- }
- static u_char tmpbuf[HISAX_STATUS_BUFSIZE];
- void VHiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt,
- va_list args)
- {
- /* if head == NULL the fmt contains the full info */
- u_long flags;
- int count, i;
- u_char *p;
- isdn_ctrl ic;
- int len;
- if (!cs) {
- printk(KERN_WARNING "HiSax: No CardStatus for message");
- return;
- }
- spin_lock_irqsave(&cs->statlock, flags);
- p = tmpbuf;
- if (head) {
- p += jiftime(p, jiffies);
- p += sprintf(p, " %s", head);
- p += vsprintf(p, fmt, args);
- *p++ = '\n';
- *p = 0;
- len = p - tmpbuf;
- p = tmpbuf;
- } else {
- p = fmt;
- len = strlen(fmt);
- }
- if (len > HISAX_STATUS_BUFSIZE) {
- spin_unlock_irqrestore(&cs->statlock, flags);
- printk(KERN_WARNING "HiSax: status overflow %d/%d\n",
- len, HISAX_STATUS_BUFSIZE);
- return;
- }
- count = len;
- i = cs->status_end - cs->status_write + 1;
- if (i >= len)
- i = len;
- len -= i;
- memcpy(cs->status_write, p, i);
- cs->status_write += i;
- if (cs->status_write > cs->status_end)
- cs->status_write = cs->status_buf;
- p += i;
- if (len) {
- memcpy(cs->status_write, p, len);
- cs->status_write += len;
- }
- #ifdef KERNELSTACK_DEBUG
- i = (ulong) & len - current->kernel_stack_page;
- sprintf(tmpbuf, "kstack %s %lx use %ld\n", current->comm,
- current->kernel_stack_page, i);
- len = strlen(tmpbuf);
- for (p = tmpbuf, i = len; i > 0; i--, p++) {
- *cs->status_write++ = *p;
- if (cs->status_write > cs->status_end)
- cs->status_write = cs->status_buf;
- count++;
- }
- #endif
- spin_unlock_irqrestore(&cs->statlock, flags);
- if (count) {
- ic.command = ISDN_STAT_STAVAIL;
- ic.driver = cs->myid;
- ic.arg = count;
- cs->iif.statcallb(&ic);
- }
- }
- void HiSax_putstatus(struct IsdnCardState *cs, char *head, char *fmt, ...)
- {
- va_list args;
- va_start(args, fmt);
- VHiSax_putstatus(cs, head, fmt, args);
- va_end(args);
- }
- int ll_run(struct IsdnCardState *cs, int addfeatures)
- {
- isdn_ctrl ic;
- ic.driver = cs->myid;
- ic.command = ISDN_STAT_RUN;
- cs->iif.features |= addfeatures;
- cs->iif.statcallb(&ic);
- return 0;
- }
- static void ll_stop(struct IsdnCardState *cs)
- {
- isdn_ctrl ic;
- ic.command = ISDN_STAT_STOP;
- ic.driver = cs->myid;
- cs->iif.statcallb(&ic);
- // CallcFreeChan(cs);
- }
- static void ll_unload(struct IsdnCardState *cs)
- {
- isdn_ctrl ic;
- ic.command = ISDN_STAT_UNLOAD;
- ic.driver = cs->myid;
- cs->iif.statcallb(&ic);
- kfree(cs->status_buf);
- cs->status_read = NULL;
- cs->status_write = NULL;
- cs->status_end = NULL;
- kfree(cs->dlog);
- cs->dlog = NULL;
- }
- static void closecard(int cardnr)
- {
- struct IsdnCardState *csta = cards[cardnr].cs;
- if (csta->bcs->BC_Close != NULL) {
- csta->bcs->BC_Close(csta->bcs + 1);
- csta->bcs->BC_Close(csta->bcs);
- }
- skb_queue_purge(&csta->rq);
- skb_queue_purge(&csta->sq);
- kfree(csta->rcvbuf);
- csta->rcvbuf = NULL;
- if (csta->tx_skb) {
- dev_kfree_skb(csta->tx_skb);
- csta->tx_skb = NULL;
- }
- if (csta->DC_Close != NULL) {
- csta->DC_Close(csta);
- }
- if (csta->cardmsg)
- csta->cardmsg(csta, CARD_RELEASE, NULL);
- if (csta->dbusytimer.function != NULL) // FIXME?
- del_timer(&csta->dbusytimer);
- ll_unload(csta);
- }
- static irqreturn_t card_irq(int intno, void *dev_id)
- {
- struct IsdnCardState *cs = dev_id;
- irqreturn_t ret = cs->irq_func(intno, cs);
- if (ret == IRQ_HANDLED)
- cs->irq_cnt++;
- return ret;
- }
- static int init_card(struct IsdnCardState *cs)
- {
- int irq_cnt, cnt = 3, ret;
- if (!cs->irq) {
- ret = cs->cardmsg(cs, CARD_INIT, NULL);
- return (ret);
- }
- irq_cnt = cs->irq_cnt = 0;
- printk(KERN_INFO "%s: IRQ %d count %d\n", CardType[cs->typ],
- cs->irq, irq_cnt);
- if (request_irq(cs->irq, card_irq, cs->irq_flags, "HiSax", cs)) {
- printk(KERN_WARNING "HiSax: couldn't get interrupt %d\n",
- cs->irq);
- return 1;
- }
- while (cnt) {
- cs->cardmsg(cs, CARD_INIT, NULL);
- /* Timeout 10ms */
- msleep(10);
- printk(KERN_INFO "%s: IRQ %d count %d\n",
- CardType[cs->typ], cs->irq, cs->irq_cnt);
- if (cs->irq_cnt == irq_cnt) {
- printk(KERN_WARNING
- "%s: IRQ(%d) getting no interrupts during init %d\n",
- CardType[cs->typ], cs->irq, 4 - cnt);
- if (cnt == 1) {
- free_irq(cs->irq, cs);
- return 2;
- } else {
- cs->cardmsg(cs, CARD_RESET, NULL);
- cnt--;
- }
- } else {
- cs->cardmsg(cs, CARD_TEST, NULL);
- return 0;
- }
- }
- return 3;
- }
- static int hisax_cs_setup_card(struct IsdnCard *card)
- {
- int ret;
- switch (card->typ) {
- #if CARD_TELES0
- case ISDN_CTYPE_16_0:
- case ISDN_CTYPE_8_0:
- ret = setup_teles0(card);
- break;
- #endif
- #if CARD_TELES3
- case ISDN_CTYPE_16_3:
- case ISDN_CTYPE_PNP:
- case ISDN_CTYPE_TELESPCMCIA:
- case ISDN_CTYPE_COMPAQ_ISA:
- ret = setup_teles3(card);
- break;
- #endif
- #if CARD_S0BOX
- case ISDN_CTYPE_S0BOX:
- ret = setup_s0box(card);
- break;
- #endif
- #if CARD_TELESPCI
- case ISDN_CTYPE_TELESPCI:
- ret = setup_telespci(card);
- break;
- #endif
- #if CARD_AVM_A1
- case ISDN_CTYPE_A1:
- ret = setup_avm_a1(card);
- break;
- #endif
- #if CARD_AVM_A1_PCMCIA
- case ISDN_CTYPE_A1_PCMCIA:
- ret = setup_avm_a1_pcmcia(card);
- break;
- #endif
- #if CARD_FRITZPCI
- case ISDN_CTYPE_FRITZPCI:
- ret = setup_avm_pcipnp(card);
- break;
- #endif
- #if CARD_ELSA
- case ISDN_CTYPE_ELSA:
- case ISDN_CTYPE_ELSA_PNP:
- case ISDN_CTYPE_ELSA_PCMCIA:
- case ISDN_CTYPE_ELSA_PCI:
- ret = setup_elsa(card);
- break;
- #endif
- #if CARD_IX1MICROR2
- case ISDN_CTYPE_IX1MICROR2:
- ret = setup_ix1micro(card);
- break;
- #endif
- #if CARD_DIEHLDIVA
- case ISDN_CTYPE_DIEHLDIVA:
- ret = setup_diva(card);
- break;
- #endif
- #if CARD_ASUSCOM
- case ISDN_CTYPE_ASUSCOM:
- ret = setup_asuscom(card);
- break;
- #endif
- #if CARD_TELEINT
- case ISDN_CTYPE_TELEINT:
- ret = setup_TeleInt(card);
- break;
- #endif
- #if CARD_SEDLBAUER
- case ISDN_CTYPE_SEDLBAUER:
- case ISDN_CTYPE_SEDLBAUER_PCMCIA:
- case ISDN_CTYPE_SEDLBAUER_FAX:
- ret = setup_sedlbauer(card);
- break;
- #endif
- #if CARD_SPORTSTER
- case ISDN_CTYPE_SPORTSTER:
- ret = setup_sportster(card);
- break;
- #endif
- #if CARD_MIC
- case ISDN_CTYPE_MIC:
- ret = setup_mic(card);
- break;
- #endif
- #if CARD_NETJET_S
- case ISDN_CTYPE_NETJET_S:
- ret = setup_netjet_s(card);
- break;
- #endif
- #if CARD_HFCS
- case ISDN_CTYPE_TELES3C:
- case ISDN_CTYPE_ACERP10:
- ret = setup_hfcs(card);
- break;
- #endif
- #if CARD_HFC_PCI
- case ISDN_CTYPE_HFC_PCI:
- ret = setup_hfcpci(card);
- break;
- #endif
- #if CARD_HFC_SX
- case ISDN_CTYPE_HFC_SX:
- ret = setup_hfcsx(card);
- break;
- #endif
- #if CARD_NICCY
- case ISDN_CTYPE_NICCY:
- ret = setup_niccy(card);
- break;
- #endif
- #if CARD_ISURF
- case ISDN_CTYPE_ISURF:
- ret = setup_isurf(card);
- break;
- #endif
- #if CARD_HSTSAPHIR
- case ISDN_CTYPE_HSTSAPHIR:
- ret = setup_saphir(card);
- break;
- #endif
- #if CARD_BKM_A4T
- case ISDN_CTYPE_BKM_A4T:
- ret = setup_bkm_a4t(card);
- break;
- #endif
- #if CARD_SCT_QUADRO
- case ISDN_CTYPE_SCT_QUADRO:
- ret = setup_sct_quadro(card);
- break;
- #endif
- #if CARD_GAZEL
- case ISDN_CTYPE_GAZEL:
- ret = setup_gazel(card);
- break;
- #endif
- #if CARD_W6692
- case ISDN_CTYPE_W6692:
- ret = setup_w6692(card);
- break;
- #endif
- #if CARD_NETJET_U
- case ISDN_CTYPE_NETJET_U:
- ret = setup_netjet_u(card);
- break;
- #endif
- #if CARD_FN_ENTERNOW_PCI
- case ISDN_CTYPE_ENTERNOW:
- ret = setup_enternow_pci(card);
- break;
- #endif
- case ISDN_CTYPE_DYNAMIC:
- ret = 2;
- break;
- default:
- printk(KERN_WARNING
- "HiSax: Support for %s Card not selected\n",
- CardType[card->typ]);
- ret = 0;
- break;
- }
- return ret;
- }
- static int hisax_cs_new(int cardnr, char *id, struct IsdnCard *card,
- struct IsdnCardState **cs_out, int *busy_flag,
- struct module *lockowner)
- {
- struct IsdnCardState *cs;
- *cs_out = NULL;
- cs = kzalloc(sizeof(struct IsdnCardState), GFP_ATOMIC);
- if (!cs) {
- printk(KERN_WARNING
- "HiSax: No memory for IsdnCardState(card %d)\n",
- cardnr + 1);
- goto out;
- }
- card->cs = cs;
- spin_lock_init(&cs->statlock);
- spin_lock_init(&cs->lock);
- cs->chanlimit = 2; /* maximum B-channel number */
- cs->logecho = 0; /* No echo logging */
- cs->cardnr = cardnr;
- cs->debug = L1_DEB_WARN;
- cs->HW_Flags = 0;
- cs->busy_flag = busy_flag;
- cs->irq_flags = I4L_IRQ_FLAG;
- #if TEI_PER_CARD
- if (card->protocol == ISDN_PTYPE_NI1)
- test_and_set_bit(FLG_TWO_DCHAN, &cs->HW_Flags);
- #else
- test_and_set_bit(FLG_TWO_DCHAN, &cs->HW_Flags);
- #endif
- cs->protocol = card->protocol;
- if (card->typ <= 0 || card->typ > ISDN_CTYPE_COUNT) {
- printk(KERN_WARNING
- "HiSax: Card Type %d out of range\n", card->typ);
- goto outf_cs;
- }
- if (!(cs->dlog = kmalloc(MAX_DLOG_SPACE, GFP_ATOMIC))) {
- printk(KERN_WARNING
- "HiSax: No memory for dlog(card %d)\n", cardnr + 1);
- goto outf_cs;
- }
- if (!(cs->status_buf = kmalloc(HISAX_STATUS_BUFSIZE, GFP_ATOMIC))) {
- printk(KERN_WARNING
- "HiSax: No memory for status_buf(card %d)\n",
- cardnr + 1);
- goto outf_dlog;
- }
- cs->stlist = NULL;
- cs->status_read = cs->status_buf;
- cs->status_write = cs->status_buf;
- cs->status_end = cs->status_buf + HISAX_STATUS_BUFSIZE - 1;
- cs->typ = card->typ;
- #ifdef MODULE
- cs->iif.owner = lockowner;
- #endif
- strcpy(cs->iif.id, id);
- cs->iif.channels = 2;
- cs->iif.maxbufsize = MAX_DATA_SIZE;
- cs->iif.hl_hdrlen = MAX_HEADER_LEN;
- cs->iif.features =
- ISDN_FEATURE_L2_X75I |
- ISDN_FEATURE_L2_HDLC |
- ISDN_FEATURE_L2_HDLC_56K |
- ISDN_FEATURE_L2_TRANS |
- ISDN_FEATURE_L3_TRANS |
- #ifdef CONFIG_HISAX_1TR6
- ISDN_FEATURE_P_1TR6 |
- #endif
- #ifdef CONFIG_HISAX_EURO
- ISDN_FEATURE_P_EURO |
- #endif
- #ifdef CONFIG_HISAX_NI1
- ISDN_FEATURE_P_NI1 |
- #endif
- 0;
- cs->iif.command = HiSax_command;
- cs->iif.writecmd = NULL;
- cs->iif.writebuf_skb = HiSax_writebuf_skb;
- cs->iif.readstat = HiSax_readstatus;
- register_isdn(&cs->iif);
- cs->myid = cs->iif.channels;
- *cs_out = cs;
- return 1; /* success */
- outf_dlog:
- kfree(cs->dlog);
- outf_cs:
- kfree(cs);
- card->cs = NULL;
- out:
- return 0; /* error */
- }
- static int hisax_cs_setup(int cardnr, struct IsdnCard *card,
- struct IsdnCardState *cs)
- {
- int ret;
- if (!(cs->rcvbuf = kmalloc(MAX_DFRAME_LEN_L1, GFP_ATOMIC))) {
- printk(KERN_WARNING "HiSax: No memory for isac rcvbuf\n");
- ll_unload(cs);
- goto outf_cs;
- }
- cs->rcvidx = 0;
- cs->tx_skb = NULL;
- cs->tx_cnt = 0;
- cs->event = 0;
- skb_queue_head_init(&cs->rq);
- skb_queue_head_init(&cs->sq);
- init_bcstate(cs, 0);
- init_bcstate(cs, 1);
- /* init_card only handles interrupts which are not */
- /* used here for the loadable driver */
- switch (card->typ) {
- case ISDN_CTYPE_DYNAMIC:
- ret = 0;
- break;
- default:
- ret = init_card(cs);
- break;
- }
- if (ret) {
- closecard(cardnr);
- goto outf_cs;
- }
- init_tei(cs, cs->protocol);
- ret = CallcNewChan(cs);
- if (ret) {
- closecard(cardnr);
- goto outf_cs;
- }
- /* ISAR needs firmware download first */
- if (!test_bit(HW_ISAR, &cs->HW_Flags))
- ll_run(cs, 0);
- return 1;
- outf_cs:
- kfree(cs);
- card->cs = NULL;
- return 0;
- }
- static int checkcard(int cardnr, char *id, int *busy_flag,
- struct module *lockowner, hisax_setup_func_t card_setup)
- {
- int ret;
- struct IsdnCard *card = cards + cardnr;
- struct IsdnCardState *cs;
- ret = hisax_cs_new(cardnr, id, card, &cs, busy_flag, lockowner);
- if (!ret)
- return 0;
- printk(KERN_INFO
- "HiSax: Card %d Protocol %s Id=%s (%d)\n", cardnr + 1,
- (card->protocol == ISDN_PTYPE_1TR6) ? "1TR6" :
- (card->protocol == ISDN_PTYPE_EURO) ? "EDSS1" :
- (card->protocol == ISDN_PTYPE_LEASED) ? "LEASED" :
- (card->protocol == ISDN_PTYPE_NI1) ? "NI1" :
- "NONE", cs->iif.id, cs->myid);
- ret = card_setup(card);
- if (!ret) {
- ll_unload(cs);
- goto outf_cs;
- }
- ret = hisax_cs_setup(cardnr, card, cs);
- goto out;
- outf_cs:
- kfree(cs);
- card->cs = NULL;
- out:
- return ret;
- }
- static void HiSax_shiftcards(int idx)
- {
- int i;
- for (i = idx; i < (HISAX_MAX_CARDS - 1); i++)
- memcpy(&cards[i], &cards[i + 1], sizeof(cards[i]));
- }
- static int __init HiSax_inithardware(int *busy_flag)
- {
- int foundcards = 0;
- int i = 0;
- int t = ',';
- int flg = 0;
- char *id;
- char *next_id = HiSax_id;
- char ids[20];
- if (strchr(HiSax_id, ','))
- t = ',';
- else if (strchr(HiSax_id, '%'))
- t = '%';
- while (i < nrcards) {
- if (cards[i].typ < 1)
- break;
- id = next_id;
- if ((next_id = strchr(id, t))) {
- *next_id++ = 0;
- strcpy(ids, id);
- flg = i + 1;
- } else {
- next_id = id;
- if (flg >= i)
- strcpy(ids, id);
- else
- sprintf(ids, "%s%d", id, i);
- }
- if (checkcard(i, ids, busy_flag, THIS_MODULE,
- hisax_cs_setup_card)) {
- foundcards++;
- i++;
- } else {
- /* make sure we don't oops the module */
- if (cards[i].typ > 0 && cards[i].typ <= ISDN_CTYPE_COUNT) {
- printk(KERN_WARNING
- "HiSax: Card %s not installed !\n",
- CardType[cards[i].typ]);
- }
- HiSax_shiftcards(i);
- nrcards--;
- }
- }
- return foundcards;
- }
- void HiSax_closecard(int cardnr)
- {
- int i, last = nrcards - 1;
- if (cardnr > last || cardnr < 0)
- return;
- if (cards[cardnr].cs) {
- ll_stop(cards[cardnr].cs);
- release_tei(cards[cardnr].cs);
- CallcFreeChan(cards[cardnr].cs);
- closecard(cardnr);
- if (cards[cardnr].cs->irq)
- free_irq(cards[cardnr].cs->irq, cards[cardnr].cs);
- kfree((void *) cards[cardnr].cs);
- cards[cardnr].cs = NULL;
- }
- i = cardnr;
- while (i <= last) {
- cards[i] = cards[i + 1];
- i++;
- }
- nrcards--;
- }
- void HiSax_reportcard(int cardnr, int sel)
- {
- struct IsdnCardState *cs = cards[cardnr].cs;
- printk(KERN_DEBUG "HiSax: reportcard No %d\n", cardnr + 1);
- printk(KERN_DEBUG "HiSax: Type %s\n", CardType[cs->typ]);
- printk(KERN_DEBUG "HiSax: debuglevel %x\n", cs->debug);
- printk(KERN_DEBUG "HiSax: HiSax_reportcard address 0x%lX\n",
- (ulong) & HiSax_reportcard);
- printk(KERN_DEBUG "HiSax: cs 0x%lX\n", (ulong) cs);
- printk(KERN_DEBUG "HiSax: HW_Flags %lx bc0 flg %lx bc1 flg %lx\n",
- cs->HW_Flags, cs->bcs[0].Flag, cs->bcs[1].Flag);
- printk(KERN_DEBUG "HiSax: bcs 0 mode %d ch%d\n",
- cs->bcs[0].mode, cs->bcs[0].channel);
- printk(KERN_DEBUG "HiSax: bcs 1 mode %d ch%d\n",
- cs->bcs[1].mode, cs->bcs[1].channel);
- #ifdef ERROR_STATISTIC
- printk(KERN_DEBUG "HiSax: dc errors(rx,crc,tx) %d,%d,%d\n",
- cs->err_rx, cs->err_crc, cs->err_tx);
- printk(KERN_DEBUG
- "HiSax: bc0 errors(inv,rdo,crc,tx) %d,%d,%d,%d\n",
- cs->bcs[0].err_inv, cs->bcs[0].err_rdo, cs->bcs[0].err_crc,
- cs->bcs[0].err_tx);
- printk(KERN_DEBUG
- "HiSax: bc1 errors(inv,rdo,crc,tx) %d,%d,%d,%d\n",
- cs->bcs[1].err_inv, cs->bcs[1].err_rdo, cs->bcs[1].err_crc,
- cs->bcs[1].err_tx);
- if (sel == 99) {
- cs->err_rx = 0;
- cs->err_crc = 0;
- cs->err_tx = 0;
- cs->bcs[0].err_inv = 0;
- cs->bcs[0].err_rdo = 0;
- cs->bcs[0].err_crc = 0;
- cs->bcs[0].err_tx = 0;
- cs->bcs[1].err_inv = 0;
- cs->bcs[1].err_rdo = 0;
- cs->bcs[1].err_crc = 0;
- cs->bcs[1].err_tx = 0;
- }
- #endif
- }
- static int __init HiSax_init(void)
- {
- int i, retval;
- #ifdef MODULE
- int j;
- int nzproto = 0;
- #endif
- HiSaxVersion();
- retval = CallcNew();
- if (retval)
- goto out;
- retval = Isdnl3New();
- if (retval)
- goto out_callc;
- retval = Isdnl2New();
- if (retval)
- goto out_isdnl3;
- retval = TeiNew();
- if (retval)
- goto out_isdnl2;
- retval = Isdnl1New();
- if (retval)
- goto out_tei;
- #ifdef MODULE
- if (!type[0]) {
- /* We 'll register drivers later, but init basic functions */
- for (i = 0; i < HISAX_MAX_CARDS; i++)
- cards[i].typ = 0;
- return 0;
- }
- #ifdef CONFIG_HISAX_ELSA
- if (type[0] == ISDN_CTYPE_ELSA_PCMCIA) {
- /* we have exported and return in this case */
- return 0;
- }
- #endif
- #ifdef CONFIG_HISAX_SEDLBAUER
- if (type[0] == ISDN_CTYPE_SEDLBAUER_PCMCIA) {
- /* we have to export and return in this case */
- return 0;
- }
- #endif
- #ifdef CONFIG_HISAX_AVM_A1_PCMCIA
- if (type[0] == ISDN_CTYPE_A1_PCMCIA) {
- /* we have to export and return in this case */
- return 0;
- }
- #endif
- #ifdef CONFIG_HISAX_HFC_SX
- if (type[0] == ISDN_CTYPE_HFC_SP_PCMCIA) {
- /* we have to export and return in this case */
- return 0;
- }
- #endif
- #endif
- nrcards = 0;
- #ifdef MODULE
- if (id) /* If id= string used */
- HiSax_id = id;
- for (i = j = 0; j < HISAX_MAX_CARDS; i++) {
- cards[j].typ = type[i];
- if (protocol[i]) {
- cards[j].protocol = protocol[i];
- nzproto++;
- } else {
- cards[j].protocol = DEFAULT_PROTO;
- }
- switch (type[i]) {
- case ISDN_CTYPE_16_0:
- cards[j].para[0] = irq[i];
- cards[j].para[1] = mem[i];
- cards[j].para[2] = io[i];
- break;
- case ISDN_CTYPE_8_0:
- cards[j].para[0] = irq[i];
- cards[j].para[1] = mem[i];
- break;
- #ifdef IO0_IO1
- case ISDN_CTYPE_PNP:
- case ISDN_CTYPE_NICCY:
- cards[j].para[0] = irq[i];
- cards[j].para[1] = io0[i];
- cards[j].para[2] = io1[i];
- break;
- case ISDN_CTYPE_COMPAQ_ISA:
- cards[j].para[0] = irq[i];
- cards[j].para[1] = io0[i];
- cards[j].para[2] = io1[i];
- cards[j].para[3] = io[i];
- break;
- #endif
- case ISDN_CTYPE_ELSA:
- case ISDN_CTYPE_HFC_PCI:
- cards[j].para[0] = io[i];
- break;
- case ISDN_CTYPE_16_3:
- case ISDN_CTYPE_TELESPCMCIA:
- case ISDN_CTYPE_A1:
- case ISDN_CTYPE_A1_PCMCIA:
- case ISDN_CTYPE_ELSA_PNP:
- case ISDN_CTYPE_ELSA_PCMCIA:
- case ISDN_CTYPE_IX1MICROR2:
- case ISDN_CTYPE_DIEHLDIVA:
- case ISDN_CTYPE_ASUSCOM:
- case ISDN_CTYPE_TELEINT:
- case ISDN_CTYPE_SEDLBAUER:
- case ISDN_CTYPE_SEDLBAUER_PCMCIA:
- case ISDN_CTYPE_SEDLBAUER_FAX:
- case ISDN_CTYPE_SPORTSTER:
- case ISDN_CTYPE_MIC:
- case ISDN_CTYPE_TELES3C:
- case ISDN_CTYPE_ACERP10:
- case ISDN_CTYPE_S0BOX:
- case ISDN_CTYPE_FRITZPCI:
- case ISDN_CTYPE_HSTSAPHIR:
- case ISDN_CTYPE_GAZEL:
- case ISDN_CTYPE_HFC_SX:
- case ISDN_CTYPE_HFC_SP_PCMCIA:
- cards[j].para[0] = irq[i];
- cards[j].para[1] = io[i];
- break;
- case ISDN_CTYPE_ISURF:
- cards[j].para[0] = irq[i];
- cards[j].para[1] = io[i];
- cards[j].para[2] = mem[i];
- break;
- case ISDN_CTYPE_ELSA_PCI:
- case ISDN_CTYPE_NETJET_S:
- case ISDN_CTYPE_TELESPCI:
- case ISDN_CTYPE_W6692:
- case ISDN_CTYPE_NETJET_U:
- break;
- case ISDN_CTYPE_BKM_A4T:
- break;
- case ISDN_CTYPE_SCT_QUADRO:
- if (irq[i]) {
- cards[j].para[0] = irq[i];
- } else {
- /* QUADRO is a 4 BRI card */
- cards[j++].para[0] = 1;
- /* we need to check if further cards can be added */
- if (j < HISAX_MAX_CARDS) {
- cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
- cards[j].protocol = protocol[i];
- cards[j++].para[0] = 2;
- }
- if (j < HISAX_MAX_CARDS) {
- cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
- cards[j].protocol = protocol[i];
- cards[j++].para[0] = 3;
- }
- if (j < HISAX_MAX_CARDS) {
- cards[j].typ = ISDN_CTYPE_SCT_QUADRO;
- cards[j].protocol = protocol[i];
- cards[j].para[0] = 4;
- }
- }
- break;
- }
- j++;
- }
- if (!nzproto) {
- printk(KERN_WARNING
- "HiSax: Warning - no protocol specified\n");
- printk(KERN_WARNING "HiSax: using protocol %s\n",
- DEFAULT_PROTO_NAME);
- }
- #endif
- if (!HiSax_id)
- HiSax_id = HiSaxID;
- if (!HiSaxID[0])
- strcpy(HiSaxID, "HiSax");
- for (i = 0; i < HISAX_MAX_CARDS; i++)
- if (cards[i].typ > 0)
- nrcards++;
- printk(KERN_DEBUG "HiSax: Total %d card%s defined\n",
- nrcards, (nrcards > 1) ? "s" : "");
- /* Install only, if at least one card found */
- if (!HiSax_inithardware(NULL))
- return -ENODEV;
- return 0;
- out_tei:
- TeiFree();
- out_isdnl2:
- Isdnl2Free();
- out_isdnl3:
- Isdnl3Free();
- out_callc:
- CallcFree();
- out:
- return retval;
- }
- static void __exit HiSax_exit(void)
- {
- int cardnr = nrcards - 1;
- while (cardnr >= 0)
- HiSax_closecard(cardnr--);
- Isdnl1Free();
- TeiFree();
- Isdnl2Free();
- Isdnl3Free();
- CallcFree();
- printk(KERN_INFO "HiSax module removed\n");
- }
- int hisax_init_pcmcia(void *pcm_iob, int *busy_flag, struct IsdnCard *card)
- {
- u_char ids[16];
- int ret = -1;
- cards[nrcards] = *card;
- if (nrcards)
- sprintf(ids, "HiSax%d", nrcards);
- else
- sprintf(ids, "HiSax");
- if (!checkcard(nrcards, ids, busy_flag, THIS_MODULE,
- hisax_cs_setup_card))
- goto error;
- ret = nrcards;
- nrcards++;
- error:
- return ret;
- }
- EXPORT_SYMBOL(hisax_init_pcmcia);
- EXPORT_SYMBOL(HiSax_closecard);
- #include "hisax_if.h"
- EXPORT_SYMBOL(hisax_register);
- EXPORT_SYMBOL(hisax_unregister);
- static void hisax_d_l1l2(struct hisax_if *ifc, int pr, void *arg);
- static void hisax_b_l1l2(struct hisax_if *ifc, int pr, void *arg);
- static void hisax_d_l2l1(struct PStack *st, int pr, void *arg);
- static void hisax_b_l2l1(struct PStack *st, int pr, void *arg);
- static int hisax_cardmsg(struct IsdnCardState *cs, int mt, void *arg);
- static int hisax_bc_setstack(struct PStack *st, struct BCState *bcs);
- static void hisax_bc_close(struct BCState *bcs);
- static void hisax_bh(struct work_struct *work);
- static void EChannel_proc_rcv(struct hisax_d_if *d_if);
- static int hisax_setup_card_dynamic(struct IsdnCard *card)
- {
- return 2;
- }
- int hisax_register(struct hisax_d_if *hisax_d_if, struct hisax_b_if *b_if[],
- char *name, int protocol)
- {
- int i, retval;
- char id[20];
- struct IsdnCardState *cs;
- for (i = 0; i < HISAX_MAX_CARDS; i++) {
- if (!cards[i].typ)
- break;
- }
- if (i >= HISAX_MAX_CARDS)
- return -EBUSY;
- cards[i].typ = ISDN_CTYPE_DYNAMIC;
- cards[i].protocol = protocol;
- sprintf(id, "%s%d", name, i);
- nrcards++;
- retval = checkcard(i, id, NULL, hisax_d_if->owner,
- hisax_setup_card_dynamic);
- if (retval == 0) { // yuck
- cards[i].typ = 0;
- nrcards--;
- return -EINVAL;
- }
- cs = cards[i].cs;
- hisax_d_if->cs = cs;
- cs->hw.hisax_d_if = hisax_d_if;
- cs->cardmsg = hisax_cardmsg;
- INIT_WORK(&cs->tqueue, hisax_bh);
- cs->channel[0].d_st->l2.l2l1 = hisax_d_l2l1;
- for (i = 0; i < 2; i++) {
- cs->bcs[i].BC_SetStack = hisax_bc_setstack;
- cs->bcs[i].BC_Close = hisax_bc_close;
- b_if[i]->ifc.l1l2 = hisax_b_l1l2;
- hisax_d_if->b_if[i] = b_if[i];
- }
- hisax_d_if->ifc.l1l2 = hisax_d_l1l2;
- skb_queue_head_init(&hisax_d_if->erq);
- clear_bit(0, &hisax_d_if->ph_state);
- return 0;
- }
- void hisax_unregister(struct hisax_d_if *hisax_d_if)
- {
- cards[hisax_d_if->cs->cardnr].typ = 0;
- HiSax_closecard(hisax_d_if->cs->cardnr);
- skb_queue_purge(&hisax_d_if->erq);
- }
- #include "isdnl1.h"
- static void hisax_sched_event(struct IsdnCardState *cs, int event)
- {
- test_and_set_bit(event, &cs->event);
- schedule_work(&cs->tqueue);
- }
- static void hisax_bh(struct work_struct *work)
- {
- struct IsdnCardState *cs =
- container_of(work, struct IsdnCardState, tqueue);
- struct PStack *st;
- int pr;
- if (test_and_clear_bit(D_RCVBUFREADY, &cs->event))
- DChannel_proc_rcv(cs);
- if (test_and_clear_bit(E_RCVBUFREADY, &cs->event))
- EChannel_proc_rcv(cs->hw.hisax_d_if);
- if (test_and_clear_bit(D_L1STATECHANGE, &cs->event)) {
- if (test_bit(0, &cs->hw.hisax_d_if->ph_state))
- pr = PH_ACTIVATE | INDICATION;
- else
- pr = PH_DEACTIVATE | INDICATION;
- for (st = cs->stlist; st; st = st->next)
- st->l1.l1l2(st, pr, NULL);
- }
- }
- static void hisax_b_sched_event(struct BCState *bcs, int event)
- {
- test_and_set_bit(event, &bcs->event);
- schedule_work(&bcs->tqueue);
- }
- static inline void D_L2L1(struct hisax_d_if *d_if, int pr, void *arg)
- {
- struct hisax_if *ifc = (struct hisax_if *) d_if;
- ifc->l2l1(ifc, pr, arg);
- }
- static inline void B_L2L1(struct hisax_b_if *b_if, int pr, void *arg)
- {
- struct hisax_if *ifc = (struct hisax_if *) b_if;
- ifc->l2l1(ifc, pr, arg);
- }
- static void hisax_d_l1l2(struct hisax_if *ifc, int pr, void *arg)
- {
- struct hisax_d_if *d_if = (struct hisax_d_if *) ifc;
- struct IsdnCardState *cs = d_if->cs;
- struct PStack *st;
- struct sk_buff *skb;
- switch (pr) {
- case PH_ACTIVATE | INDICATION:
- set_bit(0, &d_if->ph_state);
- hisax_sched_event(cs, D_L1STATECHANGE);
- break;
- case PH_DEACTIVATE | INDICATION:
- clear_bit(0, &d_if->ph_state);
- hisax_sched_event(cs, D_L1STATECHANGE);
- break;
- case PH_DATA | INDICATION:
- skb_queue_tail(&cs->rq, arg);
- hisax_sched_event(cs, D_RCVBUFREADY);
- break;
- case PH_DATA | CONFIRM:
- skb = skb_dequeue(&cs->sq);
- if (skb) {
- D_L2L1(d_if, PH_DATA | REQUEST, skb);
- break;
- }
- clear_bit(FLG_L1_DBUSY, &cs->HW_Flags);
- for (st = cs->stlist; st; st = st->next) {
- if (test_and_clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags)) {
- st->l1.l1l2(st, PH_PULL | CONFIRM, NULL);
- break;
- }
- }
- break;
- case PH_DATA_E | INDICATION:
- skb_queue_tail(&d_if->erq, arg);
- hisax_sched_event(cs, E_RCVBUFREADY);
- break;
- default:
- printk("pr %#x\n", pr);
- break;
- }
- }
- static void hisax_b_l1l2(struct hisax_if *ifc, int pr, void *arg)
- {
- struct hisax_b_if *b_if = (struct hisax_b_if *) ifc;
- struct BCState *bcs = b_if->bcs;
- struct PStack *st = bcs->st;
- struct sk_buff *skb;
- // FIXME use isdnl1?
- switch (pr) {
- case PH_ACTIVATE | INDICATION:
- st->l1.l1l2(st, pr, NULL);
- break;
- case PH_DEACTIVATE | INDICATION:
- st->l1.l1l2(st, pr, NULL);
- clear_bit(BC_FLG_BUSY, &bcs->Flag);
- skb_queue_purge(&bcs->squeue);
- bcs->hw.b_if = NULL;
- break;
- case PH_DATA | INDICATION:
- skb_queue_tail(&bcs->rqueue, arg);
- hisax_b_sched_event(bcs, B_RCVBUFREADY);
- break;
- case PH_DATA | CONFIRM:
- bcs->tx_cnt -= (long)arg;
- if (test_bit(FLG_LLI_L1WAKEUP, &bcs->st->lli.flag)) {
- u_long flags;
- spin_lock_irqsave(&bcs->aclock, flags);
- bcs->ackcnt += (long)arg;
- spin_unlock_irqrestore(&bcs->aclock, flags);
- schedule_event(bcs, B_ACKPENDING);
- }
- skb = skb_dequeue(&bcs->squeue);
- if (skb) {
- B_L2L1(b_if, PH_DATA | REQUEST, skb);
- break;
- }
- clear_bit(BC_FLG_BUSY, &bcs->Flag);
- if (test_and_clear_bit(FLG_L1_PULL_REQ, &st->l1.Flags)) {
- st->l1.l1l2(st, PH_PULL | CONFIRM, NULL);
- }
- break;
- default:
- printk("hisax_b_l1l2 pr %#x\n", pr);
- break;
- }
- }
- static void hisax_d_l2l1(struct PStack *st, int pr, void *arg)
- {
- struct IsdnCardState *cs = st->l1.hardware;
- struct hisax_d_if *hisax_d_if = cs->hw.hisax_d_if;
- struct sk_buff *skb = arg;
- switch (pr) {
- case PH_DATA | REQUEST:
- case PH_PULL | INDICATION:
- if (cs->debug & DEB_DLOG_HEX)
- LogFrame(cs, skb->data, skb->len);
- if (cs->debug & DEB_DLOG_VERBOSE)
- dlogframe(cs, skb, 0);
- Logl2Frame(cs, skb, "PH_DATA_REQ", 0);
- // FIXME lock?
- if (!test_and_set_bit(FLG_L1_DBUSY, &cs->HW_Flags))
- D_L2L1(hisax_d_if, PH_DATA | REQUEST, skb);
- else
- skb_queue_tail(&cs->sq, skb);
- break;
- case PH_PULL | REQUEST:
- if (!test_bit(FLG_L1_DBUSY, &cs->HW_Flags))
- st->l1.l1l2(st, PH_PULL | CONFIRM, NULL);
- else
- set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
- break;
- default:
- D_L2L1(hisax_d_if, pr, arg);
- break;
- }
- }
- static int hisax_cardmsg(struct IsdnCardState *cs, int mt, void *arg)
- {
- return 0;
- }
- static void hisax_b_l2l1(struct PStack *st, int pr, void *arg)
- {
- struct BCState *bcs = st->l1.bcs;
- struct hisax_b_if *b_if = bcs->hw.b_if;
- switch (pr) {
- case PH_ACTIVATE | REQUEST:
- B_L2L1(b_if, pr, (void *)(unsigned long)st->l1.mode);
- break;
- case PH_DATA | REQUEST:
- case PH_PULL | INDICATION:
- // FIXME lock?
- if (!test_and_set_bit(BC_FLG_BUSY, &bcs->Flag)) {
- B_L2L1(b_if, PH_DATA | REQUEST, arg);
- } else {
- skb_queue_tail(&bcs->squeue, arg);
- }
- break;
- case PH_PULL | REQUEST:
- if (!test_bit(BC_FLG_BUSY, &bcs->Flag))
- st->l1.l1l2(st, PH_PULL | CONFIRM, NULL);
- else
- set_bit(FLG_L1_PULL_REQ, &st->l1.Flags);
- break;
- case PH_DEACTIVATE | REQUEST:
- test_and_clear_bit(BC_FLG_BUSY, &bcs->Flag);
- skb_queue_purge(&bcs->squeue);
- default:
- B_L2L1(b_if, pr, arg);
- break;
- }
- }
- static int hisax_bc_setstack(struct PStack *st, struct BCState *bcs)
- {
- struct IsdnCardState *cs = st->l1.hardware;
- struct hisax_d_if *hisax_d_if = cs->hw.hisax_d_if;
- bcs->channel = st->l1.bc;
- bcs->hw.b_if = hisax_d_if->b_if[st->l1.bc];
- hisax_d_if->b_if[st->l1.bc]->bcs = bcs;
- st->l1.bcs = bcs;
- st->l2.l2l1 = hisax_b_l2l1;
- setstack_manager(st);
- bcs->st = st;
- setstack_l1_B(st);
- skb_queue_head_init(&bcs->rqueue);
- skb_queue_head_init(&bcs->squeue);
- return 0;
- }
- static void hisax_bc_close(struct BCState *bcs)
- {
- struct hisax_b_if *b_if = bcs->hw.b_if;
- if (b_if)
- B_L2L1(b_if, PH_DEACTIVATE | REQUEST, NULL);
- }
- static void EChannel_proc_rcv(struct hisax_d_if *d_if)
- {
- struct IsdnCardState *cs = d_if->cs;
- u_char *ptr;
- struct sk_buff *skb;
- while ((skb = skb_dequeue(&d_if->erq)) != NULL) {
- if (cs->debug & DEB_DLOG_HEX) {
- ptr = cs->dlog;
- if ((skb->len) < MAX_DLOG_SPACE / 3 - 10) {
- *ptr++ = 'E';
- *ptr++ = 'C';
- *ptr++ = 'H';
- *ptr++ = 'O';
- *ptr++ = ':';
- ptr += QuickHex(ptr, skb->data, skb->len);
- ptr--;
- *ptr++ = '\n';
- *ptr = 0;
- HiSax_putstatus(cs, NULL, cs->dlog);
- } else
- HiSax_putstatus(cs, "LogEcho: ",
- "warning Frame too big (%d)",
- skb->len);
- }
- dev_kfree_skb_any(skb);
- }
- }
- #ifdef CONFIG_PCI
- #include <linux/pci.h>
- static struct pci_device_id hisax_pci_tbl[] __used = {
- #ifdef CONFIG_HISAX_FRITZPCI
- {PCI_VDEVICE(AVM, PCI_DEVICE_ID_AVM_A1) },
- #endif
- #ifdef CONFIG_HISAX_DIEHLDIVA
- {PCI_VDEVICE(EICON, PCI_DEVICE_ID_EICON_DIVA20) },
- {PCI_VDEVICE(EICON, PCI_DEVICE_ID_EICON_DIVA20_U) },
- {PCI_VDEVICE(EICON, PCI_DEVICE_ID_EICON_DIVA201) },
- /*##########################################################################*/
- {PCI_VDEVICE(EICON, PCI_DEVICE_ID_EICON_DIVA202) },
- /*##########################################################################*/
- #endif
- #ifdef CONFIG_HISAX_ELSA
- {PCI_VDEVICE(ELSA, PCI_DEVICE_ID_ELSA_MICROLINK) },
- {PCI_VDEVICE(ELSA, PCI_DEVICE_ID_ELSA_QS3000) },
- #endif
- #ifdef CONFIG_HISAX_GAZEL
- {PCI_VDEVICE(PLX, PCI_DEVICE_ID_PLX_R685) },
- {PCI_VDEVICE(PLX, PCI_DEVICE_ID_PLX_R753) },
- {PCI_VDEVICE(PLX, PCI_DEVICE_ID_PLX_DJINN_ITOO) },
- {PCI_VDEVICE(PLX, PCI_DEVICE_ID_PLX_OLITEC) },
- #endif
- #ifdef CONFIG_HISAX_SCT_QUADRO
- {PCI_VDEVICE(PLX, PCI_DEVICE_ID_PLX_9050) },
- #endif
- #ifdef CONFIG_HISAX_NICCY
- {PCI_VDEVICE(SATSAGEM, PCI_DEVICE_ID_SATSAGEM_NICCY) },
- #endif
- #ifdef CONFIG_HISAX_SEDLBAUER
- {PCI_VDEVICE(TIGERJET, PCI_DEVICE_ID_TIGERJET_100) },
- #endif
- #if defined(CONFIG_HISAX_NETJET) || defined(CONFIG_HISAX_NETJET_U)
- {PCI_VDEVICE(TIGERJET, PCI_DEVICE_ID_TIGERJET_300) },
- #endif
- #if defined(CONFIG_HISAX_TELESPCI) || defined(CONFIG_HISAX_SCT_QUADRO)
- {PCI_VDEVICE(ZORAN, PCI_DEVICE_ID_ZORAN_36120) },
- #endif
- #ifdef CONFIG_HISAX_W6692
- {PCI_VDEVICE(DYNALINK, PCI_DEVICE_ID_DYNALINK_IS64PH) },
- {PCI_VDEVICE(WINBOND2, PCI_DEVICE_ID_WINBOND2_6692) },
- #endif
- #ifdef CONFIG_HISAX_HFC_PCI
- {PCI_VDEVICE(CCD, PCI_DEVICE_ID_CCD_2BD0) },
- {PCI_VDEVICE(CCD, PCI_DEVICE_ID_CCD_B000) },
- {PCI_VDEVICE(CCD, PCI_DEVICE_ID_CCD_B006) },
- {PCI_VDEVICE(CCD, PCI_DEVICE_ID_CCD_B007) },
- {PCI_VDEVICE(CCD, PCI_DEVICE_ID_CCD_B008) },
- {PCI_VDEVICE(CCD, PCI_DEVICE_ID_CCD_B009) },
- {PCI_VDEVICE(CCD, PCI_DEVICE_ID_CCD_B00A) },
- {PCI_VDEVICE(CCD, PCI_DEVICE_ID_CCD_B00B) },
- {PCI_VDEVICE(CCD, PCI_DEVICE_ID_CCD_B00C) },
- {PCI_VDEVICE(CCD, PCI_DEVICE_ID_CCD_B100) },
- {PCI_VDEVICE(CCD, PCI_DEVICE_ID_CCD_B700) },
- {PCI_VDEVICE(CCD, PCI_DEVICE_ID_CCD_B701) },
- {PCI_VDEVICE(ABOCOM, PCI_DEVICE_ID_ABOCOM_2BD1) },
- {PCI_VDEVICE(ASUSTEK, PCI_DEVICE_ID_ASUSTEK_0675) },
- {PCI_VDEVICE(BERKOM, PCI_DEVICE_ID_BERKOM_T_CONCEPT) },
- {PCI_VDEVICE(BERKOM, PCI_DEVICE_ID_BERKOM_A1T) },
- {PCI_VDEVICE(ANIGMA, PCI_DEVICE_ID_ANIGMA_MC145575) },
- {PCI_VDEVICE(ZOLTRIX, PCI_DEVICE_ID_ZOLTRIX_2BD0) },
- {PCI_VDEVICE(DIGI, PCI_DEVICE_ID_DIGI_DF_M_IOM2_E) },
- {PCI_VDEVICE(DIGI, PCI_DEVICE_ID_DIGI_DF_M_E) },
- {PCI_VDEVICE(DIGI, PCI_DEVICE_ID_DIGI_DF_M_IOM2_A) },
- {PCI_VDEVICE(DIGI, PCI_DEVICE_ID_DIGI_DF_M_A) },
- #endif
- { } /* Terminating entry */
- };
- MODULE_DEVICE_TABLE(pci, hisax_pci_tbl);
- #endif /* CONFIG_PCI */
- module_init(HiSax_init);
- module_exit(HiSax_exit);
- EXPORT_SYMBOL(FsmNew);
- EXPORT_SYMBOL(FsmFree);
- EXPORT_SYMBOL(FsmEvent);
- EXPORT_SYMBOL(FsmChangeState);
- EXPORT_SYMBOL(FsmInitTimer);
- EXPORT_SYMBOL(FsmDelTimer);
- EXPORT_SYMBOL(FsmRestartTimer);
|