comparison src/g23m-gprs/grr/grr_em.c @ 183:219afcfc6250

src/g23m-gprs: initial import from TCS3.2/LoCosto
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 13 Oct 2016 04:24:13 +0000
parents
children
comparison
equal deleted inserted replaced
182:f02d0a0e1849 183:219afcfc6250
1
2
3 /*
4 +-----------------------------------------------------------------------------
5 | Project :
6 | Modul :
7 +-----------------------------------------------------------------------------
8 | Copyright 2002 Texas Instruments Berlin, AG
9 | All rights reserved.
10 |
11 | This file is confidential and a trade secret of Texas
12 | Instruments Berlin, AG
13 | The receipt of or possession of this file does not convey
14 | any rights to reproduce or disclose its contents or to
15 | manufacture, use, or sell anything it may describe, in
16 | whole, or in part, without the specific written consent of
17 | Texas Instruments Berlin, AG.
18 +-----------------------------------------------------------------------------
19 | Purpose : This Module defines the engineering mode (EM) device driver for the
20 | G23 protocol stack. This driver is used to control all engineering
21 | mode related functions.
22 +-----------------------------------------------------------------------------
23 */
24
25 #ifndef GRR_EM_C
26 #define GRR_EM_C
27
28 #define ENTITY_GRR
29
30 /*--------- INCLUDES -----*/
31 /* Maybee some include is missing,
32 but compiling has worked*/
33 #include <string.h> /*definition of memset*/
34 #include "typedefs.h" /* to get Condat data types */
35
36 #include "vsi.h" /* to get a lot of macros */
37 #include "gprs.h"
38
39 #include "gsm.h" /* to get a lot of macros */
40 #include "custom.h" /*set FF_EM_MODE compile switch for SIMULATION*/
41 #include "prim.h" /* to get the definitions of used SAP and directions */
42 #include "message.h"
43
44 #include "grr.h" /* to get the global entity definitions */
45 #include "grr_em.h" /* to get the definition for EM */
46
47 #ifdef FF_EM_MODE
48
49 /*-----Variables------------------*/
50
51 /*
52 * em_dsc_val is used for the engineering mode. To avoid unnecessary primitive sending
53 * this variable is defined as global and is used between entities.
54 */
55 GLOBAL UBYTE em_dsc_val = 0;
56
57 #endif /* FF_EM_MODE */
58 /*-----------Functions ----------------*/
59
60 #ifdef FF_EM_MODE
61
62 /*
63 +------------------------------------------------------------------------------
64 | Function : grr_em_pco_trace_req
65 |
66 | Parameter : *grr_em_pco_trace_req (EM_PCO_TRACE_REQ )
67 |
68 | Result : void
69 |
70 +------------------------------------------------------------------------------
71 This function traces the EM data at the PCO.
72 */
73 GLOBAL void grr_em_pco_trace_req ( T_EM_PCO_TRACE_REQ * em_pco_trace_req )
74 {
75 if(em_pco_trace_req->pco_bitmap & EM_PCO_GPRS_INFO)
76 {
77 TRACE_EVENT_EM_P5("EM_SC_GPRS_INFO_REQ: dl_nts:%d nmo:%d nw:%d pri_acc_thr:%d cba:%d",
78 grr_data->downlink_tbf.nts,
79 psc_db->cell_info_for_gmm.cell_info.net_mode,
80 psc_db->net_ctrl.spgc_ccch_supp.nw_supp,
81 psc_db->net_ctrl.priority_access_thr,
82 psc_db->scell_par.cell_ba);
83 TRACE_EVENT_EM_P6("EM_SC_GPRS_INFO_REQ: rac:%d tav:%d dsc:%d c31:%d c32:%d nco:%d",
84 psc_db->cell_info_for_gmm.cell_info.cell_env.rai.rac,
85 grr_data->ta_params.ta_value,
86 em_dsc_val,
87 grr_data->db.scell_info.cr_crit.c31,
88 grr_data->db.scell_info.cr_crit.c32,
89 psc_db->nc_cw.param.ctrl_order);
90 }
91
92 PFREE (em_pco_trace_req);
93
94 }/*grr_em_pco_trace_req*/
95
96
97
98 /*
99 +------------------------------------------------------------------------------
100 | Function : grr_em_sc_gprs_info_req
101 |
102 | Parameter : *em_sc_gprs_info_req (T_EM_SC_GPRS_INFO_REQ)
103 |
104 | Result : void
105 |
106 +------------------------------------------------------------------------------
107 */
108 GLOBAL void grr_em_sc_gprs_info_req (T_EM_SC_GPRS_INFO_REQ *em_sc_gprs_info_req)
109 {
110 PALLOC(em_sc_gprs_info_cnf, EM_SC_GPRS_INFO_CNF);
111
112 PFREE(em_sc_gprs_info_req);
113
114 TRACE_FUNCTION( "grr_em_sc_gprs_info_req" );
115
116 memset (em_sc_gprs_info_cnf, 0, sizeof (T_EM_SC_GPRS_INFO_CNF));
117
118 em_sc_gprs_info_cnf->tn = grr_data->downlink_tbf.nts;
119 em_sc_gprs_info_cnf->nmo = psc_db->cell_info_for_gmm.cell_info.net_mode;
120 em_sc_gprs_info_cnf->net_ctrl.spgc_ccch_sup = psc_db->net_ctrl.spgc_ccch_supp.nw_supp;
121 em_sc_gprs_info_cnf->net_ctrl.priority_access_thr = psc_db->net_ctrl.priority_access_thr;
122 em_sc_gprs_info_cnf->cba = psc_db->scell_par.cell_ba;
123 em_sc_gprs_info_cnf->rac = psc_db->cell_info_for_gmm.cell_info.cell_env.rai.rac;
124 em_sc_gprs_info_cnf->tav = grr_data->ta_params.ta_value;
125 em_sc_gprs_info_cnf->dsc = em_dsc_val;
126 em_sc_gprs_info_cnf->c31 = grr_data->db.scell_info.cr_crit.c31;
127 em_sc_gprs_info_cnf->c32 = grr_data->db.scell_info.cr_crit.c32;
128 em_sc_gprs_info_cnf->nco = psc_db->nc_cw.param.ctrl_order;
129
130 PSEND (hCommGMM, em_sc_gprs_info_cnf);
131 }
132 /*
133 +------------------------------------------------------------------------------
134 | Function : grr_em_fmm_sc_gprs_info_req
135 |
136 | Parameter : *em_fmm_sc_gprs_info_req (EM_FMM_SC_GPRS_INFO_REQ)
137 |
138 | Result : void
139 |
140 +------------------------------------------------------------------------------
141 This function provides data needed for microtec fmm. this is the only requested
142 data, that is not available in RR.
143 */
144 GLOBAL void grr_em_fmm_sc_gprs_info_req (T_EM_FMM_SC_GPRS_INFO_REQ * em_fmm_sc_gprs_info_req)
145 {
146 PALLOC(em_fmm_sc_gprs_info_cnf, EM_FMM_SC_GPRS_INFO_CNF);
147 PFREE(em_fmm_sc_gprs_info_req);
148
149 TRACE_FUNCTION( "grr_em_fmm_sc_gprs_info_req" );
150
151 memset (em_fmm_sc_gprs_info_cnf, 0, sizeof (T_EM_FMM_SC_GPRS_INFO_CNF));
152
153 em_fmm_sc_gprs_info_cnf->c31_hyst = psc_db->gen_cell_par.c31_hyst;
154 if (psc_db->gen_cell_par.v_ra_re_hyst)
155 em_fmm_sc_gprs_info_cnf->ra_re_hyst = psc_db->gen_cell_par.gprs_c_hyst;
156 em_fmm_sc_gprs_info_cnf->nco = psc_db->nc_cw.param.ctrl_order;
157
158 TRACE_EVENT_P3("c31_hyst:%d ra_re_hyst:%d nco:%d", em_fmm_sc_gprs_info_cnf->c31_hyst,\
159 em_fmm_sc_gprs_info_cnf->ra_re_hyst, em_fmm_sc_gprs_info_cnf->nco);
160
161 #ifdef FF_WAP
162 PSEND( hCommWAP , em_fmm_sc_gprs_info_cnf);
163 #else /*FF_WAP*/
164 PFREE(em_fmm_sc_gprs_info_cnf);
165 #endif /*FF_WAP*/
166 }
167
168
169 /*
170 +------------------------------------------------------------------------------
171 | Function : grr_em_fmm_tbf_info_req
172 |
173 | Parameter : *grr_em_fmm_tbf_info_req (EM_FMM_TBF_INFO_REQ)
174 |
175 | Result : void
176 |
177 +------------------------------------------------------------------------------
178 This function provides data needed for microtec fmm. this is the only requested
179 data, that is not available in RR.
180 */
181 GLOBAL void grr_em_fmm_tbf_info_req (T_EM_FMM_TBF_INFO_REQ *em_fmm_tbf_info_req)
182 {
183 PFREE(em_fmm_tbf_info_req);
184 TRACE_FUNCTION( "grr_em_fmm_tbf_info_req" );
185 #ifdef FF_WAP
186 {
187 PALLOC(em_fmm_tbf_info_cnf, EM_FMM_TBF_INFO_CNF);
188
189 memset (em_fmm_tbf_info_cnf, 0, sizeof (T_EM_FMM_TBF_INFO_CNF));
190
191 em_fmm_tbf_info_cnf->tbf_trans_type = grr_data->tbf_type;
192 em_fmm_tbf_info_cnf->tbf_num_ults = grr_data->uplink_tbf.nts;
193 em_fmm_tbf_info_cnf->tbf_num_rlc = grr_data->uplink_tbf.rlc_oct_cnt;
194
195 /*TRACE_EVENT_P3("t: %d ts: %d r: %d", em_fmm_tbf_info_cnf->tbf_trans_type,
196 em_fmm_tbf_info_cnf->tbf_num_ults, em_fmm_tbf_info_cnf->tbf_num_rlc);*/
197
198 PSEND(hCommWAP, em_fmm_tbf_info_cnf);
199 }
200
201 #endif /*FF_WAP*/
202 }
203
204
205
206 #endif /* FF_EM_MODE */
207 #endif /*GRR_EM_C */