History

Merge tag 'isdn-removal' of https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground

Arnd Bergmann says: ==================== isdn: deprecate non-mISDN drivers When isdn4linux came up in the context of another patch series, I remembered that we had discussed removing it a while ago. It turns out that the suggestion from Karsten Keil wa to remove I4L in 2018 after the last public ISDN networks are shut down. This has happened now (with a very small number of exceptions), so I guess it's time to try again. We currently have three ISDN stacks in the kernel: the original isdn4linux (with the hisax driver), the newer CAPI (with four drivers), and finally the mISDN stack (supporting roughly the same hardware as hisax). As far as I can tell, anyone using ISDN with mainline kernel drivers in the past few years uses mISDN, and this is typically used for voice-only PBX installations that don't require a public network. The older stacks support additional features for data networks, but those typically make no sense any more if there is no network to connect to. My proposal for this time is to kill off isdn4linux entirely, as it seems to have been unusable for quite a while. This code has been abandoned for many years and it does cause problems for treewide maintenance as it tends to do everything that we try to stop doing. Birger Harzenetter mentioned that is is still using i4l in order to make use of the 'divert' feature that is not part of mISDN, but has otherwise moved on to mISDN for normal operation, like apparently everyone else. CAPI in turn is not quite as obsolete, but two of the drivers (avm and hysdn) don't seem to be used at all, while another one (gigaset) will stop being maintained as Paul Bolle is no longer able to test it after the network gets shut down in September. All three are now moved into drivers/staging to let others speak up in case there are remaining users. This leaves Bluetooth CMTP as the only remaining user of CAPI, but Marcel Holtmann wishes to keep maintaining it. For the discussion on version 1, see [2] Unfortunately, Karsten Keil as the maintainer has not participated in the discussion. Arnd [1] https://patchwork.kernel.org/patch/8484861/#17900371 [2] https://listserv.isdn4linux.de/pipermail/isdn4linux/2019-April/thread.html ====================

David S. Miller committed 7 years ago

Commit 8a7e8ff2 parents 57f0410 6d97985216 files · +107 −83884Browse files

Showing the changes to include/linux (7 of 216 files). Show all

Unified · Split

7 files
  1. include/linux/concap.h +0 −112
  2. include/linux/isdn.h +0 −473
  3. include/linux/isdn/hdlc.h +0 −69
  4. include/linux/isdn_divertif.h +0 −35
  5. include/linux/isdn_ppp.h +0 −194
  6. include/linux/isdnif.h +0 −505
  7. include/linux/wanrouter.h +0 −11
