FreeCalypso > hg > fc-magnetite
comparison src/g23m-gsm/cc/cc.h @ 104:27a4235405c6
src/g23m-gsm: import from LoCosto source
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 04 Oct 2016 18:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
103:76d139c7a25e | 104:27a4235405c6 |
---|---|
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 the Protocol Stack Entity Call Control. | |
18 +----------------------------------------------------------------------------- | |
19 */ | |
20 | |
21 #ifndef CC_H | |
22 #define CC_H | |
23 | |
24 #ifdef TI_PS_HCOMM_CHANGE | |
25 #include "cl_hComm_handle.h" | |
26 #endif | |
27 | |
28 #ifdef TI_GSP_STR2IND_S2I_STRING | |
29 typedef unsigned int T_S2I_STRING; | |
30 #else | |
31 typedef char * T_S2I_STRING; | |
32 #define S2I_STRING(x) (x) | |
33 #endif | |
34 | |
35 #ifdef TI_PS_OP_VSI_NO_CALL_ID | |
36 #define TIMER_START(C,I,T) vsi_t_start_nc(I,T) | |
37 #define TIMER_PSTART(C,I,T,R) vsi_t_pstart_nc(I,T,R) | |
38 #define TIMER_STOP(C,I) vsi_t_stop_nc(I) | |
39 #define TIMER_STATUS(C,I,T) vsi_t_status_nc(I,T) | |
40 #define SUSPEND_SELF(C,T) vsi_t_sleep_nc(T) | |
41 #define SYSTEM_TIME(C,T) vsi_t_time_nc(T) | |
42 #else /* TI_PS_OP_VSI_NO_CALL_ID */ | |
43 #define TIMER_START(C,I,T) vsi_t_start(C,I,T) | |
44 #define TIMER_PSTART(C,I,T,R) vsi_t_pstart(C,I,T,R) | |
45 #define TIMER_STOP(C,I) vsi_t_stop(C,I) | |
46 #define TIMER_STATUS(C,I,T) vsi_t_status(C,I,T) | |
47 #define SUSPEND_SELF(C,T) vsi_t_sleep(C,T) | |
48 #define SYSTEM_TIME(C,T) vsi_t_time(C,T) | |
49 #endif /* TI_PS_OP_VSI_NO_CALL_ID */ | |
50 | |
51 #ifdef MNCC_TI_BERLIN | |
52 | |
53 /* The code is compiled for TI Berlin, some differences (for now) */ | |
54 #define TI_BERLIN | |
55 | |
56 /* Texas Instruments Berlin wants to compile for GSM always */ | |
57 #define TI_GSM | |
58 | |
59 /* Define TI_CAUSE_U16 for TI Berlin U16 bitmap cause concept */ | |
60 #define TI_CAUSE_U16 | |
61 | |
62 /* Make a compatible definition for "no cause present" */ | |
63 #define CAUSE_CC_NO_ERROR MNCC_CAUSE_NO_MS_CAUSE | |
64 | |
65 /* Protocoldiscriminator CC */ | |
66 #define M_MM_PD_CC 3 | |
67 | |
68 /* Originating entity for MMCM */ | |
69 #define NAS_ORG_ENTITY_CC MMCM_ORG_ENTITY_CC | |
70 | |
71 /* | |
72 * TI Berlin has no "NAS_" defines and typedef, map what's needed to compile | |
73 */ | |
74 #define NAS_CH_SDCCH MMCM_CH_SDCCH | |
75 #define NAS_CH_TCH_F MMCM_CH_TCH_F | |
76 #define NAS_CH_TCH_H MMCM_CH_TCH_H | |
77 | |
78 #define NAS_CHM_SIG_ONLY MMCM_CHM_SIG_ONLY | |
79 #define NAS_CHM_SPEECH MMCM_CHM_SPEECH | |
80 #define NAS_CHM_SPEECH_V2 MMCM_CHM_SPEECH_V2 | |
81 #define NAS_CHM_SPEECH_V3 MMCM_CHM_SPEECH_V3 | |
82 #define NAS_CHM_DATA_9_6 MMCM_CHM_DATA_9_6 | |
83 #define NAS_CHM_DATA_4_8 MMCM_CHM_DATA_4_8 | |
84 #define NAS_CHM_DATA_2_4 MMCM_CHM_DATA_2_4 | |
85 #define NAS_CHM_DATA_14_4 MMCM_CHM_DATA_14_4 | |
86 | |
87 typedef T_MNCC_fac_inf T_NAS_fac_inf; | |
88 | |
89 #else /* TI DK */ | |
90 #define IS_CAUSE_INVALID(cause) (cause EQ CAUSE_CC_NO_ERROR) | |
91 #endif /* else, #ifdef MNCC_TI_BERLIN */ | |
92 | |
93 | |
94 /* | |
95 * Some macros to give the optimize the chance to optimize code away, | |
96 * making it possible to save some #ifdefs for GSM / UMTS only configurations. | |
97 */ | |
98 #ifdef TI_DUAL_MODE | |
99 /* In dual mode we have to evaluate the RAT at runtime */ | |
100 #define IS_RAT_UMTS_FDD() (cc_current_rat EQ PS_RAT_UMTS_FDD) | |
101 #define IS_RAT_GSM() (cc_current_rat EQ PS_RAT_GSM) | |
102 #else | |
103 #ifdef TI_GSM | |
104 /* GSM/GPRS only phone, RAT is always GSM/GPRS */ | |
105 #define IS_RAT_UMTS_FDD() FALSE | |
106 #define IS_RAT_GSM() TRUE | |
107 #else | |
108 /* UMTS only phone, RAT is always UMTS */ | |
109 #define IS_RAT_UMTS_FDD() TRUE | |
110 #define IS_RAT_GSM() FALSE | |
111 #endif | |
112 #endif /* #ifdef TI_DUAL_MODE */ | |
113 | |
114 | |
115 /* | |
116 * Definition whether bearer caps shall be traced | |
117 */ | |
118 #ifndef NTRACE | |
119 #define TRACE_BCAP | |
120 #endif | |
121 | |
122 /* | |
123 * Definition whether a shared CCD buffer shall be used | |
124 */ | |
125 #define SHARED_CCD_BUF | |
126 | |
127 /*==== CONSTANTS ==================================================*/ | |
128 /* | |
129 * Macros | |
130 */ | |
131 | |
132 | |
133 #ifdef FRAME_OFFSET_ZERO | |
134 | |
135 #define GET_PD(s,p) p = s.buf[3] & 0x0F | |
136 #define GET_TI(s,t) t = (s.buf[3] & 0xF0)>>4 | |
137 #define SET_PD(s,p) s.buf[3] = (s.buf[3] & 0xF0) + p | |
138 #define SET_TI(s,t) s.buf[3] = (s.buf[3] & 0x0F) + (t<<4) | |
139 | |
140 #else | |
141 | |
142 #define GET_PD(s,p) ccd_decodeByte(s.buf,(USHORT)(s.o_buf+4),4,&p) | |
143 #define GET_TI(s,t) ccd_decodeByte(s.buf,s.o_buf,4,&t) | |
144 #define GET_TI_EXT(s,t) ccd_decodeByte(s.buf,(USHORT)(s.o_buf+8),8,&t) | |
145 #define SET_PD(s,p) ccd_codeByte(s.buf,(USHORT)(s.o_buf-4),4,p) | |
146 #define SET_TI(s,t) ccd_codeByte(s.buf,(USHORT)(s.o_buf-8),4,t) | |
147 | |
148 #endif | |
149 | |
150 #define SET_DTMF_MOD( key, mode ) (((key) & 0x7F) | ((mode) << 7)) | |
151 #define GET_DTMF_MOD( key ) (((key) & 0x80) >> 7) | |
152 | |
153 /* | |
154 * The assert() macro as defined by the frame stops the task, | |
155 * not only in simulation but also on the target. For the | |
156 * simulation this is a desired behaviour, for the target it is not. | |
157 */ | |
158 #ifndef WIN32 | |
159 #undef assert | |
160 #define assert(x) if (!(x)) { TRACE_ERROR ("Assertion failed"); } | |
161 #endif | |
162 | |
163 /* | |
164 * Bitoffset for encoding/decoding | |
165 */ | |
166 #define CC_ENCODE_OFFSET L3_CODING_OFFSET | |
167 #define ENCODE_OFFSET CC_ENCODE_OFFSET /* macro used by mem alloc macros */ | |
168 | |
169 | |
170 /* | |
171 * Dynamic Configuration Numbers | |
172 */ | |
173 /* Not present currently for entity CC */ | |
174 #ifdef WIN32 | |
175 #define ID_STD 7 | |
176 #endif/* WIN32 */ | |
177 | |
178 /* | |
179 * Timer indices, configuration parameters | |
180 */ | |
181 #define T303 0 | |
182 #define T305 1 | |
183 #define T308 2 | |
184 #define T310 3 | |
185 #define T313 4 | |
186 #define T323 5 | |
187 #define T332 6 | |
188 #define T335 7 | |
189 #define T336 8 | |
190 #define T337 9 | |
191 | |
192 #define NUM_OF_CC_TIMERS MAX_CC_TIMER | |
193 | |
194 | |
195 /* | |
196 * Information Element Identifier | |
197 */ | |
198 #define PROGRESS_IEI 0x1E | |
199 #define REPEAT_IEI 0x0D | |
200 #define CONNECTED_NUMBER_IEI 0x4C | |
201 #define CONNECTED_SUBADDR_IEI 0x4D | |
202 #define CAUSE_IEI 0x08 | |
203 #define NOTIFICATION_IEI 0x00 /* ???? */ | |
204 #define SIGNAL_IEI 0x34 | |
205 #define CALLING_PARTY_BCD_IEI 0x5C | |
206 #define CALLING_PARTY_SUB_IEI 0x5D | |
207 #define CALLED_PARTY_BCD_IEI 0x5E | |
208 #define CALLED_PARTY_SUB_IEI 0x6D | |
209 #define BEARER_CAP_IEI 0x04 | |
210 | |
211 /* | |
212 * Call Type | |
213 */ | |
214 #define CALL_TYPE_MTC 1 | |
215 #define CALL_TYPE_MOC 0 | |
216 | |
217 /* | |
218 * DTMF States | |
219 */ | |
220 #define DTMF_IDLE 0 | |
221 #define DTMF_SEND_REQUEST 1 | |
222 #define DTMF_STOP_REQUEST 2 | |
223 #define DTMF_SEND_ACKNOWLEDGE 3 | |
224 | |
225 /* | |
226 * DTMF mode | |
227 */ | |
228 #define DTMF_AUTO 0 | |
229 #define DTMF_MAN 1 | |
230 | |
231 /* | |
232 * Compatibility Check Result Codes | |
233 */ | |
234 #define OKAY 0 | |
235 #define NEGOTIATION 1 | |
236 #define ERROR 2 | |
237 #define BAD_SUBADDRESS 3 | |
238 | |
239 /* | |
240 * Intermediate States | |
241 */ | |
242 #define CS_101 0xd | |
243 #define CS_261 0xe | |
244 | |
245 /* | |
246 * Maximum Length of SDU | |
247 */ | |
248 #define LEN_U_SETUP (128*8) | |
249 #define LEN_U_RELEASE_COMPLETE ( 34*8) | |
250 #define LEN_U_RELEASE ( 34*8) | |
251 #define LEN_U_DISCONNECT ( 33*8) | |
252 #define LEN_U_MODIFY_REJ ( 47*8) | |
253 #define LEN_U_CONNECT ( 2*8) | |
254 #define LEN_U_ALERT ( 2*8) | |
255 #define LEN_U_USER_USER ( 5*8) | |
256 #define LEN_U_FACILITY ( 5*8) | |
257 | |
258 /* | |
259 * Max number of speech codecs for bearer capabilities | |
260 */ | |
261 #define MAX_SPEECH_CODECS 5 | |
262 | |
263 /* | |
264 * Define the valid flag for the extended transaction identifier | |
265 */ | |
266 | |
267 #define EXTENDED_TI_VALID 0x80 | |
268 | |
269 | |
270 /*==== TYPES ======================================================*/ | |
271 | |
272 typedef struct | |
273 { | |
274 UBYTE t_mode; | |
275 ULONG t_val; | |
276 } T_TIMER_CONFIG; | |
277 | |
278 typedef struct | |
279 { | |
280 UBYTE state; | |
281 UBYTE mode; | |
282 UBYTE key; /* Last key which was sent */ | |
283 UBYTE read; | |
284 UBYTE write; | |
285 UBYTE buf[DTMF_BUF_SIZE]; | |
286 } T_DTMF; | |
287 | |
288 typedef struct | |
289 { | |
290 UBYTE serv1; | |
291 UBYTE serv2; | |
292 UBYTE ri; | |
293 T_M_CC_bearer_cap bc1; | |
294 T_M_CC_bearer_cap bc2; | |
295 T_MNCC_bcpara bcpara1; | |
296 T_MNCC_bcpara bcpara2; | |
297 UBYTE neg_serv1; | |
298 UBYTE neg_serv2; | |
299 UBYTE neg_ri; | |
300 T_M_CC_bearer_cap neg_bc1; | |
301 T_M_CC_bearer_cap neg_bc2; | |
302 T_MNCC_bcpara neg_bcpara1; | |
303 T_MNCC_bcpara neg_bcpara2; | |
304 UBYTE active_service; | |
305 UBYTE mt; | |
306 UBYTE ti; /* Transaction Identifier */ | |
307 UBYTE ti_ext; /* extension octet of ti, if any */ | |
308 UBYTE ti_rec; | |
309 BOOL ti_ext_pres; /* presence of extension octet of ti */ | |
310 | |
311 UBYTE index_ti; | |
312 UBYTE error; | |
313 UBYTE error_count; | |
314 UBYTE error_inf [MAX_ERROR_TAGS]; | |
315 UBYTE channel_type; | |
316 UBYTE channel_mode; | |
317 UBYTE progress_desc[MAX_CC_CALLS]; | |
318 UBYTE new_itc; | |
319 UBYTE old_itc; | |
320 T_M_CC_calling_subaddr my_party_subaddr; | |
321 BOOL negotiation; | |
322 UBYTE timer [MAX_CC_TIMER]; | |
323 UBYTE stored_ti_values [MAX_CC_CALLS]; | |
324 UBYTE call_type [MAX_CC_CALLS]; | |
325 // PATCH LE 10.04.00 | |
326 // new variables to check disconnect collision | |
327 UBYTE disc_coll [MAX_CC_CALLS]; | |
328 // END PATCH LE 10.04.00 | |
329 UBYTE t308_counter [MAX_CC_CALLS]; | |
330 T_DTMF dtmf [MAX_CC_CALLS]; | |
331 UBYTE state [MAX_CC_CALLS]; | |
332 UBYTE hold_state [MAX_CC_CALLS]; | |
333 UBYTE mpty_state [MAX_CC_CALLS]; | |
334 /* stores the cause used by the MS (not by the network) */ | |
335 USHORT cc_cause [MAX_CC_CALLS]; | |
336 #ifdef OPTION_REF | |
337 T_PRIM * stored_prim [MAX_STORED_PRIM]; | |
338 #else | |
339 T_PRIM stored_prim [MAX_STORED_PRIM]; | |
340 #endif | |
341 UBYTE stored_prim_write; | |
342 UBYTE stored_prim_read; | |
343 UBYTE stored_prim_in; | |
344 UBYTE stored_prim_out; | |
345 EF_MSCAP mscap; | |
346 // EF_MSSUP mssup; | |
347 T_M_CC_call_ctrl_cap call_ctrl_cap; | |
348 /* The pointer to the readily built uplink SETUP or EC SETUP message */ | |
349 T_MMCM_DATA_REQ * stored_setup; | |
350 T_MNCC_bcpara sns_bcpara; | |
351 UBYTE sns_mode; | |
352 UBYTE ctm_ena; | |
353 /* Connection element to be used in a MTC, set by at+cbst */ | |
354 UBYTE conn_elem; | |
355 /* Pointer to stored MMCC_DATA_REQ which contains the CCBS SETUP message */ | |
356 T_MMCM_DATA_REQ * stored_ccbs_setup; | |
357 /* Establishment cause */ | |
358 USHORT estcs; | |
359 /* Number of retries to establish a MO call */ | |
360 UBYTE setup_attempts; | |
361 /* Transaction identifier for setup reattempt, NOT_PRESENT_8BIT if none */ | |
362 UBYTE setup_reattempt_ti; | |
363 /* Buffer for trace outputs, it doesn't save you anything if this | |
364 * buffer is kept on the stack as stack is a scarce resource */ | |
365 #ifdef TRACE_BCAP | |
366 char string_buf[80]; | |
367 #endif /* #ifdef TRACE_BCAP */ | |
368 } T_CC_DATA; | |
369 | |
370 /*==== EXPORT =====================================================*/ | |
371 | |
372 /* | |
373 * Prototypes Formatter | |
374 */ | |
375 EXTERN void for_init (void); | |
376 EXTERN void for_mmcm_est_ind (T_MMCM_ESTABLISH_IND * mmcm_establish_ind); | |
377 | |
378 EXTERN void for_mmcm_data_ind (T_MMCM_DATA_IND * mmcm_data_ind ); | |
379 EXTERN void for_decode (T_PRIM * prim, | |
380 BOOL est_flag); | |
381 EXTERN void for_d_alert (void); | |
382 EXTERN void for_d_call_proceed (void); | |
383 EXTERN void for_d_connect (void); | |
384 EXTERN void for_d_facility (void); | |
385 EXTERN void for_d_disconnect (void); | |
386 EXTERN void for_b_modify (void); | |
387 EXTERN void for_b_modify_comp (void); | |
388 EXTERN void for_b_modify_rej (void); | |
389 EXTERN void for_b_notify (void); | |
390 EXTERN void for_d_progress (void); | |
391 EXTERN void for_d_release (void); | |
392 EXTERN void for_d_release_comp (void); | |
393 EXTERN void for_d_cc_establishment (void); | |
394 EXTERN void for_d_recall (void); | |
395 EXTERN void for_d_setup (void); | |
396 EXTERN void for_d_start_dtmf_ack (void); | |
397 EXTERN void for_d_start_dtmf_rej (void); | |
398 EXTERN void for_b_status (void); | |
399 EXTERN void for_d_hold_rej (void); | |
400 EXTERN void for_d_retrieve_rej (void); | |
401 EXTERN void for_b_congest_ctrl (void); | |
402 EXTERN void for_b_user_information (void); | |
403 | |
404 EXTERN BOOL cc_check_critical_error (UBYTE ccd_err); | |
405 | |
406 EXTERN void for_mmcm_sync_ind (T_MMCM_SYNC_IND * mmcm_sync_ind ); | |
407 EXTERN void for_mmcm_est_cnf (T_MMCM_ESTABLISH_CNF * mmcm_establish_cnf ); | |
408 EXTERN void for_mmcm_rel_ind (T_MMCM_RELEASE_IND * mmcm_release_ind ); | |
409 EXTERN void for_mmcm_err_ind (T_MMCM_ERROR_IND * mmcm_error_ind ); | |
410 EXTERN void for_mmcm_reest_cnf (T_MMCM_REESTABLISH_CNF* mmcm_reestablish_cnf); | |
411 EXTERN void for_mmcm_prompt_ind (T_MMCM_PROMPT_IND * mmcm_prompt_ind); | |
412 EXTERN void for_est_req (T_MMCM_ESTABLISH_REQ * mmcm_establish_req ); | |
413 | |
414 EXTERN void for_rel_req (void); | |
415 EXTERN void for_reest_req (void); | |
416 EXTERN void for_start_cc (T_U_START_CC * start_cc); | |
417 EXTERN void for_cc_est_confirm (T_U_CC_EST_CONF * est_cnf); | |
418 EXTERN void for_setup (T_U_SETUP * setup); | |
419 EXTERN void for_emergency_setup (T_U_EMERGE_SETUP * emerg_setup); | |
420 EXTERN void for_status (T_B_STATUS * status); | |
421 EXTERN void for_release_complete (T_U_RELEASE_COMP * rel_com); | |
422 EXTERN void for_disconnect (T_U_DISCONNECT * disconnect); | |
423 EXTERN void for_modify_reject (T_B_MODIFY_REJ * modify_rej); | |
424 EXTERN void for_modify_complete (T_B_MODIFY_COMP * mod_com); | |
425 EXTERN void for_start_dtmf (T_U_START_DTMF * start_dtmf); | |
426 EXTERN void for_stop_dtmf (void); | |
427 EXTERN void for_call_confirm (T_U_CALL_CONF * call_confirm); | |
428 EXTERN void for_release (T_U_RELEASE * release); | |
429 EXTERN void for_connect_ack (T_B_CONNECT_ACK *b_connect_ack); | |
430 EXTERN void for_retrieve (void); | |
431 EXTERN void for_hold (void); | |
432 EXTERN void for_user_information (T_B_USER_INFO * user_info); | |
433 EXTERN void for_congestion_control (T_B_CONGEST_CTRL * cong); | |
434 EXTERN void for_modify (T_B_MODIFY * modify); | |
435 EXTERN void for_connect (T_U_CONNECT * connect); | |
436 EXTERN void for_alert (T_U_ALERT * alert); | |
437 EXTERN void for_facility (T_U_FACILITY * facility); | |
438 EXTERN void for_pd (T_MMCM_DATA_REQ * mmcm_data_req); | |
439 | |
440 /* | |
441 * Prototypes Formatter Functions | |
442 */ | |
443 EXTERN BOOL for_check_called_party_bcd (UBYTE ton, UBYTE npi); | |
444 EXTERN BOOL for_check_called_party_sub (T_M_CC_called_subaddr * called_subaddr); | |
445 EXTERN BOOL for_check_calling_party_bcd (T_M_CC_calling_num * calling_num); | |
446 EXTERN BOOL for_check_calling_party_sub (T_M_CC_calling_subaddr * calling_subaddr); | |
447 EXTERN void for_check_call_state (T_M_CC_call_state * call_state); | |
448 EXTERN BOOL for_check_cc_cause (T_M_CC_cc_cause * cc_cause); | |
449 EXTERN BOOL for_check_notification (T_M_CC_notific * notify); | |
450 EXTERN BOOL for_check_progress_indicator (T_M_CC_progress * progress); | |
451 EXTERN BOOL for_check_repeat_indicator (UBYTE repeat); | |
452 EXTERN BOOL for_check_signal (UBYTE signal); | |
453 EXTERN BOOL cc_check_critical_error (UBYTE ccd_err); | |
454 /* | |
455 * If all entities are linked into one module this definitions | |
456 * prefixes all this functions with the enity name | |
457 */ | |
458 #ifdef OPTION_MULTITHREAD | |
459 #define for_set_conditional_error _ENTITY_PREFIXED(for_set_conditional_error) | |
460 #ifdef REL99 | |
461 #define for_set_content_error _ENTITY_PREFIXED(for_set_content_error) | |
462 #endif | |
463 #define for_set_mandatory_error _ENTITY_PREFIXED(for_set_mandatory_error) | |
464 #define for_set_optional_error _ENTITY_PREFIXED(for_set_optional_error) | |
465 #endif | |
466 | |
467 | |
468 EXTERN void for_set_conditional_error (UBYTE iei); | |
469 EXTERN void for_set_mandatory_error (UBYTE iei); | |
470 EXTERN void for_set_optional_error (UBYTE iei); | |
471 | |
472 | |
473 /* | |
474 * Prototypes Call Control (Establishment) | |
475 */ | |
476 EXTERN void cc_init (void); | |
477 EXTERN void cc_init_data (void); | |
478 EXTERN void cc_mncc_configure_req (T_MNCC_CONFIGURE_REQ * mncc_configure_req); | |
479 EXTERN void cc_mncc_setup_req (T_MNCC_SETUP_REQ * mncc_setup_req ); | |
480 EXTERN void cc_mncc_prompt_res (T_MNCC_PROMPT_RES * prompt); | |
481 EXTERN void cc_mncc_prompt_rej (T_MNCC_PROMPT_REJ * prompt); | |
482 EXTERN void cc_mncc_alert_req (T_MNCC_ALERT_REQ * mncc_alert_req ); | |
483 EXTERN void cc_mncc_setup_res (T_MNCC_SETUP_RES * mncc_setup_res ); | |
484 | |
485 | |
486 EXTERN void cc_alert (T_D_ALERT * alert); | |
487 EXTERN void cc_call_proceeding (T_D_CALL_PROCEED * proceed); | |
488 EXTERN void cc_connect (T_D_CONNECT * connect); | |
489 EXTERN void cc_connect_ack (void); | |
490 EXTERN void cc_progress (T_D_PROGRESS * progress); | |
491 EXTERN void cc_setup (T_D_SETUP * setup); | |
492 EXTERN void cc_sync_ind (T_MMCM_SYNC_IND *mmcc_sync_ind); | |
493 EXTERN void cc_est_cnf (void); | |
494 EXTERN void cc_reest_cnf (void); | |
495 EXTERN void cc_cc_establishment (T_U_SETUP * setup); | |
496 EXTERN void cc_recall (T_D_RECALL * recall); | |
497 | |
498 #ifdef SIM_TOOLKIT | |
499 EXTERN void cc_mncc_bearer_cap_req (T_MNCC_BEARER_CAP_REQ * bc_req); | |
500 #endif /* SIM_TOOLKIT */ | |
501 | |
502 /* | |
503 * Prototypes Call Control (Active Phase) | |
504 */ | |
505 EXTERN void cc_mncc_facility_req (T_MNCC_FACILITY_REQ * mncc_facility_req ); | |
506 EXTERN void cc_mncc_start_dtmf_req (T_MNCC_START_DTMF_REQ * mncc_start_dtmf_req); | |
507 EXTERN void cc_reset_dtmf (void); | |
508 EXTERN void cc_mncc_modify_req (T_MNCC_MODIFY_REQ * mncc_modify_req ); | |
509 EXTERN void cc_mncc_user_req (T_MNCC_USER_REQ * mncc_user_req ); | |
510 EXTERN void cc_mncc_hold_req (T_MNCC_HOLD_REQ * mncc_hold_req ); | |
511 EXTERN void cc_mncc_retrieve_req (T_MNCC_RETRIEVE_REQ * mncc_retrieve_req ); | |
512 EXTERN void cc_mncc_sync_req (T_MNCC_SYNC_REQ * mncc_sync_req ); | |
513 EXTERN void cc_mncc_status_res (T_MNCC_STATUS_RES * mncc_status_res ); | |
514 | |
515 | |
516 EXTERN void cc_facility (T_D_FACILITY * facility); | |
517 EXTERN void cc_start_dtmf_ack (T_D_START_DTMF_ACK * start_dtmf_ack); | |
518 EXTERN void cc_start_dtmf_rej (T_D_START_DTMF_REJ * start_dtmf_rej); | |
519 EXTERN void cc_stop_dtmf (void); | |
520 EXTERN void cc_stop_dtmf_ack (void); | |
521 EXTERN void cc_hold_ack (void); | |
522 EXTERN void cc_hold_rej (T_D_HOLD_REJ * hold_rej); | |
523 EXTERN void cc_retrieve_ack (void); | |
524 EXTERN void cc_retrieve_rej (T_D_RETRIEVE_REJ * retrieve_rej); | |
525 EXTERN void cc_congestion_control (T_B_CONGEST_CTRL * cong); | |
526 EXTERN void cc_user_information (T_B_USER_INFO * user); | |
527 EXTERN void cc_modify (T_B_MODIFY * modify); | |
528 EXTERN void cc_mod_reject (void); | |
529 EXTERN void cc_mod_complete (void); | |
530 EXTERN void cc_modify_complete (T_B_MODIFY_COMP * mod_com); | |
531 EXTERN void cc_modify_reject (T_B_MODIFY_REJ * mod_rej); | |
532 EXTERN void cc_status (T_B_STATUS * status); | |
533 EXTERN void cc_status_enquiry (void); | |
534 EXTERN void cc_unknown_message (void); | |
535 | |
536 | |
537 /* | |
538 * Prototypes Call Control (Release) | |
539 */ | |
540 EXTERN void cc_mncc_disconnect_req (T_MNCC_DISCONNECT_REQ * mncc_disconnect_req); | |
541 EXTERN void cc_mncc_reject_req (T_MNCC_REJECT_REQ * rej); | |
542 EXTERN void cc_mncc_release_req (T_MNCC_RELEASE_REQ * mncc_release_req ); | |
543 | |
544 EXTERN void cc_disconnect (T_D_DISCONNECT * disconnect); | |
545 EXTERN void cc_release (T_D_RELEASE * release); | |
546 EXTERN void cc_release_complete (T_D_RELEASE_COMP * rel_com); | |
547 EXTERN void cc_rel_ind (USHORT cause); | |
548 EXTERN void cc_err_ind (T_MMCM_ERROR_IND *mmcm_error_ind); | |
549 | |
550 /* | |
551 * Prototypes Call Control Functions | |
552 */ | |
553 EXTERN BOOL cc_voice_capability (void); | |
554 EXTERN BOOL cc_bcs_compatible (const T_M_CC_bearer_cap * bc1, | |
555 const T_M_CC_bearer_cap * bc2, | |
556 BOOL full); | |
557 EXTERN void cc_build_llc (UBYTE * v_low_layer_compat, | |
558 T_M_CC_low_layer_comp * low_layer_compat, | |
559 const T_M_CC_bearer_cap * bc); | |
560 | |
561 EXTERN void cc_build_bc (T_M_CC_bearer_cap * bearer_cap, | |
562 UBYTE * serv, | |
563 const T_MNCC_bcpara * bc_params); | |
564 | |
565 EXTERN void cc_set_conn_elem (T_M_CC_bearer_cap * bearer_cap, | |
566 UBYTE conn_elem, | |
567 UBYTE flow_control); | |
568 EXTERN void cc_set_sync_async (T_M_CC_bearer_cap * bearer_cap, | |
569 const T_MNCC_bcpara * bcpara); | |
570 | |
571 EXTERN void cc_set_user_rate (T_M_CC_bearer_cap * bearer_cap, | |
572 UBYTE rate, | |
573 UBYTE modem_type); | |
574 EXTERN void cc_build_call_confirm (T_U_CALL_CONF * call_cnf, | |
575 USHORT cause); | |
576 EXTERN void cc_build_cc_est_confirm (T_U_CC_EST_CONF * cc_est_conf, | |
577 USHORT cause); | |
578 EXTERN void cc_build_congestion_control (const T_MNCC_USER_REQ * user, | |
579 T_B_CONGEST_CTRL * cong_ctrl); | |
580 EXTERN void cc_build_disconnect (T_U_DISCONNECT * disconnect, | |
581 USHORT cause, | |
582 const T_NAS_fac_inf * fac_inf, | |
583 UBYTE ss_ver); | |
584 EXTERN void cc_build_emergency_setup (T_U_EMERGE_SETUP * emergency_setup); | |
585 EXTERN void cc_build_facility (const T_MNCC_FACILITY_REQ * facility, | |
586 T_U_FACILITY * facility_msg); | |
587 EXTERN void cc_build_mncc_alert_ind (const T_D_ALERT * alert, | |
588 T_MNCC_ALERT_IND * alert_ind); | |
589 EXTERN void cc_build_mncc_proceed_ind (const T_D_CALL_PROCEED * proceed, | |
590 T_MNCC_CALL_PROCEED_IND * proceed_ind); | |
591 EXTERN void cc_build_mncc_facility_ind (const T_D_FACILITY * facility, | |
592 T_MNCC_FACILITY_IND * facility_ind); | |
593 EXTERN void cc_build_mncc_progress_ind (const T_D_PROGRESS * progress, | |
594 T_MNCC_PROGRESS_IND * progress_ind); | |
595 EXTERN void cc_build_mncc_setup_cnf (const T_D_CONNECT * connect, | |
596 T_MNCC_SETUP_CNF * setup_cnf); | |
597 EXTERN void cc_build_mncc_setup_ind (const T_D_SETUP * setup, | |
598 T_MNCC_SETUP_IND * setup_ind); | |
599 EXTERN void cc_build_modify (const T_MNCC_MODIFY_REQ * modify, | |
600 T_B_MODIFY * modify_msg); | |
601 EXTERN void cc_build_modify_complete (T_B_MODIFY_COMP * modify_com); | |
602 EXTERN void cc_build_modify_reject (T_B_MODIFY_REJ * modify_rej, | |
603 USHORT cause); | |
604 EXTERN void cc_build_release (T_U_RELEASE * release, | |
605 USHORT cause, | |
606 const T_NAS_fac_inf * fac_inf, | |
607 UBYTE ss_ver); | |
608 EXTERN void cc_build_release_complete (T_U_RELEASE_COMP * rel_com, | |
609 USHORT cause); | |
610 EXTERN void cc_build_start_cc (T_U_START_CC * start_cc); | |
611 EXTERN void cc_build_llc_hlc (T_U_SETUP * setup); | |
612 EXTERN void cc_build_cc_capabilities (T_U_SETUP * setup); | |
613 EXTERN void cc_build_setup (T_U_SETUP * setup_msg, | |
614 const T_MNCC_SETUP_REQ *setup_prm); | |
615 EXTERN void cc_build_start_dtmf (UBYTE key, | |
616 T_U_START_DTMF * start_dtmf); | |
617 EXTERN void cc_build_alert (T_U_ALERT * alert_msg); | |
618 EXTERN void cc_build_connect (T_U_CONNECT * connect_msg); | |
619 EXTERN void cc_build_status (T_B_STATUS * status, | |
620 USHORT cause); | |
621 EXTERN void cc_build_user_ind_from_cong (T_MNCC_USER_IND * user, | |
622 const T_B_CONGEST_CTRL * cong); | |
623 EXTERN void cc_build_user_ind_from_user (T_MNCC_USER_IND * user_ind, | |
624 const T_B_USER_INFO * user); | |
625 EXTERN void cc_build_user_information (T_MNCC_USER_REQ * user, | |
626 T_B_USER_INFO * user_msg); | |
627 | |
628 EXTERN BOOL cc_check_error_flag (void); | |
629 EXTERN UBYTE cc_compatibility_check (const T_D_SETUP * setup); | |
630 EXTERN UBYTE cc_basic_service_align (T_U_SETUP * setup); | |
631 EXTERN UBYTE cc_count_active_connections (void); | |
632 EXTERN void cc_disconnect_after_timeout (void); | |
633 EXTERN void cc_encode_cause (T_M_CC_cc_cause * cc_cause, | |
634 USHORT cause); | |
635 EXTERN UBYTE cc_mtc_check_subaddr (const T_D_SETUP * setup); | |
636 EXTERN UBYTE cc_moc_compatibility (const T_D_CALL_PROCEED * proceed); | |
637 EXTERN void cc_set_state (UBYTE new_state); | |
638 EXTERN UBYTE cc_check_bc (const T_M_CC_bearer_cap * bearer_cap, | |
639 T_M_CC_bearer_cap * neg_bearer_cap, | |
640 T_MNCC_bcpara * bcpara, | |
641 UBYTE * service, | |
642 BOOL * negotiation); | |
643 EXTERN void cc_set_radio_channel_requirement | |
644 (T_M_CC_bearer_cap * bearer_cap, | |
645 const T_MNCC_bcpara * bc_para); | |
646 EXTERN void cc_set_trans_cap (T_M_CC_bearer_cap * bearer_cap, | |
647 const T_MNCC_bcpara * bcpara); | |
648 EXTERN void cc_set_data_default_parameter | |
649 (T_M_CC_bearer_cap * bearer_cap); | |
650 EXTERN void cc_build_facility_ind (UBYTE context, | |
651 UBYTE valid, | |
652 const T_M_CC_facility * facility); | |
653 EXTERN void cc_build_user_user_ind (UBYTE context, | |
654 UBYTE valid, | |
655 T_M_CC_user_user * user_user); | |
656 EXTERN UBYTE cc_check_capabilities (const T_MNCC_bcpara * bcpara); | |
657 EXTERN void cc_check_transparent_async (UBYTE * found, | |
658 const T_M_CC_bearer_cap * bearer_cap, | |
659 T_M_CC_bearer_cap * neg_bearer_cap, | |
660 T_MNCC_bcpara * bcpara, | |
661 BOOL * negotiation); | |
662 EXTERN void cc_check_non_transparent_async | |
663 (UBYTE * found, | |
664 const T_M_CC_bearer_cap * bearer_cap, | |
665 T_M_CC_bearer_cap * neg_bearer_cap, | |
666 T_MNCC_bcpara * bcpara, | |
667 BOOL * negotiation); | |
668 EXTERN UBYTE cc_check_transparent_fax (const T_M_CC_bearer_cap * bearer_cap, | |
669 T_M_CC_bearer_cap * neg_bearer_cap, | |
670 T_MNCC_bcpara * bcpara, | |
671 BOOL * negotiation); | |
672 | |
673 #ifdef SIM_TOOLKIT | |
674 EXTERN UBYTE cc_bearer_cap_code (const T_MNCC_bcpara *bcpara, | |
675 T_MNCC_bcconf *bcconf ); | |
676 EXTERN UBYTE cc_bearer_cap_decode (const T_MNCC_bcconf *bcconf, | |
677 T_MNCC_bcpara *bcpara ); | |
678 #endif | |
679 | |
680 | |
681 /* CQ 23619: Added supplementary diagnostic handling */ | |
682 EXTERN UBYTE cc_get_ss_diag ( USHORT curr_cause, | |
683 T_D_DISCONNECT * disc); | |
684 | |
685 EXTERN UBYTE cc_build_cause (T_M_CC_cc_cause * decoded_cause_val, | |
686 UBYTE * raw_cause_bytes); | |
687 | |
688 | |
689 /* Implements Measure# 3 and streamline encoding */ | |
690 EXTERN void cc_send_status (USHORT cause); | |
691 | |
692 /* | |
693 * Prototypes Services | |
694 */ | |
695 /* | |
696 * If all entities are linked into one module this definitions | |
697 * prefixes all this functions with the enity name | |
698 */ | |
699 #ifdef OPTION_MULTITHREAD | |
700 #define srv_convert_ti _ENTITY_PREFIXED(srv_convert_ti) | |
701 #define srv_define_ti _ENTITY_PREFIXED(srv_define_ti) | |
702 #define srv_free_ti _ENTITY_PREFIXED(srv_free_ti) | |
703 #define srv_free_stored_setup _ENTITY_PREFIXED(srv_free_stored_setup) | |
704 #define srv_store_prim _ENTITY_PREFIXED(srv_store_prim) | |
705 #define srv_use_stored_prim _ENTITY_PREFIXED(srv_use_stored_prim) | |
706 #endif | |
707 | |
708 EXTERN UBYTE srv_convert_ti (UBYTE ti); | |
709 EXTERN UBYTE srv_define_ti (void); | |
710 EXTERN void srv_free_ti (void); | |
711 EXTERN void srv_free_stored_setup (void); | |
712 EXTERN void srv_store_prim (T_PRIM * prim); | |
713 EXTERN void srv_use_stored_prim (void); | |
714 | |
715 /* | |
716 * Prototypes Timer | |
717 */ | |
718 /* | |
719 * If all entities are linked into one module this definitions | |
720 * prefixes all this functions with the enity name | |
721 */ | |
722 #ifdef OPTION_MULTITHREAD | |
723 #define tim_exec_timeout _ENTITY_PREFIXED(tim_exec_timeout) | |
724 #define tim_t303_u0_1 _ENTITY_PREFIXED(tim_t303_u0_1) | |
725 #define tim_t303_u1 _ENTITY_PREFIXED(tim_t303_u1) | |
726 #define tim_t305_u11 _ENTITY_PREFIXED(tim_t305_u11) | |
727 #define tim_t308_u19 _ENTITY_PREFIXED(tim_t308_u19) | |
728 #define tim_t310_u3 _ENTITY_PREFIXED(tim_t310_u3) | |
729 #define tim_t313_u8 _ENTITY_PREFIXED(tim_t313_u8) | |
730 #define tim_t323_u26 _ENTITY_PREFIXED(tim_t323_u26) | |
731 #define tim_t332_u0_3 _ENTITY_PREFIXED(tim_t332_u0_3) | |
732 #define tim_t335_u0_5 _ENTITY_PREFIXED(tim_t335_u0_5) | |
733 #define tim_t336 _ENTITY_PREFIXED(tim_t336) | |
734 #define tim_t337 _ENTITY_PREFIXED(tim_t337) | |
735 #endif | |
736 | |
737 EXTERN void tim_exec_timeout (USHORT index); | |
738 | |
739 EXTERN void tim_t303_u0_1 (void); | |
740 EXTERN void tim_t303_u1 (void); | |
741 EXTERN void tim_t305_u11 (void); | |
742 EXTERN void tim_t308_u19 (void); | |
743 EXTERN void tim_t310_u3 (void); | |
744 EXTERN void tim_t313_u8 (void); | |
745 EXTERN void tim_t323_u26 (void); | |
746 EXTERN void tim_t332_u0_3 (void); | |
747 EXTERN void tim_t335_u0_5 (void); | |
748 EXTERN void tim_t336 (void); | |
749 EXTERN void tim_t337 (void); | |
750 | |
751 | |
752 | |
753 /* | |
754 * Prototypes Customer Specific Functions | |
755 */ | |
756 GLOBAL void cc_csf_ms_cap (void); | |
757 | |
758 #ifdef TRACE_BCAP | |
759 #define trace_buf cc_data->string_buf | |
760 #endif /* #ifdef TRACE_BCAP */ | |
761 | |
762 /* | |
763 * CC uses two timers for each instance, one for DTMF operation (T336, T337) | |
764 * and one for the support of all other CC timers. | |
765 * The timer for the supervision of the CC states is addressed by the | |
766 * transaction identifier, the timer for the supervision of DTMF operation | |
767 * is addressed by the transaction identifier plus an offset of MAX_CC_CALLS. | |
768 * The macros are looking a little bit too complicated, | |
769 * but they have the advantage of avoiding a lot of #ifdefs in the | |
770 * code and it is expected that the if clauses are optimized | |
771 * away by the C compiler. So no disadvantage at runtime is expected | |
772 * if these macros remain macros and are not altered to functions. | |
773 */ | |
774 #define TIMER_CC 0 /* Used to stop all timers except T336, T337 */ | |
775 #define TIMER_DTMF 1 /* Uses to stop T336, T337 which control DTMF */ | |
776 | |
777 #define TIMERSTART(i,v) \ | |
778 if ((i NEQ T336) AND (i NEQ T337)) \ | |
779 TIMER_START (cc_handle, (USHORT)(cc_data->index_ti), v); \ | |
780 else \ | |
781 TIMER_START (cc_handle, (USHORT)(cc_data->index_ti+MAX_CC_CALLS), v); | |
782 | |
783 #define TIMERSTOP(i) \ | |
784 if (i EQ TIMER_CC) \ | |
785 TIMER_STOP (cc_handle, (USHORT)(cc_data->index_ti)); \ | |
786 else \ | |
787 TIMER_STOP (cc_handle, (USHORT)(cc_data->index_ti+MAX_CC_CALLS)); | |
788 | |
789 /* | |
790 * If all entities are linked into one module this definitions | |
791 * prefixes the global data with the enity name | |
792 */ | |
793 #ifdef OPTION_MULTITHREAD | |
794 #ifdef TI_PS_HCOMM_CHANGE | |
795 #else | |
796 #define hCommMMI _ENTITY_PREFIXED(hCommMMI) | |
797 #define hCommMM _ENTITY_PREFIXED(hCommMM) | |
798 #endif | |
799 #endif | |
800 | |
801 #ifdef TI_PS_HCOMM_CHANGE | |
802 #else | |
803 EXTERN T_HANDLE hCommMMI; /* MMI Communication */ | |
804 EXTERN T_HANDLE hCommMM; /* MM Communication */ | |
805 #endif | |
806 EXTERN T_HANDLE cc_handle; | |
807 | |
808 /* | |
809 * If all entities are linked into one module this definitions | |
810 * prefixes the global data with the enity name | |
811 */ | |
812 #ifdef OPTION_MULTITHREAD | |
813 #define _decodedMsg _ENTITY_PREFIXED(_decodedMsg) | |
814 #endif | |
815 | |
816 #if !defined SHARED_CCD_BUF | |
817 #define CCD_START | |
818 #define CCD_END | |
819 EXTERN UBYTE _decodedMsg []; | |
820 #else | |
821 EXTERN UBYTE * _decodedMsg; | |
822 #define CCD_START _decodedMsg = ccd_begin(); | |
823 #define CCD_END ccd_end(); | |
824 #endif | |
825 | |
826 /* | |
827 * If all entities are linked into one module this definitions | |
828 * prefixes the global data with the enity name | |
829 */ | |
830 #ifdef OPTION_MULTITHREAD | |
831 #define data_base _ENTITY_PREFIXED(data_base) | |
832 #endif | |
833 | |
834 #ifdef OPTION_MULTIPLE_INSTANCE | |
835 | |
836 EXTERN T_CC_DATA data_base [MAX_INSTANCES]; | |
837 | |
838 #define GET_INSTANCE(p) &data_base[D2P(p)->custom.route.inst_no] | |
839 | |
840 #else | |
841 | |
842 EXTERN T_CC_DATA data_base; | |
843 | |
844 | |
845 #define GET_INSTANCE_DATA register T_CC_DATA *cc_data= &data_base | |
846 | |
847 | |
848 #endif | |
849 | |
850 /* | |
851 * If all entities are linked into one module this definitions | |
852 * prefixes the global data with the entity name | |
853 */ | |
854 #define bc_prio_0 _ENTITY_PREFIXED(bc_prio_0) | |
855 | |
856 EXTERN const UBYTE bc_prio_0 [4]; | |
857 | |
858 #ifndef _TMS470 | |
859 int sprintf (char *, const char *, ...); /* Use appropriate include ... */ | |
860 #define Sprintf sprintf | |
861 #endif | |
862 | |
863 #ifdef WIN32 | |
864 EXTERN UBYTE std; | |
865 #endif /* WIN32 */ | |
866 | |
867 EXTERN void cc_pei_primitive (T_PRIM * prim); | |
868 #endif |