yu.dong | c33b307 | 2024-08-21 23:14:49 -0700 | [diff] [blame^] | 1 | #ifndef _L5_COMMON_H_ |
| 2 | #define _L5_COMMON_H_ |
| 3 | |
| 4 | #include "kal_public_defs.h" |
| 5 | #include "md_sap.h" |
| 6 | #include "svc_sap.h" |
| 7 | #include "dcl.h" |
| 8 | #include "dcl_uart.h" |
| 9 | |
| 10 | #define L5_LOCAL_PARA_HDR \ |
| 11 | LOCAL_PARA_HDR \ |
| 12 | kal_uint32 l5seq_id; |
| 13 | |
| 14 | #define L5_LOCAL_PARA_HDR8 \ |
| 15 | LOCAL_PARA_HDR \ |
| 16 | kal_uint8 l5seq_id8; |
| 17 | |
| 18 | #define L5IO_L5U_LOCAL_PARA_HDR \ |
| 19 | LOCAL_PARA_HDR \ |
| 20 | kal_uint32 l5seq_id; |
| 21 | |
| 22 | #define L5IO_L5U_LOCAL_PARA_HDR8 \ |
| 23 | LOCAL_PARA_HDR \ |
| 24 | kal_uint8 l5seq_id8; |
| 25 | |
| 26 | typedef struct { |
| 27 | L5IO_L5U_LOCAL_PARA_HDR |
| 28 | } l5io_l5u_struct; |
| 29 | |
| 30 | typedef struct { |
| 31 | L5IO_L5U_LOCAL_PARA_HDR8 |
| 32 | } l5io_l5u_struct8; |
| 33 | |
| 34 | ////////////////////////////////////////////////////////////////////////////////////// |
| 35 | #define GMC_LOCAL_PARA_HDR \ |
| 36 | LOCAL_PARA_HDR \ |
| 37 | kal_uint32 src_id; |
| 38 | |
| 39 | typedef struct { |
| 40 | GMC_LOCAL_PARA_HDR |
| 41 | kal_char config_type[32]; |
| 42 | kal_uint8 buffer_type; // 0 : local param buffer, 1 : peer buffer |
| 43 | kal_uint32 buffer_length; |
| 44 | kal_uint8 buffer[4096]; |
| 45 | } l5_general_modem_configure_set_req_struct; |
| 46 | |
| 47 | typedef struct { |
| 48 | GMC_LOCAL_PARA_HDR |
| 49 | kal_uint8 buffer_type; // 0 : local param buffer, 1 : peer buffer |
| 50 | kal_uint32 buffer_length; |
| 51 | kal_uint8 buffer[4096]; |
| 52 | } l5_general_modem_configure_set_cnf_struct; |
| 53 | |
| 54 | typedef struct { |
| 55 | GMC_LOCAL_PARA_HDR |
| 56 | kal_char config_type[32]; |
| 57 | } l5_general_modem_configure_get_req_struct; |
| 58 | |
| 59 | typedef struct { |
| 60 | GMC_LOCAL_PARA_HDR |
| 61 | kal_uint8 buffer_type; // 0 : local param buffer, 1 : peer buffer |
| 62 | kal_uint32 buffer_length; |
| 63 | kal_uint8 buffer[4096]; |
| 64 | } l5_general_modem_configure_get_cnf_struct; |
| 65 | |
| 66 | #define L5_RES_SEG_NUM (0x3FFFF) |
| 67 | //18 bit for every user |
| 68 | typedef enum { |
| 69 | //common result put here |
| 70 | L5_RES_COMMON_BEGIN = 0x00000000, |
| 71 | L5_RES_COMMON_SUCCESS = L5_RES_COMMON_BEGIN, |
| 72 | L5_RES_COMMON_END = L5_RES_COMMON_BEGIN + L5_RES_SEG_NUM, |
| 73 | //L5IO common result put in here(except XXXH's cause) |
| 74 | L5_RES_L5IO_BEGIN, |
| 75 | L5_RES_L5IO_END = L5_RES_L5IO_BEGIN + L5_RES_SEG_NUM, |
| 76 | L5_RES_CAT_BEGIN, |
| 77 | L5_RES_CAT_END = L5_RES_CAT_BEGIN + L5_RES_SEG_NUM, |
| 78 | L5_RES_CC_BEGIN, |
| 79 | L5_RES_CC_END = L5_RES_CC_BEGIN + L5_RES_SEG_NUM, |
| 80 | L5_RES_NW_BEGIN, |
| 81 | L5_RES_NW_END = L5_RES_NW_BEGIN + L5_RES_SEG_NUM, |
| 82 | L5_RES_PDN_BEGIN, |
| 83 | INVALID_PARA = L5_RES_PDN_BEGIN + 0x01, |
| 84 | NOT_FIND_APN_TO_ACT = L5_RES_PDN_BEGIN + 0x02, |
| 85 | NO_APN_INFO_TO_ABORT = L5_RES_PDN_BEGIN + 0x03, |
| 86 | APN_PROFILE_IS_DISABLED = L5_RES_PDN_BEGIN + 0x04, |
| 87 | NOT_FIND_CALL_INFO = L5_RES_PDN_BEGIN + 0x05, |
| 88 | REACH_MAX_USER = L5_RES_PDN_BEGIN + 0x06, |
| 89 | PROFILE_COUNT_ERROR = L5_RES_PDN_BEGIN + 0x07, |
| 90 | WRONG_APN_TYPE_OR_NO_APN = L5_RES_PDN_BEGIN + 0x08, |
| 91 | BUILT_IN_APN_NOT_READY = L5_RES_PDN_BEGIN + 0x09, |
| 92 | L5UPDN_ACT_CALL_RES = L5_RES_PDN_BEGIN + 0x70, |
| 93 | L5UPDN_FAIL_ABORT = L5UPDN_ACT_CALL_RES + 0x01, |
| 94 | L5UPDN_SUCC_ABORT = L5UPDN_ACT_CALL_RES + 0x02, |
| 95 | L5UPDN_FAIL_CONT = L5UPDN_ACT_CALL_RES + 0x03, |
| 96 | L5UPDN_SUCC_CONT = L5UPDN_ACT_CALL_RES + 0x04, |
| 97 | L5UPDN_REUSE = L5UPDN_ACT_CALL_RES + 0x05, |
| 98 | L5UPDN_ERROR_END = L5_RES_PDN_BEGIN + 0x7F, |
| 99 | L5_RES_PDN_END = L5_RES_PDN_BEGIN + L5_RES_SEG_NUM, |
| 100 | L5_RES_RF_BEGIN, |
| 101 | L5_RES_RF_END = L5_RES_RF_BEGIN + L5_RES_SEG_NUM, |
| 102 | L5_RES_SIM_BEGIN, |
| 103 | L5_RES_SIM_END = L5_RES_SIM_BEGIN + L5_RES_SEG_NUM, |
| 104 | L5_RES_SMS_BEGIN, |
| 105 | L5_RES_SMS_U_BEGIN = L5_RES_SMS_BEGIN, |
| 106 | L5_RES_SMS_U_UNKNOWN_ACK_MODE = L5_RES_SMS_U_BEGIN, |
| 107 | L5_RES_SMS_U_INVALID_MEMORY_INDEX, |
| 108 | L5_RES_SMS_U_MMS_TYPE_ERROR, |
| 109 | L5_RES_SMS_U_STATUS_NOT_SUPPORT, |
| 110 | L5_RES_SMS_U_FAILURE, |
| 111 | L5_RES_SMS_U_FILTER_NOT_SUPPORTED, |
| 112 | L5_RES_SMS_U_FORMAT_NOT_SUPPORTED, |
| 113 | L5_RES_SMS_U_SET_SCA_INVALID, |
| 114 | L5_RES_SMS_U_NOT_INITIALIZED, |
| 115 | L5_RES_SMS_U_INVALID_SMSC_ADDRESS, |
| 116 | L5_RES_SMS_U_INVALID_PDU, |
| 117 | L5_RES_SMS_U_PREFER_STORAGE_NO_SUPPORT, |
| 118 | L5_RES_SMS_U_MMS_TYPE_INVALID, |
| 119 | L5_RES_SMS_U_SEND_TWO_SOURCE_EXIST, |
| 120 | L5_RES_SMS_U_OP_ONLY_ALLOWED_WITH_AT_IN_NON_PDU_MODE, |
| 121 | L5_RES_SMS_U_UNKNOWN_CPMS, |
| 122 | L5_RES_SMS_U_UNKNOWN_CNMI, |
| 123 | L5_RES_SMS_U_CPMS_UNSYNC, |
| 124 | L5_RES_SMS_U_SEND_C5GUSMS_FAIL, |
| 125 | L5_RES_SMS_U_MEMORY_FULL, |
| 126 | L5_RES_SMS_U_SEND_EMEMS_FAIL, |
| 127 | L5_RES_SMS_U_END = L5_RES_SMS_BEGIN + 0xFFFF, |
| 128 | //SMS AT is fixed with TS27.005 |
| 129 | L5_RES_SMS_AT_BEGIN, |
| 130 | L5_RES_SMS_AT_UNASSIGNED_UNALLOCATED_NUMBER_1 = L5_RES_SMS_AT_BEGIN + 1, |
| 131 | L5_RES_SMS_AT_OPERATOR_DETERMINED_BARRING_8 = L5_RES_SMS_AT_BEGIN + 8, |
| 132 | L5_RES_SMS_AT_CALL_BARRED_10 = L5_RES_SMS_AT_BEGIN + 10, |
| 133 | L5_RES_SMS_AT_SHORT_MESSAGE_TRANSFER_REJECTED_21 = L5_RES_SMS_AT_BEGIN + 21, |
| 134 | L5_RES_SMS_AT_DESTINATION_OUT_OF_SERVICE_27 = L5_RES_SMS_AT_BEGIN + 27, |
| 135 | L5_RES_SMS_AT_UNIDENTIFIED_SUBSCRIBER_28 = L5_RES_SMS_AT_BEGIN + 28, |
| 136 | L5_RES_SMS_AT_FACILITY_REJECTED_29 = L5_RES_SMS_AT_BEGIN + 29, |
| 137 | L5_RES_SMS_AT_UNKNOWN_SUBSCRIBER_30 = L5_RES_SMS_AT_BEGIN + 30, |
| 138 | L5_RES_SMS_AT_NETWORK_OUT_OF_ORDER_38 = L5_RES_SMS_AT_BEGIN + 38, |
| 139 | L5_RES_SMS_AT_TEMPORARY_FAILURE_41 = L5_RES_SMS_AT_BEGIN + 41, |
| 140 | L5_RES_SMS_AT_CONGESTION_42 = L5_RES_SMS_AT_BEGIN + 42, |
| 141 | L5_RES_SMS_AT_RESOURCES_UNAVAILABLE_UNSPECIFIED_47 = L5_RES_SMS_AT_BEGIN + 47, |
| 142 | L5_RES_SMS_AT_REQUESTED_FACILITY_NOT_SUBSCRIBED_50 = L5_RES_SMS_AT_BEGIN + 50, |
| 143 | L5_RES_SMS_AT_REQUESTED_FACILITY_NOT_IMPLEMENTED_69 = L5_RES_SMS_AT_BEGIN + 69, |
| 144 | L5_RES_SMS_AT_INVALID_SHORT_MESSAGE_TRANSFER_REFERENCE_VALUE_81 = L5_RES_SMS_AT_BEGIN + 81, |
| 145 | L5_RES_SMS_AT_INVALID_MESSAGE_UNSPECIFIED_95 = L5_RES_SMS_AT_BEGIN + 95, |
| 146 | L5_RES_SMS_AT_INVALID_MANDATORY_INFORMATION_96 = L5_RES_SMS_AT_BEGIN + 96, |
| 147 | L5_RES_SMS_AT_MESSAGE_TYPE_NON_EXISTENT_OR_NOT_IMPLEMENTED_97 = L5_RES_SMS_AT_BEGIN + 97, |
| 148 | L5_RES_SMS_AT_MESSAGE_NOT_COMPATIBLE_WITH_SHORT_MESSAGE_PROTOCOL_STATE_98 = L5_RES_SMS_AT_BEGIN + 98, |
| 149 | L5_RES_SMS_AT_INFORMATION_ELEMENT_NON_EXISTENT_OR_NOT_IMPLEMENTED_99 = L5_RES_SMS_AT_BEGIN + 99, |
| 150 | L5_RES_SMS_AT_PROTOCOL_ERROR_UNSPECIFIED_111 = L5_RES_SMS_AT_BEGIN + 111, |
| 151 | L5_RES_SMS_AT_INTERWORKING_UNSPECIFIED_127 = L5_RES_SMS_AT_BEGIN + 127, |
| 152 | L5_RES_SMS_AT_TELEMATIC_INTERWORKING_NOT_SUPPORTED_0x80 = L5_RES_SMS_AT_BEGIN + 0x80, //0x80-0x8F: TP-PID errors |
| 153 | L5_RES_SMS_AT_SHORT_MESSAGE_TYPE_0_NOT_SUPPORTED_0x81 = L5_RES_SMS_AT_BEGIN + 0x81, |
| 154 | L5_RES_SMS_AT_CANNOT_REPLACE_SHORT_MESSAGE_0x82 = L5_RES_SMS_AT_BEGIN + 0x82, |
| 155 | L5_RES_SMS_AT_UNSPECIFIED_TP_PID_ERROR_0x8F = L5_RES_SMS_AT_BEGIN + 0x8F, |
| 156 | L5_RES_SMS_AT_DATA_CODING_SCHEME_ALPHABET_NOT_SUPPORTED_0x90 = L5_RES_SMS_AT_BEGIN + 0x90, //0x90-0x9F: TP-DCS errors |
| 157 | L5_RES_SMS_AT_MESSAGE_CLASS_NOT_SUPPORTED_0x91 = L5_RES_SMS_AT_BEGIN + 0x91, |
| 158 | L5_RES_SMS_AT_UNSPECIFIED_TP_DCS_ERROR_0x9F = L5_RES_SMS_AT_BEGIN + 0x9F, |
| 159 | L5_RES_SMS_AT_COMMAND_CANNOT_BE_ACTIONED_0xA0 = L5_RES_SMS_AT_BEGIN + 0xA0, //0xA0-0xAF: TP-Command errors |
| 160 | L5_RES_SMS_AT_COMMAND_UNSUPPORTED_0xA1 = L5_RES_SMS_AT_BEGIN + 0xA1, |
| 161 | L5_RES_SMS_AT_UNSPECIFIED_TP_COMMAND_ERROR_0xAF = L5_RES_SMS_AT_BEGIN + 0xAF, |
| 162 | L5_RES_SMS_AT_TPDU_NOT_SUPPORTED_0xB0 = L5_RES_SMS_AT_BEGIN + 0xB0, |
| 163 | L5_RES_SMS_AT_SC_BUSY_0xC0 = L5_RES_SMS_AT_BEGIN + 0xC0, |
| 164 | L5_RES_SMS_AT_NO_SC_SUBSCRIPTION_0xC1 = L5_RES_SMS_AT_BEGIN + 0xC1, |
| 165 | L5_RES_SMS_AT_SC_SYSTEM_FAILURE_0xC2 = L5_RES_SMS_AT_BEGIN + 0xC2, |
| 166 | L5_RES_SMS_AT_INVALID_SME_ADDRESS_0xC3 = L5_RES_SMS_AT_BEGIN + 0xC3, |
| 167 | L5_RES_SMS_AT_DESTINATION_SME_BARRED_0xC4 = L5_RES_SMS_AT_BEGIN + 0xC4, |
| 168 | L5_RES_SMS_AT_SM_REJECTED_DUPLICATE_SM_0xC5 = L5_RES_SMS_AT_BEGIN + 0xC5, |
| 169 | L5_RES_SMS_AT_TP_VPF_NOT_SUPPORTED_0xC6 = L5_RES_SMS_AT_BEGIN + 0xC6, |
| 170 | L5_RES_SMS_AT_TP_VP_NOT_SUPPORTED_0xC7 = L5_RES_SMS_AT_BEGIN + 0xC7, |
| 171 | L5_RES_SMS_AT_SIM_SMS_STORAGE_FULL_0xD0 = L5_RES_SMS_AT_BEGIN + 0xD0, |
| 172 | L5_RES_SMS_AT_NO_SMS_STORAGE_CAPABILITY_IN_SIM_0xD1 = L5_RES_SMS_AT_BEGIN + 0xD1, |
| 173 | L5_RES_SMS_AT_ERROR_IN_MS_0xD2 = L5_RES_SMS_AT_BEGIN + 0xD2, |
| 174 | L5_RES_SMS_AT_MEMORY_CAPACITY_EXCEEDED_0xD3 = L5_RES_SMS_AT_BEGIN + 0xD3, |
| 175 | L5_RES_SMS_AT_SIM_APPLICATION_TOOLKIT_BUSY_0xD4 = L5_RES_SMS_AT_BEGIN + 0xD4, |
| 176 | L5_RES_SMS_AT_SIM_DATA_DOWNLOAD_ERROR_0xD5 = L5_RES_SMS_AT_BEGIN + 0xD5, |
| 177 | L5_RES_SMS_AT_SPECIFIC_APPLICATION_ERROR_0xE0 = L5_RES_SMS_AT_BEGIN + 0xE0, //0xE0-0xEF: Specific to an application |
| 178 | L5_RES_SMS_AT_UNSPECIFIED_ERROR_CAUSE_0xFF = L5_RES_SMS_AT_BEGIN + 0xFF, |
| 179 | L5_RES_SMS_AT_ME_FAILURE_300 = L5_RES_SMS_AT_BEGIN + 300, |
| 180 | L5_RES_SMS_AT_SMS_SERVICE_OF_ME_RESERVED_301 = L5_RES_SMS_AT_BEGIN + 301, |
| 181 | L5_RES_SMS_AT_OPERATION_NOT_ALLOWED_302 = L5_RES_SMS_AT_BEGIN + 302, |
| 182 | L5_RES_SMS_AT_OPERATION_NOT_SUPPORTED_303 = L5_RES_SMS_AT_BEGIN + 303, |
| 183 | L5_RES_SMS_AT_INVALID_PDU_MODE_PARAMETER_304 = L5_RES_SMS_AT_BEGIN + 304, |
| 184 | L5_RES_SMS_AT_INVALID_TEXT_MODE_PARAMETER_305 = L5_RES_SMS_AT_BEGIN + 305, |
| 185 | L5_RES_SMS_AT_SIM_NOT_INSERTED_310 = L5_RES_SMS_AT_BEGIN + 310, |
| 186 | L5_RES_SMS_AT_SIM_PIN_REQUIRED_311 = L5_RES_SMS_AT_BEGIN + 311, |
| 187 | L5_RES_SMS_AT_PH_SIM_PIN_REQUIRED_312 = L5_RES_SMS_AT_BEGIN + 312, |
| 188 | L5_RES_SMS_AT_SIM_FAILURE_313 = L5_RES_SMS_AT_BEGIN + 313, |
| 189 | L5_RES_SMS_AT_SIM_BUSY_314 = L5_RES_SMS_AT_BEGIN + 314, |
| 190 | L5_RES_SMS_AT_SIM_WRONG_315 = L5_RES_SMS_AT_BEGIN + 315, |
| 191 | L5_RES_SMS_AT_SIM_PUK_REQUIRED_316 = L5_RES_SMS_AT_BEGIN + 316, |
| 192 | L5_RES_SMS_AT_SIM_PIN2_REQUIRED_317 = L5_RES_SMS_AT_BEGIN + 317, |
| 193 | L5_RES_SMS_AT_SIM_PUK2_REQUIRED_318 = L5_RES_SMS_AT_BEGIN + 318, |
| 194 | L5_RES_SMS_AT_MEMORY_FAILURE_320 = L5_RES_SMS_AT_BEGIN + 320, |
| 195 | L5_RES_SMS_AT_INVALID_MEMORY_INDEX_321 = L5_RES_SMS_AT_BEGIN + 321, |
| 196 | L5_RES_SMS_AT_MEMORY_FULL_322 = L5_RES_SMS_AT_BEGIN + 322, |
| 197 | L5_RES_SMS_AT_SMSC_ADDRESS_UNKNOWN_330 = L5_RES_SMS_AT_BEGIN + 330, |
| 198 | L5_RES_SMS_AT_NO_NETWORK_SERVICE_331 = L5_RES_SMS_AT_BEGIN + 331, |
| 199 | L5_RES_SMS_AT_NETWORK_TIMEOUT_332 = L5_RES_SMS_AT_BEGIN + 332, |
| 200 | L5_RES_SMS_AT_NO_CNMA_ACKNOWLEDGEMENT_EXPECTED_340 = L5_RES_SMS_AT_BEGIN + 340, |
| 201 | L5_RES_SMS_AT_UNKNOWN_ERROR_500 = L5_RES_SMS_AT_BEGIN + 500, |
| 202 | L5_RES_SMS_AT_END = L5_RES_SMS_AT_BEGIN + 0xFFFF, |
| 203 | L5_RES_SMS_END = L5_RES_SMS_BEGIN + L5_RES_SEG_NUM, |
| 204 | L5_RES_SS_BEGIN, |
| 205 | L5_RES_SS_END = L5_RES_SS_BEGIN + L5_RES_SEG_NUM, |
| 206 | L5_RES_SWITCH_BEGIN, |
| 207 | L5_RES_SWITCH_END = L5_RES_SWITCH_BEGIN + L5_RES_SEG_NUM, |
| 208 | L5_RES_SYS_BEGIN, |
| 209 | L5_RES_SYS_ERR_OPERATION_NOT_ALLOWED, |
| 210 | L5_RES_SYS_ERR_PEROID_EXCEED, |
| 211 | L5_RES_SYS_END = L5_RES_SYS_BEGIN + L5_RES_SEG_NUM, |
| 212 | //common l5u result put here |
| 213 | L5_RES_L5U_BEGIN, |
| 214 | L5_RES_L5U_SIM_NOT_INSERT, |
| 215 | L5_RES_L5U_AT_CMD_ENCODE_FAIL, |
| 216 | L5_RES_L5U_AT_CNF_DECODE_FAIL, |
| 217 | L5_RES_L5U_AT_CNF_TYPE_ERROR, |
| 218 | L5_RES_L5U_FAIL, |
| 219 | L5_RES_L5U_END = L5_RES_L5U_BEGIN + L5_RES_SEG_NUM, |
| 220 | } l5_res_enum; |
| 221 | |
| 222 | typedef struct { |
| 223 | kal_bool is_standard; |
| 224 | kal_char name[32]; |
| 225 | union { |
| 226 | kal_uint8 c[16]; |
| 227 | kal_uint32 i[4]; |
| 228 | } uuid; |
| 229 | kal_uint32 cid_count; |
| 230 | void *cid_table_ptr; |
| 231 | |
| 232 | kal_uint32 is_custom_service; |
| 233 | kal_uint32 has_custom_service; |
| 234 | } mbci_service_t; |
| 235 | |
| 236 | typedef kal_uint32 (*DSS_SERVICE_OPEN)(UART_PORT port); |
| 237 | typedef kal_uint32 (*DSS_SERVICE_CLOSE)(UART_PORT port); |
| 238 | |
| 239 | typedef struct { |
| 240 | kal_char name[32]; |
| 241 | union { |
| 242 | kal_uint8 c[16]; |
| 243 | kal_uint32 i[4]; |
| 244 | } uuid; |
| 245 | |
| 246 | DSS_SERVICE_OPEN open_func; |
| 247 | DSS_SERVICE_CLOSE close_func; |
| 248 | } mbci_dss_service_t; |
| 249 | |
| 250 | typedef void (*CUSTOM_L5_TIMER_CB)(void *cb_priv); |
| 251 | |
| 252 | #endif |