include/linux/concap.h+0−112
@@ -1,112 +0,0 @@
1/* $Id: concap.h,v 1.3.2.2 2004/01/12 23:08:35 keil Exp $
2 *
3 * Copyright 1997 by Henner Eisen <eis@baty.hanse.de>
4 *
5 * This software may be used and distributed according to the terms
6 * of the GNU General Public License, incorporated herein by reference.
7 */
8
9#ifndef _LINUX_CONCAP_H
10#define _LINUX_CONCAP_H
11
12#include <linux/skbuff.h>
13#include <linux/netdevice.h>
14
15/* Stuff to support encapsulation protocols genericly. The encapsulation
16 protocol is processed at the uppermost layer of the network interface.
17
18 Based on a ideas developed in a 'synchronous device' thread in the
19 linux-x25 mailing list contributed by Alan Cox, Thomasz Motylewski
20 and Jonathan Naylor.
21
22 For more documetation on this refer to Documentation/isdn/README.concap
23*/
24
25struct concap_proto_ops;
26struct concap_device_ops;
27
28/* this manages all data needed by the encapsulation protocol
29 */
30struct concap_proto{
31 struct net_device *net_dev; /* net device using our service */
32 struct concap_device_ops *dops; /* callbacks provided by device */
33 struct concap_proto_ops *pops; /* callbacks provided by us */
34 spinlock_t lock;
35 int flags;
36 void *proto_data; /* protocol specific private data, to
37 be accessed via *pops methods only*/
38 /*
39 :
40 whatever
41 :
42 */
43};
44
45/* Operations to be supported by the net device. Called by the encapsulation
46 * protocol entity. No receive method is offered because the encapsulation
47 * protocol directly calls netif_rx().
48 */
49struct concap_device_ops{
50
51 /* to request data is submitted by device*/
52 int (*data_req)(struct concap_proto *, struct sk_buff *);
53
54 /* Control methods must be set to NULL by devices which do not
55 support connection control.*/
56 /* to request a connection is set up */
57 int (*connect_req)(struct concap_proto *);
58
59 /* to request a connection is released */
60 int (*disconn_req)(struct concap_proto *);
61};
62
63/* Operations to be supported by the encapsulation protocol. Called by
64 * device driver.
65 */
66struct concap_proto_ops{
67
68 /* create a new encapsulation protocol instance of same type */
69 struct concap_proto * (*proto_new) (void);
70
71 /* delete encapsulation protocol instance and free all its resources.
72 cprot may no loger be referenced after calling this */
73 void (*proto_del)(struct concap_proto *cprot);
74
75 /* initialize the protocol's data. To be called at interface startup
76 or when the device driver resets the interface. All services of the
77 encapsulation protocol may be used after this*/
78 int (*restart)(struct concap_proto *cprot,
79 struct net_device *ndev,
80 struct concap_device_ops *dops);
81
82 /* inactivate an encapsulation protocol instance. The encapsulation
83 protocol may not call any *dops methods after this. */
84 int (*close)(struct concap_proto *cprot);
85
86 /* process a frame handed down to us by upper layer */
87 int (*encap_and_xmit)(struct concap_proto *cprot, struct sk_buff *skb);
88
89 /* to be called for each data entity received from lower layer*/
90 int (*data_ind)(struct concap_proto *cprot, struct sk_buff *skb);
91
92 /* to be called when a connection was set up/down.
93 Protocols that don't process these primitives might fill in
94 dummy methods here */
95 int (*connect_ind)(struct concap_proto *cprot);
96 int (*disconn_ind)(struct concap_proto *cprot);
97 /*
98 Some network device support functions, like net_header(), rebuild_header(),
99 and others, that depend solely on the encapsulation protocol, might
100 be provided here, too. The net device would just fill them in its
101 corresponding fields when it is opened.
102 */
103};
104
105/* dummy restart/close/connect/reset/disconn methods
106 */
107extern int concap_nop(struct concap_proto *cprot);
108
109/* dummy submit method
110 */
111extern int concap_drop_skb(struct concap_proto *cprot, struct sk_buff *skb);
112#endif
include/linux/isdn.h+0−473
@@ -1,473 +0,0 @@
1/* $Id: isdn.h,v 1.125.2.3 2004/02/10 01:07:14 keil Exp $
2 *
3 * Main header for the Linux ISDN subsystem (linklevel).
4 *
5 * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
6 * Copyright 1995,96 by Thinking Objects Software GmbH Wuerzburg
7 * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
8 *
9 * This software may be used and distributed according to the terms
10 * of the GNU General Public License, incorporated herein by reference.
11 *
12 */
13#ifndef __ISDN_H__
14#define __ISDN_H__
15
16
17#include <linux/errno.h>
18#include <linux/fs.h>
19#include <linux/major.h>
20#include <asm/io.h>
21#include <linux/kernel.h>
22#include <linux/signal.h>
23#include <linux/slab.h>
24#include <linux/timer.h>
25#include <linux/wait.h>
26#include <linux/tty.h>
27#include <linux/tty_flip.h>
28#include <linux/serial_reg.h>
29#include <linux/fcntl.h>
30#include <linux/types.h>
31#include <linux/interrupt.h>
32#include <linux/ip.h>
33#include <linux/in.h>
34#include <linux/netdevice.h>
35#include <linux/etherdevice.h>
36#include <linux/skbuff.h>
37#include <linux/tcp.h>
38#include <linux/mutex.h>
39#include <uapi/linux/isdn.h>
40
41#define ISDN_TTY_MAJOR 43
42#define ISDN_TTYAUX_MAJOR 44
43#define ISDN_MAJOR 45
44
45/* The minor-devicenumbers for Channel 0 and 1 are used as arguments for
46 * physical Channel-Mapping, so they MUST NOT be changed without changing
47 * the correspondent code in isdn.c
48 */
49
50#define ISDN_MINOR_B 0
51#define ISDN_MINOR_BMAX (ISDN_MAX_CHANNELS-1)
52#define ISDN_MINOR_CTRL 64
53#define ISDN_MINOR_CTRLMAX (64 + (ISDN_MAX_CHANNELS-1))
54#define ISDN_MINOR_PPP 128
55#define ISDN_MINOR_PPPMAX (128 + (ISDN_MAX_CHANNELS-1))
56#define ISDN_MINOR_STATUS 255
57
58#ifdef CONFIG_ISDN_PPP
59
60#ifdef CONFIG_ISDN_PPP_VJ
61# include <net/slhc_vj.h>
62#endif
63
64#include <linux/ppp_defs.h>
65#include <linux/ppp-ioctl.h>
66
67#include <linux/isdn_ppp.h>
68#endif
69
70#ifdef CONFIG_ISDN_X25
71# include <linux/concap.h>
72#endif
73
74#include <linux/isdnif.h>
75
76#define ISDN_DRVIOCTL_MASK 0x7f /* Mask for Device-ioctl */
77
78/* Until now unused */
79#define ISDN_SERVICE_VOICE 1
80#define ISDN_SERVICE_AB 1<<1
81#define ISDN_SERVICE_X21 1<<2
82#define ISDN_SERVICE_G4 1<<3
83#define ISDN_SERVICE_BTX 1<<4
84#define ISDN_SERVICE_DFUE 1<<5
85#define ISDN_SERVICE_X25 1<<6
86#define ISDN_SERVICE_TTX 1<<7
87#define ISDN_SERVICE_MIXED 1<<8
88#define ISDN_SERVICE_FW 1<<9
89#define ISDN_SERVICE_GTEL 1<<10
90#define ISDN_SERVICE_BTXN 1<<11
91#define ISDN_SERVICE_BTEL 1<<12
92
93/* Macros checking plain usage */
94#define USG_NONE(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_NONE)
95#define USG_RAW(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_RAW)
96#define USG_MODEM(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_MODEM)
97#define USG_VOICE(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_VOICE)
98#define USG_NET(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_NET)
99#define USG_FAX(x) ((x & ISDN_USAGE_MASK)==ISDN_USAGE_FAX)
100#define USG_OUTGOING(x) ((x & ISDN_USAGE_OUTGOING)==ISDN_USAGE_OUTGOING)
101#define USG_MODEMORVOICE(x) (((x & ISDN_USAGE_MASK)==ISDN_USAGE_MODEM) || \
102 ((x & ISDN_USAGE_MASK)==ISDN_USAGE_VOICE) )
103
104/* Timer-delays and scheduling-flags */
105#define ISDN_TIMER_RES 4 /* Main Timer-Resolution */
106#define ISDN_TIMER_02SEC (HZ/ISDN_TIMER_RES/5) /* Slow-Timer1 .2 sec */
107#define ISDN_TIMER_1SEC (HZ/ISDN_TIMER_RES) /* Slow-Timer2 1 sec */
108#define ISDN_TIMER_RINGING 5 /* tty RINGs = ISDN_TIMER_1SEC * this factor */
109#define ISDN_TIMER_KEEPINT 10 /* Cisco-Keepalive = ISDN_TIMER_1SEC * this factor */
110#define ISDN_TIMER_MODEMREAD 1
111#define ISDN_TIMER_MODEMPLUS 2
112#define ISDN_TIMER_MODEMRING 4
113#define ISDN_TIMER_MODEMXMIT 8
114#define ISDN_TIMER_NETDIAL 16
115#define ISDN_TIMER_NETHANGUP 32
116#define ISDN_TIMER_CARRIER 256 /* Wait for Carrier */
117#define ISDN_TIMER_FAST (ISDN_TIMER_MODEMREAD | ISDN_TIMER_MODEMPLUS | \
118 ISDN_TIMER_MODEMXMIT)
119#define ISDN_TIMER_SLOW (ISDN_TIMER_MODEMRING | ISDN_TIMER_NETHANGUP | \
120 ISDN_TIMER_NETDIAL | ISDN_TIMER_CARRIER)
121
122/* Timeout-Values for isdn_net_dial() */
123#define ISDN_TIMER_DTIMEOUT10 (10*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1)))
124#define ISDN_TIMER_DTIMEOUT15 (15*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1)))
125#define ISDN_TIMER_DTIMEOUT60 (60*HZ/(ISDN_TIMER_02SEC*(ISDN_TIMER_RES+1)))
126
127/* GLOBAL_FLAGS */
128#define ISDN_GLOBAL_STOPPED 1
129
130/*=================== Start of ip-over-ISDN stuff =========================*/
131
132/* Feature- and status-flags for a net-interface */
133#define ISDN_NET_CONNECTED 0x01 /* Bound to ISDN-Channel */
134#define ISDN_NET_SECURE 0x02 /* Accept calls from phonelist only */
135#define ISDN_NET_CALLBACK 0x04 /* activate callback */
136#define ISDN_NET_CBHUP 0x08 /* hangup before callback */
137#define ISDN_NET_CBOUT 0x10 /* remote machine does callback */
138
139#define ISDN_NET_MAGIC 0x49344C02 /* for paranoia-checking */
140
141/* Phone-list-element */
142typedef struct {
143 void *next;
144 char num[ISDN_MSNLEN];
145} isdn_net_phone;
146
147/*
148 Principles when extending structures for generic encapsulation protocol
149 ("concap") support:
150 - Stuff which is hardware specific (here i4l-specific) goes in
151 the netdev -> local structure (here: isdn_net_local)
152 - Stuff which is encapsulation protocol specific goes in the structure
153 which holds the linux device structure (here: isdn_net_device)
154*/
155
156/* Local interface-data */
157typedef struct isdn_net_local_s {
158 ulong magic;
159 struct net_device_stats stats; /* Ethernet Statistics */
160 int isdn_device; /* Index to isdn-device */
161 int isdn_channel; /* Index to isdn-channel */
162 int ppp_slot; /* PPPD device slot number */
163 int pre_device; /* Preselected isdn-device */
164 int pre_channel; /* Preselected isdn-channel */
165 int exclusive; /* If non-zero idx to reserved chan.*/
166 int flags; /* Connection-flags */
167 int dialretry; /* Counter for Dialout-retries */
168 int dialmax; /* Max. Number of Dial-retries */
169 int cbdelay; /* Delay before Callback starts */
170 int dtimer; /* Timeout-counter for dialing */
171 char msn[ISDN_MSNLEN]; /* MSNs/EAZs for this interface */
172 u_char cbhup; /* Flag: Reject Call before Callback*/
173 u_char dialstate; /* State for dialing */
174 u_char p_encap; /* Packet encapsulation */
175 /* 0 = Ethernet over ISDN */
176 /* 1 = RAW-IP */
177 /* 2 = IP with type field */
178 u_char l2_proto; /* Layer-2-protocol */
179 /* See ISDN_PROTO_L2..-constants in */
180 /* isdnif.h */
181 /* 0 = X75/LAPB with I-Frames */
182 /* 1 = X75/LAPB with UI-Frames */
183 /* 2 = X75/LAPB with BUI-Frames */
184 /* 3 = HDLC */
185 u_char l3_proto; /* Layer-3-protocol */
186 /* See ISDN_PROTO_L3..-constants in */
187 /* isdnif.h */
188 /* 0 = Transparent */
189 int huptimer; /* Timeout-counter for auto-hangup */
190 int charge; /* Counter for charging units */
191 ulong chargetime; /* Timer for Charging info */
192 int hupflags; /* Flags for charge-unit-hangup: */
193 /* bit0: chargeint is invalid */
194 /* bit1: Getting charge-interval */
195 /* bit2: Do charge-unit-hangup */
196 /* bit3: Do hangup even on incoming */
197 int outgoing; /* Flag: outgoing call */
198 int onhtime; /* Time to keep link up */
199 int chargeint; /* Interval between charge-infos */
200 int onum; /* Flag: at least 1 outgoing number */
201 int cps; /* current speed of this interface */
202 int transcount; /* byte-counter for cps-calculation */
203 int sqfull; /* Flag: netdev-queue overloaded */
204 ulong sqfull_stamp; /* Start-Time of overload */
205 ulong slavedelay; /* Dynamic bundling delaytime */
206 int triggercps; /* BogoCPS needed for trigger slave */
207 isdn_net_phone *phone[2]; /* List of remote-phonenumbers */
208 /* phone[0] = Incoming Numbers */
209 /* phone[1] = Outgoing Numbers */
210 isdn_net_phone *dial; /* Pointer to dialed number */
211 struct net_device *master; /* Ptr to Master device for slaves */
212 struct net_device *slave; /* Ptr to Slave device for masters */
213 struct isdn_net_local_s *next; /* Ptr to next link in bundle */
214 struct isdn_net_local_s *last; /* Ptr to last link in bundle */
215 struct isdn_net_dev_s *netdev; /* Ptr to netdev */
216 struct sk_buff_head super_tx_queue; /* List of supervisory frames to */
217 /* be transmitted asap */
218 atomic_t frame_cnt; /* number of frames currently */
219 /* queued in HL driver */
220 /* Ptr to orig. hard_header_cache */
221 spinlock_t xmit_lock; /* used to protect the xmit path of */
222 /* a particular channel (including */
223 /* the frame_cnt */
224
225 int pppbind; /* ippp device for bindings */
226 int dialtimeout; /* How long shall we try on dialing? (jiffies) */
227 int dialwait; /* How long shall we wait after failed attempt? (jiffies) */
228 ulong dialstarted; /* jiffies of first dialing-attempt */
229 ulong dialwait_timer; /* jiffies of earliest next dialing-attempt */
230 int huptimeout; /* How long will the connection be up? (seconds) */
231#ifdef CONFIG_ISDN_X25
232 struct concap_device_ops *dops; /* callbacks used by encapsulator */
233#endif
234 /* use an own struct for that in later versions */
235 ulong cisco_myseq; /* Local keepalive seq. for Cisco */
236 ulong cisco_mineseen; /* returned keepalive seq. from remote */
237 ulong cisco_yourseq; /* Remote keepalive seq. for Cisco */
238 int cisco_keepalive_period; /* keepalive period */
239 ulong cisco_last_slarp_in; /* jiffie of last keepalive packet we received */
240 char cisco_line_state; /* state of line according to keepalive packets */
241 char cisco_debserint; /* debugging flag of cisco hdlc with slarp */
242 struct timer_list cisco_timer;
243 struct work_struct tqueue;
244} isdn_net_local;
245
246/* the interface itself */
247typedef struct isdn_net_dev_s {
248 isdn_net_local *local;
249 isdn_net_local *queue; /* circular list of all bundled
250 channels, which are currently
251 online */
252 spinlock_t queue_lock; /* lock to protect queue */
253 void *next; /* Pointer to next isdn-interface */
254 struct net_device *dev; /* interface to upper levels */
255#ifdef CONFIG_ISDN_PPP
256 ippp_bundle * pb; /* pointer to the common bundle structure
257 * with the per-bundle data */
258#endif
259#ifdef CONFIG_ISDN_X25
260 struct concap_proto *cprot; /* connection oriented encapsulation protocol */
261#endif
262
263} isdn_net_dev;
264
265/*===================== End of ip-over-ISDN stuff ===========================*/
266
267/*======================= Start of ISDN-tty stuff ===========================*/
268
269#define ISDN_ASYNC_MAGIC 0x49344C01 /* for paranoia-checking */
270#define ISDN_SERIAL_XMIT_SIZE 1024 /* Default bufsize for write */
271#define ISDN_SERIAL_XMIT_MAX 4000 /* Maximum bufsize for write */
272
273#ifdef CONFIG_ISDN_AUDIO
274/* For using sk_buffs with audio we need some private variables
275 * within each sk_buff. For this purpose, we declare a struct here,
276 * and put it always at the private skb->cb data array. A few macros help
277 * accessing the variables.
278 */
279typedef struct _isdn_audio_data {
280 unsigned short dle_count;
281 unsigned char lock;
282} isdn_audio_data_t;
283
284#define ISDN_AUDIO_SKB_DLECOUNT(skb) (((isdn_audio_data_t *)&skb->cb[0])->dle_count)
285#define ISDN_AUDIO_SKB_LOCK(skb) (((isdn_audio_data_t *)&skb->cb[0])->lock)
286#endif
287
288/* Private data of AT-command-interpreter */
289typedef struct atemu {
290 u_char profile[ISDN_MODEM_NUMREG]; /* Modem-Regs. Profile 0 */
291 u_char mdmreg[ISDN_MODEM_NUMREG]; /* Modem-Registers */
292 char pmsn[ISDN_MSNLEN]; /* EAZ/MSNs Profile 0 */
293 char msn[ISDN_MSNLEN]; /* EAZ/MSN */
294 char plmsn[ISDN_LMSNLEN]; /* Listening MSNs Profile 0 */
295 char lmsn[ISDN_LMSNLEN]; /* Listening MSNs */
296 char cpn[ISDN_MSNLEN]; /* CalledPartyNumber on incoming call */
297 char connmsg[ISDN_CMSGLEN]; /* CONNECT-Msg from HL-Driver */
298#ifdef CONFIG_ISDN_AUDIO
299 u_char vpar[10]; /* Voice-parameters */
300 int lastDLE; /* Flag for voice-coding: DLE seen */
301#endif
302 int mdmcmdl; /* Length of Modem-Commandbuffer */
303 int pluscount; /* Counter for +++ sequence */
304 u_long lastplus; /* Timestamp of last + */
305 int carrierwait; /* Seconds of carrier waiting */
306 char mdmcmd[255]; /* Modem-Commandbuffer */
307 unsigned int charge; /* Charge units of current connection */
308} atemu;
309
310/* Private data (similar to async_struct in <linux/serial.h>) */
311typedef struct modem_info {
312 int magic;
313 struct tty_port port;
314 int x_char; /* xon/xoff character */
315 int mcr; /* Modem control register */
316 int msr; /* Modem status register */
317 int lsr; /* Line status register */
318 int line;
319 int online; /* 1 = B-Channel is up, drop data */
320 /* 2 = B-Channel is up, deliver d.*/
321 int dialing; /* Dial in progress or ATA */
322 int closing;
323 int rcvsched; /* Receive needs schedule */
324 int isdn_driver; /* Index to isdn-driver */
325 int isdn_channel; /* Index to isdn-channel */
326 int drv_index; /* Index to dev->usage */
327 int ncarrier; /* Flag: schedule NO CARRIER */
328 unsigned char last_cause[8]; /* Last cause message */
329 unsigned char last_num[ISDN_MSNLEN];
330 /* Last phone-number */
331 unsigned char last_l2; /* Last layer-2 protocol */
332 unsigned char last_si; /* Last service */
333 unsigned char last_lhup; /* Last hangup local? */
334 unsigned char last_dir; /* Last direction (in or out) */
335 struct timer_list nc_timer; /* Timer for delayed NO CARRIER */
336 int send_outstanding;/* # of outstanding send-requests */
337 int xmit_size; /* max. # of chars in xmit_buf */
338 int xmit_count; /* # of chars in xmit_buf */
339 struct sk_buff_head xmit_queue; /* transmit queue */
340 atomic_t xmit_lock; /* Semaphore for isdn_tty_write */
341#ifdef CONFIG_ISDN_AUDIO
342 int vonline; /* Voice-channel status */
343 /* Bit 0 = recording */
344 /* Bit 1 = playback */
345 /* Bit 2 = playback, DLE-ETX seen */
346 struct sk_buff_head dtmf_queue; /* queue for dtmf results */
347 void *adpcms; /* state for adpcm decompression */
348 void *adpcmr; /* state for adpcm compression */
349 void *dtmf_state; /* state for dtmf decoder */
350 void *silence_state; /* state for silence detection */
351#endif
352#ifdef CONFIG_ISDN_TTY_FAX
353 struct T30_s *fax; /* T30 Fax Group 3 data/interface */
354 int faxonline; /* Fax-channel status */
355#endif
356 atemu emu; /* AT-emulator data */
357 spinlock_t readlock;
358} modem_info;
359
360#define ISDN_MODEM_WINSIZE 8
361
362/* Description of one ISDN-tty */
363typedef struct _isdn_modem {
364 int refcount; /* Number of opens */
365 struct tty_driver *tty_modem; /* tty-device */
366 struct tty_struct *modem_table[ISDN_MAX_CHANNELS]; /* ?? copied from Orig */
367 struct ktermios *modem_termios[ISDN_MAX_CHANNELS];
368 struct ktermios *modem_termios_locked[ISDN_MAX_CHANNELS];
369 modem_info info[ISDN_MAX_CHANNELS]; /* Private data */
370} isdn_modem_t;
371
372/*======================= End of ISDN-tty stuff ============================*/
373
374/*======================== Start of V.110 stuff ============================*/
375#define V110_BUFSIZE 1024
376
377typedef struct {
378 int nbytes; /* 1 Matrixbyte -> nbytes in stream */
379 int nbits; /* Number of used bits in streambyte */
380 unsigned char key; /* Bitmask in stream eg. 11 (nbits=2) */
381 int decodelen; /* Amount of data in decodebuf */
382 int SyncInit; /* Number of sync frames to send */
383 unsigned char *OnlineFrame; /* Precalculated V110 idle frame */
384 unsigned char *OfflineFrame; /* Precalculated V110 sync Frame */
385 int framelen; /* Length of frames */
386 int skbuser; /* Number of unacked userdata skbs */
387 int skbidle; /* Number of unacked idle/sync skbs */
388 int introducer; /* Local vars for decoder */
389 int dbit;
390 unsigned char b;
391 int skbres; /* space to reserve in outgoing skb */
392 int maxsize; /* maxbufsize of lowlevel driver */
393 unsigned char *encodebuf; /* temporary buffer for encoding */
394 unsigned char decodebuf[V110_BUFSIZE]; /* incomplete V110 matrices */
395} isdn_v110_stream;
396
397/*========================= End of V.110 stuff =============================*/
398
399/*======================= Start of general stuff ===========================*/
400
401typedef struct {
402 char *next;
403 char *private;
404} infostruct;
405
406#define DRV_FLAG_RUNNING 1
407#define DRV_FLAG_REJBUS 2
408#define DRV_FLAG_LOADED 4
409
410/* Description of hardware-level-driver */
411typedef struct _isdn_driver {
412 ulong online; /* Channel-Online flags */
413 ulong flags; /* Misc driver Flags */
414 int locks; /* Number of locks for this driver */
415 int channels; /* Number of channels */
416 wait_queue_head_t st_waitq; /* Wait-Queue for status-read's */
417 int maxbufsize; /* Maximum Buffersize supported */
418 unsigned long pktcount; /* Until now: unused */
419 int stavail; /* Chars avail on Status-device */
420 isdn_if *interface; /* Interface to driver */
421 int *rcverr; /* Error-counters for B-Ch.-receive */
422 int *rcvcount; /* Byte-counters for B-Ch.-receive */
423#ifdef CONFIG_ISDN_AUDIO
424 unsigned long DLEflag; /* Flags: Insert DLE at next read */
425#endif
426 struct sk_buff_head *rpqueue; /* Pointers to start of Rcv-Queue */
427 wait_queue_head_t *rcv_waitq; /* Wait-Queues for B-Channel-Reads */
428 wait_queue_head_t *snd_waitq; /* Wait-Queue for B-Channel-Send's */
429 char msn2eaz[10][ISDN_MSNLEN]; /* Mapping-Table MSN->EAZ */
430} isdn_driver_t;
431
432/* Main driver-data */
433typedef struct isdn_devt {
434 struct module *owner;
435 spinlock_t lock;
436 unsigned short flags; /* Bitmapped Flags: */
437 int drivers; /* Current number of drivers */
438 int channels; /* Current number of channels */
439 int net_verbose; /* Verbose-Flag */
440 int modempoll; /* Flag: tty-read active */
441 spinlock_t timerlock;
442 int tflags; /* Timer-Flags: */
443 /* see ISDN_TIMER_..defines */
444 int global_flags;
445 infostruct *infochain; /* List of open info-devs. */
446 wait_queue_head_t info_waitq; /* Wait-Queue for isdninfo */
447 struct timer_list timer; /* Misc.-function Timer */
448 int chanmap[ISDN_MAX_CHANNELS]; /* Map minor->device-channel */
449 int drvmap[ISDN_MAX_CHANNELS]; /* Map minor->driver-index */
450 int usage[ISDN_MAX_CHANNELS]; /* Used by tty/ip/voice */
451 char num[ISDN_MAX_CHANNELS][ISDN_MSNLEN];
452 /* Remote number of active ch.*/
453 int m_idx[ISDN_MAX_CHANNELS]; /* Index for mdm.... */
454 isdn_driver_t *drv[ISDN_MAX_DRIVERS]; /* Array of drivers */
455 isdn_net_dev *netdev; /* Linked list of net-if's */
456 char drvid[ISDN_MAX_DRIVERS][20];/* Driver-ID */
457 struct task_struct *profd; /* For iprofd */
458 isdn_modem_t mdm; /* tty-driver-data */
459 isdn_net_dev *rx_netdev[ISDN_MAX_CHANNELS]; /* rx netdev-pointers */
460 isdn_net_dev *st_netdev[ISDN_MAX_CHANNELS]; /* stat netdev-pointers */
461 ulong ibytes[ISDN_MAX_CHANNELS]; /* Statistics incoming bytes */
462 ulong obytes[ISDN_MAX_CHANNELS]; /* Statistics outgoing bytes */
463 int v110emu[ISDN_MAX_CHANNELS]; /* V.110 emulator-mode 0=none */
464 atomic_t v110use[ISDN_MAX_CHANNELS]; /* Usage-Semaphore for stream */
465 isdn_v110_stream *v110[ISDN_MAX_CHANNELS]; /* V.110 private data */
466 struct mutex mtx; /* serialize list access*/
467 unsigned long global_features;
468} isdn_dev;
469
470extern isdn_dev *dev;
471
472
473#endif /* __ISDN_H__ */
include/linux/isdn/hdlc.h+0−69
@@ -1,69 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * hdlc.h -- General purpose ISDN HDLC decoder.
4 *
5 * Implementation of a HDLC decoder/encoder in software.
6 * Necessary because some ISDN devices don't have HDLC
7 * controllers.
8 *
9 * Copyright (C)
10 * 2009 Karsten Keil <keil@b1-systems.de>
11 * 2002 Wolfgang Mües <wolfgang@iksw-muees.de>
12 * 2001 Frode Isaksen <fisaksen@bewan.com>
13 * 2001 Kai Germaschewski <kai.germaschewski@gmx.de>
14 */
15
16#ifndef __ISDNHDLC_H__
17#define __ISDNHDLC_H__
18
19struct isdnhdlc_vars {
20 int bit_shift;
21 int hdlc_bits1;
22 int data_bits;
23 int ffbit_shift; /* encoding only */
24 int state;
25 int dstpos;
26
27 u16 crc;
28
29 u8 cbin;
30 u8 shift_reg;
31 u8 ffvalue;
32
33 /* set if transferring data */
34 u32 data_received:1;
35 /* set if D channel (send idle instead of flags) */
36 u32 dchannel:1;
37 /* set if 56K adaptation */
38 u32 do_adapt56:1;
39 /* set if in closing phase (need to send CRC + flag) */
40 u32 do_closing:1;
41 /* set if data is bitreverse */
42 u32 do_bitreverse:1;
43};
44
45/* Feature Flags */
46#define HDLC_56KBIT 0x01
47#define HDLC_DCHANNEL 0x02
48#define HDLC_BITREVERSE 0x04
49
50/*
51 The return value from isdnhdlc_decode is
52 the frame length, 0 if no complete frame was decoded,
53 or a negative error number
54*/
55#define HDLC_FRAMING_ERROR 1
56#define HDLC_CRC_ERROR 2
57#define HDLC_LENGTH_ERROR 3
58
59extern void isdnhdlc_rcv_init(struct isdnhdlc_vars *hdlc, u32 features);
60
61extern int isdnhdlc_decode(struct isdnhdlc_vars *hdlc, const u8 *src,
62 int slen, int *count, u8 *dst, int dsize);
63
64extern void isdnhdlc_out_init(struct isdnhdlc_vars *hdlc, u32 features);
65
66extern int isdnhdlc_encode(struct isdnhdlc_vars *hdlc, const u8 *src,
67 u16 slen, int *count, u8 *dst, int dsize);
68
69#endif /* __ISDNHDLC_H__ */
include/linux/isdn_divertif.h+0−35
@@ -1,35 +0,0 @@
1/* $Id: isdn_divertif.h,v 1.4.6.1 2001/09/23 22:25:05 kai Exp $
2 *
3 * Header for the diversion supplementary interface for i4l.
4 *
5 * Author Werner Cornelius (werner@titro.de)
6 * Copyright by Werner Cornelius (werner@titro.de)
7 *
8 * This software may be used and distributed according to the terms
9 * of the GNU General Public License, incorporated herein by reference.
10 *
11 */
12#ifndef _LINUX_ISDN_DIVERTIF_H
13#define _LINUX_ISDN_DIVERTIF_H
14
15#include <linux/isdnif.h>
16#include <linux/types.h>
17#include <uapi/linux/isdn_divertif.h>
18
19/***************************************************************/
20/* structure exchanging data between isdn hl and divert module */
21/***************************************************************/
22typedef struct
23 { ulong if_magic; /* magic info and version */
24 int cmd; /* command */
25 int (*stat_callback)(isdn_ctrl *); /* supplied by divert module when calling */
26 int (*ll_cmd)(isdn_ctrl *); /* supplied by hl on return */
27 char * (*drv_to_name)(int); /* map a driver id to name, supplied by hl */
28 int (*name_to_drv)(char *); /* map a driver id to name, supplied by hl */
29 } isdn_divert_if;
30
31/*********************/
32/* function register */
33/*********************/
34extern int DIVERT_REG_NAME(isdn_divert_if *);
35#endif /* _LINUX_ISDN_DIVERTIF_H */
include/linux/isdn_ppp.h+0−194
@@ -1,194 +0,0 @@
1/* Linux ISDN subsystem, sync PPP, interface to ipppd
2 *
3 * Copyright 1994-1999 by Fritz Elfert (fritz@isdn4linux.de)
4 * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg
5 * Copyright 1995,96 by Michael Hipp (Michael.Hipp@student.uni-tuebingen.de)
6 * Copyright 2000-2002 by Kai Germaschewski (kai@germaschewski.name)
7 *
8 * This software may be used and distributed according to the terms
9 * of the GNU General Public License, incorporated herein by reference.
10 *
11 */
12#ifndef _LINUX_ISDN_PPP_H
13#define _LINUX_ISDN_PPP_H
14
15
16
17
18#ifdef CONFIG_IPPP_FILTER
19#include <linux/filter.h>
20#endif
21#include <uapi/linux/isdn_ppp.h>
22
23#define DECOMP_ERR_NOMEM (-10)
24
25#define MP_END_FRAG 0x40
26#define MP_BEGIN_FRAG 0x80
27
28#define MP_MAX_QUEUE_LEN 16
29
30/*
31 * We need a way for the decompressor to influence the generation of CCP
32 * Reset-Requests in a variety of ways. The decompressor is already returning
33 * a lot of information (generated skb length, error conditions) so we use
34 * another parameter. This parameter is a pointer to a structure which is
35 * to be marked valid by the decompressor and only in this case is ever used.
36 * Furthermore, the only case where this data is used is when the decom-
37 * pressor returns DECOMP_ERROR.
38 *
39 * We use this same struct for the reset entry of the compressor to commu-
40 * nicate to its caller how to deal with sending of a Reset Ack. In this
41 * case, expra is not used, but other options still apply (suppressing
42 * sending with rsend, appending arbitrary data, etc).
43 */
44
45#define IPPP_RESET_MAXDATABYTES 32
46
47struct isdn_ppp_resetparams {
48 unsigned char valid:1; /* rw Is this structure filled at all ? */
49 unsigned char rsend:1; /* rw Should we send one at all ? */
50 unsigned char idval:1; /* rw Is the id field valid ? */
51 unsigned char dtval:1; /* rw Is the data field valid ? */
52 unsigned char expra:1; /* rw Is an Ack expected for this Req ? */
53 unsigned char id; /* wo Send CCP ResetReq with this id */
54 unsigned short maxdlen; /* ro Max bytes to be stored in data field */
55 unsigned short dlen; /* rw Bytes stored in data field */
56 unsigned char *data; /* wo Data for ResetReq info field */
57};
58
59/*
60 * this is an 'old friend' from ppp-comp.h under a new name
61 * check the original include for more information
62 */
63struct isdn_ppp_compressor {
64 struct isdn_ppp_compressor *next, *prev;
65 struct module *owner;
66 int num; /* CCP compression protocol number */
67
68 void *(*alloc) (struct isdn_ppp_comp_data *);
69 void (*free) (void *state);
70 int (*init) (void *state, struct isdn_ppp_comp_data *,
71 int unit,int debug);
72
73 /* The reset entry needs to get more exact information about the
74 ResetReq or ResetAck it was called with. The parameters are
75 obvious. If reset is called without a Req or Ack frame which
76 could be handed into it, code MUST be set to 0. Using rsparm,
77 the reset entry can control if and how a ResetAck is returned. */
78
79 void (*reset) (void *state, unsigned char code, unsigned char id,
80 unsigned char *data, unsigned len,
81 struct isdn_ppp_resetparams *rsparm);
82
83 int (*compress) (void *state, struct sk_buff *in,
84 struct sk_buff *skb_out, int proto);
85
86 int (*decompress) (void *state,struct sk_buff *in,
87 struct sk_buff *skb_out,
88 struct isdn_ppp_resetparams *rsparm);
89
90 void (*incomp) (void *state, struct sk_buff *in,int proto);
91 void (*stat) (void *state, struct compstat *stats);
92};
93
94extern int isdn_ppp_register_compressor(struct isdn_ppp_compressor *);
95extern int isdn_ppp_unregister_compressor(struct isdn_ppp_compressor *);
96extern int isdn_ppp_dial_slave(char *);
97extern int isdn_ppp_hangup_slave(char *);
98
99typedef struct {
100 unsigned long seqerrs;
101 unsigned long frame_drops;
102 unsigned long overflows;
103 unsigned long max_queue_len;
104} isdn_mppp_stats;
105
106typedef struct {
107 int mp_mrru; /* unused */
108 struct sk_buff * frags; /* fragments sl list -- use skb->next */
109 long frames; /* number of frames in the frame list */
110 unsigned int seq; /* last processed packet seq #: any packets
111 * with smaller seq # will be dropped
112 * unconditionally */
113 spinlock_t lock;
114 int ref_ct;
115 /* statistics */
116 isdn_mppp_stats stats;
117} ippp_bundle;
118
119#define NUM_RCV_BUFFS 64
120
121struct ippp_buf_queue {
122 struct ippp_buf_queue *next;
123 struct ippp_buf_queue *last;
124 char *buf; /* NULL here indicates end of queue */
125 int len;
126};
127
128/* The data structure for one CCP reset transaction */
129enum ippp_ccp_reset_states {
130 CCPResetIdle,
131 CCPResetSentReq,
132 CCPResetRcvdReq,
133 CCPResetSentAck,
134 CCPResetRcvdAck
135};
136
137struct ippp_ccp_reset_state {
138 enum ippp_ccp_reset_states state; /* State of this transaction */
139 struct ippp_struct *is; /* Backlink to device stuff */
140 unsigned char id; /* Backlink id index */
141 unsigned char ta:1; /* The timer is active (flag) */
142 unsigned char expra:1; /* We expect a ResetAck at all */
143 int dlen; /* Databytes stored in data */
144 struct timer_list timer; /* For timeouts/retries */
145 /* This is a hack but seems sufficient for the moment. We do not want
146 to have this be yet another allocation for some bytes, it is more
147 memory management overhead than the whole mess is worth. */
148 unsigned char data[IPPP_RESET_MAXDATABYTES];
149};
150
151/* The data structure keeping track of the currently outstanding CCP Reset
152 transactions. */
153struct ippp_ccp_reset {
154 struct ippp_ccp_reset_state *rs[256]; /* One per possible id */
155 unsigned char lastid; /* Last id allocated by the engine */
156};
157
158struct ippp_struct {
159 struct ippp_struct *next_link;
160 int state;
161 spinlock_t buflock;
162 struct ippp_buf_queue rq[NUM_RCV_BUFFS]; /* packet queue for isdn_ppp_read() */
163 struct ippp_buf_queue *first; /* pointer to (current) first packet */
164 struct ippp_buf_queue *last; /* pointer to (current) last used packet in queue */
165 wait_queue_head_t wq;
166 struct task_struct *tk;
167 unsigned int mpppcfg;
168 unsigned int pppcfg;
169 unsigned int mru;
170 unsigned int mpmru;
171 unsigned int mpmtu;
172 unsigned int maxcid;
173 struct isdn_net_local_s *lp;
174 int unit;
175 int minor;
176 unsigned int last_link_seqno;
177 long mp_seqno;
178#ifdef CONFIG_ISDN_PPP_VJ
179 unsigned char *cbuf;
180 struct slcompress *slcomp;
181#endif
182#ifdef CONFIG_IPPP_FILTER
183 struct bpf_prog *pass_filter; /* filter for packets to pass */
184 struct bpf_prog *active_filter; /* filter for pkts to reset idle */
185#endif
186 unsigned long debug;
187 struct isdn_ppp_compressor *compressor,*decompressor;
188 struct isdn_ppp_compressor *link_compressor,*link_decompressor;
189 void *decomp_stat,*comp_stat,*link_decomp_stat,*link_comp_stat;
190 struct ippp_ccp_reset *reset; /* Allocated on demand, may never be needed */
191 unsigned long compflags;
192};
193
194#endif /* _LINUX_ISDN_PPP_H */
include/linux/isdnif.h+0−505
@@ -1,505 +0,0 @@
1/* $Id: isdnif.h,v 1.43.2.2 2004/01/12 23:08:35 keil Exp $
2 *
3 * Linux ISDN subsystem
4 * Definition of the interface between the subsystem and its low-level drivers.
5 *
6 * Copyright 1994,95,96 by Fritz Elfert (fritz@isdn4linux.de)
7 * Copyright 1995,96 Thinking Objects Software GmbH Wuerzburg
8 *
9 * This software may be used and distributed according to the terms
10 * of the GNU General Public License, incorporated herein by reference.
11 *
12 */
13#ifndef __ISDNIF_H__
14#define __ISDNIF_H__
15
16
17#include <linux/skbuff.h>
18#include <uapi/linux/isdnif.h>
19
20/***************************************************************************/
21/* Extensions made by Werner Cornelius (werner@ikt.de) */
22/* */
23/* The proceed command holds a incoming call in a state to leave processes */
24/* enough time to check whether ist should be accepted. */
25/* The PROT_IO Command extends the interface to make protocol dependent */
26/* features available (call diversion, call waiting...). */
27/* */
28/* The PROT_IO Command is executed with the desired driver id and the arg */
29/* parameter coded as follows: */
30/* The lower 8 bits of arg contain the desired protocol from ISDN_PTYPE */
31/* definitions. The upper 24 bits represent the protocol specific cmd/stat.*/
32/* Any additional data is protocol and command specific. */
33/* This mechanism also applies to the statcallb callback STAT_PROT. */
34/* */
35/* This suggested extension permits an easy expansion of protocol specific */
36/* handling. Extensions may be added at any time without changing the HL */
37/* driver code and not getting conflicts without certifications. */
38/* The well known CAPI 2.0 interface handles such extensions in a similar */
39/* way. Perhaps a protocol specific module may be added and separately */
40/* loaded and linked to the basic isdn module for handling. */
41/***************************************************************************/
42
43/*****************/
44/* DSS1 commands */
45/*****************/
46#define DSS1_CMD_INVOKE ((0x00 << 8) | ISDN_PTYPE_EURO) /* invoke a supplementary service */
47#define DSS1_CMD_INVOKE_ABORT ((0x01 << 8) | ISDN_PTYPE_EURO) /* abort a invoke cmd */
48
49/*******************************/
50/* DSS1 Status callback values */
51/*******************************/
52#define DSS1_STAT_INVOKE_RES ((0x80 << 8) | ISDN_PTYPE_EURO) /* Result for invocation */
53#define DSS1_STAT_INVOKE_ERR ((0x81 << 8) | ISDN_PTYPE_EURO) /* Error Return for invocation */
54#define DSS1_STAT_INVOKE_BRD ((0x82 << 8) | ISDN_PTYPE_EURO) /* Deliver invoke broadcast info */
55
56
57/*********************************************************************/
58/* structures for DSS1 commands and callback */
59/* */
60/* An action is invoked by sending a DSS1_CMD_INVOKE. The ll_id, proc*/
61/* timeout, datalen and data fields must be set before calling. */
62/* */
63/* The return value is a positive hl_id value also delivered in the */
64/* hl_id field. A value of zero signals no more left hl_id capacitys.*/
65/* A negative return value signals errors in LL. So if the return */
66/* value is <= 0 no action in LL will be taken -> request ignored */
67/* */
68/* The timeout field must be filled with a positive value specifying */
69/* the amount of time the INVOKED process waits for a reaction from */
70/* the network. */
71/* If a response (either error or result) is received during this */
72/* intervall, a reporting callback is initiated and the process will */
73/* be deleted, the hl identifier will be freed. */
74/* If no response is received during the specified intervall, a error*/
75/* callback is initiated with timeout set to -1 and a datalen set */
76/* to 0. */
77/* If timeout is set to a value <= 0 during INVOCATION the process is*/
78/* immediately deleted after sending the data. No callback occurs ! */
79/* */
80/* A currently waiting process may be aborted with INVOKE_ABORT. No */
81/* callback will occur when a process has been aborted. */
82/* */
83/* Broadcast invoke frames from the network are reported via the */
84/* STAT_INVOKE_BRD callback. The ll_id is set to 0, the other fields */
85/* are supplied by the network and not by the HL. */
86/*********************************************************************/
87
88/*****************/
89/* NI1 commands */
90/*****************/
91#define NI1_CMD_INVOKE ((0x00 << 8) | ISDN_PTYPE_NI1) /* invoke a supplementary service */
92#define NI1_CMD_INVOKE_ABORT ((0x01 << 8) | ISDN_PTYPE_NI1) /* abort a invoke cmd */
93
94/*******************************/
95/* NI1 Status callback values */
96/*******************************/
97#define NI1_STAT_INVOKE_RES ((0x80 << 8) | ISDN_PTYPE_NI1) /* Result for invocation */
98#define NI1_STAT_INVOKE_ERR ((0x81 << 8) | ISDN_PTYPE_NI1) /* Error Return for invocation */
99#define NI1_STAT_INVOKE_BRD ((0x82 << 8) | ISDN_PTYPE_NI1) /* Deliver invoke broadcast info */
100
101typedef struct
102 { ulong ll_id; /* ID supplied by LL when executing */
103 /* a command and returned by HL for */
104 /* INVOKE_RES and INVOKE_ERR */
105 int hl_id; /* ID supplied by HL when called */
106 /* for executing a cmd and delivered */
107 /* for results and errors */
108 /* must be supplied by LL when aborting*/
109 int proc; /* invoke procedure used by CMD_INVOKE */
110 /* returned by callback and broadcast */
111 int timeout; /* timeout for INVOKE CMD in ms */
112 /* -1 in stat callback when timed out */
113 /* error value when error callback */
114 int datalen; /* length of cmd or stat data */
115 u_char *data;/* pointer to data delivered or send */
116 } isdn_cmd_stat;
117
118/*
119 * Commands from linklevel to lowlevel
120 *
121 */
122#define ISDN_CMD_IOCTL 0 /* Perform ioctl */
123#define ISDN_CMD_DIAL 1 /* Dial out */
124#define ISDN_CMD_ACCEPTD 2 /* Accept an incoming call on D-Chan. */
125#define ISDN_CMD_ACCEPTB 3 /* Request B-Channel connect. */
126#define ISDN_CMD_HANGUP 4 /* Hangup */
127#define ISDN_CMD_CLREAZ 5 /* Clear EAZ(s) of channel */
128#define ISDN_CMD_SETEAZ 6 /* Set EAZ(s) of channel */
129#define ISDN_CMD_GETEAZ 7 /* Get EAZ(s) of channel */
130#define ISDN_CMD_SETSIL 8 /* Set Service-Indicator-List of channel */
131#define ISDN_CMD_GETSIL 9 /* Get Service-Indicator-List of channel */
132#define ISDN_CMD_SETL2 10 /* Set B-Chan. Layer2-Parameter */
133#define ISDN_CMD_GETL2 11 /* Get B-Chan. Layer2-Parameter */
134#define ISDN_CMD_SETL3 12 /* Set B-Chan. Layer3-Parameter */
135#define ISDN_CMD_GETL3 13 /* Get B-Chan. Layer3-Parameter */
136// #define ISDN_CMD_LOCK 14 /* Signal usage by upper levels */
137// #define ISDN_CMD_UNLOCK 15 /* Release usage-lock */
138#define ISDN_CMD_SUSPEND 16 /* Suspend connection */
139#define ISDN_CMD_RESUME 17 /* Resume connection */
140#define ISDN_CMD_PROCEED 18 /* Proceed with call establishment */
141#define ISDN_CMD_ALERT 19 /* Alert after Proceeding */
142#define ISDN_CMD_REDIR 20 /* Redir a incoming call */
143#define ISDN_CMD_PROT_IO 21 /* Protocol specific commands */
144#define CAPI_PUT_MESSAGE 22 /* CAPI message send down or up */
145#define ISDN_CMD_FAXCMD 23 /* FAX commands to HL-driver */
146#define ISDN_CMD_AUDIO 24 /* DSP, DTMF, ... settings */
147
148/*
149 * Status-Values delivered from lowlevel to linklevel via
150 * statcallb().
151 *
152 */
153#define ISDN_STAT_STAVAIL 256 /* Raw status-data available */
154#define ISDN_STAT_ICALL 257 /* Incoming call detected */
155#define ISDN_STAT_RUN 258 /* Signal protocol-code is running */
156#define ISDN_STAT_STOP 259 /* Signal halt of protocol-code */
157#define ISDN_STAT_DCONN 260 /* Signal D-Channel connect */
158#define ISDN_STAT_BCONN 261 /* Signal B-Channel connect */
159#define ISDN_STAT_DHUP 262 /* Signal D-Channel disconnect */
160#define ISDN_STAT_BHUP 263 /* Signal B-Channel disconnect */
161#define ISDN_STAT_CINF 264 /* Charge-Info */
162#define ISDN_STAT_LOAD 265 /* Signal new lowlevel-driver is loaded */
163#define ISDN_STAT_UNLOAD 266 /* Signal unload of lowlevel-driver */
164#define ISDN_STAT_BSENT 267 /* Signal packet sent */
165#define ISDN_STAT_NODCH 268 /* Signal no D-Channel */
166#define ISDN_STAT_ADDCH 269 /* Add more Channels */
167#define ISDN_STAT_CAUSE 270 /* Cause-Message */
168#define ISDN_STAT_ICALLW 271 /* Incoming call without B-chan waiting */
169#define ISDN_STAT_REDIR 272 /* Redir result */
170#define ISDN_STAT_PROT 273 /* protocol IO specific callback */
171#define ISDN_STAT_DISPLAY 274 /* deliver a received display message */
172#define ISDN_STAT_L1ERR 275 /* Signal Layer-1 Error */
173#define ISDN_STAT_FAXIND 276 /* FAX indications from HL-driver */
174#define ISDN_STAT_AUDIO 277 /* DTMF, DSP indications */
175#define ISDN_STAT_DISCH 278 /* Disable/Enable channel usage */
176
177/*
178 * Audio commands
179 */
180#define ISDN_AUDIO_SETDD 0 /* Set DTMF detection */
181#define ISDN_AUDIO_DTMF 1 /* Rx/Tx DTMF */
182
183/*
184 * Values for errcode field
185 */
186#define ISDN_STAT_L1ERR_SEND 1
187#define ISDN_STAT_L1ERR_RECV 2
188
189/*
190 * Values for feature-field of interface-struct.
191 */
192/* Layer 2 */
193#define ISDN_FEATURE_L2_X75I (0x0001 << ISDN_PROTO_L2_X75I)
194#define ISDN_FEATURE_L2_X75UI (0x0001 << ISDN_PROTO_L2_X75UI)
195#define ISDN_FEATURE_L2_X75BUI (0x0001 << ISDN_PROTO_L2_X75BUI)
196#define ISDN_FEATURE_L2_HDLC (0x0001 << ISDN_PROTO_L2_HDLC)
197#define ISDN_FEATURE_L2_TRANS (0x0001 << ISDN_PROTO_L2_TRANS)
198#define ISDN_FEATURE_L2_X25DTE (0x0001 << ISDN_PROTO_L2_X25DTE)
199#define ISDN_FEATURE_L2_X25DCE (0x0001 << ISDN_PROTO_L2_X25DCE)
200#define ISDN_FEATURE_L2_V11096 (0x0001 << ISDN_PROTO_L2_V11096)
201#define ISDN_FEATURE_L2_V11019 (0x0001 << ISDN_PROTO_L2_V11019)
202#define ISDN_FEATURE_L2_V11038 (0x0001 << ISDN_PROTO_L2_V11038)
203#define ISDN_FEATURE_L2_MODEM (0x0001 << ISDN_PROTO_L2_MODEM)
204#define ISDN_FEATURE_L2_FAX (0x0001 << ISDN_PROTO_L2_FAX)
205#define ISDN_FEATURE_L2_HDLC_56K (0x0001 << ISDN_PROTO_L2_HDLC_56K)
206
207#define ISDN_FEATURE_L2_MASK (0x0FFFF) /* Max. 16 protocols */
208#define ISDN_FEATURE_L2_SHIFT (0)
209
210/* Layer 3 */
211#define ISDN_FEATURE_L3_TRANS (0x10000 << ISDN_PROTO_L3_TRANS)
212#define ISDN_FEATURE_L3_TRANSDSP (0x10000 << ISDN_PROTO_L3_TRANSDSP)
213#define ISDN_FEATURE_L3_FCLASS2 (0x10000 << ISDN_PROTO_L3_FCLASS2)
214#define ISDN_FEATURE_L3_FCLASS1 (0x10000 << ISDN_PROTO_L3_FCLASS1)
215
216#define ISDN_FEATURE_L3_MASK (0x0FF0000) /* Max. 8 Protocols */
217#define ISDN_FEATURE_L3_SHIFT (16)
218
219/* Signaling */
220#define ISDN_FEATURE_P_UNKNOWN (0x1000000 << ISDN_PTYPE_UNKNOWN)
221#define ISDN_FEATURE_P_1TR6 (0x1000000 << ISDN_PTYPE_1TR6)
222#define ISDN_FEATURE_P_EURO (0x1000000 << ISDN_PTYPE_EURO)
223#define ISDN_FEATURE_P_NI1 (0x1000000 << ISDN_PTYPE_NI1)
224
225#define ISDN_FEATURE_P_MASK (0x0FF000000) /* Max. 8 Protocols */
226#define ISDN_FEATURE_P_SHIFT (24)
227
228typedef struct setup_parm {
229 unsigned char phone[32]; /* Remote Phone-Number */
230 unsigned char eazmsn[32]; /* Local EAZ or MSN */
231 unsigned char si1; /* Service Indicator 1 */
232 unsigned char si2; /* Service Indicator 2 */
233 unsigned char plan; /* Numbering plan */
234 unsigned char screen; /* Screening info */
235} setup_parm;
236
237
238#ifdef CONFIG_ISDN_TTY_FAX
239/* T.30 Fax G3 */
240
241#define FAXIDLEN 21
242
243typedef struct T30_s {
244 /* session parameters */
245 __u8 resolution;
246 __u8 rate;
247 __u8 width;
248 __u8 length;
249 __u8 compression;
250 __u8 ecm;
251 __u8 binary;
252 __u8 scantime;
253 __u8 id[FAXIDLEN];
254 /* additional parameters */
255 __u8 phase;
256 __u8 direction;
257 __u8 code;
258 __u8 badlin;
259 __u8 badmul;
260 __u8 bor;
261 __u8 fet;
262 __u8 pollid[FAXIDLEN];
263 __u8 cq;
264 __u8 cr;
265 __u8 ctcrty;
266 __u8 minsp;
267 __u8 phcto;
268 __u8 rel;
269 __u8 nbc;
270 /* remote station parameters */
271 __u8 r_resolution;
272 __u8 r_rate;
273 __u8 r_width;
274 __u8 r_length;
275 __u8 r_compression;
276 __u8 r_ecm;
277 __u8 r_binary;
278 __u8 r_scantime;
279 __u8 r_id[FAXIDLEN];
280 __u8 r_code;
281} __packed T30_s;
282
283#define ISDN_TTY_FAX_CONN_IN 0
284#define ISDN_TTY_FAX_CONN_OUT 1
285
286#define ISDN_TTY_FAX_FCON 0
287#define ISDN_TTY_FAX_DIS 1
288#define ISDN_TTY_FAX_FTT 2
289#define ISDN_TTY_FAX_MCF 3
290#define ISDN_TTY_FAX_DCS 4
291#define ISDN_TTY_FAX_TRAIN_OK 5
292#define ISDN_TTY_FAX_EOP 6
293#define ISDN_TTY_FAX_EOM 7
294#define ISDN_TTY_FAX_MPS 8
295#define ISDN_TTY_FAX_DTC 9
296#define ISDN_TTY_FAX_RID 10
297#define ISDN_TTY_FAX_HNG 11
298#define ISDN_TTY_FAX_DT 12
299#define ISDN_TTY_FAX_FCON_I 13
300#define ISDN_TTY_FAX_DR 14
301#define ISDN_TTY_FAX_ET 15
302#define ISDN_TTY_FAX_CFR 16
303#define ISDN_TTY_FAX_PTS 17
304#define ISDN_TTY_FAX_SENT 18
305
306#define ISDN_FAX_PHASE_IDLE 0
307#define ISDN_FAX_PHASE_A 1
308#define ISDN_FAX_PHASE_B 2
309#define ISDN_FAX_PHASE_C 3
310#define ISDN_FAX_PHASE_D 4
311#define ISDN_FAX_PHASE_E 5
312
313#endif /* TTY_FAX */
314
315#define ISDN_FAX_CLASS1_FAE 0
316#define ISDN_FAX_CLASS1_FTS 1
317#define ISDN_FAX_CLASS1_FRS 2
318#define ISDN_FAX_CLASS1_FTM 3
319#define ISDN_FAX_CLASS1_FRM 4
320#define ISDN_FAX_CLASS1_FTH 5
321#define ISDN_FAX_CLASS1_FRH 6
322#define ISDN_FAX_CLASS1_CTRL 7
323
324#define ISDN_FAX_CLASS1_OK 0
325#define ISDN_FAX_CLASS1_CONNECT 1
326#define ISDN_FAX_CLASS1_NOCARR 2
327#define ISDN_FAX_CLASS1_ERROR 3
328#define ISDN_FAX_CLASS1_FCERROR 4
329#define ISDN_FAX_CLASS1_QUERY 5
330
331typedef struct {
332 __u8 cmd;
333 __u8 subcmd;
334 __u8 para[50];
335} aux_s;
336
337#define AT_COMMAND 0
338#define AT_EQ_VALUE 1
339#define AT_QUERY 2
340#define AT_EQ_QUERY 3
341
342/* CAPI structs */
343
344/* this is compatible to the old union size */
345#define MAX_CAPI_PARA_LEN 50
346
347typedef struct {
348 /* Header */
349 __u16 Length;
350 __u16 ApplId;
351 __u8 Command;
352 __u8 Subcommand;
353 __u16 Messagenumber;
354
355 /* Parameter */
356 union {
357 __u32 Controller;
358 __u32 PLCI;
359 __u32 NCCI;
360 } adr;
361 __u8 para[MAX_CAPI_PARA_LEN];
362} capi_msg;
363
364/*
365 * Structure for exchanging above infos
366 *
367 */
368typedef struct {
369 int driver; /* Lowlevel-Driver-ID */
370 int command; /* Command or Status (see above) */
371 ulong arg; /* Additional Data */
372 union {
373 ulong errcode; /* Type of error with STAT_L1ERR */
374 int length; /* Amount of bytes sent with STAT_BSENT */
375 u_char num[50]; /* Additional Data */
376 setup_parm setup;/* For SETUP msg */
377 capi_msg cmsg; /* For CAPI like messages */
378 char display[85];/* display message data */
379 isdn_cmd_stat isdn_io; /* ISDN IO-parameter/result */
380 aux_s aux; /* for modem commands/indications */
381#ifdef CONFIG_ISDN_TTY_FAX
382 T30_s *fax; /* Pointer to ttys fax struct */
383#endif
384 ulong userdata; /* User Data */
385 } parm;
386} isdn_ctrl;
387
388#define dss1_io isdn_io
389#define ni1_io isdn_io
390
391/*
392 * The interface-struct itself (initialized at load-time of lowlevel-driver)
393 *
394 * See Documentation/isdn/INTERFACE for a description, how the communication
395 * between the ISDN subsystem and its drivers is done.
396 *
397 */
398typedef struct {
399 struct module *owner;
400
401 /* Number of channels supported by this driver
402 */
403 int channels;
404
405 /*
406 * Maximum Size of transmit/receive-buffer this driver supports.
407 */
408 int maxbufsize;
409
410 /* Feature-Flags for this driver.
411 * See defines ISDN_FEATURE_... for Values
412 */
413 unsigned long features;
414
415 /*
416 * Needed for calculating
417 * dev->hard_header_len = linklayer header + hl_hdrlen;
418 * Drivers, not supporting sk_buff's should set this to 0.
419 */
420 unsigned short hl_hdrlen;
421
422 /*
423 * Receive-Callback using sk_buff's
424 * Parameters:
425 * int Driver-ID
426 * int local channel-number (0 ...)
427 * struct sk_buff *skb received Data
428 */
429 void (*rcvcallb_skb)(int, int, struct sk_buff *);
430
431 /* Status-Callback
432 * Parameters:
433 * isdn_ctrl*
434 * driver = Driver ID.
435 * command = One of above ISDN_STAT_... constants.
436 * arg = depending on status-type.
437 * num = depending on status-type.
438 */
439 int (*statcallb)(isdn_ctrl*);
440
441 /* Send command
442 * Parameters:
443 * isdn_ctrl*
444 * driver = Driver ID.
445 * command = One of above ISDN_CMD_... constants.
446 * arg = depending on command.
447 * num = depending on command.
448 */
449 int (*command)(isdn_ctrl*);
450
451 /*
452 * Send data using sk_buff's
453 * Parameters:
454 * int driverId
455 * int local channel-number (0...)
456 * int Flag: Need ACK for this packet.
457 * struct sk_buff *skb Data to send
458 */
459 int (*writebuf_skb) (int, int, int, struct sk_buff *);
460
461 /* Send raw D-Channel-Commands
462 * Parameters:
463 * u_char pointer data
464 * int length of data
465 * int driverId
466 * int local channel-number (0 ...)
467 */
468 int (*writecmd)(const u_char __user *, int, int, int);
469
470 /* Read raw Status replies
471 * u_char pointer data (volatile)
472 * int length of buffer
473 * int driverId
474 * int local channel-number (0 ...)
475 */
476 int (*readstat)(u_char __user *, int, int, int);
477
478 char id[20];
479} isdn_if;
480
481/*
482 * Function which must be called by lowlevel-driver at loadtime with
483 * the following fields of above struct set:
484 *
485 * channels Number of channels that will be supported.
486 * hl_hdrlen Space to preserve in sk_buff's when sending. Drivers, not
487 * supporting sk_buff's should set this to 0.
488 * command Address of Command-Handler.
489 * features Bitwise coded Features of this driver. (use ISDN_FEATURE_...)
490 * writebuf_skb Address of Skbuff-Send-Handler.
491 * writecmd " " D-Channel " which accepts raw D-Ch-Commands.
492 * readstat " " D-Channel " which delivers raw Status-Data.
493 *
494 * The linklevel-driver fills the following fields:
495 *
496 * channels Driver-ID assigned to this driver. (Must be used on all
497 * subsequent callbacks.
498 * rcvcallb_skb Address of handler for received Skbuff's.
499 * statcallb " " " for status-changes.
500 *
501 */
502extern int register_isdn(isdn_if*);
503#include <linux/uaccess.h>
504
505#endif /* __ISDNIF_H__ */
include/linux/wanrouter.h+0−11
@@ -1,11 +0,0 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * wanrouter.h Legacy declarations kept around until X25 is removed
4 */
5
6#ifndef _ROUTER_H
7#define _ROUTER_H
8
9#include <uapi/linux/wanrouter.h>
10
11#endif /* _ROUTER_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t