FreeCalypso > hg > freecalypso-sw
annotate gsm-fw/comlib/cl_ribu.c @ 671:210268d8e553
gsm-fw: comlib included in the build along with ccd
CONFIG_INCLUDE_CCD eliminated and absorbed into CONFIG_INCLUDE_PS
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 28 Sep 2014 18:23:19 +0000 |
parents | d36f647c2432 |
children |
rev | line source |
---|---|
664
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 +----------------------------------------------------------------------------- |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 | Project : COMLIB |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 | Modul : cl_ribu.c |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 +----------------------------------------------------------------------------- |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 | Copyright 2002 Texas Instruments Berlin, AG |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 | All rights reserved. |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 | |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 | This file is confidential and a trade secret of Texas |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 | Instruments Berlin, AG |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 | The receipt of or possession of this file does not convey |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 | any rights to reproduce or disclose its contents or to |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 | manufacture, use, or sell anything it may describe, in |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 | whole, or in part, without the specific written consent of |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 | Texas Instruments Berlin, AG. |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 +----------------------------------------------------------------------------- |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 | Purpose : Definitions of common library functions: ring buffer |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 +----------------------------------------------------------------------------- |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 */ |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 /* |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 * Version 1.0 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 */ |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 /**********************************************************************************/ |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 /* |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 NOTE: |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 */ |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 /**********************************************************************************/ |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 #ifndef CL_RIBU_C |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 #define CL_RIBU_C |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
35 #include <string.h> |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
36 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
37 #include "typedefs.h" |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
38 #include "vsi.h" |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
39 #include "cl_ribu.h" |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
40 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
41 #undef ENA_ASSERT |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
42 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
43 /*==== FUNCTIONS ==================================================*/ |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
44 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
45 GLOBAL void cl_ribu_init(T_RIBU *ribu, const U8 depth) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
46 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
47 TRACE_FUNCTION("cl_ribu_init()"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
48 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
49 #ifdef ENA_ASSERT |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
50 assert(ribu NEQ NULL); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
51 #else |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
52 if (ribu EQ NULL) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
53 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
54 TRACE_ERROR("ribu EQ NULL"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
55 return; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
56 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
57 #endif |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
58 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
59 ribu->ri = 0; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
60 ribu->wi = 0; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
61 ribu->depth = depth; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
62 ribu->filled = 0; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
63 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
64 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
65 GLOBAL U8 cl_ribu_read_index(T_RIBU *ribu) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
66 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
67 U8 ri; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
68 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
69 TRACE_FUNCTION("cl_ribu_read_index()"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
70 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
71 #ifdef ENA_ASSERT |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
72 assert(ribu NEQ NULL); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
73 #else |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
74 if (ribu EQ NULL) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
75 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
76 TRACE_ERROR("ribu EQ NULL"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
77 return 0; //255; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
78 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
79 #endif |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
80 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
81 ri = ribu->ri; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
82 ribu->ri++; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
83 if (ribu->ri EQ ribu->depth) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
84 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
85 ribu->ri = 0; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
86 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
87 ribu->filled--; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
88 return ri; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
89 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
90 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
91 GLOBAL U8 cl_ribu_write_index(T_RIBU *ribu) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
92 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
93 U8 wi; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
94 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
95 TRACE_FUNCTION("cl_ribu_write_index()"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
96 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
97 #ifdef ENA_ASSERT |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
98 assert(ribu NEQ NULL); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
99 #else |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
100 if (ribu EQ NULL) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
101 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
102 TRACE_ERROR("ribu EQ NULL"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
103 return 0; //255; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
104 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
105 #endif |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
106 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
107 wi = ribu->wi; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
108 ribu->wi++; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
109 if (ribu->wi EQ ribu->depth) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
110 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
111 ribu->wi = 0; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
112 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
113 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
114 #ifdef ENA_ASSERT |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
115 assert(ribu->ri NEQ ribu->wi); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
116 #else |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
117 if (ribu->ri EQ ribu->wi) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
118 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
119 TRACE_ERROR("cl_ribu_write_index(): buffer full!"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
120 return 0; //255; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
121 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
122 #endif |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
123 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
124 ribu->filled++; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
125 return wi; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
126 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
127 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
128 GLOBAL void cl_ribu_create(T_RIBU_FD **ribu, const U8 buflen, const U8 depth) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
129 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
130 int i; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
131 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
132 TRACE_FUNCTION("cl_ribu_create()"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
133 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
134 if (*ribu NEQ NULL) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
135 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
136 TRACE_EVENT("cl_ribu_create(): *ribu already created ?"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
137 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
138 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
139 MALLOC(*ribu, sizeof(T_RIBU_FD)); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
140 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
141 cl_ribu_init(&(*ribu)->idx, depth); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
142 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
143 MALLOC((*ribu)->pFDv, depth * sizeof(T_FD*)); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
144 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
145 for (i = 0; i < depth; i++) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
146 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
147 T_FD **pFD = &(*ribu)->pFDv[i]; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
148 MALLOC(*pFD, sizeof(T_FD)); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
149 MALLOC((*pFD)->buf, buflen * sizeof(U8)); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
150 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
151 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
152 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
153 GLOBAL void cl_ribu_release(T_RIBU_FD **ribu) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
154 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
155 int i; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
156 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
157 TRACE_FUNCTION("cl_ribu_release()"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
158 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
159 if (*ribu EQ NULL) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
160 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
161 TRACE_EVENT("cl_ribu_release(): *ribu EQ NULL!"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
162 return; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
163 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
164 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
165 for (i = 0; i < (*ribu)->idx.depth; i++) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
166 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
167 T_FD *pFD = (*ribu)->pFDv[i]; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
168 MFREE(pFD->buf); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
169 MFREE(pFD); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
170 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
171 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
172 MFREE((*ribu)->pFDv); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
173 MFREE(*ribu); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
174 *ribu = NULL; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
175 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
176 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
177 GLOBAL BOOL cl_ribu_data_avail(const T_RIBU_FD *ribu) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
178 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
179 TRACE_FUNCTION("cl_ribu_data_avail()"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
180 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
181 #ifdef ENA_ASSERT |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
182 assert(ribu NEQ NULL); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
183 #else |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
184 if (ribu EQ NULL) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
185 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
186 TRACE_ERROR("ribu EQ NULL"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
187 return 0; //255; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
188 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
189 #endif |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
190 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
191 return ribu->idx.ri NEQ ribu->idx.wi; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
192 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
193 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
194 GLOBAL T_FD *cl_ribu_get_new_frame_desc(T_RIBU_FD *ribu) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
195 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
196 U8 wi; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
197 T_FD *pFDc; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
198 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
199 TRACE_FUNCTION("cl_ribu_get_new_frame_desc()"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
200 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
201 #ifdef ENA_ASSERT |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
202 assert(ribu NEQ NULL); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
203 #else |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
204 if (ribu EQ NULL) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
205 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
206 TRACE_ERROR("ribu EQ NULL"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
207 return NULL; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
208 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
209 #endif |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
210 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
211 wi = cl_ribu_write_index(&ribu->idx); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
212 if (wi >= ribu->idx.depth) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
213 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
214 TRACE_EVENT_P1("invalid write index: %d", (int)wi); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
215 return NULL; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
216 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
217 pFDc = ribu->pFDv[wi]; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
218 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
219 return pFDc; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
220 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
221 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
222 GLOBAL void cl_ribu_put(const T_FD fd, T_RIBU_FD *ribu) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
223 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
224 T_FD *pFDc = cl_ribu_get_new_frame_desc(ribu); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
225 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
226 TRACE_FUNCTION("cl_ribu_put()"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
227 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
228 if (pFDc EQ NULL) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
229 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
230 TRACE_ERROR("cl_ribu_put(): no write buffer!"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
231 return; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
232 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
233 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
234 (*pFDc).type = fd.type; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
235 (*pFDc).status = fd.status; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
236 (*pFDc).len = fd.len; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
237 memcpy((*pFDc).buf, fd.buf, fd.len); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
238 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
239 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
240 GLOBAL T_FD *cl_ribu_get(T_RIBU_FD *ribu) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
241 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
242 int ri; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
243 T_FD *pFDc; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
244 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
245 TRACE_FUNCTION("cl_ribu_get()"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
246 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
247 #ifdef ENA_ASSERT |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
248 assert(ribu NEQ NULL); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
249 #else |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
250 if (ribu EQ NULL) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
251 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
252 TRACE_ERROR("ribu EQ NULL"); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
253 return NULL; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
254 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
255 #endif |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
256 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
257 ri = (int)cl_ribu_read_index(&ribu->idx); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
258 pFDc = ribu->pFDv[ri]; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
259 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
260 return pFDc; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
261 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
262 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
263 GLOBAL void cl_set_frame_desc(T_FRAME_DESC *frame_desc, U8 *A0, U16 L0, U8 *A1, U16 L1) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
264 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
265 TRACE_ASSERT(frame_desc NEQ NULL); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
266 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
267 frame_desc->Adr[0] = A0; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
268 frame_desc->Len[0] = L0; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
269 frame_desc->Adr[1] = A1; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
270 frame_desc->Len[1] = L1; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
271 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
272 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
273 GLOBAL void cl_set_frame_desc_0(T_FRAME_DESC *frame_desc, U8 *A0, U16 L0) |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
274 { |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
275 TRACE_ASSERT(frame_desc NEQ NULL); |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
276 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
277 frame_desc->Adr[0] = A0; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
278 frame_desc->Len[0] = L0; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
279 frame_desc->Adr[1] = NULL; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
280 frame_desc->Len[1] = 0; |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
281 } |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
282 |
d36f647c2432
gsm-fw/comlib: initial import of TI's source
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff
changeset
|
283 #endif /* CL_RIBU_C */ |