comparison src/g23m-aci/aci/aci_pei.c @ 162:53929b40109c

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