blob: 5ebb39d9c10cfdc87893980b6a2b2cb143b5b920 [file] [log] [blame]
yu.dongc33b3072024-08-21 23:14:49 -07001/*****************************************************************************
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 * Filename:
38 * ---------
39 * phb_defs.h
40 *
41 * Project:
42 * --------
43 * MT6208
44 *
45 * Description:
46 * ------------
47 * This file contains common definitions for PHB module.
48 *
49 * Author:
50 * -------
51 * -------
52 *
53 *==============================================================================
54 *******************************************************************************/
55#ifndef _PHB_DEFS_H
56#define _PHB_DEFS_H
57
58#include "kal_public_defs.h" //MSBB change #include "stack_config.h"
59#include "kal_general_types.h"
60#include "kal_public_api.h"
61#include "sim_public_api.h"
62#if defined(__NG_ECALL_SUPPORT__)
63#include "ps_public_struct.h"
64#endif
65
66#ifdef __cplusplus
67extern "C"
68{
69#endif /* __cplusplus */
70
71/* Header files should be include before this one */
72
73#define PHB_INVALID_VALUE ~0
74#define PHB_NULL_VALUE 0
75
76#define BYTE_SIZE 8
77#define BYTE_SIZE_SHIFT_ARITHMETIC 3
78
79
80#define PHB_TYPE2_FILE_FLAG (0x80)
81
82/* delete all turbo */
83#define __PHB_DELETE_ALL_TURBO__
84/* Concurrency degree is the number of control blocks. */
85#define PHB_CONCURRENCY_DEGREE 3
86
87/* In byte(s). Must not exceeds the capacity defined by l4_common_struct.h. */
88/* 20040802 Wilson, If LMMI providing sorting mechanism, it does not need to sort in L4 */
89
90#define PHB_ALPHA_ID_DEPTH 10
91
92/* Number of bytes after ALPHA_ID field */
93#define PHB_LENGTH_AFTER_ALPHA_ID 14
94
95/* Byte size of TON/NPI allocated in NVRAM/SIM */
96#define TON_NPI_SIZE 1
97
98/**
99 * Maximum bytes of TON/NPI and DIALLING_NUMBER/SSC_STRING
100 * fields allocated for ADN-like EF's
101 */
102#define PHB_EF_MAX_TON_NPI_TEL_NUMBER_LEN 11
103
104/**
105 * Maximum bytes of DIALLING_NUMBER/SSC_STRING field allocated
106 * for EXT-like EF's.
107 */
108#define PHB_EF_EXT_MAX_TEL_NUMBER_LEN 10
109
110#define PHB_EMAIL_MAX_LEN 60
111
112 /* TON and NPI constants */
113#define NPI_UNKNOWN 0
114#define NPI_ISDN 1
115/**
116 * Most significant bit is always 1 for TON. ie, 1???.
117 * Hence,
118 * TON_UNKNOW is 1000, TON_NATIONAL is 1010, and
119 * TON_INTERNATIONAL is 1001
120 */
121#define TON_EXT 0x08
122#define TON_UNKNOWN 0x00
123#define TON_INTERNATIONAL 0x01
124#define TON_NATIONAL 0x02
125#define TON_NETWORK_SPECIFIC 0x03
126#define TON_DEDICATED 0x04
127
128/* Default TON/NPI */
129#define TON_NPI_DEFAULT (((TON_EXT | TON_UNKNOWN) << 4) | NPI_ISDN)
130
131#define FETCH_TON(x) ((x >> 4) & 0x07)
132
133/* This is reserved for possible revision of l4_addr_bcd_struct */
134#define L4_ADDR_BCD_TON_NPI_OFFSET 0
135#define L4_ADDR_BCD_TON_NPI_SIZE 1
136#define L4_ADDR_BCD_TEL_NUM_OFFSET 1
137
138/* Valid digits are 0x00 ~ 0x0C; ie, before p; ranges from 0 ~ *, #. */
139#define DN_VALID_DIGIT_LIMIT 0x0C
140
141#define PHB_MCC_MNC_STR_LEN 6
142
143#if defined(GEMINI_PLUS) && (GEMINI_PLUS >= 4)
144extern module_type phb_current_mod;
145#define PHB_SIM_NUM 4
146#elif defined(GEMINI_PLUS) && (GEMINI_PLUS >= 3)
147extern module_type phb_current_mod;
148#define PHB_SIM_NUM 3
149#elif defined(__GEMINI__)
150extern module_type phb_current_mod;
151#define PHB_SIM_NUM 2
152#else
153#define PHB_SIM_NUM 1
154#endif
155
156#define MAX_NETWORK_ECC_NUM 16
157
158
159#if defined(__GEMINI__) || defined(GEMINI_PLUS)
160#define PHB_WHICH_SIM phb_which_sim_ex()
161#else /* __GEMINI__ */
162#define PHB_WHICH_SIM
163#endif /* __GEMINI__ */
164
165#define PHB_SIM_SERVICE_TABLE_QUERY_BY_PS_ID(x, ps_id) (sim_service_table_query_by_ps_id(x, ps_id) == SERVICE_SUPPORT ? KAL_TRUE : KAL_FALSE)
166#define PHB_SIM_SERVICE_TABLE_QUERY(x) (PHB_SIM_SERVICE_TABLE_QUERY_BY_PS_ID(x, phb_which_sim_ex()))
167
168
169typedef enum
170{
171 IO_NONE,
172 IO_READ_IAP,
173 IO_WRITE_IAP,
174 IO_WAIT,
175 IO_SEGMENTATION,
176 IO_COMPLETE,
177} IO_state_enum;
178
179typedef enum
180{
181 OP_READ,
182 OP_WRITE,
183 OP_DELETE
184} op_enum;
185
186typedef struct
187{
188 kal_uint8 length;
189 kal_uint8 charset;
190 kal_uint8 data[PHB_ALPHA_ID_DEPTH];
191} alpha_id_type;
192
193#define EF_TEL_NUMBER_SIZE 10
194/* Stored phone book entries structure */
195typedef struct
196{
197 kal_uint8 len;
198 kal_uint8 ton_npi;
199 kal_uint8 tel_number[EF_TEL_NUMBER_SIZE];
200 kal_uint8 cap_cnf_id;
201 kal_uint8 ext_id; /* Should not be used for nvram_access. */
202 /* Note that BDN has 1 byte more: comparison method ID */
203} phb_ef_mandatory_struct;
204
205typedef struct
206{
207 kal_uint8 *alpha_id;
208 phb_ef_mandatory_struct *mandatory;
209} phb_ef_struct;
210
211#if defined(__NG_ECALL_SUPPORT__)
212 typedef struct
213 {
214 kal_uint8 no_uri;
215 l4_phb_uri_struct uri_record[MAX_PHB_XDN_URI_NUM];
216 } phb_uri_struct;
217#endif
218
219#ifdef __cplusplus
220}
221#endif
222
223#endif /* _PHB_DEFS_H */
224