| /***************************************************************************** |
| * Copyright Statement: |
| * -------------------- |
| * This software is protected by Copyright and the information contained |
| * herein is confidential. The software may not be copied and the information |
| * contained herein may not be used or disclosed except with the written |
| * permission of MediaTek Inc. (C) 2005 |
| * |
| * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") |
| * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON |
| * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, |
| * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH |
| * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO |
| * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S |
| * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. |
| * |
| * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE |
| * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, |
| * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO |
| * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| * |
| * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE |
| * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF |
| * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND |
| * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER |
| * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC). |
| * |
| *****************************************************************************/ |
| |
| /******************************************************************************* |
| * Filename: |
| * --------- |
| * dispatcher_struct.h |
| * |
| * Project: |
| * -------- |
| * VMOLY |
| * |
| * Description: |
| * ------------ |
| * Dispatcher data structure definition. |
| * |
| * Author: |
| * ------- |
| * ------- |
| * |
| *******************************************************************************/ |
| |
| #ifndef __INC_DISPATCHER_STRUCT_H |
| #define __INC_DISPATCHER_STRUCT_H |
| |
| |
| #include "kal_public_api.h" |
| #include "ps_public_enum.h" |
| //#include "ps_public_struct.h" |
| //#include "ddm_common_struct.h" |
| #include "ipcore_dispatcher_struct.h" |
| #include "n3epc_dispatcher_struct.h" |
| #include "qmu_bm.h" |
| #include "upcm.h" |
| #include "dispatcher_ut.h" |
| #include "dpcopro_custom.h" |
| #include "wtunnel_api.h" |
| |
| #define DISPATCHER_PDNID_OFFSET 38 |
| #define INVALID_DEFAULT_BID 0 |
| |
| |
| #if defined(__MTK_TARGET__) |
| #define DISPATCHER_VRB_ADDR_BANK (0x5) |
| #define DISPATCHER_VRB_CHECK_VADDR(vrb_addr) (DISPATCHER_VRB_ADDR_BANK==(((kal_uint32)(vrb_addr))>>28)) |
| #undef kal_mem_cpy |
| #define kal_mem_cpy(_p_dst, _p_src, _len) \ |
| do { \ |
| if (DISPATCHER_VRB_CHECK_VADDR(_p_src)) { \ |
| dpcopro_vrb_copy((kal_uint8 *)_p_dst, (kal_uint8 *)_p_src, (kal_uint32)_len); \ |
| } else { \ |
| kal_mem_cpy(_p_dst, _p_src, _len); \ |
| } \ |
| } while (0) |
| #endif |
| |
| |
| #ifdef ATEST_SYS_DISPATCHER |
| #define DISPATCHER_REGISTER_DL_DID_CBK dispatcher_ut_register_dl_cbk |
| #define DISPATCHER_DROP_DL_DID dispatcher_ut_drop_dl_did |
| #define DIPSTACHER_QUERY_META_TBL dispatcher_ut_query_meta_table |
| #define DISPATCHER_FORWARD_UL_META_UPCM dispatcher_ut_forward_upcm_ul_meta |
| #define DISPATCHER_FORWARD_UL_GPD_WTUNNEL dispatcher_ut_forward_wtunnel_ul_gpd |
| #define DISPATCHER_FORWARD_UL_GPD_UPCM dispatcher_ut_forward_upcm_ul_gpd |
| #define DISPATCHER_FORWARD_UL_GPD_UPCM_BY_EBI dispatcher_ut_forward_upcm_ul_gpd_by_ebi |
| #define DISPATCHER_DROP_UL_GPD dispatcher_ut_drop_ul_gpd |
| |
| |
| #else |
| #define DISPATCHER_REGISTER_DL_DID_CBK wtunnel_upp_dl_reg_cbk |
| #define DISPATCHER_DROP_DL_DID dispatcher_drop_dl_did |
| #define DIPSTACHER_QUERY_META_TBL lhif_query_meta_table |
| #define DISPATCHER_FORWARD_UL_META_UPCM upcm_rcv_ul_sdu_93 |
| #define DISPATCHER_FORWARD_UL_GPD_WTUNNEL dispatcher_wtunnel_ul_send |
| #define DISPATCHER_FORWARD_UL_GPD_UPCM upcm_rcv_ul_sdu_93_gpd |
| #define DISPATCHER_FORWARD_UL_GPD_UPCM_BY_EBI upcm_rcv_ul_sdu_by_ebi_93_gpd |
| #define DISPATCHER_DROP_UL_GPD dispatcher_drop_ul_gpd |
| #endif |
| |
| |
| |
| #ifndef ATEST_SYS_DISPATCHER |
| #define IS_PDNID_OF_WIFI(_pdnid) \ |
| (_pdnid > 38 && _pdnid < 54) |
| |
| #define IS_VALID_BEARERID(_bearerid) \ |
| (_bearerid > 0 && _bearerid < 16) |
| |
| #define DISPATCHER_CONVERT_BEARERID_TO_PDNID(_bearerid, _pdnid) \ |
| _pdnid = (_bearerid + 38) |
| |
| |
| #define DISPATCHER_CONVERT_PDNID_TO_BEARERID(_pdnid, _bearerid) \ |
| _bearerid = (_pdnid - 38) |
| |
| /* Free Copro vrb helper macro */ |
| #define DISPATCHER_FREE_META_VRB(_meta) \ |
| do { \ |
| ASSERT(_meta); \ |
| dpcopro_rbuf_release(_meta->vrb_addr, _meta->length); \ |
| } while (0) |
| |
| #else |
| /*temp code will remove later, just to run the test case as LHIF 5 bit field for PDN*/ |
| #define IS_PDNID_OF_WIFI(_pdnid) \ |
| (_pdnid > 0 && _pdnid < 16) |
| |
| #define IS_VALID_BEARERID(_bearerid) \ |
| (_bearerid > 0 && _bearerid < 16) |
| |
| |
| #define DISPATCHER_CONVERT_BEARERID_TO_PDNID(_bearerid, _pdnid) \ |
| _pdnid = (_bearerid + 1) |
| |
| |
| #define DISPATCHER_CONVERT_PDNID_TO_BEARERID(_pdnid, _bearerid) \ |
| _bearerid = (_pdnid - 1) |
| |
| #undef DISPATCHER_FREE_META_VRB |
| #define DISPATCHER_FREE_META_VRB |
| #endif |
| |
| |
| typedef enum { |
| DISPATCHER_PDN_ST_UNBIND, |
| DISPATCHER_PDN_ST_BINDING, |
| DISPATCHER_PDN_ST_BINDING_GOING_TO_UNBIND, |
| DISPATCHER_PDN_ST_BIND |
| } dispatcher_bind_state_enum; |
| |
| typedef enum |
| { |
| DISPATCHER_PENDING_REQ_NONE, |
| DISPATCHER_PENDING_REQ_UNBIND_IND, |
| DISPATCHER_PENDING_REQ_UNBIND_CNF, |
| DISPATCHER_PENDING_REQ_UNBIND_IND_N_CNF = (DISPATCHER_PENDING_REQ_UNBIND_IND | DISPATCHER_PENDING_REQ_UNBIND_CNF) // 3 |
| } dispatcher_pending_req_enum; |
| |
| typedef struct { |
| kal_uint8 bearer_id; |
| kal_uint8 defult_bearer_id; |
| kal_uint8 context_id; /**< index of cid_info */ |
| } dispatcher_bearer_info_struct; |
| |
| typedef struct { |
| |
| kal_uint8 bearer_id; /**< bearer info index*/ |
| kal_uint8 old_bearer_id; /**< useful when UNBIND->DEACT */ |
| dispatcher_bind_state_enum bind_state; |
| dispatcher_pending_req_enum pending_req; |
| |
| /** for keeping bind information for IPCORE */ |
| kal_uint32 network_interface_id; |
| apn_type_info_struct apn_type_info; |
| ip_addr_struct ip_addr; |
| dns_struct dns; |
| } dispatcher_cid_info_struct; |
| |
| typedef struct { |
| dispatcher_bearer_info_struct bearer_info[(MAX_EPDG_BEARER_ID + 1) - (MIN_EPDG_BEARER_ID - 1)]; /**< 1~15 are valid bearer id */ |
| dispatcher_cid_info_struct cid_info[MAX_EPDG_CID]; /**< 0~199 are valid cid range */ |
| } dispatcher_control_cntx; |
| |
| /*control path */ |
| void n3epc_dispatcher_bearer_act_req(n3epc_dispatcher_bearer_act_req_struct *p_local); |
| void n3epc_dispatcher_bearer_deact_req(n3epc_dispatcher_bearer_deact_req_struct *p_local); |
| void n3epc_dispatcher_pdn_bind_req(n3epc_dispatcher_pdn_bind_req_struct *p_local, kal_uint32 src_mod_id); |
| void n3epc_dispatcher_pdn_unbind_req(n3epc_dispatcher_pdn_unbind_req_struct *p_local, kal_uint32 src_mod_id); |
| void ipcore_dispatcher_pdn_bind_rsp(ipcore_dispatcher_pdn_bind_rsp_struct *p_local); |
| void dispatcher_unbind_cnf_optional_ipc_ind(dispatcher_bearer_info_struct *p_bearer_info, kal_bool ipc_unbind_required, kal_uint32 dest_mod_id, kal_uint8 proto_idx); |
| void dispatcher_report_bind_unbind_error_cnf(kal_bool is_bindreq, |
| ps_cause_enum error_code, |
| kal_uint8 cid, |
| kal_uint32 reply_mod_id); |
| |
| /*data path*/ |
| |
| kal_bool dispatcher_wtunnel_ul_send(kal_uint8 bearer_id, qbm_gpd *head, qbm_gpd *tail, kal_uint8 proto_idx); |
| void dispatcher_utils_set_gpd_datalen(void *p_gpd, kal_uint32 datalen, void **p_payload); |
| |
| /*helper functions*/ |
| dispatcher_bind_state_enum dispatcher_get_bind_state_by_bearerid(kal_uint8 bearer_id, kal_uint8 proto_idx); |
| dispatcher_bind_state_enum dispatcher_get_bind_state_by_pdnid(kal_uint8 pdn_id, kal_uint8 proto_idx); |
| kal_bool dispatcher_check_is_bearer_active_by_pdnid(kal_uint8 pdn_id, kal_uint8 proto_idx); |
| kal_bool dispatcher_check_is_bearer_active_by_bearerid(kal_uint8 bearer_id, kal_uint8 proto_idx); |
| void dispatcher_forward_dl_did_to_ipc(kal_uint8 bearer_id, upcm_did* p_head, upcm_did* p_tail, kal_uint8 protocol_idx); |
| void dispatcher_drop_dl_did(kal_uint8 bearer_id, upcm_did* p_head, upcm_did* p_tail, kal_uint8 protocol_idx); |
| void dispatcher_drop_ul_gpd(kal_uint32 pdn_id, qbm_gpd* p_head, qbm_gpd* p_tail, kal_uint8 protocol_idx); |
| void dispatcher_simulate_wtunnel_ul_gpd(kal_uint8 bearer_id, qbm_gpd* p_head, qbm_gpd* p_tail, kal_uint8 protocol_idx); |
| void dispatcher_init_control_cntx(void); |
| void dispatcher_ctrl_set_current_protoidx(kal_uint8 protoidx); |
| |
| #if defined(__SENSITIVE_DATA_MOSAIC__) |
| void dispatcher_clean_private_data(void); |
| #endif |
| |
| #endif /* __INC_DISPATCHER_STRUCT_H */ |