yu.dong | c33b307 | 2024-08-21 23:14:49 -0700 | [diff] [blame] | 1 | /***************************************************************************** |
| 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 | #ifndef _L5_STRUCTS_H_ |
| 37 | #define _L5_STRUCTS_H_ |
| 38 | |
| 39 | #include "ps_public_struct.h" |
| 40 | #include "kal_general_types.h" |
| 41 | #include "kal_public_defs.h" |
| 42 | #include "kal_public_api.h" |
| 43 | #include "atp_public_defs.h" |
| 44 | #ifndef __MTK_TARGET__ |
| 45 | #include "dcl_uart.h" |
| 46 | #endif |
| 47 | #include "l5_common.h" |
| 48 | |
| 49 | #define L5_TABLE_DATA_SIZE (20) |
| 50 | #define L5_L5IO_MBCI_MAX_PENDING_NUM (16) |
| 51 | #define L5_L5IO_MBCI_MAX_CONTROL_TRANSFER (4096) |
| 52 | #define L5_L5IO_MBCI_SUPPORT_VERSION (0x0100) |
| 53 | #define L5_L5IO_MBCI_SUPPORT_EXT_VERSION (0x0300) |
| 54 | |
| 55 | #define L5SEQ_ID_URC (0xffffffff) |
| 56 | /**********L5IO<->L5U***************/ |
| 57 | |
| 58 | #define L5IO_AT_CMD_REQ_LOCAL_PARA_HDR\ |
| 59 | L5IO_L5U_LOCAL_PARA_HDR \ |
| 60 | atp_channel_enum md_ch_id; |
| 61 | |
| 62 | #define L5IO_AT_CMD_CNF_LOCAL_PARA_HDR\ |
| 63 | L5IO_L5U_LOCAL_PARA_HDR \ |
| 64 | atp_channel_enum md_ch_id; \ |
| 65 | proxy_cmd_result_enum result; \ |
| 66 | atp_err_id_enum cause; \ |
| 67 | kal_bool stuff; |
| 68 | |
| 69 | #define L5IO_AT_URC_IND_LOCAL_PARA_HDR\ |
| 70 | L5IO_L5U_LOCAL_PARA_HDR \ |
| 71 | atp_channel_enum md_ch_id; \ |
| 72 | kal_bool stuff; |
| 73 | |
| 74 | typedef struct { |
| 75 | L5IO_AT_CMD_REQ_LOCAL_PARA_HDR |
| 76 | }l5io_at_cmd_req_struct; |
| 77 | |
| 78 | typedef struct { |
| 79 | L5IO_AT_CMD_CNF_LOCAL_PARA_HDR |
| 80 | }l5io_at_cmd_cnf_struct; |
| 81 | |
| 82 | typedef struct { |
| 83 | L5IO_AT_URC_IND_LOCAL_PARA_HDR |
| 84 | }l5io_at_urc_ind_struct; |
| 85 | |
| 86 | /**********L5U<->ATP***************/ |
| 87 | |
| 88 | #define L5U_ATP_CMD_REQ_LOCAL_PARA_HDR\ |
| 89 | LOCAL_PARA_HDR \ |
| 90 | atp_channel_enum md_ch_id; |
| 91 | |
| 92 | #define L5U_ATP_CMD_CNF_LOCAL_PARA_HDR\ |
| 93 | LOCAL_PARA_HDR \ |
| 94 | atp_channel_enum md_ch_id; \ |
| 95 | proxy_cmd_result_enum result; \ |
| 96 | atp_err_id_enum cause; \ |
| 97 | kal_bool stuff; |
| 98 | |
| 99 | #define L5U_ATP_URC_IND_LOCAL_PARA_HDR\ |
| 100 | LOCAL_PARA_HDR \ |
| 101 | atp_channel_enum md_ch_id; \ |
| 102 | kal_bool stuff; |
| 103 | |
| 104 | |
| 105 | typedef struct { |
| 106 | L5U_ATP_CMD_REQ_LOCAL_PARA_HDR |
| 107 | }l5u_atp_at_cmd_req_struct; |
| 108 | |
| 109 | |
| 110 | |
| 111 | typedef struct { |
| 112 | L5U_ATP_CMD_CNF_LOCAL_PARA_HDR |
| 113 | }l5u_atp_at_cmd_cnf_struct; |
| 114 | |
| 115 | typedef struct { |
| 116 | L5U_ATP_URC_IND_LOCAL_PARA_HDR |
| 117 | }l5u_atp_at_urc_ind_struct; |
| 118 | |
| 119 | typedef struct{ |
| 120 | LOCAL_PARA_HDR |
| 121 | UART_PORT port; |
| 122 | kal_uint8 client_name[16]; |
| 123 | }l5io_l5io_mipc_dump_struct; |
| 124 | typedef l5io_l5io_mipc_dump_struct l5io_l5io_mipc_recv_dump_struct; |
| 125 | typedef l5io_l5io_mipc_dump_struct l5io_l5io_mipc_send_dump_struct; |
| 126 | |
| 127 | typedef struct{ |
| 128 | LOCAL_PARA_HDR |
| 129 | kal_uint8 context_id; |
| 130 | kal_uint8 is_frag_msg; |
| 131 | kal_uint16 mbim_ver; |
| 132 | kal_uint16 mbim_ext_ver; |
| 133 | }l5io_l5io_mbci_dump_struct; |
| 134 | typedef l5io_l5io_mbci_dump_struct l5io_l5io_mbci_recv_dump_struct; |
| 135 | typedef l5io_l5io_mbci_dump_struct l5io_l5io_mbci_send_dump_struct; |
| 136 | |
| 137 | /***** UT begin *****/ |
| 138 | #define L5IO_UT_MAX_UART_LENGTH (128) |
| 139 | |
| 140 | /* MSG_ID_L5IO_UT_AT_CMD_CNF */ |
| 141 | typedef struct { |
| 142 | LOCAL_PARA_HDR |
| 143 | kal_uint16 ch_id; |
| 144 | kal_bool stuff; |
| 145 | kal_uint8 at_string[L5IO_UT_MAX_UART_LENGTH]; |
| 146 | } l5io_ut_at_cmd_cnf_struct; |
| 147 | |
| 148 | #ifndef __MTK_TARGET__ |
| 149 | /* MSG_ID_L5IO_UT_UART_RTR_IND */ |
| 150 | typedef struct { |
| 151 | LOCAL_PARA_HDR |
| 152 | UART_PORT port; |
| 153 | kal_uint16 at_length; |
| 154 | kal_uint8 at_string[L5IO_UT_MAX_UART_LENGTH]; |
| 155 | } l5io_ut_uart_rtr_ind_struct; |
| 156 | |
| 157 | /* MSG_ID_L5IO_UT_UART_RTW_IND */ |
| 158 | typedef struct { |
| 159 | LOCAL_PARA_HDR |
| 160 | UART_PORT port; |
| 161 | } l5io_ut_uart_rtw_ind_struct; |
| 162 | |
| 163 | /* MSG_ID_L5IO_UT_AT_CMD_REQ */ |
| 164 | typedef struct { |
| 165 | LOCAL_PARA_HDR |
| 166 | kal_uint16 ch_id; |
| 167 | kal_uint8 at_string[L5IO_UT_MAX_UART_LENGTH]; |
| 168 | } l5io_ut_at_cmd_req_struct; |
| 169 | |
| 170 | |
| 171 | typedef struct { |
| 172 | LOCAL_PARA_HDR |
| 173 | kal_uint8 mode[ATP_REPORT_MODE_MAX]; |
| 174 | } l5io_ut_urc_report_mode_ind_struct; |
| 175 | |
| 176 | //MSG_ID_L5_UT_IO_CONTEXT_REQ |
| 177 | typedef struct |
| 178 | { |
| 179 | LOCAL_PARA_HDR |
| 180 | kal_uint8 cid; |
| 181 | kal_uint16 head; |
| 182 | kal_uint16 length; |
| 183 | kal_uint8 data[ATP_MAX_DATA_QUEUE_LENGTH]; |
| 184 | kal_uint8 uart_sim_mapping[ATP_CHANNEL_NUMBER]; |
| 185 | } l5io_ut_io_context_req_struct; |
| 186 | |
| 187 | #endif /* __MTK_TARGET__ */ |
| 188 | /***** UT end *****/ |
| 189 | |
| 190 | #define MAX_CELL_NUM_3G (1) |
| 191 | #define MAX_CELL_NUM_4G (8) |
| 192 | #define MAX_CELL_NUM_5G (8) |
| 193 | |
| 194 | typedef struct { |
| 195 | kal_bool activated; |
| 196 | kal_uint32 ul_arfcn; |
| 197 | kal_uint32 dl_arfcn; |
| 198 | kal_uint32 dl_center_frequency; |
| 199 | //kal_uint32 ul_center_frequency; |
| 200 | kal_uint32 ul_bandwidth; |
| 201 | kal_uint32 dl_bandwidth; |
| 202 | kal_bool is_connected; |
| 203 | kal_uint32 pci; |
| 204 | } l5_cell_info1_t; //if changed, need to notify L5IO |
| 205 | |
| 206 | typedef struct { |
| 207 | kal_bool configured; |
| 208 | kal_int16 rsrp; //in dbm,range[-162, 22], -32768 means invalid |
| 209 | kal_int8 rsrq; //in db,range[-40, 10], -128 means invalid |
| 210 | kal_int8 sinr; //in db,range[-20, 40], -128 means invalid |
| 211 | kal_int16 rssi; //in dbm,range[-150, -10], -32768 means invalid |
| 212 | kal_uint32 pci; |
| 213 | } l5_cell_info2_t; //if changed, no need to notify L5IO |
| 214 | |
| 215 | |
| 216 | extern kal_uint32 eifconfig[1]; |
| 217 | |
| 218 | |
| 219 | |
| 220 | typedef enum |
| 221 | { |
| 222 | L5IO_TABLE_CMD_MODE_QUEUE, // AT commands in Whitelist need to be queued |
| 223 | L5IO_TABLE_CMD_MODE_EXE, // AT commands in Whitelist need to be executed |
| 224 | L5IO_TABLE_CMD_MODE_ERROR, // AT commands in Whitelist need to return Error |
| 225 | L5IO_TABLE_CMD_MODE_NONBLOCK, |
| 226 | |
| 227 | } l5io_table_cmd_mode_enum; |
| 228 | |
| 229 | typedef struct |
| 230 | { |
| 231 | kal_uint16 cmd_id; |
| 232 | atp_cmd_mode_enum cmd_mode; |
| 233 | l5io_table_cmd_mode_enum mode; |
| 234 | |
| 235 | } l5io_list_table_item; |
| 236 | |
| 237 | typedef struct |
| 238 | { |
| 239 | kal_uint8 urc[L5_TABLE_DATA_SIZE]; |
| 240 | atp_urc_report_mode_enum rpt_mode; |
| 241 | |
| 242 | } l5io_urc_rpt_mode_chk_tbl_item; |
| 243 | |
| 244 | typedef struct |
| 245 | { |
| 246 | LOCAL_PARA_HDR |
| 247 | kal_uint32 src_id; |
| 248 | kal_char apn[APN_STRING_LEN]; |
| 249 | }l5updn_get_disabled_apn_req_struct; |
| 250 | |
| 251 | typedef struct |
| 252 | { |
| 253 | LOCAL_PARA_HDR |
| 254 | kal_uint32 src_id; |
| 255 | kal_bool disabled; // TRUE means apn is disabled |
| 256 | }l5updn_get_disabled_apn_cnf_struct; |
| 257 | |
| 258 | typedef struct { |
| 259 | LOCAL_PARA_HDR |
| 260 | kal_uint8 ctx_id; |
| 261 | kal_uint32 mbim_msg_len; |
| 262 | } mbim_l5io_mbci_command_req_struct; |
| 263 | |
| 264 | typedef struct { |
| 265 | LOCAL_PARA_HDR |
| 266 | kal_uint8 ctx_id; |
| 267 | kal_uint32 mbim_msg_len; |
| 268 | } mbim_l5io_mbci_command_cnf_struct; |
| 269 | |
| 270 | typedef struct { |
| 271 | LOCAL_PARA_HDR |
| 272 | kal_uint8 ctx_id; |
| 273 | kal_uint32 mbim_msg_len; |
| 274 | } mbim_l5io_mbci_status_ind_struct; |
| 275 | |
| 276 | #endif |