comparison src/g23m-gprs/llc/llc_uf.h @ 1:d393cd9bb723

src/g23m-*: initial import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 04:40:46 +0000
parents
children
comparison
equal deleted inserted replaced
0:b6a5e36de839 1:d393cd9bb723
1 /*
2 +-----------------------------------------------------------------------------
3 | Project :
4 | Modul :
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : Definitions for llc_uf.c
18 +-----------------------------------------------------------------------------
19 */
20
21
22 #ifndef LLC_UF_H
23 #define LLC_UF_H
24
25
26 /*==== XID DEFINITIONS ======================================================*/
27
28 /*
29 * XID parameter types
30 */
31 #define XID_VERSION 0
32 #define XID_IOV_UI 1
33 #define XID_IOV_I 2
34 #define XID_T200 3
35 #define XID_N200 4
36 #define XID_N201_U 5
37 #define XID_N201_I 6
38 #define XID_MD 7
39 #define XID_MU 8
40 #define XID_KD 9
41 #define XID_KU 10
42 #define XID_LAYER_3 11
43 #define XID_RESET 12
44
45 #define XID_MAX_TYPE XID_RESET
46
47 /*
48 * XID parameter lengths in octets
49 */
50 #define XID_VERSION_LEN 1
51 #define XID_IOV_UI_LEN 4
52 #define XID_IOV_I_LEN 4
53 #define XID_T200_LEN 2
54 #define XID_N200_LEN 1
55 #define XID_N201_U_LEN 2
56 #define XID_N201_I_LEN 2
57 #define XID_MD_LEN 2
58 #define XID_MU_LEN 2
59 #define XID_KD_LEN 1
60 #define XID_KU_LEN 1
61 /* no default length for layer 3 parameters */
62 #define XID_RESET_LEN 0
63
64 /*
65 * XID parameter header lengths in octets
66 */
67 #define XID_VERSION_HDR_LEN 1
68 #define XID_IOV_UI_HDR_LEN 2
69 #define XID_IOV_I_HDR_LEN 2
70 #define XID_T200_HDR_LEN 1
71 #define XID_N200_HDR_LEN 1
72 #define XID_N201_U_HDR_LEN 1
73 #define XID_N201_I_HDR_LEN 1
74 #define XID_MD_HDR_LEN 1
75 #define XID_MU_HDR_LEN 1
76 #define XID_KD_HDR_LEN 1
77 #define XID_KU_HDR_LEN 1
78 #define XID_LAYER_3_HDR_LEN 2
79 #define XID_RESET_HDR_LEN 1
80
81 /*
82 * XID parameter ranges
83 */
84 #define XID_VERSION_MIN 0u
85 #define XID_VERSION_MAX 15u
86 #define XID_IOV_UI_MIN 0u
87 #define XID_IOV_UI_MAX 4294967295uL /* actually: 2 ^ 32 - 1 */
88 #define XID_IOV_I_MIN 0u
89 #define XID_IOV_I_MAX 4294967295uL /* actually: 2 ^ 32 - 1 */
90 #define XID_T200_MIN 1u /* units: 0.1 seconds */
91 #define XID_T200_MAX 4095u
92 #define XID_N200_MIN 1u
93 #define XID_N200_MAX 15u
94 #ifdef _SIMULATION_
95 #ifdef MULTI_LAYER
96 /* units: octets */
97 #define XID_N201_U_MIN (llc_data->current_sapi EQ LL_SAPI_1 ? 400u : \
98 llc_data->current_sapi EQ LL_SAPI_7 ? 270u : 59u)
99 #else
100 #define XID_N201_U_MIN (llc_data->current_sapi EQ LL_SAPI_1 ? 400u : \
101 llc_data->current_sapi EQ LL_SAPI_7 ? 270u : 140u)
102
103 #endif /* MULTI_LAYER */
104 #else
105 /* units: octets */
106 #define XID_N201_U_MIN (llc_data->current_sapi EQ LL_SAPI_1 ? 400u : \
107 llc_data->current_sapi EQ LL_SAPI_7 ? 270u : 140u)
108 #endif /* SIMULATION */
109 #define XID_N201_U_MAX 1520u
110 #ifdef _SIMULATION_
111 #ifdef MULTI_LAYER
112 #define XID_N201_I_MIN 59u /* units: octets */
113 #else
114 #define XID_N201_I_MIN 140u /* units: octets */
115
116 #endif /* MULTI_LAYER */
117 #else
118 #define XID_N201_I_MIN 140u /* units: octets */
119 #endif /* SIMULATION */
120 #define XID_N201_I_MAX 1520u
121 #define XID_MD_OFF 0u
122 #define XID_MD_MIN 9u /* units: 16 octets */
123 #define XID_MD_MAX 24320u
124 #define XID_MU_OFF 0u
125 #define XID_MU_MIN 9u /* units: 16 octets */
126 #define XID_MU_MAX 24320u
127 #define XID_KD_MIN 1u /* units: frames */
128 #define XID_KD_MAX 255u
129 #define XID_KU_MIN 1u /* units: frames */
130 #define XID_KU_MAX 255u
131
132 /*
133 * Conditions for checking correct sense of negotiation.
134 */
135 #define XID_SENSE_UP >
136 #define XID_SENSE_DOWN <
137
138
139 /*==== FUNCTION DECLARATIONS ================================================*/
140
141 EXTERN void u_init (void);
142 EXTERN void u_init_sapi (void);
143
144 EXTERN void u_build_u_frame
145 (
146 #ifdef LL_DESC
147 T_desc_list3 *desc_list3,
148 #else
149 T_sdu *sdu,
150 #endif
151 T_BIT cr_bit,
152 UBYTE sapi,
153 T_BIT pf_bit,
154 T_COMMAND command
155 );
156
157 EXTERN BOOL u_check_xid (T_sdu *sdu,
158 T_BIT cr_bit,
159 T_COMMAND command);
160 EXTERN void u_eval_xid (T_BIT cr_bit,
161 BOOL *reset_received,
162 BOOL *xid_ind);
163
164 EXTERN void u_insert_xid
165 (
166 #ifdef LL_DESC
167 T_desc_list3 *desc_list3,
168 #else
169 T_sdu *sdu,
170 #endif
171 T_BIT cr_bit
172 );
173
174 EXTERN void u_insert_frmr_information
175 (
176 #ifndef LL_DESC
177 T_sdu *sdu,
178 #else
179 T_desc_list3 *desc_list3,
180 #endif
181 T_LL_UNITDATA_IND *frame,
182 T_PDU_TYPE pdu_type,
183 USHORT ctrl_length,
184 T_FRAME_NUM vs,
185 T_FRAME_NUM vr,
186 T_BIT cr_bit,
187 UBYTE reason
188 );
189
190 EXTERN void u_send_sabm (void);
191 EXTERN void u_send_disc (void);
192
193 #ifdef REL99
194 EXTERN void sig_tx_u_send_null (UBYTE cause);
195 #endif /* REL99 */
196
197 EXTERN void u_send_ua (T_BIT pf_bit,
198 BOOL include_xid);
199 EXTERN void u_send_dm (T_BIT pf_bit);
200 EXTERN void u_send_frmr (T_LL_UNITDATA_IND *frame,
201 T_PDU_TYPE pdu_type,
202 USHORT ctrl_length,
203 T_FRAME_NUM vs,
204 T_FRAME_NUM vr,
205 T_BIT cr_bit,
206 UBYTE reason);
207 #ifdef CC_CONCEPT
208 EXTERN void u_send_llgmm_status_ind (USHORT error_cause);
209 EXTERN void u_send_ll_status_ind (USHORT cause);
210 EXTERN void u_send_ll_release_ind (USHORT cause);
211 #else
212 EXTERN void u_send_llgmm_status_ind (UBYTE error_cause);
213 EXTERN void u_send_ll_status_ind (UBYTE cause);
214 EXTERN void u_send_ll_release_ind (UBYTE cause);
215 #endif
216
217 EXTERN void u_send_ll_release_cnf (void);
218 EXTERN void u_send_ll_xid_cnf (void);
219 EXTERN void u_send_ll_establish_ind (void);
220 EXTERN void u_send_ll_establish_cnf (void);
221 EXTERN void u_send_ll_xid_ind (void);
222 EXTERN void u_send_xid (T_BIT cr_bit);
223 EXTERN void u_tag_xid_parameters (T_BIT cr_bit, BOOL send_ack_para);
224 EXTERN void u_handle_optimization (void);
225
226 EXTERN void u_handle_mX_zero_rsp (USHORT mX_req, USHORT* n201_i,
227 USHORT mX, USHORT mX_max,
228 UBYTE* kX, UBYTE kX_min,
229 UBYTE kX_type );
230 EXTERN void u_check_requested_xid (void);
231
232 #endif /* !LLC_UF_H */