xref: /utopia/UTPA2-700.0.x/projects/tools/lint/mips-linux-gnu_include/linux/if_frad.h (revision 53ee8cc121a030b8d368113ac3e966b4705770ef)
1 /*
2  * DLCI/FRAD	Definitions for Frame Relay Access Devices.  DLCI devices are
3  *		created for each DLCI associated with a FRAD.  The FRAD driver
4  *		is not truly a network device, but the lower level device
5  *		handler.  This allows other FRAD manufacturers to use the DLCI
6  *		code, including its RFC1490 encapsulation alongside the current
7  *		implementation for the Sangoma cards.
8  *
9  * Version:	@(#)if_ifrad.h	0.15	31 Mar 96
10  *
11  * Author:	Mike McLagan <mike.mclagan@linux.org>
12  *
13  * Changes:
14  *		0.15	Mike McLagan	changed structure defs (packed)
15  *					re-arranged flags
16  *					added DLCI_RET vars
17  *
18  *		This program is free software; you can redistribute it and/or
19  *		modify it under the terms of the GNU General Public License
20  *		as published by the Free Software Foundation; either version
21  *		2 of the License, or (at your option) any later version.
22  */
23 
24 #ifndef _FRAD_H_
25 #define _FRAD_H_
26 
27 #include <linux/if.h>
28 
29 #if defined(CONFIG_DLCI) || defined(CONFIG_DLCI_MODULE)
30 
31 /* Structures and constants associated with the DLCI device driver */
32 
33 struct dlci_add
34 {
35    char  devname[IFNAMSIZ];
36    short dlci;
37 };
38 
39 #define DLCI_GET_CONF	(SIOCDEVPRIVATE + 2)
40 #define DLCI_SET_CONF	(SIOCDEVPRIVATE + 3)
41 
42 /*
43  * These are related to the Sangoma SDLA and should remain in order.
44  * Code within the SDLA module is based on the specifics of this
45  * structure.  Change at your own peril.
46  */
47 struct dlci_conf {
48    short flags;
49    short CIR_fwd;
50    short Bc_fwd;
51    short Be_fwd;
52    short CIR_bwd;
53    short Bc_bwd;
54    short Be_bwd;
55 
56 /* these are part of the status read */
57    short Tc_fwd;
58    short Tc_bwd;
59    short Tf_max;
60    short Tb_max;
61 
62 /* add any new fields here above is a mirror of sdla_dlci_conf */
63 };
64 
65 #define DLCI_GET_SLAVE	(SIOCDEVPRIVATE + 4)
66 
67 /* configuration flags for DLCI */
68 #define DLCI_IGNORE_CIR_OUT	0x0001
69 #define DLCI_ACCOUNT_CIR_IN	0x0002
70 #define DLCI_BUFFER_IF		0x0008
71 
72 #define DLCI_VALID_FLAGS	0x000B
73 
74 /* FRAD driver uses these to indicate what it did with packet */
75 #define DLCI_RET_OK		0x00
76 #define DLCI_RET_ERR		0x01
77 #define DLCI_RET_DROP		0x02
78 
79 /* defines for the actual Frame Relay hardware */
80 #define FRAD_GET_CONF	(SIOCDEVPRIVATE)
81 #define FRAD_SET_CONF	(SIOCDEVPRIVATE + 1)
82 
83 #define FRAD_LAST_IOCTL	FRAD_SET_CONF
84 
85 /*
86  * Based on the setup for the Sangoma SDLA.  If changes are
87  * necessary to this structure, a routine will need to be
88  * added to that module to copy fields.
89  */
90 struct frad_conf
91 {
92    short station;
93    short flags;
94    short kbaud;
95    short clocking;
96    short mtu;
97    short T391;
98    short T392;
99    short N391;
100    short N392;
101    short N393;
102    short CIR_fwd;
103    short Bc_fwd;
104    short Be_fwd;
105    short CIR_bwd;
106    short Bc_bwd;
107    short Be_bwd;
108 
109 /* Add new fields here, above is a mirror of the sdla_conf */
110 
111 };
112 
113 #define FRAD_STATION_CPE	0x0000
114 #define FRAD_STATION_NODE	0x0001
115 
116 #define FRAD_TX_IGNORE_CIR	0x0001
117 #define FRAD_RX_ACCOUNT_CIR	0x0002
118 #define FRAD_DROP_ABORTED	0x0004
119 #define FRAD_BUFFERIF		0x0008
120 #define FRAD_STATS		0x0010
121 #define FRAD_MCI		0x0100
122 #define FRAD_AUTODLCI		0x8000
123 #define FRAD_VALID_FLAGS	0x811F
124 
125 #define FRAD_CLOCK_INT		0x0001
126 #define FRAD_CLOCK_EXT		0x0000
127 
128 
129 #endif /* CONFIG_DLCI || CONFIG_DLCI_MODULE */
130 
131 
132 #endif
133