comparison src/g23m-aci/aci/aci_pei.c @ 1:fa8dc04885d8

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