FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/g23m-aci/aci/cmh_raf.c @ 775:eedbf248bac0
gsm-fw/g23m-aci subtree: initial import from LoCosto source
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 12 Oct 2014 01:45:14 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
774:40a721fd9854 | 775:eedbf248bac0 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-PS (6147) | |
4 | Modul : CMH_RAF | |
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 : This module defines the functions used by the command | |
18 | handler for RA. | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 #ifdef DTI | |
22 #ifndef CMH_RAF_C | |
23 #define CMH_RAF_C | |
24 #endif | |
25 | |
26 #include "aci_all.h" | |
27 /*==== INCLUDES ===================================================*/ | |
28 #include "aci_cmh.h" | |
29 #include "ati_cmd.h" | |
30 #include "aci_cmd.h" | |
31 | |
32 #ifdef FAX_AND_DATA | |
33 #include "aci_fd.h" | |
34 #endif /* of #ifdef FAX_AND_DATA */ | |
35 | |
36 #include "aci.h" | |
37 #include "psa.h" | |
38 #include "aci_io.h" | |
39 #include "psa_ra.h" | |
40 #include "psa_cc.h" | |
41 #include "cmh.h" | |
42 #include "cmh_ra.h" | |
43 #include "cmh_cc.h" | |
44 | |
45 /*==== CONSTANTS ==================================================*/ | |
46 | |
47 /*==== TYPES ======================================================*/ | |
48 | |
49 /*==== EXPORT =====================================================*/ | |
50 | |
51 /*==== VARIABLES ==================================================*/ | |
52 | |
53 /*==== FUNCTIONS ==================================================*/ | |
54 | |
55 | |
56 | |
57 /* | |
58 +-------------------------------------------------------------------+ | |
59 | PROJECT : GSM-PS (6147) MODULE : CMH_RA | | |
60 | ROUTINE : cmhRA_SelTrfProt | | |
61 +-------------------------------------------------------------------+ | |
62 | |
63 PURPOSE : select transfer protocol | |
64 | |
65 */ | |
66 | |
67 GLOBAL UBYTE cmhRA_SelTrfProt( SHORT cId ) | |
68 { | |
69 switch( cmhCC_getcalltype(cId) ) | |
70 { | |
71 case( TRANS_CALL ): | |
72 return( RA_MODEL_TRANS ); | |
73 | |
74 case( NON_TRANS_CALL ): | |
75 return( RA_MODEL_RLP ); | |
76 | |
77 case( FAX_CALL ): | |
78 return( RA_MODEL_FAX ); | |
79 #ifdef CO_UDP_IP | |
80 /* a WAP call should be a non-transparent call for RA */ | |
81 case( UDPIP_CALL ): | |
82 return( RA_MODEL_RLP ); | |
83 #endif | |
84 #ifdef FF_PPP | |
85 case( PPP_CALL ): | |
86 return( RA_MODEL_RLP ); | |
87 #endif /* FF_PPP */ | |
88 #if defined(FF_GPF_TCPIP) | |
89 case TCPIP_CALL: | |
90 return RA_MODEL_RLP ; | |
91 | |
92 #endif /* FF_GPF_TCPIP */ | |
93 default: | |
94 TRACE_EVENT( "UNEXP TYPE OF CALL IN CTB" ); | |
95 return( NOT_PRESENT_8BIT ); | |
96 } | |
97 } | |
98 | |
99 /* | |
100 +-------------------------------------------------------------------+ | |
101 | PROJECT : GSM-PS (6147) MODULE : CMH_RA | | |
102 | ROUTINE : cmhRA_SelChnRate | | |
103 +-------------------------------------------------------------------+ | |
104 | |
105 PURPOSE : select channel rate | |
106 | |
107 */ | |
108 | |
109 GLOBAL UBYTE cmhRA_SelChnRate ( void ) | |
110 { | |
111 switch( ccShrdPrm.chType ) | |
112 { | |
113 case( MNCC_CH_TCH_F ): | |
114 switch( ccShrdPrm.chMod ) | |
115 { | |
116 case( MNCC_CHM_DATA_14_4 ): return( TRA_FULLRATE_14400 ); | |
117 case( MNCC_CHM_DATA_9_6 ): return( TRA_FULLRATE_9600 ); | |
118 case( MNCC_CHM_DATA_4_8 ): return( TRA_FULLRATE_4800 ); | |
119 case( MNCC_CHM_DATA_2_4 ): return( TRA_FULLRATE_2400 ); | |
120 default: TRACE_EVENT( "UNEXP CHN MODE IN CTB" ); | |
121 return((UBYTE)-1); /* return type is UBYTE,so return type is typecasted with UBYTE */ | |
122 } | |
123 | |
124 case( MNCC_CH_TCH_H ): | |
125 switch( ccShrdPrm.chMod ) | |
126 { | |
127 case( MNCC_CHM_DATA_2_4 ): return( TRA_HALFRATE_2400 ); | |
128 case( MNCC_CHM_DATA_4_8 ): return( TRA_HALFRATE_4800 ); | |
129 case( MNCC_CHM_DATA_14_4 ): | |
130 case( MNCC_CHM_DATA_9_6 ): | |
131 default: TRACE_EVENT( "UNEXP CHN MODE IN CTB" ); | |
132 return((UBYTE)-1); /* return type is UBYTE,so return type is typecasted with UBYTE */ | |
133 } | |
134 | |
135 default: TRACE_EVENT( "UNEXP CHN TYPE IN CTB" ); | |
136 return((UBYTE)-1); /* return type is UBYTE,so return type is typecasted with UBYTE */ | |
137 } | |
138 } | |
139 | |
140 /* | |
141 +-------------------------------------------------------------------+ | |
142 | PROJECT : GSM-PS (6147) MODULE : CMH_RA | | |
143 | ROUTINE : cmhRA_SelChnRate | | |
144 +-------------------------------------------------------------------+ | |
145 | |
146 PURPOSE : select channel rate | |
147 | |
148 */ | |
149 | |
150 GLOBAL UBYTE cmhRA_SelUsrRate( SHORT cId ) | |
151 { | |
152 if (ccShrdPrm.ctb[cId] EQ NULL) | |
153 return NOT_PRESENT_8BIT; | |
154 | |
155 switch (psaCC_ctb(cId)->BC[psaCC_ctb(cId)->curBC].rate) | |
156 { | |
157 case( MNCC_UR_0_3_KBIT ): return( URA_300 ); | |
158 case( MNCC_UR_1_2_KBIT ): return( URA_1200 ); | |
159 case( MNCC_UR_2_4_KBIT ): return( URA_2400 ); | |
160 case( MNCC_UR_4_8_KBIT ): return( URA_4800 ); | |
161 case( MNCC_UR_9_6_KBIT ): return( URA_9600 ); | |
162 case( MNCC_UR_1_2_KBIT_V23 ): return( URA_1200_75 ); | |
163 case( MNCC_UR_12_0_KBIT_TRANS): return( URA_14400 ); | |
164 case( 8 ): return( URA_14400 ); /* !!! change if SAP is updated */ | |
165 default: TRACE_EVENT( "UNEXP USER RATE IN CTB" ); | |
166 return( NOT_PRESENT_8BIT ); | |
167 } | |
168 } | |
169 | |
170 /* | |
171 +-------------------------------------------------------------------+ | |
172 | PROJECT : GSM-PS (6147) MODULE : CMH_RA | | |
173 | ROUTINE : cmhRA_SelDataBits | | |
174 +-------------------------------------------------------------------+ | |
175 | |
176 PURPOSE : select number of data bits | |
177 | |
178 */ | |
179 | |
180 GLOBAL UBYTE cmhRA_SelDataBits( SHORT cId ) | |
181 { | |
182 if (ccShrdPrm.ctb[cId] EQ NULL) | |
183 return NOT_PRESENT_8BIT; | |
184 | |
185 switch (psaCC_ctb(cId)->BC[psaCC_ctb(cId)->curBC].data_bits) | |
186 { | |
187 case( MNCC_DATA_7_BIT ): return( 7 ); | |
188 case( MNCC_DATA_8_BIT ): return( 8 ); | |
189 default: TRACE_EVENT( "UNEXP NR OF DATA BITS IN CTB" ); | |
190 return( NOT_PRESENT_8BIT ); | |
191 } | |
192 } | |
193 | |
194 /* | |
195 +-------------------------------------------------------------------+ | |
196 | PROJECT : GSM-PS (6147) MODULE : CMH_RA | | |
197 | ROUTINE : cmhRA_SelStopBits | | |
198 +-------------------------------------------------------------------+ | |
199 | |
200 PURPOSE : select number of stop bits | |
201 | |
202 */ | |
203 | |
204 GLOBAL UBYTE cmhRA_SelStopBits( SHORT cId ) | |
205 { | |
206 if (ccShrdPrm.ctb[cId] EQ NULL) | |
207 return NOT_PRESENT_8BIT; | |
208 | |
209 switch (psaCC_ctb(cId)->BC[psaCC_ctb(cId)->curBC].stop_bits) | |
210 { | |
211 case( MNCC_STOP_1_BIT ): return( 1 ); | |
212 case( MNCC_STOP_2_BIT ): return( 2 ); | |
213 default: TRACE_EVENT( "UNEXP NR OF STOP BITS IN CTB" ); | |
214 return( NOT_PRESENT_8BIT ); | |
215 } | |
216 } | |
217 | |
218 #ifdef FF_FAX | |
219 | |
220 /* | |
221 +-------------------------------------------------------------------+ | |
222 | PROJECT : GSM-PS (6147) MODULE : CMH_RA | | |
223 | ROUTINE : cmhRA_SelBitOrder | | |
224 +-------------------------------------------------------------------+ | |
225 | |
226 PURPOSE : select bit order | |
227 | |
228 */ | |
229 | |
230 GLOBAL UBYTE cmhRA_SelBitOrder( T_ACI_CMD_SRC srcId ) | |
231 { | |
232 switch( fnd_cmhPrm[srcId].t30CmdPrm.FBOval ) | |
233 { | |
234 case( FBO_VAL_DirCDirBD ): return( FBO_NRM_STATUS + FBO_NRM_DATA ); | |
235 case( FBO_VAL_RvrCDirBD ): return( FBO_NRM_STATUS + FBO_REV_DATA ); | |
236 case( FBO_VAL_DirCRvrBD ): return( FBO_REV_STATUS + FBO_NRM_DATA ); | |
237 case( FBO_VAL_RvrCRvrBD ): return( FBO_REV_STATUS + FBO_REV_DATA ); | |
238 default: TRACE_EVENT( "UNEXP FBO VALUE" ); | |
239 return( NOT_PRESENT_8BIT ); | |
240 } | |
241 } | |
242 | |
243 #endif /* FF_FAX */ | |
244 #endif /* DTI */ | |
245 /*==== EOF ========================================================*/ |