root/drivers/isdn/teles/mod.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. teles_mod_dec_use_count
  2. teles_mod_inc_use_count
  3. teles_setup
  4. teles_init
  5. cleanup_module

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

/* [previous][next][first][last][top][bottom][index][help] */