comparison src/g23m-gprs/grlc/grlc_em.c @ 1:fa8dc04885d8

src/g23m-*: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:25:50 +0000
parents
children
comparison
equal deleted inserted replaced
0:4e78acac3d88 1:fa8dc04885d8
1 /*+-----------------------------------------------------------------------------
2 | Copyright 2002 Texas Instruments Berlin, AG
3 | All rights reserved.
4 |
5 | This file is confidential and a trade secret of Texas
6 | Instruments Berlin, AG
7 | The receipt of or possession of this file does not convey
8 | any rights to reproduce or disclose its contents or to
9 | manufacture, use, or sell anything it may describe, in
10 | whole, or in part, without the specific written consent of
11 | Texas Instruments Berlin, AG.
12 +-----------------------------------------------------------------------------
13 | Purpose : This Module defines the engineering mode (EM) device driver for the
14 | G23 protocol stack. This driver is used to control all engineering
15 | mode related functions.
16 +-----------------------------------------------------------------------------
17 */
18
19 #ifndef GRLC_EM_C
20 #define GRLC_EM_C
21
22 #define ENTITY_GRLC
23
24 /*--------- INCLUDES -----*/
25 /* Maybee some include is missing but windows and target build works*/
26 #include <string.h> /*definition of memset*/
27 #include "typedefs.h"
28
29 #include "vsi.h"
30 #include "gprs.h"
31
32 #include "gsm.h"
33 #include "custom.h" /*set FF_EM_MODE compile switch for SIMULATION*/
34 #include "prim.h"
35 #include "message.h"
36
37 #include "grlc.h"
38 #include "grlc_em.h"
39
40 #ifdef FF_EM_MODE
41 /*
42 +------------------------------------------------------------------------------
43 | Function : grlc_em_pco_trace_req
44 |
45 | Parameter : *grlc_em_pco_trace_req (EM_PCO_TRACE_REQ )
46 |
47 | Result : void
48 |
49 +------------------------------------------------------------------------------
50 This function traces the EM data at the PCO.
51 */
52 GLOBAL void grlc_em_pco_trace_req ( T_EM_PCO_TRACE_REQ * em_pco_trace_req)
53 {
54 TRACE_FUNCTION( "grlc_em_pco_trace_req" );
55
56 if(em_pco_trace_req->pco_bitmap & EM_PCO_GRLC_INFO)
57 {
58
59 TRACE_EVENT_EM_P4("EM_GRLC_INFO_REQ: grlc_sta:%d tbf_mode:%d dl_tfi:%d dl_mac_mode:%d",
60 grlc_data->tm.state,
61 grlc_data->tbf_type,
62 grlc_data->dl_tfi,
63 grlc_data->downlink_tbf.mac_mode);
64
65 TRACE_EVENT_EM_P5("EM_GRLC_INFO_REQ: ul_tfi:%d ul_mac_mode:%d ul_nb_blocks:%d ul_cv:%d ul_cs:%d",
66 grlc_data->ul_tfi,
67 grlc_data->uplink_tbf.mac_mode,
68 grlc_data->ru.rlc_octet_cnt,
69 grlc_data->ru.cv,
70 grlc_data->ru.cs_type);
71 }
72
73 PFREE (em_pco_trace_req);
74
75 }/*grlc_em_pco_trace_req*/
76
77 /*
78 +------------------------------------------------------------------------------
79 | Function : grlc_em_fmm_rlc_trans_info_req
80 |
81 | Parameter : *em_fmm_rlc_trans_info_req (EM_FMM_RLC_TRANS_INFO_REQ)
82 |
83 | Result : void
84 |
85 +------------------------------------------------------------------------------
86 This function provides data needed for microtec fmm1251. It gives the actual status about RLC.
87 */
88 GLOBAL void grlc_em_fmm_rlc_trans_info_req (T_EM_FMM_RLC_TRANS_INFO_REQ * em_fmm_rlc_trans_info_req)
89 {
90 PFREE(em_fmm_rlc_trans_info_req);
91
92 TRACE_FUNCTION( "grlc_em_fmm_rlc_trans_info_req" );
93
94 #ifdef FF_WAP
95 {
96 PALLOC(em_fmm_rlc_trans_info_cnf, EM_FMM_RLC_TRANS_INFO_CNF);
97
98 memset (em_fmm_rlc_trans_info_cnf, 0, sizeof (T_EM_FMM_RLC_TRANS_INFO_CNF));
99
100 em_fmm_rlc_trans_info_cnf->rlc_num_retrans = grlc_data->tbf_ctrl[grlc_data->ul_index].ret_bsn;
101 em_fmm_rlc_trans_info_cnf->rlc_num_trans = (grlc_data->tbf_ctrl[grlc_data->ul_index].cnt_ts) - (grlc_data->tbf_ctrl[grlc_data->ul_index].ret_bsn);
102 em_fmm_rlc_trans_info_cnf->rlc_pdu_cnt = grlc_data->tbf_ctrl[grlc_data->ul_index].pdu_cnt;
103 em_fmm_rlc_trans_info_cnf->rlc_start_fn = grlc_data->tbf_ctrl[grlc_data->ul_index].start_fn;
104 em_fmm_rlc_trans_info_cnf->rlc_end_fn = grlc_data->tbf_ctrl[grlc_data->ul_index].end_fn;
105 em_fmm_rlc_trans_info_cnf->rlc_tbc = grlc_data->ru.tbc;
106
107 /* TRACE_EVENT_P5("t:%d r:%d p:%d s:%d e:%d", em_fmm_rlc_trans_info_cnf->rlc_num_trans,
108 em_fmm_rlc_trans_info_cnf->rlc_num_retrans, em_fmm_rlc_trans_info_cnf->rlc_pdu_cnt,
109 em_fmm_rlc_trans_info_cnf->rlc_start_fn, em_fmm_rlc_trans_info_cnf->rlc_end_fn);*/
110
111 PSEND(hCommWAP, em_fmm_rlc_trans_info_cnf);
112 }
113
114 #endif /*FF_WAP*/
115
116 }
117
118 /*
119 +------------------------------------------------------------------------------
120 | Function : grlc_em_grlc_info_req
121 |
122 | Parameter : *em_grlc_info_req (T_EM_GLRC_INFO_REQ)
123 |
124 | Result : void
125 |
126 +------------------------------------------------------------------------------
127 */
128 GLOBAL void grlc_em_grlc_info_req (T_EM_GRLC_INFO_REQ * em_grlc_info_req)
129 {
130 PALLOC (em_grlc_info_cnf, EM_GRLC_INFO_CNF);
131
132 TRACE_FUNCTION( "grlc_em_grlc_info_req" );
133
134 PFREE (em_grlc_info_req);
135
136 memset (em_grlc_info_cnf, 0, sizeof (T_EM_GRLC_INFO_CNF));
137
138 em_grlc_info_cnf->grlc_state = grlc_data->tm.state;
139 em_grlc_info_cnf->tbf_mod = grlc_data->tbf_type;
140 /* ul tbf*/
141 em_grlc_info_cnf->ul_tbf_par.tfi = grlc_data->ul_tfi;
142 em_grlc_info_cnf->ul_tbf_par.mac_mod = grlc_data->uplink_tbf.mac_mode;
143 em_grlc_info_cnf->ul_tbf_par.ul_nb_block= grlc_data->ru.rlc_octet_cnt;
144 em_grlc_info_cnf->ul_tbf_par.cv = grlc_data->ru.cv;
145 em_grlc_info_cnf->ul_tbf_par.cs = grlc_data->ru.cs_type;
146 /* dl tbf*/
147 em_grlc_info_cnf->dl_tbf_par.tfi = grlc_data->dl_tfi;
148 em_grlc_info_cnf->dl_tbf_par.mac_mod = grlc_data->downlink_tbf.mac_mode;
149
150 PSEND(hCommGMM, em_grlc_info_cnf);
151 } /*grlc_em_grlc_info_req*/
152
153 #endif /* FF_EM_MODE */
154 #endif /* GRLC_EM_C */