OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [uclinux/] [uClinux-2.0.x/] [drivers/] [isdn/] [isdnloop/] [isdnloop.h] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 199 simons
/* $Id: isdnloop.h,v 1.1.1.1 2001-09-10 07:44:19 simons Exp $
2
 
3
 * Loopback lowlevel module for testing of linklevel.
4
 *
5
 * Copyright 1998 by Fritz Elfert (fritz@isdn4linux.de)
6
 *
7
 * This program is free software; you can redistribute it and/or modify
8
 * it under the terms of the GNU General Public License as published by
9
 * the Free Software Foundation; either version 2, or (at your option)
10
 * any later version.
11
 *
12
 * This program is distributed in the hope that it will be useful,
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 * GNU General Public License for more details.
16
 *
17
 * You should have received a copy of the GNU General Public License
18
 * along with this program; if not, write to the Free Software
19
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
 *
21
 * $Log: not supported by cvs2svn $
22
 * Revision 1.1.1.1  2001/07/02 17:58:32  simons
23
 * Initial revision
24
 *
25
 * Revision 1.1.2.1  1998/11/05 22:13:20  fritz
26
 * Changed mail-address.
27
 *
28
 * Revision 1.1  1997/03/24 23:02:05  fritz
29
 * Added isdnloop driver.
30
 *
31
 */
32
 
33
#ifndef isdnloop_h
34
#define isdnloop_h
35
 
36
#define ISDNLOOP_IOCTL_DEBUGVAR  0
37
#define ISDNLOOP_IOCTL_ADDCARD   1
38
#define ISDNLOOP_IOCTL_LEASEDCFG 2
39
#define ISDNLOOP_IOCTL_STARTUP   3
40
 
41
/* Struct for adding new cards */
42
typedef struct isdnloop_cdef {
43
        char id1[10];
44
} isdnloop_cdef;
45
 
46
/* Struct for configuring cards */
47
typedef struct isdnloop_sdef {
48
        int ptype;
49
        char num[3][20];
50
} isdnloop_sdef;
51
 
52
#if defined(__KERNEL__) || defined(__DEBUGVAR__)
53
 
54
#ifdef __KERNEL__
55
/* Kernel includes */
56
 
57
#include <linux/config.h>
58
#include <linux/module.h>
59
#include <linux/version.h>
60
#include <linux/errno.h>
61
#include <linux/fs.h>
62
#include <linux/major.h>
63
#include <asm/segment.h>
64
#include <asm/io.h>
65
#include <linux/kernel.h>
66
#include <linux/signal.h>
67
#include <linux/malloc.h>
68
#include <linux/mm.h>
69
#include <linux/mman.h>
70
#include <linux/ioport.h>
71
#include <linux/timer.h>
72
#include <linux/wait.h>
73
#include <linux/isdnif.h>
74
 
75
#endif                          /* __KERNEL__ */
76
 
77
#define ISDNLOOP_FLAGS_B1ACTIVE 1       /* B-Channel-1 is open           */
78
#define ISDNLOOP_FLAGS_B2ACTIVE 2       /* B-Channel-2 is open           */
79
#define ISDNLOOP_FLAGS_RUNNING  4       /* Cards driver activated        */
80
#define ISDNLOOP_FLAGS_RBTIMER  8       /* scheduling of B-Channel-poll  */
81
#define ISDNLOOP_TIMER_BCREAD 1 /* B-Channel poll-cycle          */
82
#define ISDNLOOP_TIMER_DCREAD (HZ/2)    /* D-Channel poll-cycle          */
83
#define ISDNLOOP_TIMER_ALERTWAIT (10*HZ)        /* Alert timeout                 */
84
#define ISDNLOOP_MAX_SQUEUE 65536       /* Max. outstanding send-data    */
85
#define ISDNLOOP_BCH 2          /* channels per card             */
86
 
87
/*
88
 * Per card driver data
89
 */
90
typedef struct isdnloop_card {
91
        struct isdnloop_card *next;     /* Pointer to next device struct    */
92
        struct isdnloop_card
93
        *rcard[ISDNLOOP_BCH];   /* Pointer to 'remote' card         */
94
        int rch[ISDNLOOP_BCH];  /* 'remote' channel                 */
95
        int myid;               /* Driver-Nr. assigned by linklevel */
96
        int leased;             /* Flag: This Adapter is connected  */
97
        /*       to a leased line           */
98
        int sil[ISDNLOOP_BCH];  /* SI's to listen for               */
99
        char eazlist[ISDNLOOP_BCH][11];
100
        /* EAZ's to listen for              */
101
        char s0num[3][20];      /* 1TR6 base-number or MSN's        */
102
        unsigned short flags;   /* Statusflags                      */
103
        int ptype;              /* Protocol type (1TR6 or Euro)     */
104
        struct timer_list st_timer;     /* Timer for Status-Polls           */
105
        struct timer_list rb_timer;     /* Timer for B-Channel-Polls        */
106
        struct timer_list
107
         c_timer[ISDNLOOP_BCH]; /* Timer for Alerting               */
108
        int l2_proto[ISDNLOOP_BCH];     /* Current layer-2-protocol         */
109
        isdn_if interface;      /* Interface to upper layer         */
110
        int iptr;               /* Index to imsg-buffer             */
111
        char imsg[60];          /* Internal buf for status-parsing  */
112
        int optr;               /* Index to omsg-buffer             */
113
        char omsg[60];          /* Internal buf for cmd-parsing     */
114
        char msg_buf[2048];     /* Buffer for status-messages       */
115
        char *msg_buf_write;    /* Writepointer for statusbuffer    */
116
        char *msg_buf_read;     /* Readpointer for statusbuffer     */
117
        char *msg_buf_end;      /* Pointer to end of statusbuffer   */
118
        int sndcount[ISDNLOOP_BCH];     /* Byte-counters for B-Ch.-send     */
119
        struct sk_buff_head
120
         bqueue[ISDNLOOP_BCH];  /* B-Channel queues                 */
121
        struct sk_buff_head dqueue;     /* D-Channel queue                  */
122
} isdnloop_card;
123
 
124
/*
125
 * Main driver data
126
 */
127
#ifdef __KERNEL__
128
static isdnloop_card *cards = (isdnloop_card *) 0;
129
static char *isdnloop_id = "\0";
130
 
131
#ifdef MODULE
132
#if (LINUX_VERSION_CODE > 0x020111)
133
MODULE_AUTHOR("Fritz Elfert");
134
MODULE_PARM(isdnloop_id, "s");
135
MODULE_PARM_DESC(isdnloop_id, "ID-String of first card");
136
#endif
137
#endif
138
 
139
#endif                          /* __KERNEL__ */
140
 
141
/* Utility-Macros */
142
 
143
#define CID (card->interface.id)
144
#define MIN(a,b) ((a<b)?a:b)
145
#define MAX(a,b) ((a>b)?a:b)
146
 
147
#endif                          /* defined(__KERNEL__) || defined(__DEBUGVAR__) */
148
#endif                          /* isdnloop_h */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.