comparison src/aci2/aci/aci_pei.c @ 3:93999a60b835

src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 26 Sep 2016 00:29:36 +0000
parents
children ba63f14d1e84
comparison
equal deleted inserted replaced
2:c41a534f33c6 3:93999a60b835
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 : This module implements the process body interface
18 | for the AT Command Interpreter.
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifndef ACI_PEI_C
23 #define ACI_PEI_C
24
25 #include "aci_all.h"
26
27 #include "ccdapi.h"
28 #include "cnf_aci.h"
29 #include "mon_aci.h" /* mouais... */
30 #include "P_ACI.val" /* SKA 2002-09-02 for MAX_CMD_LEN */
31 #include "line_edit.h" /* SKA 2002-09-02 */
32 #include "aci_cmh.h"
33 #include "ati_cmd.h"
34 #include "aci_cmd.h"
35 #include "aci.h"
36 #include "aci_mem.h"
37
38 #ifndef _SIMULATION_
39 #include "rv_swe.h"
40 #ifdef RVM_GIL_SWE
41 #include "gil/gil_gpf.h" /* MMI_GIL_IND dispatch function */
42 #endif /* RVM_GIL_SWE */
43 #endif /* _SIMULATION_ */
44
45
46 #include "psa.h"
47 #include "psa_cc.h"
48 #include "psa_mm.h"
49 #include "psa_sim.h"
50 #include "psa_mmi.h"
51 #include "psa_sms.h"
52 #include "aoc.h"
53 #include "phb.h"
54 #include "hl_audio_drv.h"
55
56 #include "aci_lst.h"
57
58 #ifdef DTI
59 #include "dti.h" /* functionality of the dti library */
60 #include "dti_conn_mng.h"
61 #include "dti_cntrl_mng.h"
62 #endif
63
64 #ifdef GPRS
65 #include "gprs.h"
66 #include "gaci_cmh.h"
67 #include "psa_gmm.h"
68 #include "psa_sm.h"
69 #include "psa_gppp.h"
70 #endif /* GPRS */
71
72 #ifdef UART
73 #include "psa_uart.h"
74 #include "cmh_uart.h"
75 #endif
76
77 #ifdef FF_ATI
78 #include "aci_io.h"
79 #endif
80
81 #ifdef FF_PSI
82 #include "psa_psi.h"
83 #include "cmh_psi.h"
84 #endif /*FF_PSI*/
85
86 #ifdef FAX_AND_DATA
87 #include "aci_fd.h"
88 #include "psa_ra.h"
89 #include "psa_l2r.h"
90 #ifdef FF_FAX
91 #include "psa_t30.h"
92 #endif
93 #endif
94
95 #if defined (FF_WAP) || defined (FF_TCP_IP) || defined(FF_GPF_TCPIP)|| defined (FF_SAT_E)
96 #include "psa_ppp_w.h"
97 #endif
98 #if defined (CO_UDP_IP) || defined (FF_GPF_TCP_IP)
99 #include "psa_tcpip.h"
100 #endif /* defined (CO_UDP_IP) || defined(FF_GPF_TCPIP) */
101
102 #include "cmh.h"
103
104 #ifdef SIM_TOOLKIT
105 #include "psa_sat.h"
106 #endif
107
108 #ifdef MFW
109 #include "mfw_acie.h"
110 #endif
111
112 #include "gdi.h"
113 #include "audio.h"
114 #include "rx.h"
115 #include "pwr.h"
116
117
118 #ifdef BT_ADAPTER
119 #include "bti.h"
120 #include "bti_aci.h"
121 #endif
122
123 #ifdef FF_PKTIO
124 #include "psa_pktio.h"
125 #endif
126 #ifdef _SIMULATION_
127 #include "ati_src_tst.h"
128 #endif
129
130 #if defined FF_EOTD
131 #include "ati_src_lc.h"
132 #endif
133
134 #ifdef DTI
135 #include "sap_dti.h"
136 #endif
137
138 #include "psa_ss.h"
139 #ifdef FF_ESIM
140 #include "psa_aaa.h" /* esim */
141 #endif
142
143 #ifdef FF_MMI_RIV
144 EXTERN void acia_init(void);
145 #endif
146
147 #ifdef _SIMULATION_
148 #ifdef FF_ATI_BAT
149 #include "ati_bat.h"
150 #endif
151 #endif
152
153
154 /*==== DEFINE =====================================================*/
155
156 /*==== EXPORT =====================================================*/
157
158 GLOBAL UBYTE mode = 1;
159 /*
160 * instance data base
161 */
162
163 /*==== PRIVATE ====================================================*/
164
165 LOCAL const void pei_not_supported (void *data);
166
167 /*==== VARIABLES ==================================================*/
168 LOCAL BOOL first_access = TRUE;
169 LOCAL T_MONITOR aci_mon;
170
171 /*==== FUNCTIONS ==================================================*/
172
173 #ifdef SMI
174 EXTERN T_PEI_RETURN _pei_init (void);
175 EXTERN T_PEI_RETURN _pei_primitive (T_PRIM *prim);
176 EXTERN T_PEI_RETURN _pei_exit (void);
177 EXTERN T_PEI_RETURN _pei_monitor (void ** monitor);
178 EXTERN T_PEI_RETURN _pei_config ( T_PEI_CONFIG inString );
179 #endif /* SMI */
180 EXTERN void tim_exec_timeout (USHORT index);
181
182 /*
183 +--------------------------------------------------------------------+
184 | PROJECT : GSM-F&D (8411) MODULE : RLP_PEI |
185 | STATE : code ROUTINE : pei_not_supported |
186 +--------------------------------------------------------------------+
187
188 PURPOSE : An unsupported primitive is received.
189
190 */
191
192 LOCAL const void pei_not_supported (void *data)
193 {
194 TRACE_FUNCTION ("pei_not_supported()");
195
196 PFREE (data);
197 }
198
199 /*
200 *
201 * Use MAK_FUNC_0 for primitives which contains no SDU.
202 *
203 * Use MAK_FUNC_S for primitives which contains a SDU.
204 */
205
206 /*
207 * jumptable for the entity service access point. Contains
208 * the processing-function addresses and opcodes of
209 * request and response primitives.
210 *
211 */
212 LOCAL const T_FUNC sim_table[] = {
213 MAK_FUNC_0( psa_sim_read_cnf, SIM_READ_CNF ),
214 MAK_FUNC_0( psa_sim_update_cnf, SIM_UPDATE_CNF ),
215 MAK_FUNC_0( psa_sim_read_record_cnf, SIM_READ_RECORD_CNF ),
216 MAK_FUNC_N( pei_not_supported, 0 ),
217 MAK_FUNC_0( psa_sim_update_record_cnf, SIM_UPDATE_RECORD_CNF ),
218 MAK_FUNC_N( pei_not_supported, 0 ),
219 MAK_FUNC_N( pei_not_supported, 0 ),
220 MAK_FUNC_N( pei_not_supported, 0 ),
221 MAK_FUNC_0( psa_sim_increment_cnf, SIM_INCREMENT_CNF ),
222 MAK_FUNC_0( psa_sim_verify_pin_cnf, SIM_VERIFY_PIN_CNF ),
223 MAK_FUNC_0( psa_sim_change_pin_cnf, SIM_CHANGE_PIN_CNF ),
224 MAK_FUNC_0( psa_sim_disable_pin_cnf, SIM_DISABLE_PIN_CNF ),
225 MAK_FUNC_0( psa_sim_enable_pin_cnf, SIM_ENABLE_PIN_CNF ),
226 MAK_FUNC_0( psa_sim_unblock_cnf, SIM_UNBLOCK_CNF ),
227 MAK_FUNC_N( pei_not_supported, 0 ),
228 MAK_FUNC_0( psa_sim_mmi_insert_ind, SIM_MMI_INSERT_IND ),
229 MAK_FUNC_N( pei_not_supported, 0 ),
230 MAK_FUNC_0( psa_sim_remove_ind, SIM_REMOVE_IND ),
231 MAK_FUNC_0( psa_sim_sync_cnf, SIM_SYNC_CNF ),
232 MAK_FUNC_0( psa_sim_activate_cnf, SIM_ACTIVATE_CNF ),
233 MAK_FUNC_N( pei_not_supported, 0 ),/*20*/
234 #ifdef SIM_TOOLKIT
235 MAK_FUNC_0( psa_sim_toolkit_ind, SIM_TOOLKIT_IND ),
236 MAK_FUNC_0( psa_sim_toolkit_cnf, SIM_TOOLKIT_CNF ),
237 #else
238 MAK_FUNC_N( pei_not_supported, 0 ),
239 MAK_FUNC_N( pei_not_supported, 0 ),
240 #endif
241 MAK_FUNC_0( psa_sim_activate_ind, SIM_ACTIVATE_IND ),/*23*/
242 MAK_FUNC_N( pei_not_supported, 0 ),
243 MAK_FUNC_0( psa_sim_access_cnf, SIM_ACCESS_CNF ),
244 #ifdef SIM_TOOLKIT
245 MAK_FUNC_0( psa_sim_file_update_ind, SIM_FILE_UPDATE_IND ),
246 #else
247 MAK_FUNC_N( pei_not_supported, 0 ),
248 #endif
249 MAK_FUNC_N( pei_not_supported, 0 ),/* SIM_GMM_INSERT_IND */
250 #ifdef FF_SAT_E
251 MAK_FUNC_0( psa_sim_dti_cnf, SIM_DTI_CNF ),/*28*/
252 MAK_FUNC_0( psa_sim_bip_cnf, SIM_BIP_CNF ),/*29*/
253 MAK_FUNC_0( psa_sim_bip_config_cnf, SIM_BIP_CONFIG_CNF ),/*30*/
254 MAK_FUNC_0( psa_sim_dti_bip_ind, SIM_DTI_BIP_IND ),/*31*/
255 MAK_FUNC_0( psa_sim_eventlist_cnf, SIM_EVENTLIST_CNF ),/*32*/
256 #else
257 MAK_FUNC_N( pei_not_supported, 0 ),
258 MAK_FUNC_N( pei_not_supported, 0 ),
259 MAK_FUNC_N( pei_not_supported, 0 ),
260 MAK_FUNC_N( pei_not_supported, 0 ),
261 MAK_FUNC_N( pei_not_supported, 0 ),
262 #endif
263 MAK_FUNC_N( pei_not_supported, 0 ) /*33*/
264 };
265
266 LOCAL const T_FUNC mmr_table[] = {
267 MAK_FUNC_0( psa_mmr_reg_cnf, MMR_REG_CNF ),
268 MAK_FUNC_0( psa_mmr_nreg_ind, MMR_NREG_IND ),
269 MAK_FUNC_0( psa_mmr_nreg_cnf, MMR_NREG_CNF ),
270 MAK_FUNC_0( psa_mmr_plmn_ind, MMR_PLMN_IND ),
271 MAK_FUNC_0( psa_mmr_info_ind, MMR_INFO_IND ),
272 MAK_FUNC_0( psa_mmr_ciphering_ind, MMR_CIPHERING_IND ),
273 MAK_FUNC_0( psa_mmr_ahplmn_ind, MMR_AHPLMN_IND )
274 };
275
276 LOCAL const T_FUNC mncc_table[] = {
277 MAK_FUNC_0( psa_mncc_alert_ind, MNCC_ALERT_IND ),
278 MAK_FUNC_0( psa_mncc_call_proceed_ind, MNCC_CALL_PROCEED_IND ),
279 MAK_FUNC_0( psa_mncc_disconnect_ind, MNCC_DISCONNECT_IND ),
280 MAK_FUNC_0( psa_mncc_hold_cnf, MNCC_HOLD_CNF ),
281 MAK_FUNC_0( psa_mncc_modify_cnf, MNCC_MODIFY_CNF ),
282 MAK_FUNC_0( psa_mncc_modify_ind, MNCC_MODIFY_IND ),
283 MAK_FUNC_N( pei_not_supported, 0 ),
284 MAK_FUNC_0( psa_mncc_progress_ind, MNCC_PROGRESS_IND ),
285 MAK_FUNC_0( psa_mncc_reject_ind, MNCC_REJECT_IND ),
286 MAK_FUNC_0( psa_mncc_release_cnf, MNCC_RELEASE_CNF ),
287 MAK_FUNC_0( psa_mncc_release_ind, MNCC_RELEASE_IND ),
288 MAK_FUNC_0( psa_mncc_retrieve_cnf, MNCC_RETRIEVE_CNF ),
289 MAK_FUNC_0( psa_mncc_setup_cnf, MNCC_SETUP_CNF ),
290 MAK_FUNC_0( psa_mncc_setup_compl_ind, MNCC_SETUP_COMPL_IND ),
291 MAK_FUNC_0( psa_mncc_setup_ind, MNCC_SETUP_IND ),
292 MAK_FUNC_0( psa_mncc_start_dtmf_cnf, MNCC_START_DTMF_CNF ),
293 MAK_FUNC_0( psa_mncc_sync_ind, MNCC_SYNC_IND ),
294 MAK_FUNC_0( psa_mncc_user_ind, MNCC_USER_IND ),
295 MAK_FUNC_0( psa_mncc_facility_ind, MNCC_FACILITY_IND ),
296 MAK_FUNC_0( psa_mncc_bearer_cap_cnf, MNCC_BEARER_CAP_CNF ),
297 MAK_FUNC_0( psa_mncc_prompt_ind, MNCC_PROMPT_IND ),
298 MAK_FUNC_0( psa_mncc_recall_ind, MNCC_RECALL_IND ),
299 MAK_FUNC_0( psa_mncc_status_ind, MNCC_STATUS_IND )
300 };
301
302 LOCAL const T_FUNC mnss_table[] = {
303 MAK_FUNC_0( psa_mnss_begin_ind, MNSS_BEGIN_IND ),
304 MAK_FUNC_0( psa_mnss_facility_ind, MNSS_FACILITY_IND ),
305 MAK_FUNC_0( psa_mnss_end_ind, MNSS_END_IND )
306 };
307
308 LOCAL const T_FUNC mnsms_table[] = {
309 MAK_FUNC_0( psa_mnsms_delete_cnf, MNSMS_DELETE_CNF ),
310 MAK_FUNC_0( psa_mnsms_read_cnf, MNSMS_READ_CNF ),
311 MAK_FUNC_0( psa_mnsms_store_cnf, MNSMS_STORE_CNF ),
312 MAK_FUNC_0( psa_mnsms_submit_cnf, MNSMS_SUBMIT_CNF ),
313 MAK_FUNC_0( psa_mnsms_command_cnf, MNSMS_COMMAND_CNF ),
314 MAK_FUNC_N( pei_not_supported, 0 ),
315 MAK_FUNC_0( psa_mnsms_report_ind, MNSMS_REPORT_IND ),
316 MAK_FUNC_0( psa_mnsms_status_ind, MNSMS_STATUS_IND ),
317 MAK_FUNC_0( psa_mnsms_message_ind, MNSMS_MESSAGE_IND ),
318 MAK_FUNC_0( psa_mnsms_error_ind, MNSMS_ERROR_IND ),
319 MAK_FUNC_0( psa_mnsms_resume_cnf, MNSMS_RESUME_CNF ),
320 MAK_FUNC_0( psa_mnsms_query_cnf, MNSMS_QUERY_CNF ),
321 #ifdef GPRS
322 MAK_FUNC_0( psa_mnsms_mo_serv_cnf, MNSMS_MO_SERV_CNF ),
323 #else
324 MAK_FUNC_N( pei_not_supported, 0 ),
325 #endif /* GPRS */
326 #ifdef SIM_PERS_OTA
327 MAK_FUNC_0( psa_mnsms_OTA_decode_ind, MNSMS_OTA_DECODE_IND )
328 #else
329 MAK_FUNC_N( pei_not_supported, 0 )
330 #endif
331 };
332
333 LOCAL const T_FUNC mmi_table[] = {
334 MAK_FUNC_0( psa_mmi_keypad_ind, MMI_KEYPAD_IND ),
335 MAK_FUNC_0( psa_mmi_cbch_ind, MMI_CBCH_IND ),
336 MAK_FUNC_0( psa_mmi_rxlev_ind, MMI_RXLEV_IND ),
337 MAK_FUNC_0( psa_mmi_battery_ind, MMI_BATTERY_IND ),
338 #ifdef SIM_TOOLKIT
339 MAK_FUNC_0( psa_sat_cbch_dnl_ind, MMI_SAT_CBCH_DWNLD_IND ),
340 #else
341 MAK_FUNC_N( pei_not_supported, 0 ),
342 #endif
343 #ifdef BTE_MOBILE
344 MAK_FUNC_0( psa_mmi_bt_cb_notify_ind, MMI_BT_CB_NOTIFY_IND ),
345 #else
346 MAK_FUNC_N( pei_not_supported, 0 ),
347 #endif
348 #ifdef RVM_GIL_SWE
349 MAK_FUNC_N( pei_not_supported, 0 ), /* RPD MSG ? */
350 MAK_FUNC_0( gil_gpf_dispatch_message, MMI_GIL_IND ),
351 #else
352 MAK_FUNC_N( pei_not_supported, 0 ),
353 MAK_FUNC_N( pei_not_supported, 0 ),
354 #endif /* RVM_GIL_SWE */
355 #ifndef VOCODER_FUNC_INTERFACE
356 MAK_FUNC_0( psa_mmi_tch_vocoder_cfg_con, MMI_TCH_VOCODER_CFG_CON )
357 #else
358 MAK_FUNC_N( pei_not_supported, 0 )
359 #endif
360 };
361
362 #ifdef DTI
363 LOCAL const T_FUNC dti_dl_table[] = {
364 MAK_FUNC_0( dti_lib_dti_dti_connect_ind , DTI2_CONNECT_IND ), /* 7700x */
365 MAK_FUNC_0( dti_lib_dti_dti_connect_cnf , DTI2_CONNECT_CNF ), /* 7701x */
366 MAK_FUNC_0( dti_lib_dti_dti_disconnect_ind , DTI2_DISCONNECT_IND ), /* 7702x */
367 MAK_FUNC_0( dti_lib_dti_dti_ready_ind , DTI2_READY_IND ), /* 7703x */
368 MAK_FUNC_0( dti_lib_dti_dti_data_ind , DTI2_DATA_IND ), /* 7704x */
369 #if defined (_SIMULATION_)
370 MAK_FUNC_S( dti_lib_dti_dti_data_test_ind , DTI2_DATA_TEST_IND )
371 #else /* _SIMULATION_ */
372 MAK_FUNC_N( pei_not_supported , 0)
373 #endif /* _SIMULATION_ */
374 };
375 #endif /* UART */
376
377 #ifdef FF_EM_MODE
378 LOCAL const T_FUNC em_table[] = {
379 MAK_FUNC_0( psa_em_sc_info_cnf, EM_SC_INFO_CNF ), /* 0x7E00 */
380 #ifdef GPRS
381 MAK_FUNC_0( psa_em_sc_gprs_info_cnf, EM_SC_GPRS_INFO_CNF ), /* 0x7E01 */
382 #else
383 MAK_FUNC_N( pei_not_supported, EM_SC_GPRS_INFO_CNF ), /* 0x7E01 */
384 #endif /* GPRS */
385 MAK_FUNC_0( psa_em_nc_info_cnf, EM_NC_INFO_CNF ), /* 0x7E02 */
386 MAK_FUNC_0( psa_em_loc_pag_info_cnf, EM_LOC_PAG_INFO_CNF ), /* 0x7E03 */
387 MAK_FUNC_0( psa_em_plmn_info_cnf, EM_PLMN_INFO_CNF ), /* 0x7E04 */
388 MAK_FUNC_0( psa_em_cip_hop_dtx_info_cnf, EM_CIP_HOP_DTX_INFO_CNF ), /* 0x7E05 */
389 MAK_FUNC_0( psa_em_power_info_cnf, EM_POWER_INFO_CNF ), /* 0x7E06 */
390 MAK_FUNC_0( psa_em_identity_info_cnf, EM_IDENTITY_INFO_CNF ), /* 0x7E07 */
391 MAK_FUNC_0( psa_em_sw_version_info_cnf, EM_SW_VERSION_INFO_CNF ), /* 0x7E08 */
392 MAK_FUNC_N( pei_not_supported, 0 ), /* 0x7E09 */
393 MAK_FUNC_N( pei_not_supported, 0 ), /* 0x7E0A */
394 MAK_FUNC_0( em_event_trace_ind, EM_DATA_IND ), /* 0x7E0B */
395 MAK_FUNC_N( pei_not_supported, 0 ), /* 0x7E0C */
396 MAK_FUNC_N( pei_not_supported, 0 ), /* 0x7E0D */
397 MAK_FUNC_N( pei_not_supported, 0 ), /* 0x7E0E */
398 MAK_FUNC_N( pei_not_supported, 0 ), /* 0x7E0F */
399 MAK_FUNC_N( pei_not_supported, 0 ), /* 0x7E10 */
400 MAK_FUNC_N( pei_not_supported, 0 ), /* 0x7E11 */
401 MAK_FUNC_N( pei_not_supported, 0 ), /* 0x7E12 */
402 MAK_FUNC_N( pei_not_supported, 0 ), /* 0x7E13 */
403 MAK_FUNC_N( pei_not_supported, 0 ), /* 0x7E14 */
404 MAK_FUNC_N( pei_not_supported, 0 ), /* 0x7E15 */
405 MAK_FUNC_N( pei_not_supported, 0 ), /* 0x7E16 */
406 #ifdef GPRS
407 MAK_FUNC_0( psa_em_gmm_info_cnf, EM_GMM_INFO_CNF ), /* 0x7E17 */ /*GMM_INFO*/
408 MAK_FUNC_0( psa_em_grlc_info_cnf, EM_GRLC_INFO_CNF ), /* 0x7E18 */ /*GRLC_INFO*/
409 #else
410 MAK_FUNC_N( pei_not_supported, EM_GMM_INFO_CNF ), /* 0x7E17 */
411 MAK_FUNC_N( pei_not_supported, EM_GRLC_INFO_CNF ), /* 0x7E18 */
412 #endif /* GPRS */
413 MAK_FUNC_0( psa_em_amr_info_cnf, EM_AMR_INFO_CNF ) /* 0x7E19 */
414 };
415 #endif /* FF_EM_MODE */
416
417 #ifdef FF_ATI
418 /* ES!! #if !defined (MFW) */
419 LOCAL const T_FUNC aci_table[] = {
420 MAK_FUNC_0( aci_aci_cmd_req, ACI_CMD_REQ ),
421 MAK_FUNC_0( aci_aci_abort_req, ACI_ABORT_REQ ),
422 #ifdef BT_ADAPTER
423 MAK_FUNC_0( aci_aci_cmd_res , ACI_CMD_RES ),
424 MAK_FUNC_0( aci_aci_init_res , ACI_INIT_RES ),
425 MAK_FUNC_0( aci_aci_deinit_req , ACI_DEINIT_REQ ),
426 MAK_FUNC_0( aci_aci_open_port_req , ACI_OPEN_PORT_REQ ),
427 MAK_FUNC_0( aci_aci_close_port_req, ACI_CLOSE_PORT_REQ ),
428 MAK_FUNC_0( aci_aci_cmd_req_bt, ACI_CMD_REQ_BT ),
429 MAK_FUNC_0( aci_aci_cmd_res_bt, ACI_CMD_RES_BT ),
430 MAK_FUNC_0( aci_aci_abort_req_bt, ACI_ABORT_REQ_BT ),
431 #else
432 MAK_FUNC_N( pei_not_supported, 0 ),
433 MAK_FUNC_N( pei_not_supported, 0 ),
434 MAK_FUNC_N( pei_not_supported, 0 ),
435 MAK_FUNC_N( pei_not_supported, 0 ),
436 MAK_FUNC_N( pei_not_supported, 0 ),
437 MAK_FUNC_N( pei_not_supported, 0 ),
438 MAK_FUNC_N( pei_not_supported, 0 ),
439 MAK_FUNC_N( pei_not_supported, 0 ),
440 #endif /* BT_ADAPTER */
441 MAK_FUNC_0( aci_aci_trc_ind, ACI_TRC_IND ),
442 MAK_FUNC_0( aci_aci_ext_ind, ACI_EXT_IND ),
443 #ifdef FF_MMI_RIV
444 MAK_FUNC_0( aci_aci_riv_cmd_req, ACI_RIV_CMD_REQ )
445 #else
446 MAK_FUNC_N( pei_not_supported, 0 )
447 #endif /* FF_MMI_RIV */
448 };
449 /* ES!! #endif */
450 #endif
451
452 #ifdef FAX_AND_DATA
453
454 LOCAL const T_FUNC ra_table[] = {
455 MAK_FUNC_N( pei_not_supported, 0 /* RA_READY_IND */),
456 MAK_FUNC_N( pei_not_supported, 0 /* RA_DATA_IND */),
457 MAK_FUNC_0( psa_ra_activate_cnf, RA_ACTIVATE_CNF ),
458 MAK_FUNC_0( psa_ra_deactivate_cnf, RA_DEACTIVATE_CNF ),
459 MAK_FUNC_N( pei_not_supported, 0 /* RA_BREAK_IND */)
460 #ifdef FF_FAX
461 ,
462 MAK_FUNC_0( psa_ra_modify_cnf, RA_MODIFY_CNF )
463 #endif
464 };
465
466 #ifdef DTI
467 LOCAL const T_FUNC l2r_table[] = {
468 MAK_FUNC_0( psa_l2r_activate_cnf, L2R_ACTIVATE_CNF ),
469 MAK_FUNC_0( psa_l2r_deactivate_cnf, L2R_DEACTIVATE_CNF ),
470 MAK_FUNC_0( psa_l2r_connect_cnf, L2R_CONNECT_CNF ),
471 MAK_FUNC_0( psa_l2r_connect_ind, L2R_CONNECT_IND ),
472 MAK_FUNC_0( psa_l2r_disc_cnf, L2R_DISC_CNF ),
473 MAK_FUNC_0( psa_l2r_disc_ind, L2R_DISC_IND ),
474 MAK_FUNC_N( pei_not_supported, 0 /* L2R_READY_IND */),
475 MAK_FUNC_N( pei_not_supported, 0 /* L2R_DATA_IND */),
476 MAK_FUNC_N( pei_not_supported, 0 /* L2R_BREAK_CNF */),
477 MAK_FUNC_N( pei_not_supported, 0 /* L2R_BREAK_IND */),
478 MAK_FUNC_N( psa_l2r_xid_ind, L2R_XID_IND ),
479 MAK_FUNC_0( psa_l2r_error_ind, L2R_ERROR_IND ),
480 MAK_FUNC_0( psa_l2r_reset_ind, L2R_RESET_IND ),
481 MAK_FUNC_0( psa_l2r_statistic_ind, L2R_STATISTIC_IND ),
482 MAK_FUNC_0( psa_l2r_dti_cnf, L2R_DTI_CNF ),
483 MAK_FUNC_0( psa_l2r_dti_ind, L2R_DTI_IND )
484 };
485
486 #ifdef FF_FAX
487 LOCAL const T_FUNC t30_table[] = {
488 MAK_FUNC_0( psa_t30_cap_ind, T30_CAP_IND ),
489 MAK_FUNC_0( psa_t30_sgn_ind, T30_SGN_IND ),
490 MAK_FUNC_0( psa_t30_cmpl_ind, T30_CMPL_IND ),
491 MAK_FUNC_S( psa_t30_report_ind, T30_REPORT_IND ),
492 MAK_FUNC_0( psa_t30_error_ind, T30_ERROR_IND ),
493 MAK_FUNC_0( psa_t30_deactivate_cnf, T30_DEACTIVATE_CNF ),
494 MAK_FUNC_0( psa_t30_activate_cnf, T30_ACTIVATE_CNF ),
495 MAK_FUNC_0( psa_t30_preamble_ind, T30_PREAMBLE_IND ),
496 MAK_FUNC_0( psa_t30_dti_ind, T30_DTI_IND ),
497 MAK_FUNC_0( psa_t30_dti_cnf, T30_DTI_CNF ),
498 MAK_FUNC_0( psa_t30_phase_ind, T30_PHASE_IND ),
499 MAK_FUNC_0( psa_t30_eol_ind, T30_EOL_IND ),
500 MAK_FUNC_N( pei_not_supported, 0 )
501 };
502 #endif /* FF_FAX */
503
504 LOCAL const T_FUNC tra_table[] = {
505 MAK_FUNC_0( psa_tra_activate_cnf, TRA_ACTIVATE_CNF ),
506 MAK_FUNC_0( psa_tra_deactivate_cnf, TRA_DEACTIVATE_CNF ),
507 MAK_FUNC_0( psa_tra_dti_cnf, TRA_DTI_CNF ),
508 MAK_FUNC_0( psa_tra_dti_ind, TRA_DTI_IND ),
509 };
510 #endif /* DTI */
511 #endif /* FAX_AND_DATA */
512
513 #ifdef FF_GPF_TCPIP
514 LOCAL const T_FUNC tcpip_table[] = {
515 MAK_FUNC_0 (psa_tcpip_initialize_cnf, TCPIP_INITIALIZE_CNF ), /* 0x00 */
516 MAK_FUNC_N (psa_tcpip_shutdown_cnf, TCPIP_SHUTDOWN_CNF ), /* 0x01 */
517 MAK_FUNC_0 (psa_tcpip_ifconfig_cnf, TCPIP_IFCONFIG_CNF ), /* 0x02 */
518 MAK_FUNC_0 (psa_tcpip_dti_cnf, TCPIP_DTI_CNF ) /* 0x03 */
519 };
520 #endif
521
522 #ifdef CO_UDP_IP
523 LOCAL const T_FUNC udpa_table[] = {
524 MAK_FUNC_0( psa_udpa_dti_cnf, UDPA_DTI_CNF ),
525 MAK_FUNC_0( psa_udpa_dti_ind, UDPA_DTI_IND ),
526 MAK_FUNC_0( psa_udpa_config_cnf, UDPA_CONFIG_CNF ),
527 };
528 LOCAL const T_FUNC ipa_table[] = {
529 MAK_FUNC_0( psa_ipa_dti_cnf, IPA_DTI_CNF ),
530 MAK_FUNC_0( psa_ipa_dti_ind, IPA_DTI_IND ),
531 MAK_FUNC_0( psa_ipa_config_cnf, IPA_CONFIG_CNF ),
532 };
533 #endif /* CO_UDP_IP */
534
535 #ifdef FF_WAP
536 LOCAL const T_FUNC wap_table[] = {
537 MAK_FUNC_S( psa_wap_mmi_ind, WAP_MMI_IND ),
538 MAK_FUNC_S( psa_wap_mmi_req, WAP_MMI_REQ ),
539 MAK_FUNC_S( psa_wap_mmi_cnf, WAP_MMI_CNF ),
540 MAK_FUNC_0( psa_wap_dti_cnf, WAP_DTI_CNF ),
541 MAK_FUNC_0( psa_wap_dti_ind, WAP_DTI_IND )
542 };
543 #endif /* FF_WAP */
544
545 #ifdef FF_GPF_TCPIP
546 LOCAL const T_FUNC dcm_table[] = {
547 MAK_FUNC_0( psa_dcm_open_conn_req, DCM_OPEN_CONN_REQ ), /* 0x8000401c */
548 MAK_FUNC_0( psa_dcm_close_conn_req, DCM_CLOSE_CONN_REQ ), /* 0x8001401c */
549 MAK_FUNC_0( psa_dcm_get_current_conn_req , DCM_GET_CURRENT_CONN_REQ), /* 0x8002001c */
550 MAK_FUNC_N( pei_not_supported, 0 )
551 };
552 #endif /* FF_GPF_TCPIP */
553
554 /*LOCAL const T_FUNC ppp_table[] = {
555 MAK_FUNC_0( psa_ppp_establish_cnf, PPP_ESTABLISH_CNF ),
556 MAK_FUNC_0( psa_ppp_terminate_ind, PPP_TERMINATE_IND ),
557 MAK_FUNC_N( pei_not_supported, 0 ),
558 MAK_FUNC_N( pei_not_supported, 0 ),
559 MAK_FUNC_0( psa_ppp_dti_connected_ind, PPP_DTI_CONNECTED_IND )
560 };*/
561 #if defined (UART) AND defined (DTI)
562 LOCAL const T_FUNC uart_table[] = {
563 MAK_FUNC_0( psa_uart_parameters_cnf, UART_PARAMETERS_CNF ), /* 0x3400 */
564 MAK_FUNC_0( psa_uart_parameters_ind, UART_PARAMETERS_IND ), /* 0x3401 */
565 MAK_FUNC_0( psa_uart_dti_cnf, UART_DTI_CNF ), /* 0x3402 */
566 MAK_FUNC_0( psa_uart_dti_ind, UART_DTI_IND ), /* 0x3403 */
567 MAK_FUNC_0( psa_uart_disable_cnf, UART_DISABLE_CNF ), /* 0x3404 */
568 MAK_FUNC_0( psa_uart_ring_cnf, UART_RING_CNF ), /* 0x3405 */
569 MAK_FUNC_0( psa_uart_dcd_cnf, UART_DCD_CNF ), /* 0x3406 */
570 MAK_FUNC_0( psa_uart_escape_cnf, UART_ESCAPE_CNF ), /* 0x3407 */
571 MAK_FUNC_0( psa_uart_detected_ind, UART_DETECTED_IND ), /* 0x3408 */
572 MAK_FUNC_0( psa_uart_error_ind, UART_ERROR_IND ), /* 0x3409 */
573 MAK_FUNC_0( psa_uart_mux_start_cnf, UART_MUX_START_CNF ),
574 MAK_FUNC_0( psa_uart_mux_dlc_establish_ind, UART_MUX_DLC_ESTABLISH_IND),
575 MAK_FUNC_0( psa_uart_mux_dlc_release_ind, UART_MUX_DLC_RELEASE_IND ),
576 MAK_FUNC_N( pei_not_supported, 0 ), /* sleep ind */
577 MAK_FUNC_N( pei_not_supported, 0 ), /* wake up ind */
578 MAK_FUNC_0( psa_uart_mux_close_ind, UART_MUX_CLOSE_IND ),
579 MAK_FUNC_N( pei_not_supported, 0 )
580 };
581 #endif
582
583 #ifdef GPRS
584 /* GMMREG */
585 LOCAL const T_FUNC gmm_table[] = {
586 MAK_FUNC_0( psa_gmmreg_attach_cnf, GMMREG_ATTACH_CNF ),
587 MAK_FUNC_0( psa_gmmreg_attach_rej, GMMREG_ATTACH_REJ ),
588 MAK_FUNC_0( psa_gmmreg_detach_cnf, GMMREG_DETACH_CNF ),
589 MAK_FUNC_0( psa_gmmreg_detach_ind, GMMREG_DETACH_IND ),
590 MAK_FUNC_0( psa_gmmreg_plmn_ind, GMMREG_PLMN_IND ),
591 MAK_FUNC_0( psa_gmmreg_suspend_ind, GMMREG_SUSPEND_IND ),
592 MAK_FUNC_0( psa_gmmreg_resume_ind, GMMREG_RESUME_IND ),
593 MAK_FUNC_0( psa_gmmreg_info_ind, GMMREG_INFO_IND ),
594 MAK_FUNC_0( psa_gmmreg_ciphering_ind, GMMREG_CIPHERING_IND ),
595 MAK_FUNC_0( psa_gmmreg_ahplmn_ind, GMMREG_AHPLMN_IND )
596 };
597
598 /* SMREG */
599 LOCAL const T_FUNC sm_table[] = {
600 MAK_FUNC_0( psa_smreg_pdp_activate_cnf, SMREG_PDP_ACTIVATE_CNF ),
601 MAK_FUNC_0( psa_smreg_pdp_activate_rej, SMREG_PDP_ACTIVATE_REJ ),
602 MAK_FUNC_0( psa_smreg_pdp_activate_ind, SMREG_PDP_ACTIVATE_IND ),
603 MAK_FUNC_0( psa_smreg_pdp_deactivate_cnf, SMREG_PDP_DEACTIVATE_CNF ),
604 MAK_FUNC_0( psa_smreg_pdp_deactivate_ind, SMREG_PDP_DEACTIVATE_IND ),
605 MAK_FUNC_0( psa_smreg_pdp_modify_ind, SMREG_PDP_MODIFY_IND )
606 };
607
608 /* SN */
609 LOCAL const T_FUNC sndcp_table[] = {
610 MAK_FUNC_N( pei_not_supported, 0 ),
611 MAK_FUNC_N( pei_not_supported, 0 ),
612 MAK_FUNC_N( pei_not_supported, 0 ),
613 MAK_FUNC_N( pei_not_supported, 0 ),
614 MAK_FUNC_N( pei_not_supported, 0 ),
615 MAK_FUNC_N( pei_not_supported, 0 ),
616 MAK_FUNC_N( pei_not_supported, 0 ),
617 MAK_FUNC_N( pei_not_supported, 0 ),
618 MAK_FUNC_N( pei_not_supported, 0 ),
619 MAK_FUNC_N( psa_sn_count_cnf, SN_COUNT_CNF ),
620 MAK_FUNC_N( psa_sn_switch_cnf, SN_SWITCH_CNF )
621 };
622
623 /* PPP */
624 /*LOCAL const T_FUNC ppp_table[] = {
625 MAK_FUNC_0( psa_ppp_establish_cnf, PPP_ESTABLISH_CNF ),
626 MAK_FUNC_0( psa_ppp_terminate_ind, PPP_TERMINATE_IND ),
627 MAK_FUNC_0( psa_ppp_pdp_activate_ind, PPP_PDP_ACTIVATE_IND ),
628 MAK_FUNC_0( psa_ppp_modification_cnf, PPP_MODIFICATION_CNF ),
629 MAK_FUNC_0( psa_ppp_dti_connected_ind, PPP_DTI_CONNECTED_IND )
630 };*/
631
632 #ifdef FF_PKTIO
633 LOCAL const T_FUNC mnpkt_table[] = {
634 MAK_FUNC_0( psa_pkt_connect_ind, PKT_CONNECT_IND ),
635 MAK_FUNC_0( psa_pkt_disconnect_ind, PKT_DISCONNECT_IND ),
636 MAK_FUNC_0( psa_pkt_dti_open_cnf, PKT_DTI_OPEN_CNF ),
637 MAK_FUNC_0( psa_pkt_modify_cnf, PKT_MODIFY_CNF ),
638 MAK_FUNC_0( psa_pkt_dti_close_cnf, PKT_DTI_CLOSE_CNF ),
639 MAK_FUNC_0( psa_pkt_dti_close_ind, PKT_DTI_CLOSE_IND )
640 };
641 #endif
642 #endif /* GPRS */
643 #if defined (FF_PSI ) AND defined (DTI)
644 LOCAL const T_FUNC mnpsi_table[] = {
645 MAK_FUNC_0( psa_psi_conn_ind, PSI_CONN_IND ),
646 MAK_FUNC_0( psa_psi_disconn_ind, PSI_DISCONN_IND ),
647 MAK_FUNC_0( psa_psi_dti_open_cnf, PSI_DTI_OPEN_CNF ),
648 MAK_FUNC_0( psa_psi_dti_close_cnf, PSI_DTI_CLOSE_CNF ),
649 MAK_FUNC_0( psa_psi_dti_close_ind, PSI_DTI_CLOSE_IND ),
650 MAK_FUNC_0( psa_psi_setconf_cnf, PSI_SETCONF_CNF ),
651 MAK_FUNC_0( psa_psi_line_state_cnf, PSI_LINE_STATE_CNF ),
652 MAK_FUNC_0( psa_psi_line_state_ind, PSI_LINE_STATE_CNF ),
653 MAK_FUNC_0( psa_psi_close_cnf, PSI_CLOSE_CNF )
654 #ifdef _SIMULATION_
655 ,
656 MAK_FUNC_0( psa_psi_conn_ind_test, PSI_CONN_IND_TEST)
657 #endif /*_SIMULATION_ */
658 };
659 #endif /*FF_PSI*/
660 /* PPP */
661
662 #if defined FF_WAP || defined GPRS || defined FF_GPF_TCPIP || defined (FF_SAT_E)
663 LOCAL const T_FUNC ppp_table[] = {
664 MAK_FUNC_0( psa_ppp_establish_cnf, PPP_ESTABLISH_CNF ),
665 MAK_FUNC_0( psa_ppp_terminate_ind, PPP_TERMINATE_IND ),
666 MAK_FUNC_0( psa_ppp_pdp_activate_ind, PPP_PDP_ACTIVATE_IND ),
667 MAK_FUNC_0( psa_ppp_modification_cnf, PPP_MODIFICATION_CNF ),
668 MAK_FUNC_0( psa_ppp_dti_connected_ind, PPP_DTI_CONNECTED_IND )
669 };
670 #endif /* FF_WAP || GPRS || FF_GPF_TCPIP || FF_SAT_E */
671
672 #if defined FF_EOTD
673 LOCAL const T_FUNC mnlc_table[] = {
674 MAK_FUNC_0( psa_mnlc_sms_meas_cnf, MNLC_SMS_MEAS_CNF )
675 };
676 #endif /* FF_EOTD */
677
678 /* BTI */
679 #ifdef BT_ADAPTER
680 LOCAL const T_FUNC btp_table[] = {
681 MAK_FUNC_N( pei_not_supported, 0 ),
682 MAK_FUNC_N( pei_not_supported, 0 ),
683 MAK_FUNC_N( pei_not_supported, 0 ),
684 MAK_FUNC_N( pei_not_supported, 0 ),
685 MAK_FUNC_N( pei_not_supported, 0 ),
686 MAK_FUNC_N( pei_not_supported, 0 ),
687 MAK_FUNC_N( pei_not_supported, 0 ),
688 MAK_FUNC_N( pei_not_supported, 0 ),
689 MAK_FUNC_N( pei_not_supported, 0 ),
690 MAK_FUNC_N( pei_not_supported, 0 ),
691 MAK_FUNC_N( pei_not_supported, 0 ),
692 MAK_FUNC_N( pei_not_supported, 0 ),
693 MAK_FUNC_N( pei_not_supported, 0 ),
694 MAK_FUNC_N( pei_not_supported, 0 ),
695 MAK_FUNC_N( pei_not_supported, 0 ),
696 MAK_FUNC_N( pei_not_supported, 0 ),
697 MAK_FUNC_N( pei_not_supported, 0 ),
698 MAK_FUNC_N( pei_not_supported, 0 ),
699 MAK_FUNC_N( pei_not_supported, 0 ),
700 MAK_FUNC_N( pei_not_supported, 0 ),
701 MAK_FUNC_N( pei_not_supported, 0 ),
702 MAK_FUNC_N( pei_not_supported, 0 ),
703 MAK_FUNC_N( pei_not_supported, 0 ),
704 MAK_FUNC_N( pei_not_supported, 0 ),
705 MAK_FUNC_N( pei_not_supported, 0 ),
706 MAK_FUNC_N( pei_not_supported, 0 ),
707 MAK_FUNC_N( pei_not_supported, 0 ),
708 MAK_FUNC_N( pei_not_supported, 0 ),
709 MAK_FUNC_N( pei_not_supported, 0 ),
710 MAK_FUNC_N( pei_not_supported, 0 ),
711 MAK_FUNC_N( pei_not_supported, 0 ),
712 MAK_FUNC_N( pei_not_supported, 0 ),
713 MAK_FUNC_N( pei_not_supported, 0 ),
714 MAK_FUNC_N( pei_not_supported, 0 ),
715 MAK_FUNC_N( pei_not_supported, 0 ),
716 MAK_FUNC_N( pei_not_supported, 0 ),
717 MAK_FUNC_N( pei_not_supported, 0 ),
718 MAK_FUNC_N( pei_not_supported, 0 ),
719 MAK_FUNC_N( pei_not_supported, 0 ),
720 MAK_FUNC_N( pei_not_supported, 0 ),
721 MAK_FUNC_N( pei_not_supported, 0 ),
722 MAK_FUNC_N( pei_not_supported, 0 ),
723 MAK_FUNC_N( pei_not_supported, 0 ),
724 MAK_FUNC_N( pei_not_supported, 0 ),
725 MAK_FUNC_N( pei_not_supported, 0 ),
726 MAK_FUNC_N( pei_not_supported, 0 ),
727 MAK_FUNC_N( pei_not_supported, 0 ),
728 MAK_FUNC_N( pei_not_supported, 0 ),
729 MAK_FUNC_N( pei_not_supported, 0 ),
730 MAK_FUNC_N( pei_not_supported, 0 ),
731 MAK_FUNC_N( pei_not_supported, 0 ),
732 MAK_FUNC_N( pei_not_supported, 0 ),
733 MAK_FUNC_N( pei_not_supported, 0 ),
734 MAK_FUNC_N( pei_not_supported, 0 ),
735 MAK_FUNC_0( psa_btp_dti_ind, T30_DTI_IND ),
736 MAK_FUNC_0( psa_btp_dti_cnf, T30_DTI_CNF )
737 };
738 #endif /* BT_ADAPTER */
739
740 #if defined(FF_TCP_IP) || defined(FF_ESIM)
741 LOCAL const T_FUNC aaa_table[] = {
742 MAK_FUNC_0( psa_aaa_cmd_req, AAA_CMD_REQ ),
743 MAK_FUNC_0( psa_aaa_open_port_req, AAA_OPEN_PORT_REQ ),
744 MAK_FUNC_0( psa_aaa_close_port_req, AAA_CLOSE_PORT_REQ ),
745 MAK_FUNC_0( psa_aaa_dti_rsp, AAA_DTI_RES ),
746 MAK_FUNC_N( pei_not_supported, 0 ),
747 MAK_FUNC_N( pei_not_supported, 0 ),
748 MAK_FUNC_0( psa_aaa_disconnect_rsp, AAA_DISCONNECT_RES )
749 };
750 #endif
751
752 /*
753 +--------------------------------------------------------------------+
754 | PROJECT : GSM-F&D (8411) MODULE : RLP_PEI |
755 | STATE : code ROUTINE : pei_primitive |
756 +--------------------------------------------------------------------+
757
758 PURPOSE : Process protocol specific primitive.
759
760 */
761
762 LOCAL SHORT pei_primitive (void *ptr)
763 {
764 T_PRIM *prim = ptr;
765 #ifdef SMI
766 T_PEI_RETURN subReturn = PEI_ERROR;
767 #endif
768
769 /*
770 *
771 * ACI UPLINK
772 * |
773 * +-------------------------------v--------------------------------------+
774 * | |
775 * | ACI |
776 * | |
777 * +--^----^-----^----^----^----^---^---^---^----^------^----^---^----^---+
778 * | | | | | | | | | | | | | |
779 * SIM MMREG MNCC MNSS MNSMS MMI T30 L2R RA GMMREG SMREG PPP UART BTI DOWNLINK
780 * | | | | | | | | | | | | | |
781 *
782 */
783
784 #ifdef MFW
785 extern void mmeFlagHandler(void);
786 extern USHORT mfwMmeDrvFlag;
787 #endif
788
789 /* TRACE_FUNCTION ("pei_primitive()");*/
790 #ifdef MFW
791 if (mfwMmeDrvFlag)
792 mmeFlagHandler();
793 #endif
794
795 if (prim NEQ NULL)
796 {
797 ULONG opc = prim->custom.opc;
798 USHORT n;
799 const T_FUNC *table;
800 #ifdef FF_EM_MODE
801 /* This variable is only needed to extract information about the sending
802 entity. This is needed especially for testing purposes.
803 */
804 T_sdu *em_prim_data;
805 #endif /* FF_EM_MODE */
806
807 VSI_PPM_REC ((T_PRIM_HEADER*)prim, __FILE__, __LINE__);
808
809 #ifndef FF_EM_MODE
810 /*
811 * To ensure true msc directions for the engineering mode additional
812 * information (from which entity the prim is sent) must be provided
813 * before PTRACE_IN is called.
814 */
815 PTRACE_IN (opc);
816 #endif /* FF_EM_MODE */
817
818 #ifdef MFW
819 /*
820 * MFW "checks" if it needs to handle primitves coming from below before they are
821 * potentially still to be handled by ACI
822 */
823 if (aci_check_primitive (opc, (void*)(&(prim->data))))
824 {
825 PFREE (P2D(prim));
826 return PEI_OK;
827 }
828 #endif
829
830 /* TRACE_EVENT_P1("opcode: %d", opc);*/
831 switch (SAP_NR(opc))
832 {
833 #ifdef FF_ATI
834 /* ES!! #if !defined (MFW) */
835 case ACI_DL:
836 case ACI_UL: table = aci_table; n = TAB_SIZE (aci_table); break;
837 /* ES!! #endif */
838 #endif
839 case SAP_NR(SIM_UL): table = sim_table; n = TAB_SIZE (sim_table); break;
840 case SAP_NR(MMREG_DL): table = mmr_table; n = TAB_SIZE (mmr_table); break;
841 case SAP_NR(MNCC_DL): table = mncc_table; n = TAB_SIZE (mncc_table); break;
842 case SAP_NR(MNSS_DL): table = mnss_table; n = TAB_SIZE (mnss_table); break;
843 case SAP_NR(MNSMS_DL): table = mnsms_table; n = TAB_SIZE (mnsms_table); break;
844 #if defined (FF_PKTIO) AND defined (DTI)
845 case SAP_NR(PKT_DL): table = mnpkt_table; n = TAB_SIZE (mnpkt_table); break;
846 #endif
847 #if defined (FF_PSI) AND defined (DTI)
848 case SAP_NR(PSI_DL): table = mnpsi_table; n = TAB_SIZE (mnpsi_table); break;
849 #endif /*FF_PSI*/
850
851 #ifdef DTI
852 #if defined(FF_TCP_IP) || defined(FF_ESIM)
853 case SAP_NR(AAA_DL): table = aaa_table; n = TAB_SIZE (aaa_table); break;
854 #endif
855 #endif
856 case MMI_DL: table = mmi_table; n = TAB_SIZE (mmi_table); break;
857 #ifdef DTI
858 case DTI2_DL:
859 {
860 table = dti_dl_table; n = TAB_SIZE (dti_dl_table);
861 /*
862 * to be able to distinguish DTI1/DTI2 opcodes,
863 * the ones for DTI2 start at 0x50
864 */
865 opc -= 0x50;
866 }
867 break;
868 #endif /* UART */
869 #ifdef FF_EM_MODE
870 case EM_Dl:
871 table = em_table; n = TAB_SIZE (em_table); /*break;*/
872
873 em_prim_data = (T_sdu*) (((char*)&prim->data) + table->soff);
874
875 /*
876 * The prim 'EM_DATA_IND' is ambiguous concerning the sending entity.
877 * Therefore additional information is provided here.
878 */
879 if (opc EQ EM_DATA_IND_OPC)
880 {
881 switch (em_prim_data->l_buf)
882 {
883 case EM_L1: TRACE_PRIM_FROM("PL"); break;
884 case EM_DL: TRACE_PRIM_FROM("DL"); break;
885 case EM_MM: TRACE_PRIM_FROM("MM"); break;
886 case EM_CC: TRACE_PRIM_FROM("CC"); break;
887 case EM_SS: TRACE_PRIM_FROM("SS"); break;
888 case EM_SMS: TRACE_PRIM_FROM("SMS"); break;
889 case EM_SIM: TRACE_PRIM_FROM("SIM"); break;
890 default: break;
891 }
892 }
893 break;
894 #endif /* FF_EM_MODE */
895
896 #if defined (FAX_AND_DATA) AND defined (DTI)
897 case SAP_NR(RA_DL): table = ra_table; n = TAB_SIZE (ra_table); break;
898 case SAP_NR(L2R_DL): table = l2r_table; n = TAB_SIZE (l2r_table); break;
899 #ifdef FF_FAX
900 case SAP_NR(T30_DL): table = t30_table; n = TAB_SIZE (t30_table); break;
901 #endif
902 case SAP_NR(TRA_DL): table = tra_table; n = TAB_SIZE (tra_table); break;
903 #endif
904
905 #ifdef FF_GPF_TCPIP
906 case SAP_NR(TCPIP_DL): table = tcpip_table; n = TAB_SIZE (tcpip_table); break;
907 case SAP_NR(DCM_DL): table = dcm_table; n = TAB_SIZE (dcm_table); break;
908 #endif
909
910 #ifdef CO_UDP_IP
911 case SAP_NR(UDPA_DL): table = udpa_table; n = TAB_SIZE (udpa_table); break;
912 case SAP_NR(IPA_DL): table = ipa_table; n = TAB_SIZE (ipa_table); break;
913 #endif
914
915 #ifdef FF_WAP
916 case SAP_NR(WAP_DL): table = wap_table; n = TAB_SIZE (wap_table); break;
917 #endif
918
919 #if defined (FF_WAP) || defined (GPRS) || defined (FF_SAT_E)
920 case PPP_UL: table = ppp_table; n = TAB_SIZE (ppp_table); break;
921 #endif
922
923 #ifdef GPRS
924 case GMMREG_DL: table = gmm_table; n = TAB_SIZE (gmm_table); break;
925 case SMREG_DL: table = sm_table; n = TAB_SIZE (sm_table); break;
926 case SN_DL: table = sndcp_table; n = TAB_SIZE (sndcp_table); break;
927 #endif /* GPRS */
928
929 #if defined (UART) AND defined (DTI)
930 case UART_UL: table = uart_table; n = TAB_SIZE (uart_table); break;
931 #endif /* UART */
932 #ifdef BT_ADAPTER
933 /* BTI DL */
934 case BTP_G: table = btp_table; n = TAB_SIZE (btp_table); break;
935 #endif /* BT_ADAPTER */
936 #if defined FF_EOTD
937 case SAP_NR(MNLC_DL): table = mnlc_table; n = TAB_SIZE (mnlc_table); break;
938 #endif
939
940 default: table = NULL; n = 0; break;
941 }
942
943 #ifdef FF_EM_MODE
944 /*
945 * Only valid for the engineering mode as described above.
946 */
947 PTRACE_IN (opc);
948 #endif /* FF_EM_MODE */
949
950 if (table NEQ NULL )
951 {
952 if (PRIM_NR(opc) < n)
953 {
954 table += PRIM_NR(opc);
955 #ifdef PALLOC_TRANSITION
956 P_SDU(prim) = table->soff ? (T_sdu*) (((char*)&prim->data) + table->soff) : 0;
957 #ifndef NO_COPY_ROUTING
958 P_LEN(prim) = table->size + sizeof (T_PRIM_HEADER);
959 #endif /* NO_COPY_ROUTING */
960 #endif /* PALLOC_TRANSITION */
961
962 #if !defined (SMI) AND !defined (MFW)
963 if (mode EQ 0 AND
964 table NEQ aci_table)
965 {
966 PSENDX (ACI, P2D(prim));
967 }
968 else
969 #endif
970 {
971 #ifdef SMI
972 if (table->func EQ (T_VOID_FUNC) pei_not_supported)
973 {
974 subReturn = _pei_primitive (prim);
975 }
976 else
977 #endif
978 JUMP (table->func) (P2D(prim));
979 }
980 }
981 else
982 {
983 #ifndef SMI
984 pei_not_supported (P2D(prim));
985 #else
986 subReturn = _pei_primitive (prim);
987 #endif
988 }
989 return PEI_OK;
990 }
991 #ifdef SMI
992 else
993 {
994 subReturn = _pei_primitive (prim);
995 }
996 #endif
997
998 /*
999 * Primitive is no GSM Primitive
1000 * then forward to the environment
1001 */
1002 #ifdef SMI
1003 if (subReturn EQ PEI_ERROR)
1004 {
1005 #endif
1006 #ifdef GSM_ONLY
1007 PFREE (P2D(prim))
1008 return PEI_ERROR;
1009 #else
1010 if (opc & SYS_MASK)
1011 vsi_c_primitive (VSI_CALLER prim);
1012 else
1013 {
1014 PFREE (P2D(prim));
1015 return PEI_ERROR;
1016 }
1017 #endif
1018 #ifdef SMI
1019 }
1020 #endif
1021 }
1022 #ifdef SMI
1023 else
1024 {
1025 subReturn = _pei_primitive (prim);
1026 }
1027 #endif
1028
1029 return PEI_OK;
1030 }
1031
1032
1033 /*
1034 +--------------------------------------------------------------------+
1035 | PROJECT : GSM-F&D (8411) MODULE : ACI_PEI |
1036 | STATE : code ROUTINE : pei_init |
1037 +--------------------------------------------------------------------+
1038
1039 PURPOSE : Initialize Protocol Stack Entity
1040
1041 */
1042 LOCAL SHORT pei_init (T_HANDLE handle)
1043 {
1044 #ifdef FF_ATI
1045 #ifdef UART
1046 EXTERN void urt_init (void);
1047 #endif
1048 #endif
1049
1050 aci_handle = handle;
1051
1052 TRACE_FUNCTION ("pei_init()");
1053
1054 if (hCommSIM < VSI_OK)
1055 {
1056 if ((hCommSIM = vsi_c_open (VSI_CALLER SIM_NAME)) < VSI_OK)
1057 return PEI_ERROR;
1058 }
1059 #ifdef FF_ESIM
1060 if (hCommESIM < VSI_OK) /* open channel to ESIM entity */
1061 {
1062 if ((hCommESIM = vsi_c_open (VSI_CALLER ESIM_NAME)) < VSI_OK)
1063 return PEI_ERROR;
1064 }
1065 #endif
1066 if (hCommMM < VSI_OK)
1067 {
1068 if ((hCommMM = vsi_c_open (VSI_CALLER MM_NAME)) < VSI_OK)
1069 return PEI_ERROR;
1070 }
1071
1072 if (hCommCC < VSI_OK)
1073 {
1074 if ((hCommCC = vsi_c_open (VSI_CALLER CC_NAME)) < VSI_OK)
1075 return PEI_ERROR;
1076 }
1077
1078 if (hCommSS < VSI_OK)
1079 {
1080 if ((hCommSS = vsi_c_open (VSI_CALLER SS_NAME)) < VSI_OK)
1081 return PEI_ERROR;
1082 }
1083
1084 if (hCommSMS < VSI_OK)
1085 {
1086 if ((hCommSMS = vsi_c_open (VSI_CALLER SMS_NAME)) < VSI_OK)
1087 return PEI_ERROR;
1088 }
1089
1090 #ifdef UART
1091 if (hCommUART < VSI_OK)
1092 {
1093 if ((hCommUART = vsi_c_open (VSI_CALLER UART_NAME)) < VSI_OK)
1094 return PEI_ERROR;
1095 }
1096 #endif
1097
1098 if (hCommPL < VSI_OK)
1099 {
1100 if ((hCommPL = vsi_c_open (VSI_CALLER PL_NAME)) < VSI_OK)
1101 return PEI_ERROR;
1102 }
1103
1104 #if defined FF_EOTD
1105 if (hCommLC < VSI_OK)
1106 {
1107 if ((hCommLC = vsi_c_open (VSI_CALLER LC_NAME)) < VSI_OK)
1108 return PEI_ERROR;
1109 }
1110 #endif
1111
1112 #ifdef FF_TCP_IP
1113 /*#ifndef _SIMULATION_*/
1114 if (hCommAAA < VSI_OK)
1115 {
1116 if ((hCommAAA = vsi_c_open (VSI_CALLER AAA_NAME)) < VSI_OK)
1117 return PEI_ERROR;
1118 }
1119 /*#endif*/
1120 #endif
1121
1122 #if defined FF_TRACE_OVER_MTST
1123 if (hCommMTST < VSI_OK)
1124 {
1125 if ((hCommMTST = vsi_c_open (VSI_CALLER "MTST")) < VSI_OK)
1126 return PEI_ERROR;
1127 }
1128 #endif
1129
1130 if (hCommACI < VSI_OK)
1131 {
1132 if ((hCommACI = vsi_c_open (VSI_CALLER ACI_NAME)) < VSI_OK)
1133 return PEI_ERROR;
1134 }
1135
1136 #ifdef FAX_AND_DATA
1137 #ifndef USE_L1FD_FUNC_INTERFACE
1138 if (hCommRA < VSI_OK)
1139 {
1140 if ((hCommRA = vsi_c_open (VSI_CALLER RA_NAME)) < VSI_OK)
1141 return PEI_ERROR;
1142 }
1143 #endif
1144 if (hCommL2R < VSI_OK)
1145 {
1146 if ((hCommL2R = vsi_c_open (VSI_CALLER L2R_NAME)) < VSI_OK)
1147 return PEI_ERROR;
1148 }
1149
1150 if (hCommTRA < VSI_OK)
1151 {
1152 /* TRA_NAME i.e "L2R" on account of TRA being no real entity */
1153 if ((hCommTRA = vsi_c_open (VSI_CALLER TRA_NAME)) < VSI_OK)
1154 return PEI_ERROR;
1155 }
1156
1157 #ifdef FF_FAX
1158 if (hCommT30 < VSI_OK)
1159 {
1160 if ((hCommT30 = vsi_c_open (VSI_CALLER T30_NAME)) < VSI_OK)
1161 return PEI_ERROR;
1162 }
1163 #endif /* FF_FAX */
1164 #endif /* FAX_AND_DATA */
1165
1166 #ifdef FF_GPF_TCPIP
1167 if (hCommTCPIP < VSI_OK)
1168 {
1169 if ((hCommTCPIP = vsi_c_open (VSI_CALLER TCPIP_NAME)) < VSI_OK)
1170 return PEI_ERROR;
1171 }
1172 #endif
1173
1174 #if defined (CO_TCPIP_TESTAPP) || defined (CO_BAT_TESTAPP)
1175 if (hCommAPP < VSI_OK)
1176 {
1177 if ((hCommAPP = vsi_c_open (VSI_CALLER APP_NAME)) < VSI_OK)
1178 return PEI_ERROR;
1179 }
1180 #endif
1181
1182 #ifdef CO_UDP_IP
1183 if (hCommUDP < VSI_OK)
1184 {
1185 if ((hCommUDP = vsi_c_open (VSI_CALLER UDP_NAME)) < VSI_OK)
1186 return PEI_ERROR;
1187 }
1188 if (hCommIP < VSI_OK)
1189 {
1190 if ((hCommIP = vsi_c_open (VSI_CALLER IP_NAME)) < VSI_OK)
1191 return PEI_ERROR;
1192 }
1193 #endif
1194
1195 #ifdef FF_WAP
1196 if (hCommWAP < VSI_OK)
1197 {
1198 if ((hCommWAP = vsi_c_open (VSI_CALLER WAP_NAME)) < VSI_OK)
1199 return PEI_ERROR;
1200 }
1201 #endif
1202
1203 #if defined (FF_WAP) || defined (GPRS) || defined (FF_SAT_E)
1204 if (hCommPPP < VSI_OK)
1205 {
1206 if ((hCommPPP = vsi_c_open (VSI_CALLER PPP_NAME)) < VSI_OK)
1207 return PEI_ERROR;
1208 }
1209 #endif
1210
1211 #ifdef FF_EM_MODE
1212 if (hCommRR < VSI_OK)
1213 {
1214 if ((hCommRR = vsi_c_open (VSI_CALLER RR_NAME)) < VSI_OK)
1215 return PEI_ERROR;
1216 }
1217 #endif /* FF_EM_MODE */
1218
1219 #if defined (GPRS) AND defined (DTI)
1220 if (hCommGMM < VSI_OK)
1221 {
1222 if ((hCommGMM = vsi_c_open (VSI_CALLER GMM_NAME)) < VSI_OK)
1223 return PEI_ERROR;
1224 }
1225 if (hCommSM < VSI_OK)
1226 {
1227 if ((hCommSM = vsi_c_open (VSI_CALLER SM_NAME)) < VSI_OK)
1228 return PEI_ERROR;
1229 }
1230 if (hCommSNDCP < VSI_OK)
1231 {
1232 if ((hCommSNDCP = vsi_c_open (VSI_CALLER SNDCP_NAME)) < VSI_OK)
1233 return PEI_ERROR;
1234 }
1235
1236 #ifdef FF_PKTIO
1237 if (hCommPKTIO < VSI_OK)
1238 {
1239 if ((hCommPKTIO = vsi_c_open (VSI_CALLER PKTIO_NAME)) < VSI_OK)
1240 {
1241 TRACE_EVENT ("cannot open PKTIO");
1242 return PEI_ERROR;
1243 }
1244 }
1245 #endif
1246 #endif /* GPRS */
1247 #ifdef FF_PSI
1248 if (hCommPSI < VSI_OK)
1249 {
1250 if ((hCommPSI = vsi_c_open (VSI_CALLER PSI_NAME)) < VSI_OK)
1251 {
1252 TRACE_EVENT ("cannot open PSI");
1253 return PEI_ERROR;
1254 }
1255 }
1256 #endif /*FF_PSI*/
1257 #ifdef BT_ADAPTER
1258 if (hCommBTI < VSI_OK)
1259 {
1260 if ((hCommBTI = vsi_c_open (VSI_CALLER BTI_NAME)) < VSI_OK)
1261 return PEI_ERROR;
1262 }
1263 #endif /* BT_ADAPTER */
1264
1265 #ifdef FF_GPF_TCPIP
1266 if (hCommDCM < VSI_OK)
1267 {
1268 if ((hCommDCM = vsi_c_open (VSI_CALLER DCM_NAME)) < VSI_OK)
1269 return PEI_ERROR;
1270 }
1271 #endif /* FF_GPF_TCPIP */
1272
1273 if (hCommL1 < VSI_OK)
1274 {
1275 if ((hCommL1 = vsi_c_open (VSI_CALLER L1_NAME)) < VSI_OK)
1276 return PEI_ERROR;
1277 }
1278
1279 #ifdef DTI
1280 #ifdef _SIMULATION_
1281 /*
1282 * initialize dtilib for this entity
1283 */
1284 aci_hDTI = dti_init (
1285 4,
1286 handle,
1287 DTI_DEFAULT_OPTIONS,
1288 aci_pei_sig_callback
1289 );
1290 #else
1291 /*
1292 * initialize dtilib for this entity
1293 */
1294 aci_hDTI = dti_init (
1295 ACI_INSTANCES * UART_INSTANCES,
1296 handle,
1297 DTI_DEFAULT_OPTIONS,
1298 aci_pei_sig_callback
1299 );
1300 #endif
1301 #endif /* DTI */
1302
1303 #ifdef DTI
1304 if(aci_hDTI EQ NULL)
1305 {
1306 TRACE_EVENT ("ACI DTI handle is 0");
1307 return PEI_ERROR;
1308 }
1309 #endif
1310
1311 #ifdef SMI
1312 /*
1313 * initialize the slim man machine interface
1314 */
1315 if (_pei_init () EQ PEI_ERROR)
1316 return PEI_ERROR;
1317 #endif
1318
1319 #ifdef ACI
1320 audio_Init ( NULL );
1321 /* rx_Init( ) is not needed at the moment for ATI only version...
1322 causes the software not to start because it needs CST stack to be started first...
1323 rx_Init ( NULL ); */
1324 pwr_Init ( NULL );
1325 #endif
1326
1327
1328 /*
1329 * Initialize BT_ADAPTER
1330 */
1331 #if defined(FF_ATI) && defined(BT_ADAPTER)
1332 if (btiaci_init(aci_handle) EQ BTI_NAK)
1333 return PEI_ERROR;
1334 btiaci_at_init_req();
1335 #endif
1336
1337 #ifdef FF_ATI
1338 init_ati ();
1339 #endif /* FF_ATI */
1340
1341 #ifdef UART
1342 cmhUART_lst_init ();
1343 #endif
1344 #ifdef DTI
1345 psaACI_Init();
1346 dti_cntrl_init();
1347 #endif
1348 #if defined (FF_PSI) AND defined (DTI)
1349 cmhPSI_lst_init();
1350 #endif /*FF_PSI*/
1351 /*
1352 * initialize CMH's
1353 */
1354 cmh_Init ();
1355 cmh_Reset ( CMD_SRC_LCL, FALSE );
1356 #ifdef FF_ATI
1357 cmh_Reset ( CMD_SRC_ATI_1, FALSE );
1358 cmh_Reset ( CMD_SRC_ATI_2, FALSE );
1359 cmh_Reset ( CMD_SRC_ATI_3, FALSE );
1360 cmh_Reset ( CMD_SRC_ATI_4, FALSE );
1361 #ifdef SIM_TOOLKIT
1362 cmh_Reset ( CMD_SRC_ATI_5, FALSE );
1363 #endif /* SIM_TOOLKIT */
1364 #if defined FF_EOTD
1365 cmh_Reset ( CMD_SRC_ATI_6, FALSE );
1366 #endif /* FF_EOTD */
1367 #endif /* FF_ATI */
1368
1369 /*
1370 * initialize PSA's
1371 */
1372 #if defined (SIM_TOOLKIT)
1373 psaSAT_Init(); /* has to be done first! */
1374 #endif
1375 psaSS_Init();
1376 #ifdef ACI
1377 psaMMI_Init();
1378 #endif
1379 psaCC_Init();
1380 psaMM_Init();
1381 psaSIM_Init(ACI_INIT_TYPE_ALL);
1382 psaMMI_Init();
1383 psaSMS_Init();
1384
1385 #ifdef FAX_AND_DATA
1386 psaRA_Init();
1387 psaL2R_Init();
1388 #ifdef FF_FAX
1389 psaT30_Init();
1390 #endif /* FF_FAX */
1391 #endif /* FAX_AND_DATA */
1392
1393 #ifdef GPRS
1394 psa_GPRSInit();
1395 #endif /* GPRS */
1396
1397 #if defined (FF_WAP) || defined (FF_TCP_IP) || defined(FF_GPF_TCPIP)|| defined (FF_SAT_E)
1398 psaPPP_Init();
1399 #endif /* (FF_WAP) (FF_TCP_IP) (FF_GPF_TCPIP) (FF_SAT_E) */
1400
1401 #if defined(CO_UDP_IP) || defined(FF_GPF_TCPIP)
1402 psaTCPIP_Init();
1403 #endif /* CO_UDP_IP || FF_GPF_TCPIP */
1404
1405 #if defined(FF_GPF_TCPIP)
1406 dcm_init() ;
1407 #endif /* FF_GPF_TCPIP */
1408
1409
1410 #ifdef AT_ADAPTER
1411 psaBTI_Init();
1412 #endif /* AT_ADAPTER */
1413
1414 /*
1415 * Initialize Message Coder Decoder
1416 */
1417 ccd_init ();
1418 /*
1419 * Initialize the UART module
1420 */
1421 #ifdef FF_ATI
1422 #ifdef UART
1423 urt_init ();
1424 #endif
1425 ati_cmd_init ();
1426 #endif
1427
1428 /*
1429 * Initialize Advice of Charge Module
1430 */
1431 aoc_init_calltable ();
1432
1433 /*
1434 * Initialize phonebook
1435 */
1436 #ifdef TI_PS_FFS_PHB
1437 pb_init ();
1438 #else
1439 phb_Init ();
1440 #endif
1441 rdlPrm_init();
1442
1443 /* The high level audio driver is initialised here */
1444 hl_audio_drv_init();
1445
1446 #if defined(_TARGET_)
1447 cmhCC_rd_mode_FFS(AUTOM_REP_NOT_PRESENT,READ_RDLmode); /* read redial mode from FFS */
1448 #endif /* _TARGET_*/
1449
1450 #ifdef DTI
1451 #ifdef _SIMULATION_
1452 #ifdef FF_ATI_BAT
1453 ati_bat_reset();
1454 #endif
1455 ati_src_tst_init( CMD_SRC_EXT );
1456 #endif
1457 #endif
1458
1459 #if defined FF_EOTD
1460 ati_src_lc_init( CMD_SRC_EXT );
1461 #endif /* FF_EOTD */
1462
1463 #ifdef MFW
1464 /*
1465 * initialise ACI extension handler
1466 * and start MMI Logic
1467 */
1468 aci_ext_init ();
1469 mmi_main ();
1470 #endif
1471
1472 #ifdef FF_MMI_RIV
1473 acia_init();
1474 #endif
1475
1476 return PEI_OK;
1477 }
1478
1479 /*
1480 +--------------------------------------------------------------------+
1481 | PROJECT : GSM-F&D (8411) MODULE : ACI_PEI |
1482 | STATE : code ROUTINE : pei_timeout |
1483 +--------------------------------------------------------------------+
1484
1485 PURPOSE : Process timeout
1486
1487 */
1488
1489 LOCAL SHORT pei_timeout (USHORT index)
1490 {
1491 tim_exec_timeout (index);
1492
1493 return PEI_OK;
1494 }
1495
1496 /*
1497 +--------------------------------------------------------------------+
1498 | PROJECT : GSM-F&D (8411) MODULE : ACI_PEI |
1499 | STATE : code ROUTINE : mmi_pei_signal |
1500 +--------------------------------------------------------------------+
1501
1502 PURPOSE : Functional interface to signal a primitive.
1503
1504 */
1505
1506 LOCAL SHORT pei_signal ( ULONG opc, void *primData )
1507 {
1508 #ifdef OPTION_SIGNAL
1509 #ifndef _TMS470
1510 TRACE_FUNCTION ("pei_signal ()");
1511 #endif /* _TMS470 */
1512
1513 switch (opc)
1514 {
1515 #ifdef FF_MMI_RIV
1516 case ACI_RIV_CMD_REQ:
1517 aci_aci_riv_cmd_req ((T_ACI_RIV_CMD_REQ *) primData);
1518 break;
1519 #endif
1520 #ifdef FAX_AND_DATA
1521 case RA_ACTIVATE_CNF:
1522 psa_ra_activate_cnf
1523 (
1524 (T_RA_ACTIVATE_CNF *) primData
1525 );
1526 break;
1527 case RA_DEACTIVATE_CNF:
1528 psa_ra_deactivate_cnf
1529 (
1530 (T_RA_DEACTIVATE_CNF *) primData
1531 );
1532 break;
1533 #ifdef FF_FAX
1534 case RA_MODIFY_CNF:
1535 psa_ra_modify_cnf
1536 (
1537 (T_RA_MODIFY_CNF *) primData
1538 );
1539 break;
1540 #endif /* FF_FAX */
1541 #endif /* FAX_AND_DATA */
1542
1543 #ifdef FF_ATI
1544 /* ES!! #if !defined (MFW) */
1545 case ACI_CMD_REQ:
1546 aci_aci_cmd_req
1547 (
1548 (T_ACI_CMD_REQ *) primData
1549 );
1550 break;
1551 case ACI_ABORT_REQ:
1552 aci_aci_abort_req
1553 (
1554 (T_ACI_ABORT_REQ *) primData
1555 );
1556 break;
1557 #endif /* FF_ATI */
1558 }
1559 #endif /* OPTION_SIGNAL */
1560
1561 return PEI_OK;
1562 }
1563
1564 /*
1565 +--------------------------------------------------------------------+
1566 | PROJECT : GSM-F&D (8411) MODULE : ACI_PEI |
1567 | STATE : code ROUTINE : pei_exit |
1568 +--------------------------------------------------------------------+
1569
1570 PURPOSE : Close Resources and terminate
1571
1572 */
1573 LOCAL SHORT pei_exit (void)
1574 {
1575 U8 i;
1576
1577 TRACE_FUNCTION ("pei_exit()");
1578
1579 /*
1580 * clean up communication
1581 */
1582 #ifdef DTI
1583 /* close all open dti channels */
1584 dti_cntrl_close_all_connections();
1585
1586 /*
1587 * Shut down dtilib communication
1588 */
1589 dti_deinit(aci_hDTI);
1590 #endif
1591
1592 #ifdef FF_TRACE_OVER_MTST
1593 vsi_c_close (VSI_CALLER hCommMTST);
1594 hCommMTST = VSI_ERROR;
1595 #endif
1596
1597 vsi_c_close (VSI_CALLER hCommSIM);
1598 hCommSIM = VSI_ERROR;
1599
1600 vsi_c_close (VSI_CALLER hCommSIM);
1601 hCommSIM = VSI_ERROR;
1602
1603 vsi_c_close (VSI_CALLER hCommMM);
1604 hCommMM = VSI_ERROR;
1605
1606 vsi_c_close (VSI_CALLER hCommCC);
1607 hCommCC = VSI_ERROR;
1608
1609 #ifdef FF_ESIM
1610 vsi_c_close (VSI_CALLER hCommESIM);
1611 hCommESIM = VSI_ERROR;
1612 #endif
1613
1614 vsi_c_close (VSI_CALLER hCommSS);
1615 hCommSS = VSI_ERROR;
1616
1617 vsi_c_close (VSI_CALLER hCommSMS);
1618 hCommSMS = VSI_ERROR;
1619
1620 #ifdef UART
1621 vsi_c_close (VSI_CALLER hCommDTI);
1622 hCommDTI = VSI_ERROR;
1623
1624 vsi_c_close (VSI_CALLER hCommUART);
1625 hCommUART = VSI_ERROR;
1626 #endif
1627 #ifdef FF_PSI
1628 vsi_c_close (VSI_CALLER hCommPSI);
1629 hCommPSI = VSI_ERROR;
1630 #endif /*FF_PSI*/
1631 /*#if defined SMI */
1632 /* vsi_c_close (VSI_CALLER hCommSMI);*/
1633 /* hCommSMI = VSI_ERROR;*/
1634 /*#elif defined MFW */
1635 /* vsi_c_close (VSI_CALLER hCommMMI);*/
1636 /* hCommMMI = VSI_ERROR;*/
1637 /*#elif defined ACI*/
1638 vsi_c_close (VSI_CALLER hCommACI);
1639 hCommACI = VSI_ERROR;
1640 /*#endif*/
1641
1642 vsi_c_close (VSI_CALLER hCommPL);
1643 hCommPL = VSI_ERROR;
1644
1645 #if defined FF_EOTD
1646 vsi_c_close (VSI_CALLER hCommLC);
1647 hCommLC = VSI_ERROR;
1648 #endif
1649
1650 #ifdef FAX_AND_DATA
1651 #ifndef USE_L1FD_FUNC_INTERFACE
1652 vsi_c_close (VSI_CALLER hCommRA);
1653 hCommRA = VSI_ERROR;
1654 #endif
1655 vsi_c_close (VSI_CALLER hCommL2R);
1656 hCommL2R = VSI_ERROR;
1657
1658 vsi_c_close (VSI_CALLER hCommTRA);
1659 hCommTRA = VSI_ERROR;
1660
1661 #ifdef FF_FAX
1662 vsi_c_close (VSI_CALLER hCommT30);
1663 hCommT30 = VSI_ERROR;
1664 #endif /* FF_FAX */
1665 #endif /* FAX_AND_DATA */
1666
1667 #ifdef FF_GPF_TCPIP
1668 vsi_c_close (VSI_CALLER hCommTCPIP);
1669 hCommTCPIP = VSI_ERROR;
1670 #endif
1671
1672 #if defined (CO_TCPIP_TESTAPP) || defined (CO_BAT_TESTAPP)
1673 vsi_c_close (VSI_CALLER hCommAPP);
1674 hCommAPP = VSI_ERROR;
1675 #endif
1676
1677 #ifdef CO_UDP_IP
1678 vsi_c_close (VSI_CALLER hCommUDP);
1679 hCommUDP = VSI_ERROR;
1680 vsi_c_close (VSI_CALLER hCommIP);
1681 hCommIP = VSI_ERROR;
1682 #endif
1683
1684 #ifdef FF_WAP
1685 vsi_c_close (VSI_CALLER hCommWAP);
1686 hCommWAP = VSI_ERROR;
1687 #endif
1688
1689 #if defined (FF_WAP) || defined (GPRS) || defined (FF_SAT_E)
1690 vsi_c_close (VSI_CALLER hCommPPP);
1691 hCommPPP = VSI_ERROR;
1692 #endif
1693
1694 #ifdef GPRS
1695 vsi_c_close (VSI_CALLER hCommGMM);
1696 hCommGMM = VSI_ERROR;
1697
1698 vsi_c_close (VSI_CALLER hCommSM);
1699 hCommSM = VSI_ERROR;
1700
1701 vsi_c_close (VSI_CALLER hCommSNDCP);
1702 hCommSNDCP = VSI_ERROR;
1703 #ifdef FF_PKTIO
1704 vsi_c_close (VSI_CALLER hCommPKTIO);
1705 hCommPKTIO = VSI_ERROR;
1706 #endif
1707 #endif /* GPRS */
1708
1709 #ifdef BT_ADAPTER
1710 vsi_c_close (VSI_CALLER hCommBTI);
1711 hCommBTI = VSI_ERROR;
1712 #endif /* BT_ADAPTER */
1713
1714 vsi_c_close (VSI_CALLER hCommL1);
1715 hCommL1 = VSI_ERROR;
1716
1717 #ifdef SMI
1718 _pei_exit ();
1719 #endif
1720
1721 /*
1722 * deallocate all channels
1723 * for non existing channels, this will just return
1724 */
1725 #ifdef FF_ATI
1726 for (i = 1; i < CMD_SRC_MAX; i++)
1727 {
1728 ati_finit(i);
1729 }
1730 #endif /* FF_ATI */
1731
1732 /* Free still occupied pointers in ccShrdPrm */
1733 for (i = 0; i < MAX_CALL_NR; i++)
1734 {
1735 if (ccShrdPrm.ctb[i] NEQ NULL)
1736 {
1737 psaCC_FreeCtbNtry (i);
1738 }
1739 }
1740
1741 /* Deallocation of elements (2nd to last) in linked list PNN */
1742 while (mmShrdPrm.PNNLst.next NEQ NULL)
1743 {
1744 T_pnn_name *nextnext = mmShrdPrm.PNNLst.next->next;
1745 ACI_MFREE (mmShrdPrm.PNNLst.next);
1746 mmShrdPrm.PNNLst.next = nextnext;
1747 }
1748
1749 #ifdef DTI
1750 #ifdef _SIMULATION_
1751
1752 #ifdef SIM_TOOLKIT
1753 satShrdPrm.run_at_id = -1;
1754 #endif /* SIM_TOOLKIT */
1755
1756 ati_src_tst_finit();
1757 #endif /* _SIMULATION_ */
1758 #endif /* DTI */
1759
1760 #if defined FF_EOTD
1761 ati_src_lc_finit();
1762 #endif /* FF_EOTD */
1763
1764 rdlPrm_exit();
1765
1766 #ifdef UART
1767 cmhUART_CleanComParameterList();
1768 #endif
1769
1770
1771 #ifdef FF_PSI
1772 cmhPSI_clean_all_elem();
1773 cmhPSI_CleanDcbParameterList();
1774 #endif
1775
1776 #ifdef UART
1777 cmhUART_lst_exit();
1778 #endif
1779
1780 return PEI_OK;
1781 }
1782
1783 /*
1784 +--------------------------------------------------------------------+
1785 | PROJECT : GSM-F&D (8411) MODULE : ACI_PEI |
1786 | STATE : code ROUTINE : pei_config |
1787 +--------------------------------------------------------------------+
1788
1789 PURPOSE : Dynamic Configuration
1790
1791 */
1792
1793 #if !defined (NCONFIG)
1794
1795 LOCAL const KW_DATA kwtab[] =
1796 {
1797 ACI_KEY_SEQUENCE, KEY_SEQUENCE,
1798 ACI_KEY_PRESS, KEY_PRESS,
1799 ACI_KEY_RELEASE, KEY_RELEASE,
1800 ACI_START_AOC, START_AOC,
1801 ACI_CPOL_MODE, CPOL_MODE,
1802 ACI_CPOL_IDX2, CPOL_IDX2,
1803 ACI_ATI_VIA_TIF, ATI_VIA_TIF,
1804 /* new here*/
1805 #ifdef _SIMULATION_
1806 ACI_DATA_INPUT, DATA_INPUT,
1807 #endif /* _SIMULATION_ */
1808 "", 0
1809 };
1810
1811 #endif
1812
1813 #ifdef _SIMULATION_
1814
1815 #ifdef UART
1816 EXTERN void cmhUART_startConnection (UBYTE srcId,
1817 T_ACI_DEVICE_TYPE device_type);
1818 #endif /* UART */
1819 EXTERN UBYTE uart_new_source (UBYTE device, UBYTE dlci);
1820 EXTERN void uart_new_source_for_aci_src_tst( UBYTE src_id, UBYTE device, UBYTE dlci );
1821 #endif
1822
1823 LOCAL SHORT pei_config (char *inString)
1824 {
1825 #ifdef FF_ATI
1826 BOOL alreadyCalled = FALSE;
1827 #endif
1828
1829 #if !defined (NCONFIG)
1830 char *s = inString;
1831 SHORT valno;
1832 SHORT keyno;
1833 char *keyw;
1834 char *val[10];
1835
1836 TRACE_FUNCTION ("pei_config()");
1837
1838 #ifdef UART
1839 if (!strcmp(inString, "UART_19200"))
1840 {
1841 cmhUART_SetDataRate((UBYTE) CMD_SRC_ATI, UART_IO_SPEED_19200);
1842 return PEI_OK;
1843 }
1844 #endif
1845
1846 if (!strcmp(inString, "ATI_TRC"))
1847 { /* AT%CPRIM="MMI","CONFIG ATI_TRC" */
1848 EXTERN BOOL _g_ati_trc_enabled;
1849 _g_ati_trc_enabled = TRUE; /* only switch on possible */
1850 return PEI_OK;
1851 }
1852
1853 #ifdef _SIMULATION_
1854
1855 #ifdef UART
1856 if (!strcmp(inString, "START_DTI"))
1857 {
1858 int i;
1859 UBYTE srcId;
1860
1861 for (i=0;i<UART_INSTANCES;i++)
1862 {
1863 srcId = uart_new_source ((UBYTE)i, UART_DLCI_NOT_MULTIPLEXED);
1864 cmhUART_startConnection (srcId, DEVICE_TYPE_URT);
1865 }
1866 return PEI_OK;
1867 }
1868 if(!strcmp(inString, "EXPAND_ATI_SRC_TST"))
1869 {
1870 UBYTE srcId = ati_src_tst_get_src_id( (UBYTE) CMD_SRC_EXT );
1871
1872 if ( srcId EQ DTI_MNG_ID_NOTPRESENT )
1873 return PEI_OK;
1874
1875 uart_new_source_for_aci_src_tst( srcId, 0, NOT_PRESENT_8BIT );
1876 cmhUART_startConnection (srcId, DEVICE_TYPE_URT);
1877 return PEI_OK;
1878 }
1879
1880 if(!strncmp(inString, "ADD_TST_SRC", 11)) /* parameter [UART] */
1881 {
1882 char *end = inString + 11;
1883 UBYTE srcId;
1884
1885 srcId = ati_src_tst_get_src_id( (UBYTE) CMD_SRC_UNKNOWN );
1886
1887 if ( srcId EQ DTI_MNG_ID_NOTPRESENT )
1888 return PEI_OK;
1889
1890 while ( *end EQ ' ' )
1891 end ++;
1892
1893 if ( !strcmp( end, "UART"))
1894 {
1895 uart_new_source_for_aci_src_tst( srcId, srcId, NOT_PRESENT_8BIT );
1896 cmhUART_startConnection (srcId, DEVICE_TYPE_URT);
1897 }
1898
1899 if ( !strcmp( end, "UART_DP")) /* for dual port testing */
1900 {
1901 static UBYTE device=0; /* lint: at least init to something */
1902 uart_new_source_for_aci_src_tst( srcId, device, UART_DLCI_NOT_MULTIPLEXED );
1903 cmhUART_startConnection (srcId, DEVICE_TYPE_URT);
1904 device++;
1905 }
1906
1907 return PEI_OK;
1908 }
1909 #endif /* UART */
1910
1911 #ifdef DTI
1912 if (!strcmp(inString, "STOP_SRC_TST"))
1913 {
1914 EXTERN void ati_src_tst_finit (void);
1915 ati_src_tst_finit ();
1916 }
1917 #endif
1918
1919 #if defined SMI OR defined MFW
1920 if (!strcmp(inString, "CONC_SMS_TST"))
1921 {
1922 EXTERN void concSMS_InitForTesting();
1923 concSMS_InitForTesting();
1924 return PEI_OK;
1925 }
1926 #endif /*#if defined SMI OR defined MFW*/
1927
1928 if (!strcmp(inString, "ENABLE_VOCODER_TST"))
1929 {
1930 EXTERN void hl_audio_drv_initForTest();
1931 hl_audio_drv_initForTest();
1932 return PEI_OK;
1933 }
1934
1935 #endif /* _SIMULATION_ */
1936
1937 #ifdef GPRS
1938 /*
1939 * Class modification
1940 * Author: ANS
1941 * initial: 07-Nov-00
1942 */
1943 if(!strcmp(inString,"CLASS_CC"))
1944 {
1945 default_mobile_class = GMMREG_CLASS_CC;
1946 return PEI_OK;
1947 }
1948 if(!strcmp(inString,"CLASS_CG"))
1949 {
1950 default_mobile_class = GMMREG_CLASS_CG;
1951 return PEI_OK;
1952 }
1953 if(!strcmp(inString,"CLASS_BC"))
1954 {
1955 default_mobile_class = GMMREG_CLASS_BC;
1956 return PEI_OK;
1957 }
1958 if(!strcmp(inString,"CLASS_BG"))
1959 {
1960 default_mobile_class = GMMREG_CLASS_BG;
1961 return PEI_OK;
1962 }
1963 if(!strcmp(inString,"CLASS_B"))
1964 {
1965 default_mobile_class = GMMREG_CLASS_B;
1966 return PEI_OK;
1967 }
1968 if(!strcmp(inString,"CLASS_A"))
1969 {
1970 default_mobile_class = GMMREG_CLASS_A;
1971 return PEI_OK;
1972 }
1973 /*
1974 * End Class modification
1975 */
1976
1977 /*
1978 * Attach mode modification
1979 * Author: BRZ
1980 * initial: 14-Apr-01
1981 */
1982 if(!strcmp(inString,"AUTO_ATTACH"))
1983 {
1984 automatic_attach_mode = CGAATT_ATTACH_MODE_AUTOMATIC;
1985 return PEI_OK;
1986 }
1987 if(!strcmp(inString,"MAN_ATTACH"))
1988 {
1989 automatic_attach_mode = CGAATT_ATTACH_MODE_MANUAL;
1990 return PEI_OK;
1991 }
1992 if(!strcmp(inString,"AUTO_DETACH"))
1993 {
1994 automatic_detach_mode = CGAATT_DETACH_MODE_ON;
1995 return PEI_OK;
1996 }
1997 if(!strcmp(inString,"MAN_DETACH"))
1998 {
1999 automatic_detach_mode = CGAATT_DETACH_MODE_OFF;
2000 return PEI_OK;
2001 }
2002 /*
2003 * End Attach mode modification
2004 */
2005 #endif
2006
2007 #ifdef MFW
2008 if (!strncmp("MFWMOB ",s,7))
2009 {
2010 mfwExtIn(s+7);
2011 return PEI_OK;
2012 }
2013 #endif
2014
2015 #ifdef _SIMULATION_
2016 #ifdef MFW
2017 /*
2018 * Only for Windows: define several variants
2019 * of SIM LOCK pcm content
2020 */
2021 if (!strncmp("SIMLOCK",s,7))
2022 {
2023 EXTERN UBYTE sim_lock_mode;
2024
2025 sim_lock_mode = atoi (s+8);
2026 return PEI_OK;
2027 }
2028 #endif
2029 #endif
2030
2031 #ifdef FF_TIMEZONE
2032 /*
2033 * simulate an incoming MMR_INFO_IND
2034 */
2035 if (!strncmp("TIMEZONE_TEST",s,13))
2036 {
2037 TRACE_EVENT ("pei_config() TIMEZONE_TEST");
2038 {
2039 PALLOC (mmr_info_ind, MMR_INFO_IND); /* is freed in psa_mmr_info_ind */
2040 memcpy (mmr_info_ind, 0, sizeof (T_MMR_INFO_IND)); /* clear out all */
2041 memcpy (mmr_info_ind->short_name.text, "RFT", 3); /* pseudo short name */
2042 mmr_info_ind->short_name.v_name = 1;
2043 mmr_info_ind->short_name.c_text = 3;
2044 memcpy (mmr_info_ind->full_name.text, "Ramsch Fusch Tinneff", 20); /* pseudo long name */
2045 mmr_info_ind->full_name.v_name = 1;
2046 mmr_info_ind->full_name.c_text = 20;
2047 mmr_info_ind->ntz.v_tz = 1;
2048 mmr_info_ind->ntz.tz = 0x19; /* simulate -2:45h away from GMT */
2049 mmr_info_ind->time.v_time = 1;
2050 mmr_info_ind->time.day = 30; /* 30. February 2004 ;~) */
2051 mmr_info_ind->time.month = 02;
2052 mmr_info_ind->time.year = 04;
2053 mmr_info_ind->time.hour = 11;
2054 mmr_info_ind->time.minute = 55; /* this stuff is really 5 before 12 */
2055 mmr_info_ind->time.second = 59;
2056 mmr_info_ind->plmn.v_plmn = 1;
2057 mmr_info_ind->plmn.mcc[0] = 0x02;
2058 mmr_info_ind->plmn.mcc[1] = 0x06;
2059 mmr_info_ind->plmn.mcc[2] = 0x02;
2060 mmr_info_ind->plmn.mnc[0] = 0x00;
2061 mmr_info_ind->plmn.mnc[1] = 0x01;
2062 mmr_info_ind->plmn.mnc[2] = 0x0F;
2063
2064 psa_mmr_info_ind(mmr_info_ind);
2065 return PEI_OK;
2066 }
2067 }
2068 #endif
2069
2070 TRACE_EVENT_P1("pei_config() %s", s);
2071
2072 tok_init(s);
2073
2074 /*
2075 * Parse next keyword and number of variables
2076 */
2077 while ((valno = tok_next(&keyw,val)) NEQ TOK_EOCS)
2078 {
2079 switch ((keyno = tok_key((KW_DATA *)kwtab,keyw)))
2080 {
2081 #ifdef MFW
2082 case KEY_SEQUENCE:
2083 {
2084 if (valno EQ 1)
2085 {
2086 mfw_keystroke (val[0]);
2087 }
2088 else
2089 {
2090 TRACE_ERROR ("[PEI_CONFIG]: Wrong Number of Parameters");
2091 }
2092 break;
2093 }
2094 #endif
2095
2096 #ifdef MFW
2097 case KEY_PRESS:
2098 {
2099 if (valno EQ 1)
2100 {
2101 mfw_keystroke_long (val[0], 1);
2102 }
2103 else
2104 {
2105 TRACE_ERROR ("[PEI_CONFIG]: Wrong Number of Parameters");
2106 }
2107 break;
2108 }
2109 #endif
2110
2111 #ifdef MFW
2112 case KEY_RELEASE:
2113 {
2114 if (valno EQ 1)
2115 {
2116 mfw_keystroke_long (val[0], 0);
2117 }
2118 else
2119 {
2120 TRACE_ERROR ("[PEI_CONFIG]: Wrong Number of Parameters");
2121 }
2122 break;
2123 }
2124 #endif
2125
2126 case START_AOC:
2127 {
2128 T_FWD_CHG_ADVICE_INV charge;
2129 T_chargingInformation * aoc_para;
2130
2131 aoc_para = &charge.forwardChargeAdviceArg.chargingInformation;
2132
2133 TRACE_EVENT ("Set AoC Parameter");
2134
2135 aoc_para->v_e1 = TRUE;
2136 aoc_para->e1.c_e_val = 1;
2137 aoc_para->e1.e_val[0] = 60;
2138 aoc_para->v_e2 = TRUE;
2139 aoc_para->e2.c_e_val = 1;
2140 aoc_para->e2.e_val[0] = 140;
2141 aoc_para->v_e3 = TRUE;
2142 aoc_para->e3.c_e_val = 1;
2143 aoc_para->e3.e_val[0] = 100;
2144 aoc_para->v_e4 = TRUE;
2145 aoc_para->e4.c_e_val = 1;
2146 aoc_para->e4.e_val[0] = 250;
2147 aoc_para->v_e5 = FALSE;
2148 aoc_para->e5.c_e_val = 0;
2149 aoc_para->e5.e_val[0] = 0;
2150 aoc_para->v_e6 = FALSE;
2151 aoc_para->e6.c_e_val = 0;
2152 aoc_para->e6.e_val[0] = 0;
2153 aoc_para->v_e7 = TRUE;
2154 aoc_para->e7.c_e_val = 2;
2155 aoc_para->e7.e_val[0] = 0x2;
2156 aoc_para->e7.e_val[1] = 0x58;
2157
2158 aoc_parameter(0, &charge);
2159 aoc_info (0, AOC_START_AOC);
2160 break;
2161 }
2162
2163 #ifdef _SIMULATION_
2164 case CPOL_MODE:
2165 {
2166 #ifdef FF_ATI
2167 if (valno EQ 1)
2168 {
2169 cpolMode = atoi(val[0]);
2170 }
2171 else
2172 {
2173 TRACE_ERROR ("[PEI_CONFIG]: Wrong Number of Parameters");
2174 }
2175 #else
2176 TRACE_ERROR ("[PEI_CONFIG]: AT Command Interpreter Not Supported");
2177 #endif
2178 break;
2179 }
2180
2181 case CPOL_IDX2:
2182 {
2183 #ifdef FF_ATI
2184 if (valno EQ 1)
2185 {
2186 cpolIdx2 = atoi(val[0]);
2187 }
2188 else
2189 {
2190 TRACE_ERROR ("[PEI_CONFIG]: Wrong Number of Parameters");
2191 }
2192 #else
2193 TRACE_ERROR ("[PEI_CONFIG]: AT Command Interpreter Not Supported");
2194 #endif
2195 break;
2196 }
2197 #endif
2198
2199 #ifdef FF_ATI
2200 #ifdef UART
2201 case ATI_VIA_TIF:
2202 {
2203 EXTERN BOOL atiViaTif;
2204
2205 if (valno EQ 1)
2206 {
2207 if (strcmp (val[0], "ON") EQ 0)
2208 atiViaTif = TRUE;
2209 else if (strcmp (val[0], "OFF") EQ 0)
2210 atiViaTif = FALSE;
2211 else
2212 TRACE_ERROR ("[PEI_CONFIG]: Wrong Parameter Value");
2213 }
2214 else
2215 {
2216 TRACE_ERROR ("[PEI_CONFIG]: Wrong Number of Parameters");
2217 }
2218 break;
2219 }
2220 #endif /* UART */
2221 #endif
2222
2223 default:
2224 {
2225 #ifdef FF_ATI
2226 if ( ( toupper ( inString[0] ) ) EQ 'A' AND
2227 ( toupper ( inString[1] ) ) EQ 'T' )
2228 {
2229 USHORT len = 0;
2230
2231 /*
2232 *---------------------------------------------------------
2233 * parsing algorithm is not suitable for transparent data
2234 * transfer, call aciCommand only once
2235 *---------------------------------------------------------
2236 */
2237 if (!alreadyCalled)
2238 {
2239 while (inString[len] NEQ ' ' AND inString[len] NEQ '\0')
2240 len++;
2241
2242 inString[len] = '\0';
2243
2244 ati_execute_config_cmd ((UBYTE*)inString, len);
2245 }
2246
2247 alreadyCalled = TRUE;
2248 }
2249 else
2250 #endif
2251 {
2252 #ifdef SMI
2253 return _pei_config (inString);
2254 #else
2255 TRACE_ERROR ("[PEI_CONFIG]: Illegal Keyword");
2256 #endif
2257 }
2258 break;
2259 }
2260 }
2261 }
2262 #endif
2263
2264 return PEI_OK;
2265 }
2266
2267 /*
2268 +--------------------------------------------------------------------+
2269 | PROJECT : GSM-F&D (8411) MODULE : ACI_PEI |
2270 | STATE : code ROUTINE : pei_monitor |
2271 +--------------------------------------------------------------------+
2272
2273 PURPOSE : Monitoring of physical Parameters
2274
2275 */
2276 LOCAL SHORT pei_monitor (void ** monitor)
2277 {
2278 TRACE_FUNCTION ("pei_monitor()");
2279
2280 #ifdef SMI
2281 _pei_monitor (monitor);
2282 #else
2283 aci_mon.version = VERSION_ACI;
2284 #endif
2285
2286 *monitor = &aci_mon;
2287
2288 return PEI_OK;
2289 }
2290
2291
2292 /*
2293 +--------------------------------------------------------------------+
2294 | PROJECT : GSM-F&D (8411) MODULE : ACI_PEI |
2295 | STATE : code ROUTINE : pei_create |
2296 +--------------------------------------------------------------------+
2297
2298 PURPOSE : Create the Protocol Stack Entity
2299
2300 */
2301
2302 GLOBAL SHORT aci_pei_create (T_PEI_INFO **info)
2303 {
2304 static const T_PEI_INFO pei_info =
2305 {
2306 ACI_NAME,
2307 {
2308 pei_init,
2309 pei_exit,
2310 pei_primitive,
2311 pei_timeout,
2312 pei_signal,
2313 NULL, /* no run function */
2314 pei_config,
2315 pei_monitor,
2316 },
2317 #if defined (ACI)
2318 3072, /* Stack Size */
2319 #endif
2320 #if defined (SMI)
2321 3072, /* Stack Size */
2322 #endif
2323 #if defined (MFW)
2324 4096, /* Stack Size */
2325 #endif
2326 #if defined (FF_MMI_RIV)
2327 3072, /* Stack Size */
2328 #endif
2329 20, /* Queue Entries */
2330 #if defined (ACI)
2331 100, /* Priority */
2332 #endif
2333 #if defined (SMI)
2334 100, /* Priority */
2335 #endif
2336 #if defined (MFW)
2337 100, /* Priority */
2338 #endif
2339 #if defined (FF_MMI_RIV)
2340 100, /* Priority */
2341 #endif
2342
2343 MAX_ACI_TIMER, /* number of timer */
2344 0x03|PRIM_NO_SUSPEND /* flags */
2345 };
2346
2347 TRACE_FUNCTION ("pei_create()");
2348
2349 /*
2350 * Close Resources if open
2351 */
2352
2353 if (first_access)
2354 first_access = FALSE;
2355 else
2356 pei_exit ();
2357
2358 /*
2359 * Export startup configuration data
2360 */
2361
2362 *info = (T_PEI_INFO *)&pei_info;
2363
2364 return PEI_OK;
2365 }
2366
2367
2368 #endif /* ACI_PEI_C */