1 /* $MirOS: src/sys/netisdn/i4b_ioctl.h,v 1.2 2005/03/06 21:28:26 tg Exp $ */
2 
3 /*
4  * Copyright (c) 1997, 2000 Hellmuth Michaelis. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  *
27  *---------------------------------------------------------------------------
28  *
29  *	i4b_ioctl.h - messages kernel <--> userland
30  *
31  *---------------------------------------------------------------------------*/
32 
33 #ifndef _I4B_IOCTL_H_
34 #define _I4B_IOCTL_H_
35 
36 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
37 #ifndef _MACHINE_TYPES_H_
38 #include <machine/types.h>
39 #endif /* _MACHINE_TYPES_H_ */
40 #endif /* __FreeBSD__ */
41 
42 /*---------------------------------------------------------------------------*
43  *	version and release number for isdn4bsd package
44  *---------------------------------------------------------------------------*/
45 #define	VERSION		0		/* version number	*/
46 #define	REL		96		/* release number	*/
47 #define STEP		00		/* release step		*/
48 
49 /*---------------------------------------------------------------------------*
50  * date/time format in i4b log messages
51  * ------------------------------------
52  * Being year 2000 clean is not easy with the current state of the
53  * ANSI C library standard and it's implementation for some locales.
54  * You might like to use the "%c" format of "strftime" sometimes,
55  * but this breaks Y2K in some locales. Also the old standard logfile
56  * format "%d.%m.%y %H:%M:%S" is non compliant.
57  * NetBSD's current toolset warns about this problems, and we compile
58  * with -Werror, so this problems need to be resolved.
59  *---------------------------------------------------------------------------*/
60 #define I4B_TIME_FORMAT	"%d.%m.%Y %H:%M:%S"
61 
62 /*---------------------------------------------------------------------------*
63  *	ISDN D-channel protocols
64  *---------------------------------------------------------------------------*/
65 #define PROTOCOL_DSS1	0		/* default, Euro-ISDN/DSS1 */
66 #define PROTOCOL_D64S	1		/* 64k leased line, no protocol */
67 
68 /*---------------------------------------------------------------------------*
69  *	max length of some strings
70  *---------------------------------------------------------------------------*/
71 #define TELNO_MAX	41  /* max length of a telephone number (+ '\0')  */
72 #define	SUBADDR_MAX	22  /* max length of subaddres IE		  */
73 #define DISPLAY_MAX	91  /* max length of display information (+ '\0') */
74 #define DATETIME_MAX	21  /* max length of datetime information (+ '\0')*/
75 
76 /*---------------------------------------------------------------------------*
77  *	in case the src or dst telephone number is empty
78  *---------------------------------------------------------------------------*/
79 #define TELNO_EMPTY	"NotAvailable"
80 
81 /*---------------------------------------------------------------------------*
82  *	B channel parameters
83  *---------------------------------------------------------------------------*/
84 #define BCH_MAX_DATALEN	2048	/* max length of a B channel frame */
85 
86 /*---------------------------------------------------------------------------*
87  * B channel protocol
88  *---------------------------------------------------------------------------*/
89 #define BPROT_NONE	0	/* no protocol at all, raw data		*/
90 #define BPROT_RHDLC	1	/* raw HDLC: flag, data, crc, flag	*/
91 
92 /*---------------------------------------------------------------------------*
93  * causes data type
94  *---------------------------------------------------------------------------*/
95 typedef	unsigned int cause_t;		/* 32 bit unsigned int	*/
96 
97 /*---------------------------------------------------------------------------*
98  * call descriptor id (cdid) definitions
99  *---------------------------------------------------------------------------*/
100 #define CDID_UNUSED	0	/* cdid is invalid and unused		*/
101 #define CDID_MAX	99999	/* highest valid cdid, wraparound to 1	*/
102 
103 /*---------------------------------------------------------------------------*
104  *	The shorthold algorithm to use
105  *---------------------------------------------------------------------------*/
106 #define SHA_FIXU	0    /* timeout algorithm for fix unit charging */
107 #define SHA_VARU	1    /* timeout algorithm for variable unit charging */
108 
109 /*---------------------------------------------------------------------------*
110  *	The shorthold data struct
111  *---------------------------------------------------------------------------*/
112 typedef struct {
113 	int	shorthold_algorithm;	/* shorthold algorithm to use	*/
114 	int	unitlen_time;		/* length of a charging unit	*/
115 	int	idle_time;		/* time without activity on b ch*/
116 	int	earlyhup_time;		/* safety area at end of unit	*/
117 } msg_shorthold_t;
118 
119 
120 /****************************************************************************
121 
122 	outgoing call:
123 	--------------
124 
125 		userland		kernel
126 		--------		------
127 
128 		CDID_REQ ----------------->
129 
130 	            <------------------ cdid
131 
132 		CONNECT_REQ -------------->
133 
134 		    <------------------ PROCEEDING_IND (if connect req ok)
135 
136 	            <------------------ CONNECT_ACTIVE_IND (if connection ok)
137 
138 		or
139 
140 	            <------------------ DISCONNECT_IND (if connection failed)
141 
142 
143 
144 	incoming call:
145 	--------------
146 
147 		userland		kernel
148 		--------		------
149 
150 	            <------------------ CONNECT_IND
151 
152 		CONNECT_RESP ------------->
153 
154 	            <------------------ CONNECT_ACTIVE_IND (if accepted)
155 
156 
157 
158 	active disconnect:
159 	------------------
160 
161 		userland		kernel
162 		--------		------
163 
164 		DISCONNECT_REQ ------------>
165 
166 	            <------------------ DISCONNECT_IND
167 
168 
169 	passive disconnect:
170 	-------------------
171 
172 		userland		kernel
173 		--------		------
174 
175 	            <------------------ DISCONNECT_IND
176 
177 
178 ****************************************************************************/
179 
180 
181 /*===========================================================================*
182  *===========================================================================*
183  *	"read" messages from kernel -> userland
184  *===========================================================================*
185  *===========================================================================*/
186 
187 
188 /*---------------------------------------------------------------------------*
189  *	message header, included in every message
190  *---------------------------------------------------------------------------*/
191 typedef struct {
192 	char		type;		/* message identifier		*/
193 #define MSG_CONNECT_IND		'a'
194 #define MSG_CONNECT_ACTIVE_IND	'b'
195 #define MSG_DISCONNECT_IND	'c'
196 #define MSG_DIALOUT_IND		'd'
197 #define MSG_IDLE_TIMEOUT_IND	'e'
198 #define MSG_ACCT_IND		'f'
199 #define MSG_CHARGING_IND	'g'
200 #define MSG_PROCEEDING_IND	'h'
201 #define MSG_ALERT_IND		'i'
202 #define MSG_DRVRDISC_REQ	'j'
203 #define MSG_L12STAT_IND		'k'
204 #define MSG_TEIASG_IND		'l'
205 #define MSG_PDEACT_IND		'm'
206 #define	MSG_NEGCOMP_IND		'n'
207 #define	MSG_IFSTATE_CHANGED_IND	'o'
208 #define MSG_DIALOUTNUMBER_IND	'p'
209 #define MSG_PACKET_IND		'q'
210 #define	MSG_CONTR_EV_IND	'r'
211 	int		cdid;		/* call descriptor id		*/
212 } msg_hdr_t;
213 
214 /*---------------------------------------------------------------------------*
215  *	connect indication
216  *		indicates incoming connection
217  *---------------------------------------------------------------------------*/
218 typedef struct {
219 	msg_hdr_t	header;		/* common header		*/
220 	int		controller;	/* controller number		*/
221 	int		channel;	/* channel number		*/
222 #define  CHAN_B1  0		/* this _must_ be 0, HSCX B1 is also 0	*/
223 #define  CHAN_B2  1		/* this _must_ be 1, HSCX B2 is also 1	*/
224 #define  CHAN_ANY (-1)		/* outgoing, not possible for incoming	*/
225 #define  CHAN_NO  (-2)		/* call waiting (CW) for incoming	*/
226 	int		bprot;	/* b channel protocot, see BPROT_XXX	*/
227 	char		dst_telno[TELNO_MAX];	/* destination telno	*/
228 	char		src_telno[TELNO_MAX];	/* source telno		*/
229 	int		scr_ind;/* screening indicator			*/
230 #define  SCR_NONE     0		/* no screening indicator transmitted	*/
231 #define  SCR_USR_NOSC 1		/* screening user provided, not screened*/
232 #define  SCR_USR_PASS 2		/* screening user provided, verified & passed */
233 #define  SCR_USR_FAIL 3		/* screening user provided, verified & failed */
234 #define  SCR_NET      4		/* screening network provided		*/
235 	int		prs_ind;/* presentation indicator		*/
236 #define  PRS_NONE     0		/* no presentation indicator transmitted*/
237 #define  PRS_ALLOWED  1		/* presentation allowed			*/
238 #define  PRS_RESTRICT 2		/* presentation restricted		*/
239 #define  PRS_NNINTERW 3		/* number not available due to interworking */
240 #define  PRS_RESERVED 4		/* reserved				*/
241 	char		display[DISPLAY_MAX];	/* content of display IE*/
242 	u_int8_t	src_subaddr[SUBADDR_MAX];
243 	u_int8_t	dest_subaddr[SUBADDR_MAX];
244 	u_int8_t	type_plan;
245 } msg_connect_ind_t;
246 
247 /*---------------------------------------------------------------------------*
248  *	connect active indication
249  *		indicates active connection
250  *---------------------------------------------------------------------------*/
251 typedef struct {
252 	msg_hdr_t	header;		/* common header		   */
253 	int		controller;	/* controller number actually used */
254 	int		channel;	/* channel number actually used    */
255 	char		datetime[DATETIME_MAX];	/* content of date/time IE */
256 } msg_connect_active_ind_t;
257 
258 /*---------------------------------------------------------------------------*
259  *	disconnect indication
260  *		indicates a disconnect
261  *---------------------------------------------------------------------------*/
262 typedef struct {
263 	msg_hdr_t	header;		/* common header	*/
264 	cause_t		cause;		/* cause code		*/
265 } msg_disconnect_ind_t;
266 
267 /*---------------------------------------------------------------------------*
268  *	negotiation complete
269  *		indicates an interface is completely up & running
270  *---------------------------------------------------------------------------*/
271 typedef struct {
272 	msg_hdr_t	header;		/* common header	*/
273 } msg_negcomplete_ind_t;
274 
275 /*---------------------------------------------------------------------------*
276  *	interface changes internal state
277  *		indicates an interface has somehow switched its FSM
278  *---------------------------------------------------------------------------*/
279 typedef struct {
280 	msg_hdr_t	header;		/* common header	*/
281 	int state;			/* new interface state */
282 } msg_ifstatechg_ind_t;
283 
284 /*---------------------------------------------------------------------------*
285  *	initiate a call to a remote site
286  *		i.e. the IP driver got a packet and wants a connection
287  *---------------------------------------------------------------------------*/
288 typedef struct {
289 	msg_hdr_t	header;		/* common header	*/
290 	int		driver;		/* driver type		*/
291 	int		driver_unit;	/* driver unit number	*/
292 } msg_dialout_ind_t;
293 
294 /*---------------------------------------------------------------------------*
295  *	dial a number
296  *---------------------------------------------------------------------------*/
297 typedef struct {
298 	msg_hdr_t	header;		/* common header	*/
299 	int		driver;		/* driver type		*/
300 	int		driver_unit;	/* driver unit number	*/
301 	int		cmdlen;		/* length of string	*/
302 	char		cmd[TELNO_MAX];	/* the number to dial	*/
303 } msg_dialoutnumber_ind_t;
304 
305 /*---------------------------------------------------------------------------*
306  *	idle timeout disconnect sent indication
307  *		kernel has sent disconnect request because of b-ch idle
308  *---------------------------------------------------------------------------*/
309 typedef struct {
310 	msg_hdr_t	header;		/* common header	*/
311 } msg_idle_timeout_ind_t;
312 
313 /*---------------------------------------------------------------------------*
314  *	accounting information from userland interface driver to daemon
315  *---------------------------------------------------------------------------*/
316 typedef struct {
317 	msg_hdr_t	header;		/* common header		*/
318 	int		accttype;	/* accounting type		*/
319 #define  ACCT_DURING 0
320 #define  ACCT_FINAL  1
321 	int		ioutbytes;	/* ISDN # of bytes sent		*/
322 	int		iinbytes;	/* ISDN # of bytes received	*/
323 	int		outbps;		/* bytes per sec out		*/
324 	int		inbps;		/* bytes per sec in		*/
325 	int		outbytes;	/* driver # of bytes sent	*/
326 	int		inbytes;	/* driver # of bytes received	*/
327 } msg_accounting_ind_t;
328 
329 /*---------------------------------------------------------------------------*
330  *	charging information from isdn driver to daemon
331  *---------------------------------------------------------------------------*/
332 typedef struct {
333 	msg_hdr_t	header;		/* common header		*/
334 	int		units;		/* number of units		*/
335 	int		units_type;	/* type of units info		*/
336 #define  CHARGE_INVALID	0	/* invalid, unknown */
337 #define  CHARGE_AOCD	1	/* advice of charge during call */
338 #define  CHARGE_AOCE	2	/* advice of charge at end of call */
339 #define  CHARGE_CALC	3	/* locally calculated from rates information */
340 } msg_charging_ind_t;
341 
342 /*---------------------------------------------------------------------------*
343  *	call proceeding indication
344  *		indicates outgoing SETUP has been acknowleged
345  *---------------------------------------------------------------------------*/
346 typedef struct {
347 	msg_hdr_t	header;		/* common header		   */
348 	int		controller;	/* controller number actually used */
349 	int		channel;	/* channel number actually used    */
350 } msg_proceeding_ind_t;
351 
352 /*---------------------------------------------------------------------------*
353  *	alert indication
354  *		indicates remote user side "rings"
355  *---------------------------------------------------------------------------*/
356 typedef struct {
357 	msg_hdr_t	header;		/* common header		   */
358 } msg_alert_ind_t;
359 
360 /*---------------------------------------------------------------------------*
361  *	driver requests to disconnect line
362  *---------------------------------------------------------------------------*/
363 typedef struct {
364 	msg_hdr_t	header;		/* common header	*/
365 } msg_drvrdisc_req_t;
366 
367 /*---------------------------------------------------------------------------*
368  *	connect packet logging
369  *---------------------------------------------------------------------------*/
370 
371 typedef struct {
372 	msg_hdr_t	header;		/* common header	*/
373 	int		driver;		/* driver type		*/
374 	int		driver_unit;	/* driver unit number	*/
375 	int		direction;	/* 0=in 1=out		*/
376 #define DIRECTION_IN	0		/* sending packet to remote	*/
377 #define DIRECTION_OUT	1		/* received packet from remote	*/
378 #define MAX_PACKET_LOG	40		/* space for IP and TCP header	*/
379 	u_int8_t	pktdata[MAX_PACKET_LOG];
380 } msg_packet_ind_t;
381 
382 /*---------------------------------------------------------------------------*
383  *	state of layer 1/2
384  *---------------------------------------------------------------------------*/
385 typedef struct {
386 	msg_hdr_t	header;		/* common header	*/
387 	int		controller;	/* controller unit 	*/
388 	int		layer;		/* layer number (1/2)	*/
389 #define LAYER_ONE	1
390 #define LAYER_TWO	2
391 	int		state;		/* state info		*/
392 #define LAYER_IDLE	0
393 #define LAYER_ACTIVE	1
394 } msg_l12stat_ind_t;
395 
396 /*---------------------------------------------------------------------------*
397  *	TEI assignment messages
398  *---------------------------------------------------------------------------*/
399 typedef struct {
400 	msg_hdr_t	header;		/* common header	*/
401 	int		controller;	/* controller unit 	*/
402 	int		tei;		/* TEI or -1 if invalid */
403 } msg_teiasg_ind_t;
404 
405 /*---------------------------------------------------------------------------*
406  *	persistent deactivation state of stack
407  *---------------------------------------------------------------------------*/
408 typedef struct {
409 	msg_hdr_t	header;		/* common header	*/
410 	int		controller;	/* controller unit 	*/
411 	int		numactive;	/* number of active connections */
412 } msg_pdeact_ind_t;
413 
414 /*---------------------------------------------------------------------------*
415  *	connect indication
416  *		indicates incoming connection
417  *---------------------------------------------------------------------------*/
418 typedef struct {
419 	msg_hdr_t	header;		/* common header		*/
420 	int		controller;	/* controller number		*/
421 	int		event;
422 #define CTRL_EV_IND_DETACH	0
423 #define CTRL_EV_IND_ATTACH	1
424 } msg_ctrl_ev_ind_t;
425 
426 /*===========================================================================*
427  *===========================================================================*
428  *	"ioctl" messages from userland -> kernel
429  *===========================================================================*
430  *===========================================================================*/
431 
432 /*---------------------------------------------------------------------------*
433  *	request a unique cdid (to setup an outgoing call)
434  *---------------------------------------------------------------------------*/
435 typedef struct {
436 	int		cdid;			/* call descriptor id	*/
437 } msg_cdid_req_t;
438 
439 #define	I4B_CDID_REQ		_IOWR('4', 0, int)
440 
441 /*---------------------------------------------------------------------------*
442  *	connect request
443  *		requests an outgoing connection
444  *---------------------------------------------------------------------------*/
445 typedef struct {
446 	int		cdid;		/* call descriptor id		     */
447 	int		controller;	/* controller to use		     */
448 	int		channel;	/* channel to use		     */
449 	int		txdelay;	/* tx delay after connect	     */
450 	int		bprot;		/* b channel protocol		     */
451 	int		driver;		/* driver to route b channel data to */
452 	int		driver_unit;	/*      unit number for above driver */
453 	msg_shorthold_t	shorthold_data;	/* the shorthold data		     */
454 	int		unitlen_method;	/* how to calculate the unitlength   */
455 #define  ULEN_METHOD_STATIC  0	/* use unitlen_time value (see above) */
456 #define  ULEN_METHOD_DYNAMIC 1	/* use AOCD */
457 	char		dst_telno[TELNO_MAX];	/* destination telephone no  */
458 	char		src_telno[TELNO_MAX];	/* source telephone number   */
459 } msg_connect_req_t;
460 
461 #define	I4B_CONNECT_REQ	_IOW('4', 1, msg_connect_req_t)
462 
463 /*---------------------------------------------------------------------------*
464  *	connect response
465  *		this is the answer to an incoming connect indication
466  *---------------------------------------------------------------------------*/
467 typedef struct {
468 	int	cdid;		/* call descriptor id			*/
469 	int	response;	/* what to do with incoming call	*/
470 #define  SETUP_RESP_DNTCRE 0	/* dont care, call is not for me	*/
471 #define  SETUP_RESP_REJECT 1	/* reject call				*/
472 #define  SETUP_RESP_ACCEPT 2	/* accept call				*/
473 	cause_t	cause;		/* cause for case SETUP_RESP_REJECT	*/
474 		/* the following are only used for SETUP_RESP_ACCEPT !! */
475 	int	txdelay;	/* tx delay after connect		*/
476 	int	bprot;		/* B chan protocol			*/
477 	int	driver;		/* driver to route b channel data to	*/
478 	int	driver_unit;	/*      unit number for above driver	*/
479 	int	max_idle_time;	/* max time without activity on b ch	*/
480 } msg_connect_resp_t;
481 
482 #define	I4B_CONNECT_RESP	_IOW('4', 2, msg_connect_resp_t)
483 
484 /*---------------------------------------------------------------------------*
485  *	disconnect request
486  *		active disconnect request
487  *---------------------------------------------------------------------------*/
488 typedef struct {
489 	int	cdid;		/* call descriptor id			*/
490 	cause_t	cause;		/* protocol independent cause		*/
491 } msg_discon_req_t;
492 
493 #define	I4B_DISCONNECT_REQ	_IOW('4', 3, msg_discon_req_t)
494 
495 /*---------------------------------------------------------------------------*
496  *	controller info request
497  *---------------------------------------------------------------------------*/
498 typedef struct {
499 	int	controller;	/* controller number			*/
500 	int	ncontroller;	/* number of controllers in system	*/
501 	int	max_isdnif;	/* highest available ISDN interface num */
502 	int	tei;		/* tei controller probably has		*/
503 	char	devname[64];	/* autoconfig device name, i.e. "isic0"	*/
504 	char	cardname[80];	/* human readable brand / version	*/
505 	int	nbch;		/* number of B channels provided	*/
506 } msg_ctrl_info_req_t;
507 
508 #define	I4B_CTRL_INFO_REQ	_IOWR('4', 4, msg_ctrl_info_req_t)
509 
510 /*---------------------------------------------------------------------------*
511  *	dialout response
512  *		status report to driver who requested a dialout
513  *---------------------------------------------------------------------------*/
514 typedef struct {
515 	int		driver;		/* driver to route b channel data to */
516 	int		driver_unit;	/*      unit number for above driver */
517 	int		stat;		/* state of dialout request	     */
518 #define  DSTAT_NONE	0
519 #define  DSTAT_TFAIL	1		/* transient failure */
520 #define  DSTAT_PFAIL	2		/* permanent failure */
521 #define  DSTAT_INONLY	3		/* no outgoing dials allowed */
522 	cause_t		cause;		/* exact i4b cause */
523 } msg_dialout_resp_t;
524 
525 #define	I4B_DIALOUT_RESP	_IOW('4', 5, msg_dialout_resp_t)
526 
527 /*---------------------------------------------------------------------------*
528  *	timeout value update
529  *---------------------------------------------------------------------------*/
530 typedef struct {
531 	int	cdid;		/* call descriptor id			*/
532 	msg_shorthold_t	shorthold_data;
533 } msg_timeout_upd_t;
534 
535 #define	I4B_TIMEOUT_UPD		_IOW('4', 6, msg_timeout_upd_t)
536 
537 /*---------------------------------------------------------------------------*
538  *	soft enable/disable
539  *---------------------------------------------------------------------------*/
540 typedef struct {
541 	int		driver;		/* driver to route b channel data to */
542 	int		driver_unit;	/*      unit number for above driver */
543 	int		updown;		/* what to do			     */
544 #define  SOFT_ENA	0	/* enable interface */
545 #define  SOFT_DIS	1	/* disable interface */
546 } msg_updown_ind_t;
547 
548 #define	I4B_UPDOWN_IND		_IOW('4', 7, msg_updown_ind_t)
549 
550 /*---------------------------------------------------------------------------*
551  *	send alert request
552  *---------------------------------------------------------------------------*/
553 typedef struct {
554 	int	cdid;		/* call descriptor id			*/
555 } msg_alert_req_t;
556 
557 #define	I4B_ALERT_REQ		_IOW('4', 8, msg_alert_req_t)
558 
559 /*---------------------------------------------------------------------------*
560  *	request version and release info from kernel part
561  *	(msg_vr_req_t is also used by tel & rbch drivers)
562  *---------------------------------------------------------------------------*/
563 typedef struct {
564 	int	version;	/* version number */
565 	int	release;	/* release number */
566 	int	step;		/* release step number */
567 } msg_vr_req_t;
568 
569 #define I4B_VR_REQ              _IOR('4', 9, msg_vr_req_t)
570 
571 /*---------------------------------------------------------------------------*
572  *	set ISDN protocol used by a controller
573  *---------------------------------------------------------------------------*/
574 typedef struct {
575 	int	controller;	/* controller number		*/
576 	int	protocol;	/* ISDN D-channel protocol type	*/
577 } msg_prot_ind_t;
578 
579 #define I4B_PROT_IND		_IOW('4', 10, msg_prot_ind_t)
580 
581 /*---------------------------------------------------------------------------*
582  *	Query the identifier for a B channel driver
583  *---------------------------------------------------------------------------*/
584 #define	L4DRIVER_NAME_SIZ	16
585 typedef struct {
586 	char name[L4DRIVER_NAME_SIZ];	/* lookup this driver */
587 	int  driver_id;			/* returned driver id */
588 } msg_l4driver_lookup_t;
589 
590 #define I4B_L4DRIVER_LOOKUP	_IOWR('4', 11, msg_l4driver_lookup_t)
591 
592 /*---------------------------------------------------------------------------*
593  *	Protocol download to active cards
594  *---------------------------------------------------------------------------*/
595 struct isdn_dr_prot {
596 	size_t bytecount;	/* length of code */
597 	u_int8_t *microcode;	/* pointer to microcode */
598 };
599 
600 struct isdn_download_request {
601 	int controller;		/* controller number */
602 	int numprotos;		/* number of protocols in 'protocols' */
603 	struct isdn_dr_prot *protocols;
604 };
605 
606 #define	I4B_CTRL_DOWNLOAD	_IOW('4', 100, struct isdn_download_request)
607 
608 /*---------------------------------------------------------------------------*
609  *	Generic diagnostic interface for active cards
610  *---------------------------------------------------------------------------*/
611 struct isdn_diagnostic_request {
612 	int controller;		/* controller number */
613 	u_int32_t cmd;		/* diagnostic command to execute */
614 	size_t in_param_len;	/* length of additional input parameter */
615 #define I4B_ACTIVE_DIAGNOSTIC_MAXPARAMLEN	65536
616 	void *in_param;		/* optional input parameter */
617 	size_t out_param_len;	/* available output space */
618 	void *out_param;	/* output data goes here */
619 };
620 
621 #define	I4B_ACTIVE_DIAGNOSTIC	_IOW('4', 102, struct isdn_diagnostic_request)
622 
623 #endif /* _I4B_IOCTL_H_ */
624