blob: a431408b53cac37548a9557613ca95b16e01ee97 [file] [log] [blame]
rjw6c1fd8f2022-11-30 14:33:01 +08001/*****************************************************************************
2* Copyright Statement:
3* --------------------
4* This software is protected by Copyright and the information contained
5* herein is confidential. The software may not be copied and the information
6* contained herein may not be used or disclosed except with the written
7* permission of MediaTek Inc. (C) 2005
8*
9* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
10* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
11* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
12* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
13* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
14* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
15* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
16* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
17* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
18* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
19* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
20* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
21*
22* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
23* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
24* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
25* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
26* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
27*
28* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
29* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
30* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
31* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
32* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
33*
34*****************************************************************************/
35
36/*****************************************************************************
37 *
38 * Filename:
39 * ---------
40 * atp_public_defs.h
41 *
42 *
43 * Description:
44 * ------------
45 * This file contains the public definitions of ATP
46 *
47 * Author:
48 * -------
49 * -------
50 *
51 *============================================================================
52 * HISTORY
53 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
54 *------------------------------------------------------------------------------
55 * removed!
56 *
57 * removed!
58 * removed!
59 * removed!
60 *
61 * removed!
62 * removed!
63 * removed!
64 * removed!
65 *
66 * removed!
67 * removed!
68 * removed!
69 * removed!
70 *
71 * removed!
72 * removed!
73 * removed!
74 *
75 * removed!
76 * removed!
77 * removed!
78 * removed!
79 *
80 * removed!
81 * removed!
82 * removed!
83 * removed!
84 *
85 * removed!
86 * removed!
87 * removed!
88 * removed!
89 *
90 * removed!
91 * removed!
92 * removed!
93 * removed!
94 *
95 * removed!
96 * removed!
97 * removed!
98 *
99 * removed!
100 * removed!
101 * removed!
102 *
103 * removed!
104 * removed!
105 * removed!
106 *
107 * removed!
108 * removed!
109 * removed!
110 *
111 * removed!
112 * removed!
113 * removed!
114 * removed!
115 *
116 * removed!
117 * removed!
118 * removed!
119 * removed!
120 *
121 * removed!
122 * removed!
123 * removed!
124 * removed!
125 *
126 * removed!
127 * removed!
128 * removed!
129 * removed!
130 *
131 * removed!
132 * removed!
133 * removed!
134 * removed!
135 *
136 * removed!
137 * removed!
138 * removed!
139 * removed!
140 *
141 * removed!
142 * removed!
143 * removed!
144 * removed!
145 *
146 * removed!
147 * removed!
148 * removed!
149 * removed!
150 *
151 * removed!
152 * removed!
153 * removed!
154 *
155 * removed!
156 * removed!
157 * removed!
158 * removed!
159 *
160 * removed!
161 * removed!
162 * removed!
163 *
164 * removed!
165 * removed!
166 *
167 * removed!
168 * removed!
169 *
170 * removed!
171 * removed!
172 * removed!
173 *
174 * removed!
175 * removed!
176 * removed!
177 *
178 * removed!
179 * removed!
180 * removed!
181 *
182 * removed!
183 * removed!
184 * removed!
185 *
186 * removed!
187 *------------------------------------------------------------------------------
188 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
189 *============================================================================
190 ****************************************************************************/
191#ifndef _ATP_PUBLIC_DEFS_H_
192#define _ATP_PUBLIC_DEFS_H_
193
194#include "global_def.h"
195#include "cmux_vp_num.h"
196#include "ps_public_enum.h"
197#include "msm_service.h"
198
199#ifdef __UE_SIMULATOR__
200#include "l4c2uegw_struct.h"
201#endif
202
203//CMUX and L5 have the same channel number
204#define ATP_L5_CHANNELS_NUM ((CMUX_VP_NUM_FOR_ATCI * MAX_SIM_NUM) + (CMUX_VP_NUM_FOR_ATCI_EX * MAX_SIM_NUM) + CMUX_VP_NUM_FOR_ATCI_CSD + CMUX_VP_NUM_FOR_ATCI_IMS + CMUX_VP_NUM_FOR_ATCI_IMS_SMS + CMUX_VP_NUM_FOR_NETIF_CONTROL)
205
206typedef enum {
207 ATP_FIRST_CHANNEL,
208 /* channels mapped to ports between AP and MD */
209#ifdef __L5_SUPPORT__
210 #ifdef __CMUX_SUPPORT__
211 ATP_CMUX_CHANNELS_START = ATP_FIRST_CHANNEL,
212 ATP_L5_CHANNELS_START = ATP_CMUX_CHANNELS_START,
213 ATP_CMUX_CHANNELS_END = (ATP_CMUX_CHANNELS_START + (CMUX_VP_NUM_FOR_SINGLE_SIM * MAX_SIM_NUM) + CMUX_VPEX_TOTAL_NUM - 1),
214 ATP_L5_CHANNELS_END = ATP_CMUX_CHANNELS_END,
215 #else
216 ATP_L5_CHANNELS_START = ATP_FIRST_CHANNEL,
217 ATP_L5_CHANNELS_END = ATP_L5_CHANNELS_START + (ATP_L5_CHANNELS_NUM - 1),
218 #endif
219#else
220 #ifdef __CMUX_SUPPORT__
221 ATP_CMUX_CHANNELS_START = ATP_FIRST_CHANNEL,
222 ATP_CMUX_CHANNELS_END = (ATP_CMUX_CHANNELS_START + (CMUX_VP_NUM_FOR_SINGLE_SIM * MAX_SIM_NUM) + CMUX_VPEX_TOTAL_NUM - 1),
223 #endif
224#endif
225
226 /* channels for IMSP */
227//#if defined(__IMS_SUPPORT__)
228 ATP_IMS_CHANNEL_START,
229 ATP_IMS_CHANNEL_END = ATP_IMS_CHANNEL_START + 19, //MSP_MAX_TRANSACTION = 20, it must be the same with ATP_MAX_TRANSACTIONs
230//#endif
231
232 /* test channels per SIM for ELT inject AT command */
233 ATP_TST_CHANNEL,
234 ATP_TST_CHANNEL_END = ATP_TST_CHANNEL + MAX_SIM_NUM - 1,
235
236#ifdef __UE_SIMULATOR__
237 ATP_VMMI_CHANNEL_START,
238 ATP_VMMI_CHANNEL_END = ATP_VMMI_CHANNEL_START + (MAX_VMMI_SIM_NUM * MAX_VMMI_CHANNEL_NUM),
239#endif
240
241 ATP_EPDG_CHANNEL_START,
242 ATP_EPDG_CHANNEL_END = ATP_EPDG_CHANNEL_START + MAX_SIM_NUM - 1,
243 ATP_URC_EPDG_CHANNEL_START,
244 ATP_URC_EPDG_CHANNEL_END = ATP_URC_EPDG_CHANNEL_START + MAX_SIM_NUM - 1,
245
246 ATP_CHANNEL_NUMBER,
247
248 /* URC channel begin
249 below channels are representative for URC, no input/output queue
250 */
251 ATP_URC_CHANNEL,
252 ATP_URC2_CHANNEL,
253#ifdef __TC01_IMS_SUPPORT__
254 ATP_URC3_CHANNEL,
255#endif
256 ATP_URC_EPDG_CHANNEL,
257 ATP_URC4_CHANNEL,
258 ATP_URC_LAST_CHANNEL = ATP_URC4_CHANNEL,
259 /* URC channel end */
260
261 ATP_INVALID_CHANNEL = 0xff
262} atp_channel_enum;
263
264// TODO: to replace MAX_DATA_QUEUE_LENGTH
265#if defined (__LONG_AT_CMD_SUPPORT__) || defined (__SMART_PHONE_MODEM__)
266#define ATP_MAX_DATA_QUEUE_LENGTH 2048
267#elif defined (__ULC_AT__)
268#define ATP_MAX_DATA_QUEUE_LENGTH 192
269#elif defined (__SLIM_AT__)
270#define ATP_MAX_DATA_QUEUE_LENGTH 350
271#else
272#define ATP_MAX_DATA_QUEUE_LENGTH 2048
273#endif
274
275// TODO: replace MAX_UART_LENGTH
276/* size of per UART read/write operation
277 i.e. the size of prepared buffer transfered to UART read API as an output parameter
278*/
279#define ATP_MAX_UART_LENGTH 128
280
281#define ATP_EXT_QUEUE_RESERVE_SPACE 20
282
283
284typedef enum
285{
286 PROXY_CMD_FAIL,
287 PROXY_CMD_SUCCESS,
288 PROXY_CMD_INTERMEDIATE_RSP,
289 PROXY_CMD_NO_CARRIER,
290 PROXY_CMD_BUSY,
291 PROXY_CMD_CONNECT,
292 PROXY_CMD_CONNECT_PS
293} proxy_cmd_result_enum;
294
295typedef enum
296{
297 ATP_WRONG_MODE = 0x00,
298
299 ATP_SET_OR_EXECUTE_MODE = 0x01,
300 ATP_READ_MODE = 0x02,
301 ATP_TEST_MODE = 0x04,
302 ATP_ACTIVE_MODE = 0x8,
303
304 ATP_URC_MODE = 0x10, // URC command
305 ATP_INTERMEDIATE_MODE = 0x20, // intermidate response
306 ATP_RESULT_MODE = 0x40, // Command result
307
308 ATP_SET_OR_EXECUTE_OR_READ_MODE = ATP_SET_OR_EXECUTE_MODE | ATP_READ_MODE,
309 ATP_SET_OR_EXECUTE_OR_TEST_MODE = ATP_SET_OR_EXECUTE_MODE | ATP_TEST_MODE,
310 ATP_SET_OR_EXECUTE_OR_ACTIVE_MODE = ATP_SET_OR_EXECUTE_MODE | ATP_ACTIVE_MODE,
311 ATP_READ_OR_TEST_MODE = ATP_READ_MODE | ATP_TEST_MODE,
312 ATP_READ_OR_ACTIVE_MODE = ATP_READ_MODE | ATP_ACTIVE_MODE,
313 ATP_TEST_OR_ACTIVE_MODE = ATP_TEST_MODE | ATP_ACTIVE_MODE,
314
315 ATP_SET_OR_EXECUTE_OR_READ_OR_TEST_MODE = ATP_SET_OR_EXECUTE_MODE | ATP_READ_MODE | ATP_TEST_MODE,
316 ATP_SET_OR_EXECUTE_OR_READ_OR_ACTIVE_MODE = ATP_SET_OR_EXECUTE_MODE | ATP_READ_MODE | ATP_ACTIVE_MODE,
317 ATP_SET_OR_EXECUTE_OR_TEST_OR_ACTIVE_MODE = ATP_SET_OR_EXECUTE_MODE | ATP_TEST_MODE | ATP_ACTIVE_MODE,
318 ATP_READ_OR_TEST_OR_ACTIVE_MODE = ATP_READ_MODE | ATP_TEST_MODE | ATP_ACTIVE_MODE,
319
320 ATP_ALL_CMD_MODE = 0xff
321} atp_cmd_mode_enum;
322
323typedef enum
324{
325 ATP_CMD_CLASS_INVALID = 0,
326 ATP_CMD_CLASS_PREV,
327 ATP_CMD_CLASS_BASIC,
328 ATP_CMD_CLASS_EXTENDED,
329 ATP_CMD_CLASS_EXTENDED_CUSTOM,
330 ATP_CMD_CLASS_CUSTOM
331} atp_cmd_class_enum;
332
333
334// TODO: _Hong_ replace rmmi_error_report_mode_enum
335typedef enum
336{
337 ATP_SIMPLE_ERROR,
338 ATP_NUMERIC_ERROR,
339 ATP_TEXT_ERROR
340} atp_error_report_mode_enum;
341
342// TODO: _Hong_ replace rmmi_cmd_echo_enum
343typedef enum
344{
345 ATP_ECHO_OFF,
346 ATP_ECHO_ON
347} atp_cmd_echo_enum;
348
349// TODO: _Hong_ replace rmmi_result_code_format
350typedef enum
351{
352 ATP_NUM_PARTIAL_HEAD_TAIL,
353 ATP_VERBOSE_FULL_HEAD_TAIL
354} atp_result_code_format;
355
356// TODO: _Ian_ replace rmmi_result_code_suppress_enum
357typedef enum
358{
359 ATP_SUPPRESS_OFF,
360 ATP_SUPPRESS_ON
361} atp_result_code_suppress_enum;
362
363
364typedef enum
365{
366 ATP_PARSE_ERR_NO_FIELDS,
367 ATP_PARSE_ERR_INCOMPLETE_FIELD,
368 ATP_PARSE_ERR_INCOMPLETE_FIELD_WITH_SPACE,
369 ATP_PARSE_ERR_INCOMPLETE_FIELD_UNEXPECT_CHAR,
370 ATP_PARSE_ERR_REACH_MAX_FIELDS,
371} atp_cmd_parse_error_enum;
372
373
374
375// TODO: _Hong_ replace rmmi_rsp_type_enum
376typedef enum
377{
378 /* --- standard result codes, defined in V.25 Table1 --- */
379 ATP_RCODE_OK, //0
380 ATP_RCODE_CONNECT, //1
381 ATP_RCODE_RING, //2
382 ATP_RCODE_NO_CARRIER, //3
383 ATP_RCODE_ERROR, //4
384 //there is no 5 in V.25 spec.
385 //ATP_RCODE_NO_DIALTONE = 6, //6
386 ATP_RCODE_BUSY = 7, //7
387 //ATP_RCODE_NO_ANSWER = 8, //8
388
389 /* --- MTK Proprietary result codes --- */
390 ATP_RCODE_CONNECT_PS = 100, //MAUI_02956467, mtk02285, for PS call
391} atp_rsp_type_enum;
392
393typedef enum
394{
395 ATP_SPACE = ' ',
396 ATP_EQUAL = '=',
397 ATP_COMMA = ',',
398 ATP_SEMICOLON = ';',
399 ATP_COLON = ':',
400 ATP_AT = '@',
401 ATP_HAT = '^',
402 ATP_DOUBLE_QUOTE = '"',
403 ATP_QUESTION_MARK = '?',
404 ATP_EXCLAMATION_MARK = '!',
405 ATP_FORWARD_SLASH = '/',
406 ATP_L_ANGLE_BRACKET = '<',
407 ATP_R_ANGLE_BRACKET = '>',
408 ATP_L_SQ_BRACKET = '[',
409 ATP_R_SQ_BRACKET = ']',
410 ATP_L_CURLY_BRACKET = '{',
411 ATP_R_CURLY_BRACKET = '}',
412 ATP_CHAR_STAR = '*',
413 ATP_CHAR_POUND = '#',
414 ATP_CHAR_AMPSAND = '&',
415 ATP_CHAR_PERCENT = '%',
416 ATP_CHAR_PLUS = '+',
417 ATP_CHAR_MINUS = '-',
418 ATP_CHAR_DOT = '.',
419 ATP_CHAR_ULINE = '_',
420 ATP_CHAR_TILDE = '~',
421 ATP_CHAR_REVERSE_SOLIDUS = '\\',
422 ATP_CHAR_VERTICAL_LINE = '|',
423 ATP_END_OF_STRING_CHAR = '\0',
424 ATP_CHAR_0 = '0',
425 ATP_CHAR_1 = '1',
426 ATP_CHAR_2 = '2',
427 ATP_CHAR_3 = '3',
428 ATP_CHAR_4 = '4',
429 ATP_CHAR_5 = '5',
430 ATP_CHAR_6 = '6',
431 ATP_CHAR_7 = '7',
432 ATP_CHAR_8 = '8',
433 ATP_CHAR_9 = '9',
434 ATP_CHAR_A = 'A',
435 ATP_CHAR_B = 'B',
436 ATP_CHAR_C = 'C',
437 ATP_CHAR_D = 'D',
438 ATP_CHAR_E = 'E',
439 ATP_CHAR_F = 'F',
440 ATP_CHAR_G = 'G',
441 ATP_CHAR_H = 'H',
442 ATP_CHAR_I = 'I',
443 ATP_CHAR_J = 'J',
444 ATP_CHAR_K = 'K',
445 ATP_CHAR_L = 'L',
446 ATP_CHAR_M = 'M',
447 ATP_CHAR_N = 'N',
448 ATP_CHAR_O = 'O',
449 ATP_CHAR_P = 'P',
450 ATP_CHAR_Q = 'Q',
451 ATP_CHAR_R = 'R',
452 ATP_CHAR_S = 'S',
453 ATP_CHAR_T = 'T',
454 ATP_CHAR_U = 'U',
455 ATP_CHAR_V = 'V',
456 ATP_CHAR_W = 'W',
457 ATP_CHAR_X = 'X',
458 ATP_CHAR_Y = 'Y',
459 ATP_CHAR_Z = 'Z',
460 atp_char_a = 'a',
461 atp_char_b = 'b',
462 atp_char_c = 'c',
463 atp_char_d = 'd',
464 atp_char_e = 'e',
465 atp_char_f = 'f',
466 atp_char_g = 'g',
467 atp_char_h = 'h',
468 atp_char_i = 'i',
469 atp_char_j = 'j',
470 atp_char_k = 'k',
471 atp_char_l = 'l',
472 atp_char_m = 'm',
473 atp_char_n = 'n',
474 atp_char_o = 'o',
475 atp_char_p = 'p',
476 atp_char_q = 'q',
477 atp_char_r = 'r',
478 atp_char_s = 's',
479 atp_char_t = 't',
480 atp_char_u = 'u',
481 atp_char_v = 'v',
482 atp_char_w = 'w',
483 atp_char_x = 'x',
484 atp_char_y = 'y',
485 atp_char_z = 'z',
486 ATP_R_BRACKET = ')',
487 ATP_L_BRACKET = '(',
488 ATP_MONEY = '$',
489 ATP_EURO = 0x80 /*to avoid build error due to wcxsubmit issue*/
490} atp_char_enum;
491// TODO: _Hong_ replace rmmi_char_enum by atp_char_enum
492
493// TODO: use run time ATP context to store S3 character
494#define ATP_CHAR_S3 13
495
496//for BS(BackSpace) = '\b' = ^H
497#define ATP_CHAR_BS 0x08
498//for LF(Line Feed, end of line) = '\n' = ^J
499#define ATP_CHAR_LF 0x0a
500//for CR(Carriage Return) = '\r' = ^M
501#define ATP_CHAR_CR 0x0d
502//for CTRL-Z
503#define ATP_CHAR_CTRL_Z 0x1a
504//for ESC
505#define ATP_CHAR_ESC 0x1b
506
507#define ATP_EXTEND_SYMBOL_HASH_BASE 79235168 // 38^5
508
509
510// TODO: _Hong_ to replace rmmi_err_id_enum
511/*
512All values below 256 are reserved.
513Values in the range 0 - 100 are reserved for general errors.
514Values in the range 101 - 150 are reserved for use by GPRS and EPS.
515Values in the range 151 - 170 are reserved for use by VBS/VGCS and eMLPP.
516Values in the range 171 - 256 can be used by GPRS or by EPS.
517Sometimes ps_cause_enum is mixed in +CME ERROR: <err>; however this is a bad design
518*/
519typedef enum
520{
521 /* 07.07 Sec 9.2.1 */
522 ATP_ERR_PHONE_FAILURE,
523 ATP_ERR_NO_CONNECTION_TO_PHONE = 1,
524 ATP_ERR_PHONE_ADAPTOR_LINK_RESERVED = 2,
525 ATP_ERR_OPERATION_NOT_ALLOWED = 3,
526 ATP_ERR_OPERATION_NOT_SUPPORTED = 4,
527 ATP_ERR_PH_SIM_PIN_REQUIRED = 5,
528 ATP_ERR_PH_FSIM_PIN_REQUIRED = 6, //Kinki: SIM-ME lock [MAUI_01264994]
529 ATP_ERR_PH_FSIM_PUK_REQUIRED = 7, //Kinki: SIM-ME lock [MAUI_01264994]
530 ATP_ERR_SIM_NOT_INSERTED = 10,
531 ATP_ERR_SIM_PIN_REQUIRED = 11,
532 ATP_ERR_SIM_PUK_REQUIRED = 12,
533 ATP_ERR_SIM_FAILURE = 13,
534 ATP_ERR_SIM_BUSY = 14,
535 ATP_ERR_SIM_WRONG = 15,
536 ATP_ERR_INCORRECT_PASSWD = 16,
537 ATP_ERR_SIM_PIN2_REQUIRED = 17,
538 ATP_ERR_SIM_PUK2_REQUIRED = 18,
539 ATP_ERR_MEM_FULL = 20,
540 ATP_ERR_INVALID_INDEX = 21,
541 ATP_ERR_NO_FOUND = 22,
542 ATP_ERR_TEXT_ERRSTRING_TOO_LONG_ERR = 24,
543 ATP_ERR_INVALID_CHARACTERS_IN_TEXT_ERRSTRING_ERR = 25,
544 ATP_ERR_DIAL_ERRSTRING_TOO_LONG_ERR = 26,
545 ATP_ERR_INVALID_CHARACTERS_IN_DIAL_ERRSTRING_ERR = 27,
546 ATP_ERR_NO_NW_SERVICE = 30,
547 ATP_ERR_NETWORK_TIMEOUT = 31,
548 ATP_ERR_NETWORK_NOT_ALLOWED = 32,
549 ATP_ERR_NW_PERSON_PIN_REQUIRED = 40,
550 ATP_ERR_NW_PERSON_PUK_REQUIRED = 41,
551 ATP_ERR_NW_SUB_PERSON_PIN_REQUIRED = 42,
552 ATP_ERR_NW_SUB_PERSON_PUK_REQUIRED = 43,
553 ATP_ERR_SP_PERSON_PIN_REQUIRED = 44,
554 ATP_ERR_SP_PERSON_PUK_REQUIRED = 45,
555 ATP_ERR_CORP_PERSON_PIN_REQUIRED = 46,
556 ATP_ERR_CORP_PERSON_PUK_REQUIRED = 47,
557 ATP_ERR_HIDDEN_KEY_REQUIRED = 48,
558 ATP_ERR_EAP_NOT_SUPPORT = 49,
559 ATP_ERR_INCORRECT_PARAM = 50,
560 ATP_ERR_CMD_IMPLEMENT_BUT_CUR_DISABLED = 51,
561 ATP_ERR_CMD_ABORT_BY_USER = 52,
562 ATP_ERR_NOT_ATTACHED_TO_NETWORK = 53,
563 ATP_ERR_MODEM_NOT_ALLOW = 54,
564 ATP_ERR_OPERATION_NOT_ALLOW_MT_RESTRICTIONS = 55,
565 ATP_ERR_FIXED_DIAL_NUMBER_ONLY_ALLOW = 56,
566 ATP_ERR_TEMP_OUT_OF_SERVICE = 57,
567 ATP_ERR_LANG_NOT_SUPPORT = 58,
568 ATP_ERR_UNEXPECTED_VALUE = 59,
569 ATP_ERR_SYSTEM_FAILURE = 60,
570 ATP_ERR_DATA_MISSING = 61,
571 ATP_ERR_CALL_BARRED = 62,
572 ATP_ERR_SLA_AUTH_FAIL = 63,
573 ATP_ERR_UNKNOWN = 100,
574
575
576 ATP_ERR_ILLEGAL_MS = 103,
577 ATP_ERR_ILLEGAL_ME = 106,
578 ATP_ERR_GPRS_NOT_ALLOWED = 107,
579 ATP_ERR_GPRS_NON_GPRS_NOT_ALLOWED = 108,
580 ATP_ERR_PLMN_NOT_ALLOWED = 111,
581 ATP_ERR_LA_NOT_ALLOWED = 112,
582 ATP_ERR_ROAMING_AREA_NOT_ALLOWED = 113,
583 ATP_ERR_GPRS_NOT_ALLOWED_IN_THIS_PLMN = 114,
584 ATP_ERR_NO_SUITABLE_CELL = 115,
585 ATP_ERR_CONGESTION = 122,
586 ATP_ERR_NOT_AUTH_FOR_CSG = 125,
587
588 ATP_ERR_INSUFF_RESOURCE = 126,
589 ATP_ERR_MISSING_APN = 127,
590 ATP_ERR_UNKNOWN_PDP_ADDR = 128,
591 ATP_ERR_USER_AUTH_FAIL = 129,
592 ATP_ERR_ACTIVATION_REJ_BY_GGSN = 130,
593 ATP_ERR_ACTIVATION_REJ_UNSPECIFIED = 131,
594 ATP_ERR_SERV_OPTION_NOT_SUPPORTED = 132,
595 ATP_ERR_REQ_SERV_OPTION_NOT_SUBSCRIBED = 133,
596 ATP_ERR_SERV_OPTION_TEMP_OUT_OF_ORDER = 134,
597
598 ATP_ERR_FEATURE_NOT_SUPPORTED = 140,
599 ATP_ERR_SEMANTIC_ERR_IN_TFT = 141,
600 ATP_ERR_SYNTACTICAL_ERR_IN_TFT = 142,
601 ATP_ERR_UNKNOWN_PDP_CONTEXT = 143,
602 ATP_ERR_SEMANTIC_ERR_IN_PF = 144,
603 ATP_ERR_SYNTACTICAL_ERR_IN_PF = 145,
604 ATP_ERR_PDP_CONTEXT_WO_TFT_ALREADY_ACTIVATED = 146,
605
606 ATP_ERR_GPRS_UNSPECIFIED_ERROR = 148,
607 ATP_ERR_PDP_AUTH_FAIL = 149,
608 ATP_ERR_INVALID_MOBILE_CLASS = 150,
609 ATP_ERR_LAST_PDN_DISC_NOT_ALLOWED = 171,
610
611 ATP_ERR_SEMANTICALLY_INCORRECT_MSG = 172,
612 ATP_ERR_MANDATORY_IE_ERR = 173,
613 ATP_ERR_IE_NOT_EXIST = 174,
614 ATP_ERR_COND_IR_ERR = 175,
615 ATP_ERR_PROTOCOL_ERR_UNSPECIFIED = 176,
616
617 ATP_ERR_OPERATOR_BARRING = 177,
618 ATP_ERR_MAXIMUM_PDP_CONTEXT = 178,
619 ATP_ERR_REQUESTED_APN_NOT_SUPPORTED = 179,
620 ATP_ERR_REQUEST_REJ_BCM_MODE_VIOLATION = 180,
621 ATP_ERR_REQUEST_REJ_UNSUPPORTED_QCI_VALUE = 181,
622
623 ATP_ERROR_DIAL_MODIFIED_TO_DAIL = 246, /* This is specified for TC09 */
624
625 /*** according to TS 27.007 9.2.0, all values below 256 are reserved ***/
626
627 ATP_ERR_LINK_NS_SP_PERSON_PIN_REQUIRED = 257, //Kinki: SIM-ME lock [MAUI_01264994]
628 ATP_ERR_LINK_NS_SP_PERSON_PUK_REQUIRED = 258, //Kinki: SIM-ME lock [MAUI_01264994]
629 ATP_ERR_LINK_SIM_C_PERSON_PIN_REQUIRED = 259, //Kinki: SIM-ME lock [MAUI_01264994]
630 ATP_ERR_LINK_SIM_C_PERSON_PUK_REQUIRED = 260, //Kinki: SIM-ME lock [MAUI_01264994]
631 ATP_ERR_CHANNEL_NOT_ALLOWED_IN_META_MODE = 261, //Block all AT channels other than +EMETACFG when in META mode
632
633 /* The following error causes should be added into rmmi_result_code_fmttr() to be displayed in +CME ERROR */
634 ATP_ERR_VERIFICATION_FAILED = 270, /* for TMO */
635 ATP_ERR_REBOOT_REQUIRED = 271, /* for TMO */
636
637 /* following are proprietary error cause : the cause below WON'T be showed as +CME ERROR. */
638 ATP_ERR_COMMAND_CONFLICT = 302, //same as operation not allowed in 07.05 Sec 3.2.5
639 // will be convert to +CME ERROR: 3 or +CMS ERROR: 302
640 ATP_NO_ERR = 600,
641
642 /* following: error is related to syntax, invalid parameters.. */
643 /* according to spec 07.07 Sec 9.1, only "ERROR" will be returned to TE side */
644 ATP_ERR_UNRECOGNIZED_CMD = 601,
645 ATP_ERR_RETURN_ERROR = 602,
646 ATP_ERR_SYNTEX_ERROR = 603,
647 ATP_ERR_UNSPECIFIED = 604, //unspecified parsing error
648 ATP_ERR_DATA_TRANSFER_ALREADY = 605,
649 ATP_ERR_ACTION_ALREADY = 606,
650 ATP_ERR_NOT_AT_CMD = 607,
651 ATP_ERR_MULTI_CMD_TOO_LONG = 608,
652 ATP_ERR_ABORT_COPS = 609,
653 ATP_ERR_NO_CALL_DISC = 610,
654 ATP_ERR_BT_SAP_UNDEFINED = 611,
655 ATP_ERR_BT_SAP_NOT_ACCESSIBLE = 612,
656 ATP_ERR_BT_SAP_CARD_REMOVED = 613,
657 ATP_ERR_AT_NOT_ALLOWED_BY_CUSTOMER = 614,
658 ATP_ERR_MM_LU_REJ_17_IN_MANUAL_MODE = 615,
659 ATP_ERR_CARD_TECHNICAL_PROBLEM = 616,
660 ATP_ERR_BT_SAP_CARD_ALREADY_POWERED_OFF = 617,
661 ATP_ERR_BT_SAP_CARD_ALREADY_POWERED_ON = 618,
662 ATP_ERR_RMS_RFON_NOT_ALLOWED = 619,
663 ATP_ERR_RMS_SIMON_NOT_ALLOWED = 620,
664
665 // for secure AT command, refer to MSM_ERROR_E
666 ATP_ERR_SECURE_AT_CAUSE_START = MSM_ERROR_START, // 0x600, 1536
667 ATP_ERR_SECURE_AT_CAUSE_END = MSM_ERROR_END, // 0x6FF, 1791
668
669 /* below err id are reserved for LWTG protocol stack */
670 ATP_ERR_CAUSE_FDN_BLOCKED = PHB_CAUSE_FDN_BLOCKED, //2600
671 ATP_ERR_LWTG_PS_START = REPORT_TO_UPPER_LAYER_CAUSE_START,
672 ATP_ERR_LWTG_PS_END = REPORT_TO_UPPER_LAYER_CAUSE_END,
673 /* above err id are reserved for LWTG protocol stack */
674
675 ATP_ERR_NONE = 0xffff
676} atp_err_id_enum;
677
678typedef enum
679{
680 ATP_PARSE_OK,
681 ATP_PARSE_ERROR,
682 ATP_PARSE_NOT_FOUND,
683 ATP_PARSE_TEXT_TOO_LONG
684} atp_validator_cause_enum;
685// TODO:_Hong_ replace imsp_validator_cause_enum with atp_validator_cause_enum
686
687typedef enum
688{
689 ATP_EXTEND_HASH_PLUS = ATP_EXTEND_SYMBOL_HASH_BASE*0, // + : 0*38^5
690 ATP_EXTEND_HASH_HAT = ATP_EXTEND_SYMBOL_HASH_BASE*1, // ^ : 1*38^5
691 ATP_EXTEND_HASH_PERCENT = ATP_EXTEND_SYMBOL_HASH_BASE*2, // % : 2*38^5
692 ATP_EXTEND_HASH_MONEY = ATP_EXTEND_SYMBOL_HASH_BASE*3, // $ : 3*38^5
693 ATP_EXTEND_HASH_STAR = ATP_EXTEND_SYMBOL_HASH_BASE*4 // * : 4*38^5
694} atp_extend_symbol_hash_enum;
695
696
697
698typedef enum
699{
700 ATP_FIELD_TYPE_INVALIDE,
701 ATP_FIELD_UNKNOWN_STR, // others
702 ATP_FIELD_TYPE_INT, // 1
703 ATP_FIELD_TYPE_STR, // ,"mtk",
704 ATP_FIELD_TYPE_EMPTY, // ,,
705
706} atp_field_enum;
707
708typedef struct
709{
710 kal_uint8 *field_ptr;
711 kal_uint16 field_len;
712 kal_int64 field_value;
713 atp_field_enum field_type;
714
715} atp_field_struct;
716
717#define ATP_FIELD_MAX 30
718
719typedef struct atp_string_struct
720{
721 kal_uint8 *string_ptr;
722 kal_uint8 tid; // used to record the ATP transaction ID
723 kal_uint16 index;
724 kal_uint16 string_length;
725 kal_uint16 cmd_index;
726 kal_uint16 hdlr_index;
727 kal_uint16 field_count;
728 atp_field_struct *field_list;
729 atp_cmd_mode_enum cmd_mode;
730 atp_cmd_class_enum cmd_class;
731 atp_extend_symbol_hash_enum symbol_hash;
732
733} atp_string_struct;
734// TODO: _Hong_ replace atp_string_struct
735
736
737typedef struct
738{
739 /* TODO */
740 kal_uint8 reserved;
741
742} atp_multiple_basic_cmd_struct;
743
744
745
746#define ATP_UNKNOWN_REPORT_MODE 0xff
747
748typedef enum
749{
750 ATP_REPORT_MODE_NONE,
751 ATP_REPORT_MODE_CMEE,
752 ATP_REPORT_MODE_ECSQ,
753 ATP_REPORT_MODE_CREG,
754 ATP_REPORT_MODE_CGREG,
755 ATP_REPORT_MODE_CEREG,
756 ATP_REPORT_MODE_EN3GPECP,
757 ATP_REPORT_MODE_EANBR,
758 ATP_REPORT_MODE_EICPG,
759 ATP_REPORT_MODE_C5GUSMS,
760 //Add new report mode here
761 ATP_REPORT_MODE_MAX
762
763} atp_urc_report_mode_enum;
764
765typedef enum
766{
767 ATP_AT_CMD_BLOCK_FOR_LDU,
768 ATP_AT_CMD_BLOCK_STANDARD,
769 ATP_AT_CMD_BLOCK_MAX
770} atp_at_cmd_block_enum;
771
772
773#endif /* _ATP_PUBLIC_DEFS_H_ */