blob: 89700cc626c3100a437f1073106a196638880ea6 [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) 2016
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* This Software is the property of VIA Telecom, Inc. and may only be used pursuant to a license from VIA Telecom, Inc.
38*
39* Any unauthorized use inconsistent with the terms of such license is strictly prohibited.
40*
41* Copyright (c) 1999-2010 VIA Telecom, Inc. All rights reserved.
42*
43*************************************************************/
44/****************************************************************************
45 *
46 * Filename: pilots.h
47 *
48 * Purpose: Definition of Pilot structures and supporting routines.
49 *
50 ****************************************************************************
51 *
52 * PVCS Header Information
53 *
54 *
55 * $Log: pilots.h $
56 *
57 * 07 06 2017 sue.zhong
58 * [MOLY00259241] [6293][C2K]Replace with KAL data type
59 * Correct copyright file header
60 * Revision 1.3 2004/04/06 14:02:19 dstecker
61 * CBP6.1 release 1
62 * Revision 1.2 2004/03/25 12:09:40 fpeng
63 * Updated from 6.0 CP 2.5.0
64 * Revision 1.2 2004/02/10 12:50:53 bcolford
65 * Merged CBP4.0 Release 8.05.0 changes.
66 * Revision 1.13 2003/12/04 18:18:44 blee
67 * Pilot search for remaining set added
68 * Revision 1.12 2002/12/30 19:07:48 akayvan
69 * Per CR570, corrected replacement of IS2000_ADDENDMENT_2
70 * with IS2000_REV_A instead of IS2000_REV_0, and replaced
71 * IS2000_A_3X with IS2000_REV_A.
72 * Revision 1.11 2002/12/26 16:13:34 dstecker
73 * Conditional compile flag IS2000A replaced with IS_2000_REV_A and IS_2000_REV_0
74 * Revision 1.10 2002/10/31 18:24:03 amala
75 * Changed RMS Error Phase parameter type to kal_uint8.
76 * Revision 1.9 2002/08/26 16:11:02 ameya
77 * Changed CP_MAX_STORED_NEIGHBORS to 40 from 64. Fixed CR# 635.
78 * Revision 1.8 2002/06/06 13:14:08 chinh
79 * Changed and Added Copyright
80 * Revision 1.7 2002/03/01 16:29:59 AMALA
81 * Added Location Services AFLT functionality.
82 * Revision 1.6 2001/09/04 15:27:21 byang
83 * Redefined HO_MAX_WALSH_CODE_LENGTH to be 2
84 * instead of 65 since the maximum size is only 9 bits.
85 *
86 * Revision 1.5 2001/08/03 15:15:20 dstecker
87 * Modifications for IS2000 handoffs
88 * Revision 1.4 2001/07/18 15:14:11 chinh
89 * cbp3 porting for Idle and Access
90 * Revision 1.3 2001/06/29 12:02:56 byang
91 * Added compiler flag IS2000_A_AUX_PILOTfor all auxiliary
92 * pilot record structures declaration and processing code.
93 * Revision 1.2 2001/06/12 15:45:03 byang
94 * Update the maximum neighbor list from 20 to 40.
95 * Moved idle neighbor list structures to here to prevent circular
96 * dependency.
97 * Revision 1.1 2001/01/17 10:59:12 plabarbe
98 * Initial revision
99 * Revision 1.1 2000/10/24 14:11:23 fpeng
100 * Initial revision
101 * Revision 1.4 2000/09/23 02:38:43Z rnookala
102 * changed n8m to 20
103 * Revision 1.3 2000/08/23 22:10:10Z RSATTARI
104 * Isotel release 2.8 plus LSI applicable IS-95B changes.
105 * Revision 1.13 2000/01/17 22:27:19 scotvold
106 * TC Backward Compatibility changes.
107 *
108 * Revision 1.12 1998/11/20 16:44:23 scotvold
109 * Moved HOTCPilot Structure definition from ho_tc.h to here.
110 * Removed tDrop for TEST_PILOT optimization.
111 *
112 * Revision 1.11 1998/10/31 02:19:17 scotvold
113 * Pilot Set maintenance optimization test.
114 *
115 * Revision 1.10 1998/10/20 23:58:23 mhayduk
116 * Added T53 support.
117 *
118 * Revision 1.9 1998/08/14 23:49:45 scotvold
119 * Added pilotPN to Remaining measurement.
120 *
121 * Revision 1.8 1998/07/03 16:57:30 dfischer
122 * New load
123 *
124 * Revision 1.7 1998/06/12 14:50:38 scotvold
125 * Updated for Release 0.07.
126 *
127 * Revision 1.6 1998/06/08 21:48:25 scotvold
128 * Updated for Release 0.06.
129 *
130 * Revision 1.5 1998/05/27 17:16:28 scotvold
131 * Updated for Release 0.05.
132 *
133 * Revision 1.4 1998/05/01 18:13:54 scotvold
134 * Update for release 0.04
135 *
136 * Revision 1.3 1998/03/30 23:26:03 mhayduk
137 * Release 0.03.
138 *
139 * Revision 1.1 1997/11/06 17:49:24 mhayduk
140 * Initial revision
141 *
142 *
143 ****************************************************************************
144 ****************************************************************************/
145
146
147#ifndef _PILOTS_H_
148
149 #define _PILOTS_H_ 1
150
151/*****************************************************************************
152 * Includes
153 ****************************************************************************/
154#include "channel.h"
155#include "sync_msg.h"
156#include "cptimer.h"
157
158/*****************************************************************************
159 * Defines
160 ****************************************************************************/
161#define CP_MAX_ACTIVE_SET N6m
162#define CP_MAX_CANDIDATE_SET N7m
163#define CP_MAX_NEIGHBOR_SET N8m
164#define CP_MAX_ANALOG_NEIGHBOR_SET 7
165
166#ifdef MTK_CBP
167#define CP_MAX_REMAINING_SET 44
168#else
169#define CP_MAX_REMAINING_SET 20
170#endif
171
172#define CP_MAX_CH_CHANGE_LIST CP_MAX_NEIGHBOR_SET
173
174/* Define CF Search Set and Neighbor Set to be of maximum size as the **
175** maximum number of pilots that can be sent in a Candidate Frequency **
176** Search Request Message = N8m as specified in 7.6.6.2.1.4 */
177#define CP_MAX_CANDIDATE_FREQUENCY_SEARCH_SET N8m
178#define CP_MAX_CANDIDATE_FREQUENCY_NEIGHBOR_SET N8m
179
180typedef enum
181{
182 CP_SM_NO_SEARCH_PRIORITIES_OR_SEARCH_WINDOWS,
183 CP_SM_SEARCH_PRIORITIES,
184 CP_SM_SEARCH_WINDOWS,
185 CP_SM_SEARCH_PRIORITIES_AND_SEARCH_WINDOWS
186} NghbrSearchMode;
187
188/*****************************************************************************
189 * Pilot structure definitions
190 ****************************************************************************/
191 typedef enum
192 {
193 PILOT_REC_1X_COMMON_TD,
194 PILOT_REC_1X_AUX_NON_TD,
195 PILOT_REC_1X_AUX_TD,
196 PILOT_REC_3X_COMMON,
197 PILOT_REC_3X_AUX
198 } PilotRecType;
199
200/* Information extracted from the Universal Neighbor List Message */
201 typedef struct
202 {
203 Sr1TdPowerLevel tdPowerLevel;
204 Sr1TdModes tdMode;
205 } HONghbrPilotRecType000;
206
207/* The maximum Walsh Code size in octets */
208/* maximum of 3 bits + 6 bits = 9 bits */
209#define HO_MAX_WALSH_CODE_LENGTH 2
210
211 typedef struct
212 {
213 kal_uint8 qof;
214 kal_uint16 walshLength;
215 kal_uint8 auxPilotWalsh[ HO_MAX_WALSH_CODE_LENGTH ];
216 } HONghbrPilotRecType001;
217
218 typedef struct
219 {
220 kal_uint8 qof;
221 kal_uint16 walshLength;
222 kal_uint8 auxWalsh[ HO_MAX_WALSH_CODE_LENGTH ];
223 kal_uint8 auxTdPowerLevel;
224 kal_uint8 tdMode;
225 } HONghbrPilotRecType010;
226
227 typedef struct
228 {
229 kal_uint8 sr3PrimaryPilot;
230 kal_uint8 sr3PilotPower1;
231 kal_uint8 sr3PilotPower2;
232 } HONghbrPilotRecType011;
233
234 typedef struct
235 {
236 kal_uint8 sr3PrimaryPilot;
237 kal_uint8 sr3PilotPower1;
238 kal_uint8 sr3PilotPower2;
239 kal_uint8 qof;
240 kal_uint16 walshLength;
241 kal_uint8 auxPilotWalsh[ HO_MAX_WALSH_CODE_LENGTH ];
242 kal_bool addInfoIncl1;
243 kal_uint8 qof1;
244 kal_uint16 walshLength1;
245 kal_uint8 auxPilotWalsh1[ HO_MAX_WALSH_CODE_LENGTH ];
246 kal_bool addInfoIncl2;
247 kal_uint8 qof2;
248 kal_uint16 walshLength2;
249 kal_uint8 auxPilotWalsh2[ HO_MAX_WALSH_CODE_LENGTH ];
250 } HONghbrPilotRecType100;
251
252 typedef union
253 {
254 HONghbrPilotRecType000 type000;
255
256 HONghbrPilotRecType001 type001;
257 HONghbrPilotRecType010 type010;
258
259 HONghbrPilotRecType011 type011;
260 HONghbrPilotRecType100 type100;
261
262 } HONghbrPilotRec;
263
264 /* structure used to set search windows for pilot searches */
265 typedef struct
266 {
267 kal_uint8 activeWindow;
268 kal_uint8 neighborWindow;
269 kal_uint8 remainingWindow;
270 } PilotSearchWindow;
271
272 /* structure to define content of the IDLE neighbor list */
273 typedef struct
274 {
275 kal_uint16 pilotPN;
276 kal_bool freqIncluded; /* indicates if freq info is available */
277 SysCdmaBandT band; /* CDMA band */
278 kal_uint16 frequency; /* CDMA_CH frequency */
279 kal_uint8 priority; /* search priority */
280 kal_uint8 srchWinNghbr; /* Neighbor search window */
281 kal_uint8 srchOffsetNghbr;
282 kal_bool timingIncl;
283 kal_uint8 nghbrTxOffset;
284 kal_uint8 nghbrTxDuration;
285 kal_uint8 nghbrTxPeriod;
286 kal_bool bcchSupport;
287 kal_bool addPilotRecIncl;
288 PilotRecType pilotRecType;
289 HONghbrPilotRec pilotRec;
290 } IdleNghbrConfig;
291
292 /* R.Sattari, 6/29/00 */
293 /* structure to define content of the Traffic Channel hopping neighbor list */
294 typedef struct
295 {
296 kal_uint16 nghbrPN;
297 kal_uint8 searchPriority;
298 kal_uint8 srchWinNghbr;
299 kal_bool timeIncl;
300 kal_uint8 nghbrTxOffset;
301 kal_uint8 nghbrTxDuration;
302 kal_uint8 nghbrTxPeriod;
303 kal_uint8 srchOffsetNghbr; /* 0 means not included (only 3 bit value) */
304 kal_uint8 otdPowerLevel;
305 } NghbrPilot;
306
307 /* structure to combine Idle and TC neighbor lists */
308 /* The Global Neighbor Search Window is not included in this structure **
309 ** since it is sent down in the wbiosPilotSearchWindow() call */
310 typedef struct
311 {
312 NghbrSearchMode nghbrSrchMode; /* NGHBR_SRCH_MODE */
313 kal_uint8 numPilots; /* number of pilots provided in list */
314#ifdef MTK_CBP
315 NghbrPilot pilot[ SYS_CP_MAX_NEIGHBOR_LIST_PILOTS ];
316#else
317 NghbrPilot pilot[ CP_MAX_NEIGHBOR_SET ];
318#endif
319 } NghbrList;
320
321
322 /* structure to provide Active Pilot set list */
323 typedef struct
324 {
325 kal_uint8 numPilots; /* number of pilots provided in list */
326 kal_uint16 pilot[CP_MAX_ACTIVE_SET];
327 } ActiveList;
328
329
330 /* structure to define content of Candidate Pilot set */
331 typedef struct
332 {
333 kal_uint8 numPilots; /* number of pilots provided in list */
334 kal_uint16 pilot[CP_MAX_CANDIDATE_SET]; /* list of pilots */
335 } CandList;
336
337
338 /* Pilot lists used to define Idle pilot set*/
339 typedef struct
340 {
341 kal_uint8 nghbrSrchMode;
342 kal_uint8 numPilots;
343#ifdef MTK_CBP
344 IdleNghbrConfig idleNghbrPilot[ SYS_CP_MAX_NEIGHBOR_LIST_PILOTS ];
345#else
346 IdleNghbrConfig idleNghbrPilot[ CP_MAX_NEIGHBOR_SET ];
347#endif
348 } IdlePilotSet;
349
350
351 /* Pilots to be used for Idle channel change */
352 typedef struct
353 {
354 kal_bool frequencyIncluded;
355 SysCdmaBandT band;
356 kal_uint16 frequency;
357 kal_uint8 numPilots;
358 kal_uint16 pilotPN[ CP_MAX_CH_CHANGE_LIST ];
359 } IdleChangePilotSet;
360
361
362 /* Pilot lists used to define or update the searched Pilot Sets */
363 typedef struct
364 {
365 ActiveList active; /* Active pilot list */
366 CandList candidate; /* Candidate pilot list */
367 NghbrList neighbor; /* Neighbor pilot list */
368 } PilotSet;
369
370 /* Amala K. 03/01/02 - AFLT */
371
372 /* individual pilot PILOT_PN & TIME_CORRECTION from BS ALMANAC */
373 typedef struct
374 {
375 kal_uint16 PilotPN;
376 kal_int16 TimeCorrect;
377 } AfltPilotSet;
378
379 /* AFLT Pilot list used to update the searched AFLT Pilot Sets */
380 typedef struct
381 {
382 AfltPilotSet Pilot[SYS_CP_MAX_AFLT_LIST_PILOTS];
383 } AfltPilotSetList;
384 /* Amala K. - AFLT END */
385
386 /* report content for a pilot measurement */
387 /* Pilot Strength measurements = -8 * log10(PS) (8 bit resolution) */
388 /* i.e., the WBIOS has already performed the logarithmic calculation */
389 typedef struct
390 {
391 kal_bool stale;
392 kal_uint16 pnPhase;
393 kal_uint16 strength; /* Power of the pilot in Q16 linear units */
394 } PilotMeasurement;
395
396 /* pilot report structure defines a pilot measurement for each pilot in */
397 /* all lists */
398 typedef struct
399 {
400 kal_uint8 numActive; /* number of pilots in active list */
401 kal_uint8 numCandidate; /* number of pilots in candidate list */
402 kal_uint8 numNeighbor; /* number of pilots in neighbor list */
403 kal_uint8 numRemaining; /* number of pilots in remaining list */
404 PilotMeasurement activeList[ CP_MAX_ACTIVE_SET ];
405 PilotMeasurement candidateList[ CP_MAX_CANDIDATE_SET ];
406 PilotMeasurement neighborList[ CP_MAX_NEIGHBOR_SET ];
407 PilotMeasurement remainingList[CP_MAX_REMAINING_SET];
408 } PilotReport;
409
410
411 typedef struct
412 {
413 kal_uint16 pilotPN;
414 PilotMeasurement measure;
415 } HOTCPilot;
416#endif /*_PILOTS_H_ */
417