xref: /linux/include/uapi/linux/atmsap.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*6f52b16cSGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2607ca46eSDavid Howells /* atmsap.h - ATM Service Access Point addressing definitions */
3607ca46eSDavid Howells 
4607ca46eSDavid Howells /* Written 1995-1999 by Werner Almesberger, EPFL LRC/ICA */
5607ca46eSDavid Howells 
6607ca46eSDavid Howells 
7607ca46eSDavid Howells #ifndef _LINUX_ATMSAP_H
8607ca46eSDavid Howells #define _LINUX_ATMSAP_H
9607ca46eSDavid Howells 
10607ca46eSDavid Howells #include <linux/atmapi.h>
11607ca46eSDavid Howells 
12607ca46eSDavid Howells /*
13607ca46eSDavid Howells  * BEGIN_xx and END_xx markers are used for automatic generation of
14607ca46eSDavid Howells  * documentation. Do not change them.
15607ca46eSDavid Howells  */
16607ca46eSDavid Howells 
17607ca46eSDavid Howells 
18607ca46eSDavid Howells /*
19607ca46eSDavid Howells  * Layer 2 protocol identifiers
20607ca46eSDavid Howells  */
21607ca46eSDavid Howells 
22607ca46eSDavid Howells /* BEGIN_L2 */
23607ca46eSDavid Howells #define ATM_L2_NONE	0	/* L2 not specified */
24607ca46eSDavid Howells #define ATM_L2_ISO1745  0x01	/* Basic mode ISO 1745 */
25607ca46eSDavid Howells #define ATM_L2_Q291	0x02	/* ITU-T Q.291 (Rec. I.441) */
26607ca46eSDavid Howells #define ATM_L2_X25_LL	0x06	/* ITU-T X.25, link layer */
27607ca46eSDavid Howells #define ATM_L2_X25_ML	0x07	/* ITU-T X.25, multilink */
28607ca46eSDavid Howells #define ATM_L2_LAPB	0x08	/* Extended LAPB, half-duplex (Rec. T.71) */
29607ca46eSDavid Howells #define ATM_L2_HDLC_ARM	0x09	/* HDLC ARM (ISO/IEC 4335) */
30607ca46eSDavid Howells #define ATM_L2_HDLC_NRM	0x0a	/* HDLC NRM (ISO/IEC 4335) */
31607ca46eSDavid Howells #define ATM_L2_HDLC_ABM	0x0b	/* HDLC ABM (ISO/IEC 4335) */
32607ca46eSDavid Howells #define ATM_L2_ISO8802	0x0c	/* LAN LLC (ISO/IEC 8802/2) */
33607ca46eSDavid Howells #define ATM_L2_X75	0x0d	/* ITU-T X.75, SLP */
34607ca46eSDavid Howells #define ATM_L2_Q922	0x0e	/* ITU-T Q.922 */
35607ca46eSDavid Howells #define ATM_L2_USER	0x10	/* user-specified */
36607ca46eSDavid Howells #define ATM_L2_ISO7776	0x11	/* ISO 7776 DTE-DTE */
37607ca46eSDavid Howells /* END_L2 */
38607ca46eSDavid Howells 
39607ca46eSDavid Howells 
40607ca46eSDavid Howells /*
41607ca46eSDavid Howells  * Layer 3 protocol identifiers
42607ca46eSDavid Howells  */
43607ca46eSDavid Howells 
44607ca46eSDavid Howells /* BEGIN_L3 */
45607ca46eSDavid Howells #define ATM_L3_NONE	0	/* L3 not specified */
46607ca46eSDavid Howells #define ATM_L3_X25	0x06	/* ITU-T X.25, packet layer */
47607ca46eSDavid Howells #define ATM_L3_ISO8208	0x07	/* ISO/IEC 8208 */
48607ca46eSDavid Howells #define ATM_L3_X223	0x08	/* ITU-T X.223 | ISO/IEC 8878 */
49607ca46eSDavid Howells #define ATM_L3_ISO8473	0x09	/* ITU-T X.233 | ISO/IEC 8473 */
50607ca46eSDavid Howells #define ATM_L3_T70	0x0a	/* ITU-T T.70 minimum network layer */
51607ca46eSDavid Howells #define ATM_L3_TR9577	0x0b	/* ISO/IEC TR 9577 */
52607ca46eSDavid Howells #define ATM_L3_H310	0x0c	/* ITU-T Recommendation H.310 */
53607ca46eSDavid Howells #define ATM_L3_H321	0x0d	/* ITU-T Recommendation H.321 */
54607ca46eSDavid Howells #define ATM_L3_USER	0x10	/* user-specified */
55607ca46eSDavid Howells /* END_L3 */
56607ca46eSDavid Howells 
57607ca46eSDavid Howells 
58607ca46eSDavid Howells /*
59607ca46eSDavid Howells  * High layer identifiers
60607ca46eSDavid Howells  */
61607ca46eSDavid Howells 
62607ca46eSDavid Howells /* BEGIN_HL */
63607ca46eSDavid Howells #define ATM_HL_NONE	0	/* HL not specified */
64607ca46eSDavid Howells #define ATM_HL_ISO	0x01	/* ISO */
65607ca46eSDavid Howells #define ATM_HL_USER	0x02	/* user-specific */
66607ca46eSDavid Howells #define ATM_HL_HLP	0x03	/* high layer profile - UNI 3.0 only */
67607ca46eSDavid Howells #define ATM_HL_VENDOR	0x04	/* vendor-specific application identifier */
68607ca46eSDavid Howells /* END_HL */
69607ca46eSDavid Howells 
70607ca46eSDavid Howells 
71607ca46eSDavid Howells /*
72607ca46eSDavid Howells  * ITU-T coded mode of operation
73607ca46eSDavid Howells  */
74607ca46eSDavid Howells 
75607ca46eSDavid Howells /* BEGIN_IMD */
76607ca46eSDavid Howells #define ATM_IMD_NONE	 0	/* mode not specified */
77607ca46eSDavid Howells #define ATM_IMD_NORMAL	 1	/* normal mode of operation */
78607ca46eSDavid Howells #define ATM_IMD_EXTENDED 2	/* extended mode of operation */
79607ca46eSDavid Howells /* END_IMD */
80607ca46eSDavid Howells 
81607ca46eSDavid Howells /*
82607ca46eSDavid Howells  * H.310 code points
83607ca46eSDavid Howells  */
84607ca46eSDavid Howells 
85607ca46eSDavid Howells #define ATM_TT_NONE	0	/* terminal type not specified */
86607ca46eSDavid Howells #define ATM_TT_RX	1	/* receive only */
87607ca46eSDavid Howells #define ATM_TT_TX	2	/* send only */
88607ca46eSDavid Howells #define ATM_TT_RXTX	3	/* receive and send */
89607ca46eSDavid Howells 
90607ca46eSDavid Howells #define ATM_MC_NONE	0	/* no multiplexing */
91607ca46eSDavid Howells #define ATM_MC_TS	1	/* transport stream (TS) */
92607ca46eSDavid Howells #define ATM_MC_TS_FEC	2	/* transport stream with forward error corr. */
93607ca46eSDavid Howells #define ATM_MC_PS	3	/* program stream (PS) */
94607ca46eSDavid Howells #define ATM_MC_PS_FEC	4	/* program stream with forward error corr. */
95607ca46eSDavid Howells #define ATM_MC_H221	5	/* ITU-T Rec. H.221 */
96607ca46eSDavid Howells 
97607ca46eSDavid Howells /*
98607ca46eSDavid Howells  * SAP structures
99607ca46eSDavid Howells  */
100607ca46eSDavid Howells 
101607ca46eSDavid Howells #define ATM_MAX_HLI	8	/* maximum high-layer information length */
102607ca46eSDavid Howells 
103607ca46eSDavid Howells 
104607ca46eSDavid Howells struct atm_blli {
105607ca46eSDavid Howells     unsigned char l2_proto;	/* layer 2 protocol */
106607ca46eSDavid Howells     union {
107607ca46eSDavid Howells 	struct {
108607ca46eSDavid Howells 	    unsigned char mode;	/* mode of operation (ATM_IMD_xxx), 0 if */
109607ca46eSDavid Howells 				/* absent */
110607ca46eSDavid Howells 	    unsigned char window; /* window size (k), 1-127 (0 to omit) */
111607ca46eSDavid Howells 	} itu;			/* ITU-T encoding */
112607ca46eSDavid Howells 	unsigned char user;	/* user-specified l2 information */
113607ca46eSDavid Howells     } l2;
114607ca46eSDavid Howells     unsigned char l3_proto;	/* layer 3 protocol */
115607ca46eSDavid Howells     union {
116607ca46eSDavid Howells 	struct {
117607ca46eSDavid Howells 	    unsigned char mode;	/* mode of operation (ATM_IMD_xxx), 0 if */
118607ca46eSDavid Howells 				/* absent */
119607ca46eSDavid Howells 	    unsigned char def_size; /* default packet size (log2), 4-12 (0 to */
120607ca46eSDavid Howells 				    /* omit) */
121607ca46eSDavid Howells 	    unsigned char window;/* packet window size, 1-127 (0 to omit) */
122607ca46eSDavid Howells 	} itu;			/* ITU-T encoding */
123607ca46eSDavid Howells 	unsigned char user;	/* user specified l3 information */
124607ca46eSDavid Howells 	struct {		      /* if l3_proto = ATM_L3_H310 */
125607ca46eSDavid Howells 	    unsigned char term_type;  /* terminal type */
126607ca46eSDavid Howells 	    unsigned char fw_mpx_cap; /* forward multiplexing capability */
127607ca46eSDavid Howells 				      /* only if term_type != ATM_TT_NONE */
128607ca46eSDavid Howells 	    unsigned char bw_mpx_cap; /* backward multiplexing capability */
129607ca46eSDavid Howells 				      /* only if term_type != ATM_TT_NONE */
130607ca46eSDavid Howells 	} h310;
131607ca46eSDavid Howells 	struct {		  /* if l3_proto = ATM_L3_TR9577 */
132607ca46eSDavid Howells 	    unsigned char ipi;	  /* initial protocol id */
133607ca46eSDavid Howells 	    unsigned char snap[5];/* IEEE 802.1 SNAP identifier */
134607ca46eSDavid Howells 				  /* (only if ipi == NLPID_IEEE802_1_SNAP) */
135607ca46eSDavid Howells 	} tr9577;
136607ca46eSDavid Howells     } l3;
137607ca46eSDavid Howells } __ATM_API_ALIGN;
138607ca46eSDavid Howells 
139607ca46eSDavid Howells 
140607ca46eSDavid Howells struct atm_bhli {
141607ca46eSDavid Howells     unsigned char hl_type;	/* high layer information type */
142607ca46eSDavid Howells     unsigned char hl_length;	/* length (only if hl_type == ATM_HL_USER || */
143607ca46eSDavid Howells 				/* hl_type == ATM_HL_ISO) */
144607ca46eSDavid Howells     unsigned char hl_info[ATM_MAX_HLI];/* high layer information */
145607ca46eSDavid Howells };
146607ca46eSDavid Howells 
147607ca46eSDavid Howells 
148607ca46eSDavid Howells #define ATM_MAX_BLLI	3		/* maximum number of BLLI elements */
149607ca46eSDavid Howells 
150607ca46eSDavid Howells 
151607ca46eSDavid Howells struct atm_sap {
152607ca46eSDavid Howells 	struct atm_bhli bhli;		/* local SAP, high-layer information */
153607ca46eSDavid Howells 	struct atm_blli blli[ATM_MAX_BLLI] __ATM_API_ALIGN;
154607ca46eSDavid Howells 					/* local SAP, low-layer info */
155607ca46eSDavid Howells };
156607ca46eSDavid Howells 
157607ca46eSDavid Howells 
blli_in_use(struct atm_blli blli)158607ca46eSDavid Howells static __inline__ int blli_in_use(struct atm_blli blli)
159607ca46eSDavid Howells {
160607ca46eSDavid Howells 	return blli.l2_proto || blli.l3_proto;
161607ca46eSDavid Howells }
162607ca46eSDavid Howells 
163607ca46eSDavid Howells #endif
164