Loading...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | /* $Id: mod.c,v 1.3 1997/02/14 12:23:31 fritz Exp $ * * $Log: mod.c,v $ * Revision 1.3 1997/02/14 12:23:31 fritz * Added support for new insmod parameter handling. * * Revision 1.2 1997/02/10 11:45:14 fritz * More changes for Kernel 2.1.X compatibility. * * Revision 1.1 1996/04/13 10:27:02 fritz * Initial revision * * */ #include "teles.h" extern struct IsdnCard cards[]; extern char *teles_id; int nrcards; typedef struct { byte *membase; int interrupt; unsigned int iobase; unsigned int protocol; } io_type; io_type io[] = { {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}, }; #ifdef MODULE #if (LINUX_VERSION_CODE > 0x020111) MODULE_PARM(io, "1-64i"); MODULE_PARM(teles_id, "s"); #endif #endif void teles_mod_dec_use_count(void) { MOD_DEC_USE_COUNT; } void teles_mod_inc_use_count(void) { MOD_INC_USE_COUNT; } #ifdef MODULE #define teles_init init_module #else void teles_setup(char *str, int *ints) { int i, j, argc; static char sid[20]; argc = ints[0]; i = 0; j = 1; while (argc && (i<16)) { if (argc) { io[i].iobase = ints[j]; j++; argc--; } if (argc) { io[i].interrupt = ints[j]; j++; argc--; } if (argc) { io[i].membase = (byte *)ints[j]; j++; argc--; } if (argc) { io[i].protocol = ints[j]; j++; argc--; } i++; } if (strlen(str)) { strcpy(sid,str); teles_id = sid; } } #endif int teles_init(void) { int i; nrcards = 0; for (i = 0; i < 16; i++) { if (io[i].protocol) { cards[i].membase = io[i].membase; cards[i].interrupt = io[i].interrupt; cards[i].iobase = io[i].iobase; cards[i].protocol = io[i].protocol; } } for (i = 0; i < 16; i++) if (cards[i].protocol) nrcards++; printk(KERN_DEBUG "teles: Total %d card%s defined\n", nrcards, (nrcards > 1) ? "s" : ""); if (teles_inithardware()) { /* Install only, if at least one card found */ Isdnl2New(); TeiNew(); CallcNew(); ll_init(); /* No symbols to export, hide all symbols */ #ifdef MODULE #if (LINUX_VERSION_CODE < 0x020111) register_symtab(NULL); #else EXPORT_NO_SYMBOLS; #endif printk(KERN_NOTICE "Teles module installed\n"); #endif return (0); } else return -EIO; } #ifdef MODULE void cleanup_module(void) { ll_stop(); TeiFree(); Isdnl2Free(); CallcFree(); teles_closehardware(); ll_unload(); printk(KERN_NOTICE "Teles module removed\n"); } #endif |