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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [rc203soc/] [sw/] [uClinux/] [drivers/] [isdn/] [isdnloop/] [isdnloop.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1626 jcastillo
/* $Id: isdnloop.h,v 1.1 2005-12-20 10:17:09 jcastillo 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/09/10 07:44:19  simons
23
 * Initial import
24
 *
25
 * Revision 1.1.1.1  2001/07/02 17:58:32  simons
26
 * Initial revision
27
 *
28
 * Revision 1.1.2.1  1998/11/05 22:13:20  fritz
29
 * Changed mail-address.
30
 *
31
 * Revision 1.1  1997/03/24 23:02:05  fritz
32
 * Added isdnloop driver.
33
 *
34
 */
35
 
36
#ifndef isdnloop_h
37
#define isdnloop_h
38
 
39
#define ISDNLOOP_IOCTL_DEBUGVAR  0
40
#define ISDNLOOP_IOCTL_ADDCARD   1
41
#define ISDNLOOP_IOCTL_LEASEDCFG 2
42
#define ISDNLOOP_IOCTL_STARTUP   3
43
 
44
/* Struct for adding new cards */
45
typedef struct isdnloop_cdef {
46
        char id1[10];
47
} isdnloop_cdef;
48
 
49
/* Struct for configuring cards */
50
typedef struct isdnloop_sdef {
51
        int ptype;
52
        char num[3][20];
53
} isdnloop_sdef;
54
 
55
#if defined(__KERNEL__) || defined(__DEBUGVAR__)
56
 
57
#ifdef __KERNEL__
58
/* Kernel includes */
59
 
60
#include <linux/config.h>
61
#include <linux/module.h>
62
#include <linux/version.h>
63
#include <linux/errno.h>
64
#include <linux/fs.h>
65
#include <linux/major.h>
66
#include <asm/segment.h>
67
#include <asm/io.h>
68
#include <linux/kernel.h>
69
#include <linux/signal.h>
70
#include <linux/malloc.h>
71
#include <linux/mm.h>
72
#include <linux/mman.h>
73
#include <linux/ioport.h>
74
#include <linux/timer.h>
75
#include <linux/wait.h>
76
#include <linux/isdnif.h>
77
 
78
#endif                          /* __KERNEL__ */
79
 
80
#define ISDNLOOP_FLAGS_B1ACTIVE 1       /* B-Channel-1 is open           */
81
#define ISDNLOOP_FLAGS_B2ACTIVE 2       /* B-Channel-2 is open           */
82
#define ISDNLOOP_FLAGS_RUNNING  4       /* Cards driver activated        */
83
#define ISDNLOOP_FLAGS_RBTIMER  8       /* scheduling of B-Channel-poll  */
84
#define ISDNLOOP_TIMER_BCREAD 1 /* B-Channel poll-cycle          */
85
#define ISDNLOOP_TIMER_DCREAD (HZ/2)    /* D-Channel poll-cycle          */
86
#define ISDNLOOP_TIMER_ALERTWAIT (10*HZ)        /* Alert timeout                 */
87
#define ISDNLOOP_MAX_SQUEUE 65536       /* Max. outstanding send-data    */
88
#define ISDNLOOP_BCH 2          /* channels per card             */
89
 
90
/*
91
 * Per card driver data
92
 */
93
typedef struct isdnloop_card {
94
        struct isdnloop_card *next;     /* Pointer to next device struct    */
95
        struct isdnloop_card
96
        *rcard[ISDNLOOP_BCH];   /* Pointer to 'remote' card         */
97
        int rch[ISDNLOOP_BCH];  /* 'remote' channel                 */
98
        int myid;               /* Driver-Nr. assigned by linklevel */
99
        int leased;             /* Flag: This Adapter is connected  */
100
        /*       to a leased line           */
101
        int sil[ISDNLOOP_BCH];  /* SI's to listen for               */
102
        char eazlist[ISDNLOOP_BCH][11];
103
        /* EAZ's to listen for              */
104
        char s0num[3][20];      /* 1TR6 base-number or MSN's        */
105
        unsigned short flags;   /* Statusflags                      */
106
        int ptype;              /* Protocol type (1TR6 or Euro)     */
107
        struct timer_list st_timer;     /* Timer for Status-Polls           */
108
        struct timer_list rb_timer;     /* Timer for B-Channel-Polls        */
109
        struct timer_list
110
         c_timer[ISDNLOOP_BCH]; /* Timer for Alerting               */
111
        int l2_proto[ISDNLOOP_BCH];     /* Current layer-2-protocol         */
112
        isdn_if interface;      /* Interface to upper layer         */
113
        int iptr;               /* Index to imsg-buffer             */
114
        char imsg[60];          /* Internal buf for status-parsing  */
115
        int optr;               /* Index to omsg-buffer             */
116
        char omsg[60];          /* Internal buf for cmd-parsing     */
117
        char msg_buf[2048];     /* Buffer for status-messages       */
118
        char *msg_buf_write;    /* Writepointer for statusbuffer    */
119
        char *msg_buf_read;     /* Readpointer for statusbuffer     */
120
        char *msg_buf_end;      /* Pointer to end of statusbuffer   */
121
        int sndcount[ISDNLOOP_BCH];     /* Byte-counters for B-Ch.-send     */
122
        struct sk_buff_head
123
         bqueue[ISDNLOOP_BCH];  /* B-Channel queues                 */
124
        struct sk_buff_head dqueue;     /* D-Channel queue                  */
125
} isdnloop_card;
126
 
127
/*
128
 * Main driver data
129
 */
130
#ifdef __KERNEL__
131
static isdnloop_card *cards = (isdnloop_card *) 0;
132
static char *isdnloop_id = "\0";
133
 
134
#ifdef MODULE
135
#if (LINUX_VERSION_CODE > 0x020111)
136
MODULE_AUTHOR("Fritz Elfert");
137
MODULE_PARM(isdnloop_id, "s");
138
MODULE_PARM_DESC(isdnloop_id, "ID-String of first card");
139
#endif
140
#endif
141
 
142
#endif                          /* __KERNEL__ */
143
 
144
/* Utility-Macros */
145
 
146
#define CID (card->interface.id)
147
#define MIN(a,b) ((a<b)?a:b)
148
#define MAX(a,b) ((a>b)?a:b)
149
 
150
#endif                          /* defined(__KERNEL__) || defined(__DEBUGVAR__) */
151
#endif                          /* isdnloop_h */

powered by: WebSVN 2.1.0

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