FreeCalypso > hg > fc-magnetite
comparison src/gpf3/ccd/ccddata_tap_priv.c @ 2:c41a534f33c6
src/gpf3: preened GPF goo from TCS3.2
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 25 Sep 2016 23:52:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1:864b8cc0cf63 | 2:c41a534f33c6 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : | |
4 | Modul : ccddata_tap_priv.c | |
5 +----------------------------------------------------------------------------- | |
6 | Copyright 2002 Texas Instruments Berlin, AG | |
7 | All rights reserved. | |
8 | | |
9 | This file is confidential and a trade secret of Texas | |
10 | Instruments Berlin, AG | |
11 | The receipt of or possession of this file does not convey | |
12 | any rights to reproduce or disclose its contents or to | |
13 | manufacture, use, or sell anything it may describe, in | |
14 | whole, or in part, without the specific written consent of | |
15 | Texas Instruments Berlin, AG. | |
16 +----------------------------------------------------------------------------- | |
17 | Purpose : Ccddata abstraction for use in lib/dll. This function belongs | |
18 | logically to tap_tdl.c, but is based on constants from mconst.cdg. | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 | |
22 #define CCDDATA_TAP_PRIV_C | |
23 | |
24 #include "typedefs.h" | |
25 #include "mconst.cdg" | |
26 #include "ccddata_tap_priv.h" | |
27 | |
28 /* | |
29 +------------------------------------------------------------------------------ | |
30 | Function : ccddata_tap_get_pd | |
31 +------------------------------------------------------------------------------ | |
32 | Description : This function returns the protocol discriminator to a | |
33 | given entity number generated by ccdgen. | |
34 | | |
35 | Parameters : comp - entity number. | |
36 | | |
37 | Return : The protocol discriminator or the error condition | |
38 | TAP_PD_INVALID (= -1) if the entity is not known. | |
39 +------------------------------------------------------------------------------ | |
40 */ | |
41 int ccddata_tap_get_pd (UCHAR comp) | |
42 { | |
43 switch (comp) | |
44 { | |
45 #ifdef CCDENT_XX_CSN1 | |
46 case CCDENT_XX_CSN1: | |
47 return TAP_NOPD_MT; | |
48 #endif | |
49 #ifdef CCDENT_XX_TDC | |
50 case CCDENT_XX_TDC: | |
51 return TAP_NOPD_MT; | |
52 #endif | |
53 #ifdef CCDENT_RR_SHORT_PD | |
54 case CCDENT_RR_SHORT_PD: | |
55 return TAP_RR_SHORT; | |
56 #endif | |
57 #ifdef CCDENT_RR_SHORT | |
58 case CCDENT_RR_SHORT: | |
59 return TAP_RR_SHORT; | |
60 #endif | |
61 #ifdef CCDENT_UMTS_AS_ASN1_MSG | |
62 case CCDENT_UMTS_AS_ASN1_MSG: | |
63 return TAP_NOPD_NOMT; | |
64 #endif | |
65 #ifdef CCDENT_RRLP_ASN1_MSG | |
66 case CCDENT_RRLP_ASN1_MSG: | |
67 return TAP_NOPD_NOMT; | |
68 #endif | |
69 #ifdef CCDENT_ASN1_MSG | |
70 case CCDENT_ASN1_MSG: | |
71 return TAP_NOPD_MT; | |
72 #endif | |
73 #ifdef CCDENT_CLT | |
74 case CCDENT_CLT: | |
75 return TAP_NOPD_MT; | |
76 #endif | |
77 #ifdef CCDENT_CC | |
78 case CCDENT_CC: | |
79 return TAP_PD_CC; | |
80 #endif | |
81 #ifdef CCDENT_MM | |
82 case CCDENT_MM: | |
83 return TAP_PD_MM; | |
84 #endif | |
85 #ifdef CCDENT_GMM | |
86 case CCDENT_GMM: | |
87 return TAP_PD_GMM; | |
88 #endif | |
89 #ifdef CCDENT_SM | |
90 case CCDENT_SM: | |
91 return TAP_PD_SM; | |
92 #endif | |
93 #ifdef CCDENT_RR | |
94 case CCDENT_RR: | |
95 return TAP_PD_RR; | |
96 #endif | |
97 #ifdef CCDENT_SS | |
98 case CCDENT_SS: | |
99 return TAP_PD_SS; | |
100 #endif | |
101 #ifdef CCDENT_SMS | |
102 case CCDENT_SMS: | |
103 return TAP_PD_SMS; | |
104 #endif | |
105 #ifdef CCDENT_TST | |
106 case CCDENT_TST: | |
107 return TAP_PD_TST; | |
108 #endif | |
109 #ifdef CCDENT_XX | |
110 case CCDENT_XX: | |
111 return TAP_PD_XX; | |
112 #endif | |
113 #ifdef CCDENT_ABIS | |
114 case CCDENT_ABIS: | |
115 return TAP_PD_ABIS; | |
116 #endif | |
117 #ifdef CCDENT_GRR | |
118 /* special treatment: no pd in GRR-messages */ | |
119 case CCDENT_GRR: | |
120 return TAP_PD_OK; | |
121 #endif | |
122 default: | |
123 return TAP_PD_INVALID; | |
124 } | |
125 } | |
126 | |
127 /* | |
128 +------------------------------------------------------------------------------ | |
129 | Function : ccddata_tap_check_pd | |
130 +------------------------------------------------------------------------------ | |
131 | Description : This function checks if a protocol discriminator belongs to | |
132 | an entity number generated by ccdgen. | |
133 | | |
134 | Parameters : comp - entity number. | |
135 | pd - protocol discriminator. | |
136 | | |
137 | Return : The protocol discriminator. The error condition | |
138 | TAP_PD_INVALID (= -1) is returned if the given comination | |
139 | does not match. It is not an error if the entity is not | |
140 | known. | |
141 +------------------------------------------------------------------------------ | |
142 */ | |
143 int ccddata_tap_check_pd (UCHAR comp, UCHAR pd) | |
144 { | |
145 switch (comp) | |
146 { | |
147 #ifdef CCDENT_CC | |
148 case CCDENT_CC: | |
149 if (pd == TAP_PD_CC) | |
150 return TAP_PD_CC; | |
151 break; | |
152 #endif | |
153 #ifdef CCDENT_MM | |
154 case CCDENT_MM: | |
155 if (pd == TAP_PD_MM) | |
156 return TAP_PD_MM; | |
157 break; | |
158 #endif | |
159 #ifdef CCDENT_GMM | |
160 case CCDENT_GMM: | |
161 if (pd == TAP_PD_GMM) | |
162 return TAP_PD_GMM; | |
163 break; | |
164 #endif | |
165 #ifdef CCDENT_SM | |
166 case CCDENT_SM: | |
167 if (pd == TAP_PD_SM) | |
168 return TAP_PD_SM; | |
169 break; | |
170 #endif | |
171 #ifdef CCDENT_RR | |
172 case CCDENT_RR: | |
173 if (pd == TAP_PD_RR) | |
174 return TAP_PD_RR; | |
175 break; | |
176 #endif | |
177 #ifdef CCDENT_SS | |
178 case CCDENT_SS: | |
179 if (pd == TAP_PD_SS) | |
180 return TAP_PD_SS; | |
181 break; | |
182 #endif | |
183 #ifdef CCDENT_SMS | |
184 case CCDENT_SMS: | |
185 if (pd == TAP_PD_SMS) | |
186 return TAP_PD_SMS; | |
187 break; | |
188 #endif | |
189 #ifdef CCDENT_XX | |
190 case CCDENT_XX: | |
191 if (pd == TAP_PD_XX) | |
192 return TAP_PD_XX; | |
193 break; | |
194 #endif | |
195 default: | |
196 return pd; | |
197 } | |
198 return TAP_PD_INVALID; | |
199 } |