blob: 584f23246a81d53879165c49b0794e15023c0175 [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 * Module: stats.h
47 *
48 * Purpose: This file defines the necessary data structures and interfaces
49 * to maintain the accumulated statistics. Section x.4.5.
50 *
51 ****************************************************************************
52 *
53 * PVCS Header Information
54 *
55 * $Workfile$
56 * $Revision: 1.3 $
57 * $Modtime$
58 * $Author: dstecker $
59 *
60 * $Log: stats.h $
61 *
62 * 07 06 2017 sue.zhong
63 * [MOLY00259241] [6293][C2K]Replace with KAL data type
64 * Correct copyright file header
65 * Revision 1.3 2004/04/06 14:02:23 dstecker
66 * CBP6.1 release 1
67 * Revision 1.2 2004/03/25 12:09:45 fpeng
68 * Updated from 6.0 CP 2.5.0
69 * Revision 1.1 2003/05/12 15:39:06 fpeng
70 * Initial revision
71 * Revision 1.6 2002/06/13 13:59:13 hans
72 * Statistics functions already disabled with ifdef removed.
73 * Revision 1.5 2002/06/06 13:14:56 chinh
74 * Changed and Added Copyright
75 * Revision 1.4 2002/06/04 20:15:01 hans
76 * Old mux1 and mux2 statistics counter now handled by lmd has been disabled with ifdef's.
77 * Length field removed from SetRetrievableParameterMsgT typedef.
78 * Revision 1.3 2002/05/14 20:41:03 hans
79 * CR ID636 bug fix for retrievable and settable parameters.
80 * Revision 1.2 2002/03/28 18:25:13 hans
81 * is2000 rev 0 add 2, retrievable and settable parameters implemented.
82 * CR503: get retrievable parameter implemented.
83 * CR508: set retrievable parameter implemented
84 * Revision 1.1 2001/01/17 10:59:28 plabarbe
85 * Initial revision
86 * Revision 1.1 2000/10/24 14:11:29 fpeng
87 * Initial revision
88 * Revision 1.3 2000/08/23 22:11:29Z RSATTARI
89 * Isotel release 2.8 plus LSI applicable IS-95B changes.
90 * Revision 1.10 2000/03/02 01:57:16 scotvold
91 * Added engRelay calls to extract CPE statistics.
92 *
93 * Revision 1.9 2000/01/17 22:27:19 scotvold
94 * TC Backward Compatibility changes.
95 *
96 * Revision 1.8 1999/02/05 02:16:01 scotvold
97 * Test mode API change for reporting statistics.
98 *
99 * Revision 1.7 1998/12/11 20:17:42 lchhailo
100 * changed MAX_16_BIT_VALUE
101 *
102 * Revision 1.6 1998/12/02 00:30:54 scotvold
103 * Added statistic setting and retrieval.
104 *
105 * Revision 1.5 1998/10/20 23:58:23 mhayduk
106 * Added T53 support.
107 *
108 * Revision 1.4 1998/05/01 18:13:54 scotvold
109 * Update for release 0.04
110 *
111 * Revision 1.3 1998/03/30 23:26:03 mhayduk
112 * Release 0.03.
113 *
114 * Revision 1.1 1997/11/06 17:49:24 mhayduk
115 * Initial revision
116 *
117 *
118 ****************************************************************************
119 ****************************************************************************/
120
121#ifndef _STATS_H_
122
123 #define _STATS_H_ 1
124
125/*****************************************************************************
126 * Includes
127 ****************************************************************************/
128#include "layer2.h"
129#include "Serv_cfg.h"
130
131/*****************************************************************************
132 * Definitions
133 ****************************************************************************/
134
135#define MAX_24_BIT_VALUE 16777216L
136#define MAX_16_BIT_VALUE 65536L
137
138
139 #define ST_MAX_PAG_PEG 7 /* maximum page chan peg count */
140 #define ST_MAX_ACC_PEG 8 /* maximum access chan peg count */
141 #define ST_MAX_LAYER2_RTC_PEG 5 /* maximum layer2 RTC peg count */
142 #define ST_MAX_FCCCH_PEG 4 /* maximum page chan peg count */
143 #define ST_MAX_BCCH_PEG 5 /* maximum page chan peg count */
144
145
146 #define ST_RESERVED 0
147 #define ST_LEN_16 16
148 #define ST_LEN_24 24
149 #define ST_LEN_SYS_TIME 36
150 #define ST_PARAMETER_LEN_16 15
151 #define ST_PARAMETER_LEN_24 23
152 #define ST_UNKNOWN_PARAMETER_LEN 0x03FF
153
154 #define CP_LAYER2_RTC1 0
155 #define CP_LAYER2_RTC2 1
156 #define CP_LAYER2_RTC3 2
157 #define CP_LAYER2_RTC4 3
158 #define CP_LAYER2_RTC5 4
159
160
161/*****************************************************************************
162 * Data Structures
163 ****************************************************************************/
164
165typedef struct
166{
167 kal_uint16 parameterID;
168 kal_uint32 parameter;
169} Parameter32Rec;
170
171/* Multiplex Parameters - for retrieval */
172typedef struct
173{
174 StatCounterT statCounter; /* Statistics counter */
175 kal_uint32 muxStats[MAX_STAT_ELEMENT];
176} MuxParmsT;
177
178/* Traffic Channel Multiplex Parameters - for setting */
179typedef struct
180{
181 kal_uint8 numRec;
182 Parameter32Rec rec[CP_MAX_MUX1_CATEGORY + CP_MAX_MUX2_CATEGORY];
183} MuxRecsT;
184
185typedef struct
186{
187 kal_uint16 ParameterID;
188/* Hans C. Len is not needed in currect implementation: kal_uint16 ParameterLen;
189 */
190 kal_uint32 Value;
191
192} SetRetrievableParameterMsgT;
193
194
195typedef struct
196{
197 ExeRspMsgT RspInfo;
198 StatCounterT StatCounter; /* Statistics counter */
199} GetRetrievableParameterMsgT;
200
201
202
203/*****************************************************************************
204 * Function prototypes
205 ****************************************************************************/
206 void cpResetPageChStatistics(void);
207#if defined (MTK_DEV_OPTIMIZE_XL2)
208 void cpTracePageChStatistics(void);
209#endif
210 void cpAddPageChStatistics(kal_uint8 counter,kal_uint8 value);
211 void cpResetBcchStatistics(void);
212 void cpAddBcchStatistics(kal_uint16 counter,kal_uint16 value);
213 void cpResetFccchStatistics(void);
214 void cpAddFccchStatistics(kal_uint16 counter,kal_uint16 value);
215 void cpResetAccessChStatistics(void);
216 void cpIncAccessChStatistics(kal_uint8 counter);
217#ifdef LMD_EACH_ON
218 void cpIncEACHStatistics(kal_uint16 counter);
219#endif
220 void cpAddressedFcschStatistics(kal_uint8 ChanType);
221 void stResetTCStatistics (void);
222 kal_uint32* stGetL2RTCStats (void);
223 void stMultiplexParameters (MuxParmsT* MuxParms);
224 void stRTPM (FTCMessage* msg);
225 void stSTPM (FTCMessage* msg);
226 void stRetrieveStatistics(GetRetrievableParameterMsgT *msgPtr);
227 void stSetPEStatistics(MuxRecsT *muxRecs);
228 void stSetStatistics(MuxRecsT *muxRecs);
229
230
231#endif /* _STATS_H_ */
232
233