blob: 6fcffa35810a730733a5bcebe24aaff8e8fa25be [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) 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 * File Name: iqmgr.h
47 * Project: ISOTEL C library
48 * Original Author: BJC
49 * Creation Date: Sep.8, 1997
50 *
51 * Description: Circular Queue manager interface definition.
52 *
53 * Restrictions:
54 *
55 * Dependencies:
56 *
57 ****************************************************************************
58 ****************************************************************************
59 *
60 * RCS Log Information
61 *
62 * $Log: iqmgr.h $
63 *
64 * 06 29 2017 sue.zhong
65 * [MOLY00259241] [6293][C2K]Replace with KAL data type
66 * ::KAL type - folder inc
67 * Revision 1.1 2004/01/22 10:52:15 fpeng
68 * Initial revision
69 * Revision 1.2 2002/06/06 13:52:57 chinh
70 * Changed and Added Copyright
71 * Revision 1.1 2001/04/26 11:43:13 fpeng
72 * Initial revision
73 * Revision 1.3 2000/08/28 15:07:51 hhong
74 * Moving up to Rev 1.3 by checking out 1.1.2.1 and locking 1.2.
75 * It's a duplicate version of 1.1.2.1
76 * Revision 1.1.2.1 2000/08/24 00:25:40Z hhong
77 * Add iqResetScan
78 * Revision 1.4 2000/02/05 20:25:53 bcassidy
79 * 1. Add scanning function prototypes and supporting queue descriptor elements.
80 *
81 * Revision 1.3 1998/12/01 16:28:23 scotvold
82 * The Record Size is now 16 bits.
83 * Added compile guards.
84 *
85 * Revision 1.2 1998/02/12 17:47:58 bcassidy
86 * 1. Add iqGetRef and iqDelete.
87 *
88 * Revision 1.1 1998/01/31 22:39:13 bcassidy
89 * Initial revision
90 *
91 *
92 ************************************************************************/
93
94#ifndef _IQMGR_H_
95#define _IQMGR_H_ 1
96
97typedef struct
98{
99 /* Static queue descriptors */
100 kal_uint8* q;
101 kal_uint16 numRecords;
102 kal_uint16 recordSize;
103
104 /* Dynamic queue descriptors */
105 kal_uint16 putIndex;
106 kal_uint16 getIndex;
107 kal_uint16 numInQueue;
108
109 kal_uint16 scanIndex;
110 kal_uint16 numToScan;
111} IQDesc;
112
113/* Returns KAL_FALSE if queue is full */
114kal_bool iqPut(IQDesc *qd, void *data);
115
116/* Returns the number of records enqueued */
117kal_uint16 iqBlockPut(IQDesc *qd, void *data, kal_uint16 recordsToPut);
118
119/* Returns KAL_FALSE if queue is empty */
120kal_bool iqGet(IQDesc *qd, void *data);
121
122/* Returns number of records retrieved */
123kal_uint16 iqBlockGet(IQDesc *qd, void *data, kal_uint16 recordsToGet);
124
125/* Returns a pointer to the first entry without dequing the record */
126void *iqGetRef(IQDesc *qd);
127
128/* Removes the first entry */
129kal_bool iqDelete(IQDesc *qd);
130
131/* Returns number of records currently in the queue */
132kal_uint16 iqNum(IQDesc *qd);
133
134/* Returns number of unoccupied records in the queue */
135kal_uint16 iqRoom(IQDesc *qd);
136
137void iqFlush(IQDesc *qd);
138
139void iqResetScan(IQDesc *qd, kal_uint16 start);
140
141void* iqScan(IQDesc *qd);
142
143void iqInit(IQDesc *qd, void *q, kal_uint16 numRecords, kal_uint16 recordSize);
144
145#endif /* _IQMGR_H_ */
146