aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/isdnloop/isdnloop.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/isdn/isdnloop/isdnloop.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/isdn/isdnloop/isdnloop.h')
-rw-r--r--drivers/isdn/isdnloop/isdnloop.h112
1 files changed, 112 insertions, 0 deletions
diff --git a/drivers/isdn/isdnloop/isdnloop.h b/drivers/isdn/isdnloop/isdnloop.h
new file mode 100644
index 000000000000..8fb7bc1bfe0f
--- /dev/null
+++ b/drivers/isdn/isdnloop/isdnloop.h
@@ -0,0 +1,112 @@
1/* $Id: isdnloop.h,v 1.5.6.3 2001/09/23 22:24:56 kai Exp $
2 *
3 * Loopback lowlevel module for testing of linklevel.
4 *
5 * Copyright 1997 by Fritz Elfert (fritz@isdn4linux.de)
6 *
7 * This software may be used and distributed according to the terms
8 * of the GNU General Public License, incorporated herein by reference.
9 *
10 */
11
12#ifndef isdnloop_h
13#define isdnloop_h
14
15#define ISDNLOOP_IOCTL_DEBUGVAR 0
16#define ISDNLOOP_IOCTL_ADDCARD 1
17#define ISDNLOOP_IOCTL_LEASEDCFG 2
18#define ISDNLOOP_IOCTL_STARTUP 3
19
20/* Struct for adding new cards */
21typedef struct isdnloop_cdef {
22 char id1[10];
23} isdnloop_cdef;
24
25/* Struct for configuring cards */
26typedef struct isdnloop_sdef {
27 int ptype;
28 char num[3][20];
29} isdnloop_sdef;
30
31#if defined(__KERNEL__) || defined(__DEBUGVAR__)
32
33#ifdef __KERNEL__
34/* Kernel includes */
35
36#include <linux/version.h>
37#include <linux/errno.h>
38#include <linux/fs.h>
39#include <linux/major.h>
40#include <asm/io.h>
41#include <linux/kernel.h>
42#include <linux/signal.h>
43#include <linux/slab.h>
44#include <linux/mm.h>
45#include <linux/mman.h>
46#include <linux/ioport.h>
47#include <linux/timer.h>
48#include <linux/wait.h>
49#include <linux/isdnif.h>
50
51#endif /* __KERNEL__ */
52
53#define ISDNLOOP_FLAGS_B1ACTIVE 1 /* B-Channel-1 is open */
54#define ISDNLOOP_FLAGS_B2ACTIVE 2 /* B-Channel-2 is open */
55#define ISDNLOOP_FLAGS_RUNNING 4 /* Cards driver activated */
56#define ISDNLOOP_FLAGS_RBTIMER 8 /* scheduling of B-Channel-poll */
57#define ISDNLOOP_TIMER_BCREAD 1 /* B-Channel poll-cycle */
58#define ISDNLOOP_TIMER_DCREAD (HZ/2) /* D-Channel poll-cycle */
59#define ISDNLOOP_TIMER_ALERTWAIT (10*HZ) /* Alert timeout */
60#define ISDNLOOP_MAX_SQUEUE 65536 /* Max. outstanding send-data */
61#define ISDNLOOP_BCH 2 /* channels per card */
62
63/*
64 * Per card driver data
65 */
66typedef struct isdnloop_card {
67 struct isdnloop_card *next; /* Pointer to next device struct */
68 struct isdnloop_card
69 *rcard[ISDNLOOP_BCH]; /* Pointer to 'remote' card */
70 int rch[ISDNLOOP_BCH]; /* 'remote' channel */
71 int myid; /* Driver-Nr. assigned by linklevel */
72 int leased; /* Flag: This Adapter is connected */
73 /* to a leased line */
74 int sil[ISDNLOOP_BCH]; /* SI's to listen for */
75 char eazlist[ISDNLOOP_BCH][11];
76 /* EAZ's to listen for */
77 char s0num[3][20]; /* 1TR6 base-number or MSN's */
78 unsigned short flags; /* Statusflags */
79 int ptype; /* Protocol type (1TR6 or Euro) */
80 struct timer_list st_timer; /* Timer for Status-Polls */
81 struct timer_list rb_timer; /* Timer for B-Channel-Polls */
82 struct timer_list
83 c_timer[ISDNLOOP_BCH]; /* Timer for Alerting */
84 int l2_proto[ISDNLOOP_BCH]; /* Current layer-2-protocol */
85 isdn_if interface; /* Interface to upper layer */
86 int iptr; /* Index to imsg-buffer */
87 char imsg[60]; /* Internal buf for status-parsing */
88 int optr; /* Index to omsg-buffer */
89 char omsg[60]; /* Internal buf for cmd-parsing */
90 char msg_buf[2048]; /* Buffer for status-messages */
91 char *msg_buf_write; /* Writepointer for statusbuffer */
92 char *msg_buf_read; /* Readpointer for statusbuffer */
93 char *msg_buf_end; /* Pointer to end of statusbuffer */
94 int sndcount[ISDNLOOP_BCH]; /* Byte-counters for B-Ch.-send */
95 struct sk_buff_head
96 bqueue[ISDNLOOP_BCH]; /* B-Channel queues */
97 struct sk_buff_head dqueue; /* D-Channel queue */
98} isdnloop_card;
99
100/*
101 * Main driver data
102 */
103#ifdef __KERNEL__
104static isdnloop_card *cards = (isdnloop_card *) 0;
105#endif /* __KERNEL__ */
106
107/* Utility-Macros */
108
109#define CID (card->interface.id)
110
111#endif /* defined(__KERNEL__) || defined(__DEBUGVAR__) */
112#endif /* isdnloop_h */