FreeCalypso > hg > fc-magnetite
comparison src/g23m-aci/aci/cmh_l2rf.c @ 162:53929b40109c
src/g23m-aci: initial import from TCS3.2/LoCosto
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 11 Oct 2016 02:02:43 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
161:4557e2a9c18e | 162:53929b40109c |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-PS (6147) | |
4 | Modul : CMH_L2RF | |
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 L2R. | |
19 +----------------------------------------------------------------------------- | |
20 */ | |
21 #ifdef DTI | |
22 | |
23 #ifndef CMH_L2RF_C | |
24 #define CMH_L2RF_C | |
25 #endif | |
26 | |
27 #include "aci_all.h" | |
28 | |
29 /*==== INCLUDES ===================================================*/ | |
30 #include "aci_cmh.h" | |
31 #include "ati_cmd.h" | |
32 #include "aci_cmd.h" | |
33 #include "dti.h" /* functionality of the dti library */ | |
34 | |
35 #ifdef FAX_AND_DATA | |
36 #include "aci_fd.h" | |
37 #endif /* of #ifdef FAX_AND_DATA */ | |
38 | |
39 #include "dti_conn_mng.h" | |
40 | |
41 #include "aci.h" | |
42 #include "psa.h" | |
43 #include "psa_l2r.h" | |
44 #include "psa_cc.h" | |
45 #include "cmh.h" | |
46 #include "cmh_ra.h" | |
47 #include "cmh_l2r.h" | |
48 | |
49 /*==== CONSTANTS ==================================================*/ | |
50 | |
51 /*==== TYPES ======================================================*/ | |
52 | |
53 /*==== EXPORT =====================================================*/ | |
54 | |
55 /*==== VARIABLES ==================================================*/ | |
56 | |
57 /*==== FUNCTIONS ==================================================*/ | |
58 | |
59 | |
60 | |
61 /* | |
62 +-------------------------------------------------------------------+ | |
63 | PROJECT : GSM-PS (6147) MODULE : CMH_L2R | | |
64 | ROUTINE : cmhL2R_GetCompDir | | |
65 +-------------------------------------------------------------------+ | |
66 | |
67 PURPOSE : get data compression direction out of p0 value | |
68 | |
69 */ | |
70 | |
71 GLOBAL SHORT cmhL2R_GetCompDir ( void ) | |
72 { | |
73 switch( l2rShrdPrm.set_prm_use.p0 ) | |
74 { | |
75 case( L2R_COMP_DIR_NONE ): return( DR_TYP_None ); | |
76 case( L2R_COMP_DIR_TRANSMIT ): return( DR_TYP_TxOnly ); | |
77 case( L2R_COMP_DIR_RECEIVE ): return( DR_TYP_RxOnly ); | |
78 case( L2R_COMP_DIR_BOTH ): return( DR_TYP_Both ); | |
79 default: TRACE_EVENT( "UNEXP BEARER SERVICE IN CTB" ); | |
80 return( DR_TYP_NotPresent ); | |
81 } | |
82 } | |
83 | |
84 /* | |
85 +-------------------------------------------------------------------+ | |
86 | PROJECT : GSM-PS (6147) MODULE : CMH_L2R | | |
87 | ROUTINE : cmhL2R_SelCompDir | | |
88 +-------------------------------------------------------------------+ | |
89 | |
90 PURPOSE : select data compression direction | |
91 | |
92 */ | |
93 | |
94 GLOBAL UBYTE cmhL2R_SelCompDir ( T_L2R_CMD_PRM * pCmdPrm ) | |
95 { | |
96 switch( pCmdPrm -> DSdir ) | |
97 { | |
98 case( DS_DIR_Negotiated ): return( L2R_COMP_DIR_NONE ); | |
99 case( DS_DIR_TxOnly ): return( L2R_COMP_DIR_TRANSMIT ); | |
100 case( DS_DIR_RxOnly ): return( L2R_COMP_DIR_RECEIVE ); | |
101 case( DS_DIR_Both ): return( L2R_COMP_DIR_BOTH ); | |
102 default: TRACE_EVENT( "UNEXP BEARER SERVICE IN CTB" ); | |
103 return((UBYTE)-1); /* return type is UBYTE,so return type is typecasted with UBYTE */ | |
104 } | |
105 } | |
106 | |
107 /* | |
108 +-------------------------------------------------------------------+ | |
109 | PROJECT : GSM-PS (6147) MODULE : CMH_L2R | | |
110 | ROUTINE : cmhL2R_SelChnRate | | |
111 +-------------------------------------------------------------------+ | |
112 | |
113 PURPOSE : select channel rate | |
114 | |
115 */ | |
116 | |
117 GLOBAL UBYTE cmhL2R_SelChnRate ( void ) | |
118 { | |
119 switch( ccShrdPrm.chType ) | |
120 { | |
121 case( MNCC_CH_TCH_F ): | |
122 switch( ccShrdPrm.chMod ) | |
123 { | |
124 case( MNCC_CHM_DATA_14_4 ): return( L2R_FULLRATE_14400 ); | |
125 case( MNCC_CHM_DATA_9_6 ): return( L2R_FULLRATE_9600 ); | |
126 case( MNCC_CHM_DATA_4_8 ): return( L2R_FULLRATE_4800 ); | |
127 case( MNCC_CHM_DATA_2_4 ): | |
128 default: TRACE_EVENT( "UNEXP CHN MODE IN CTB" ); | |
129 return((UBYTE)-1); /* return type is UBYTE,so return type is typecasted with UBYTE */ | |
130 } | |
131 | |
132 case( MNCC_CH_TCH_H ): | |
133 switch( ccShrdPrm.chMod ) | |
134 { | |
135 case( MNCC_CHM_DATA_4_8 ): return( L2R_HALFRATE_4800 ); | |
136 case( MNCC_CHM_DATA_14_4 ): | |
137 case( MNCC_CHM_DATA_9_6 ): | |
138 case( MNCC_CHM_DATA_2_4 ): | |
139 default: TRACE_EVENT( "UNEXP CHN MODE IN CTB" ); | |
140 return((UBYTE)-1); /* return type is UBYTE,so return type is typecasted with UBYTE */ | |
141 } | |
142 | |
143 default: TRACE_EVENT( "UNEXP CHN TYPE IN CTB" ); | |
144 return((UBYTE)1); /* return type is UBYTE,so return type is typecasted with UBYTE */ | |
145 } | |
146 } | |
147 | |
148 #endif /* DTI */ | |
149 /*==== EOF ========================================================*/ |