FreeCalypso > hg > fc-magnetite
comparison src/g23m-gprs/upm/upm.h @ 197:2cf312e56ee7
src/g23m-gprs/upm: import from LoCosto source
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 14 Oct 2016 01:21:46 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
196:a04cde1fb771 | 197:2cf312e56ee7 |
---|---|
1 /*---------------------------------------------------------------------------- | |
2 | Project : 3G PS | |
3 | Module : UPM | |
4 +----------------------------------------------------------------------------- | |
5 | Copyright 2003 Texas Instruments. | |
6 | All rights reserved. | |
7 | | |
8 | This file is confidential and a trade secret of Texas | |
9 | Instruments . | |
10 | The receipt of or possession of this file does not convey | |
11 | any rights to reproduce or disclose its contents or to | |
12 | manufacture, use, or sell anything it may describe, in | |
13 | whole, or in part, without the specific written consent of | |
14 | Texas Instruments. | |
15 +----------------------------------------------------------------------------- | |
16 | Purpose: Global definitions for the User Plane Manager (UPM) Entity. | |
17 | For design details, see: | |
18 | 8010.939 UPM Detailed Specification | |
19 +---------------------------------------------------------------------------*/ | |
20 | |
21 /*==== DECLARATION CONTROL =================================================*/ | |
22 | |
23 #ifndef _UPM_H | |
24 #define _UPM_H | |
25 | |
26 /*#ifdef FF_EGPRS | |
27 #ifndef UPM_EDGE | |
28 #define UPM_EDGE | |
29 #endif */ /*#ifndef UPM_EDGE*/ | |
30 /*#endif */ /*#ifdef FF_EGPRS*/ | |
31 | |
32 /*#ifdef UPM_EDGE */ | |
33 #define ENTITY_UPM | |
34 /*#endif */ | |
35 | |
36 #ifdef WIN32 | |
37 #define DEBUG | |
38 #endif | |
39 | |
40 /*==== INCLUDES =============================================================*/ | |
41 | |
42 #include <string.h> | |
43 #include <typedefs.h> | |
44 #include <vsi.h> | |
45 #include <gsm.h> | |
46 #include <gprs.h> | |
47 #include <prim.h> | |
48 | |
49 /*#ifndef UPM_EDGE | |
50 #include <trace.h> | |
51 #endif *//*#ifndef UPM_EDGE*/ | |
52 | |
53 #ifndef UPM_WITHOUT_USER_PLANE | |
54 #include <dti.h> | |
55 #endif /* UPM_WITHOUT_USER_PLANE */ | |
56 | |
57 struct T_CONTEXT_DATA; | |
58 typedef U32 T_MEM_HANDLE; | |
59 | |
60 #include "upm_debug.h" | |
61 | |
62 #ifndef UPM_WITHOUT_USER_PLANE | |
63 #include "upm_dti_control.h" | |
64 #include "upm_uplink_data_control.h" | |
65 #include "upm_uplink_data_suspend.h" | |
66 #include "upm_downlink_data_control.h" | |
67 #endif /* UPM_WITHOUT_USER_PLANE */ | |
68 #include "upm_link_control.h" | |
69 #ifdef TI_UMTS | |
70 #include "upm_rab_control.h" | |
71 #endif /* TI_UMTS */ | |
72 #ifdef TI_GPRS | |
73 #include "upm_sndcp_control.h" | |
74 #endif /* TI_GPRS */ | |
75 #ifdef TI_DUAL_MODE | |
76 #include "upm_rat_control.h" | |
77 #endif /* TI_DUAL_MODE */ | |
78 | |
79 /*==== CONSTS ===============================================================*/ | |
80 | |
81 #define UPM_UPLINK_DATA_BUFFER_SIZE 16 | |
82 #define UPM_DOWNLINK_DATA_BUFFER_SIZE 16 | |
83 #define UPM_DTI_QUEUE_SIZE 1 | |
84 | |
85 #define UPM_MAX_NSAPI_OFFSET (NAS_SIZE_NSAPI - (int)NAS_NSAPI_5) | |
86 /*==== TYPES ================================================================*/ | |
87 | |
88 #ifndef UPM_WITHOUT_USER_PLANE | |
89 struct T_UPM_desc_list_entry | |
90 { | |
91 /*@null@*/ struct T_UPM_desc_list_entry *next; | |
92 T_desc2 *desc; | |
93 }; | |
94 | |
95 /*@abstract@*/ struct T_UPM_USER_PLANE_DATA | |
96 { | |
97 T_UPM_DTI_UPPER_CONTROL_STATE dti_upper_control_state; | |
98 #ifdef TI_GPRS | |
99 T_UPM_DTI_LOWER_CONTROL_STATE dti_lower_control_state; | |
100 #endif /* TI_GPRS */ | |
101 T_UPM_UPLINK_DATA_CONTROL_STATE ul_data_state; | |
102 T_UPM_UPLINK_DATA_SUSPEND_STATE ul_data_suspend_state; | |
103 T_UPM_DOWNLINK_DATA_CONTROL_STATE dl_data_state; | |
104 | |
105 U8 dti_flags[UPM_DTI_NUMBER_OF_INTERFACES]; | |
106 | |
107 U16 ul_data_buffer_count; | |
108 U16 dl_data_buffer_count; | |
109 | |
110 U32 ul_data_octets_transferred; | |
111 U32 ul_data_packets_transferred; | |
112 U32 dl_data_octets_transferred; | |
113 U32 dl_data_packets_transferred; | |
114 | |
115 U32 ul_data_packets_dropped; | |
116 U32 dl_data_packets_dropped; | |
117 | |
118 /*@null@*/ /*@only@*/ /*@reldef@*/ | |
119 struct T_UPM_desc_list_entry *ul_data_buffer; | |
120 /*@null@*/ /*@only@*/ /*@reldef@*/ | |
121 T_MEM_HANDLE *dl_data_buffer; | |
122 }; | |
123 #endif /* UPM_WITHOUT_USER_PLANE */ | |
124 | |
125 #ifdef TI_GPRS | |
126 /*@abstract@*/ struct T_UPM_CONTEXT_DATA_GPRS | |
127 { | |
128 U8 sndcp_delay; /* R97 QoS */ | |
129 U8 sndcp_relclass; /* R97 QoS */ | |
130 U8 sndcp_peak_bitrate; /* R97 QoS */ | |
131 U8 sndcp_preced; /* R97 QoS */ | |
132 U8 sndcp_mean; /* R97 QoS */ | |
133 | |
134 U8 pkt_flow_id; /* EDGE */ | |
135 U8 sndcp_radio_prio; | |
136 U8 sndcp_llc_sapi; | |
137 }; | |
138 #endif /* TI_GPRS */ | |
139 | |
140 /*@abstract@*/ struct T_CONTEXT_DATA | |
141 { | |
142 U8 nsapi; | |
143 | |
144 U8 seq_nos_valid; | |
145 U8 recv_seq_no; | |
146 U8 send_seq_no; | |
147 | |
148 T_UPM_LINK_CONTROL_STATE link_control_state; | |
149 #ifdef TI_UMTS | |
150 T_UPM_RAB_CONTROL_STATE rab_control_state; | |
151 #endif /* TI_UMTS */ | |
152 #ifdef TI_GPRS | |
153 T_UPM_SNDCP_CONTROL_STATE sndcp_control_state; | |
154 #endif /* TI_GPRS */ | |
155 | |
156 #ifdef TI_UMTS | |
157 U8 rab_qos_tc; | |
158 U8 mem_user; | |
159 U16 mem_space_before; | |
160 #endif /* TI_UMTS */ | |
161 #ifdef TI_GPRS | |
162 struct T_UPM_CONTEXT_DATA_GPRS gprs_data; | |
163 #endif /* TI_GPRS */ | |
164 | |
165 #ifndef UPM_WITHOUT_USER_PLANE | |
166 struct T_UPM_USER_PLANE_DATA up_data; | |
167 #endif /* UPM_WITHOUT_USER_PLANE */ | |
168 }; | |
169 | |
170 typedef struct { | |
171 #ifdef TI_DUAL_MODE | |
172 T_UPM_RAT_CONTROL_STATE rat_control_state; | |
173 T_PS_rat upm_rat; | |
174 #endif /* TI_DUAL_MODE */ | |
175 BOOL upm_ll_entity_test; | |
176 /* Communication handles */ | |
177 T_HANDLE hCommACI; | |
178 T_HANDLE hCommSM; | |
179 T_HANDLE hCommMM; | |
180 T_HANDLE upm_handle; | |
181 #ifdef TI_UMTS | |
182 T_HANDLE hCommPDCP; | |
183 T_HANDLE hCommRRC; | |
184 #endif /* TI_UMTS */ | |
185 #ifdef TI_GPRS | |
186 T_HANDLE hCommSNDCP; | |
187 T_HANDLE hCommRR; | |
188 #endif /* TI_GPRS */ | |
189 | |
190 #ifndef UPM_WITHOUT_USER_PLANE | |
191 DTI_HANDLE upm_hDTI; | |
192 #endif /* UPM_WITHOUT_USER_PLANE */ | |
193 /*@only@*/ /*@reldef@*/ | |
194 struct T_CONTEXT_DATA *upm_context_array[UPM_MAX_NSAPI_OFFSET]; | |
195 } T_UPM_DATA; | |
196 | |
197 #ifdef DEBUG | |
198 #define M_TRANSITION(_EVENT, _FUNC) {_EVENT, _FUNC} | |
199 #else /* WIN32 */ | |
200 #define M_TRANSITION(_EVENT, _FUNC) {_FUNC} | |
201 #endif /* WIN32 */ | |
202 | |
203 /*==== EXPORTS ==============================================================*/ | |
204 | |
205 extern T_UPM_DATA upm_data; | |
206 | |
207 void upm_pfree(/*@null@*/ /*@only@*/ /*@out@*/void *data); | |
208 void upm_mfree(/*@null@*/ /*@only@*/ /*@out@*/void *data); | |
209 | |
210 U16 upm_nsapi2nsapi_set(int /*@alt U8@*/ nsapi) /*@*/; | |
211 | |
212 /*@null@*/ /*@exposed@*/ | |
213 struct T_CONTEXT_DATA *upm_get_context_data_from_nsapi(int /*@alt U8@*/ nsapi); | |
214 void upm_assign_context_data_to_nsapi(/*@keep@*/ struct T_CONTEXT_DATA *, | |
215 int /*@alt U8@*/ nsapi); | |
216 | |
217 void upm_free_context_data(int /*@alt U8@*/ nsapi); | |
218 void upm_check_for_released_context_and_release(struct T_CONTEXT_DATA *); | |
219 | |
220 BOOL upm_ll_entity_test(void); | |
221 void upm_activate_ll_entity_test(void) /*@modifies upm_data.upm_ll_entity_test@*/; | |
222 | |
223 #ifdef TI_DUAL_MODE | |
224 T_PS_rat upm_get_current_rat(void); | |
225 void upm_set_current_rat(T_PS_rat rat) /*@modifies upm_data.upm_rat@*/; | |
226 #endif /* TI_DUAL_MODE */ | |
227 | |
228 void upm_set_sequence_number(struct T_CONTEXT_DATA *, U8); | |
229 U8 upm_get_sequence_number(struct T_CONTEXT_DATA *); | |
230 | |
231 #define hCommACI upm_data.hCommACI /* Communication handle to ACI */ | |
232 #define hCommMM upm_data.hCommMM /* Communication handle to MM */ | |
233 #define hCommSM upm_data.hCommSM /* Communication handle to SM */ | |
234 | |
235 #ifdef TI_UMTS | |
236 #define hCommPDCP upm_data.hCommPDCP /* Communication handle to PDCP */ | |
237 #define hCommRRC upm_data.hCommRRC /* Communication handle to RRC */ | |
238 #endif /* TI_UMTS */ | |
239 #ifdef TI_GPRS | |
240 #define hCommSNDCP upm_data.hCommSNDCP /* Communication handle to SNDCP */ | |
241 #define hCommRR upm_data.hCommRR /* Communication handle to RR */ | |
242 #endif /* TI_GPRS */ | |
243 #ifndef UPM_WITHOUT_USER_PLANE | |
244 #define upm_hDTI upm_data.upm_hDTI | |
245 #endif /* UPM_WITHOUT_USER_PLANE */ | |
246 | |
247 #define VSI_CALLER upm_data.upm_handle, | |
248 #define VSI_CALLER_SINGLE upm_data.upm_handle | |
249 | |
250 /* Uniquify pei_create() */ | |
251 #define pei_create upm_pei_create | |
252 extern short upm_pei_create (T_PEI_INFO **info) | |
253 /*@modifies *info, internalState@*/ /*@globals internalState@*/; | |
254 | |
255 #endif /* _UPM_H */ | |
256 /*==== END OF FILE ==========================================================*/ | |
257 |