comparison src/g23m-fad/l2r/tra_dns.c @ 174:90eb61ecd093

src/g23m-fad: initial import from TCS3.2/LoCosto
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 12 Oct 2016 05:40:46 +0000
parents
children
comparison
equal deleted inserted replaced
173:bf64d785238a 174:90eb61ecd093
1 /*
2 +-----------------------------------------------------------------------------
3 | Project : CSD (8411)
4 | Modul : L2r_dns.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 : This Modul defines the functions for processing
18 | of incomming signals for the component
19 | L2R of the base station
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef TRA_DNS_C
24 #define TRA_DNS_C
25 #endif
26
27 #define ENTITY_L2R
28
29 /*==== INCLUDES ===================================================*/
30
31 #include <string.h>
32
33 #include "typedefs.h"
34 #include "pconst.cdg"
35 #include "vsi.h"
36 #include "macdef.h"
37 #include "custom.h"
38 #include "gsm.h"
39 #include "prim.h"
40 #include "pei.h"
41 #include "tok.h"
42 #include "dti.h"
43
44 #include "cl_ribu.h"
45 #include "tra_pei.h"
46 #include "tra.h"
47
48 /*==== CONST =======================================================*/
49
50 /*==== TYPES =======================================================*/
51
52 /*==== VAR EXPORT ==================================================*/
53
54 /*==== VAR LOCAL ===================================================*/
55
56 /*==== FUNCTIONS ===================================================*/
57
58 /*
59 +-------------------------------------------------------------------------------------
60 | Function : sig_mgt_tra_dn_dti_conn_setup
61 +-------------------------------------------------------------------------------------
62 | Description : Process signal SIG_MGT_DL_CONNECT received from process management.
63 |
64 | Parameters :
65 |
66 | Return : -
67 +-------------------------------------------------------------------------------------
68 */
69 GLOBAL void sig_mgt_tra_dn_dti_conn_setup ()
70 {
71 TRACE_FUNCTION ("sig_mgt_tra_dn_dti_conn_setup()");
72
73 switch (GET_STATE (DN))
74 {
75 case DN_INACTIVE:
76 dl_init(&tra_data->dn);
77 break;
78 }
79 }
80
81 /*
82 +-------------------------------------------------------------------------------------
83 | Function : sig_mgt_tra_dn_dti_conn_open
84 +-------------------------------------------------------------------------------------
85 | Description : Process signal SIG_MGT_DL_CONNECT received from process management.
86 |
87 | Parameters :
88 |
89 | Return : -
90 +-------------------------------------------------------------------------------------
91 */
92 GLOBAL void sig_mgt_tra_dn_dti_conn_open ()
93 {
94 TRACE_FUNCTION ("sig_mgt_tra_dn_dti_conn_open()");
95
96 switch (GET_STATE (DN))
97 {
98 case DN_INACTIVE:
99 dl_init(&tra_data->dn);
100 SET_STATE (DN, DN_IDLE);
101 break;
102 }
103 }
104
105 /*
106 +------------------------------------------------------------------------------
107 | Function : sig_mgt_tra_dn_dti_disc
108 +------------------------------------------------------------------------------
109 | Description : Process signal SIG_MGT_DL_DISC received
110 | from process management.
111 |
112 |
113 | Parameters : -
114 |
115 |
116 | Return : -
117 +------------------------------------------------------------------------------
118 */
119
120 GLOBAL void sig_mgt_tra_dn_dti_disc(void)
121 {
122 T_TRA_DN *ddl = &tra_data->dn;
123
124 TRACE_FUNCTION ("sig_mgt_tra_dn_dti_disc()");
125
126 SET_STATE (DN, DN_INACTIVE);
127
128 if (ddl->prim NEQ NULL) /* free allocated prims and their lists */
129 {
130 PFREE_DESC2(ddl->prim)
131 ddl->prim = NULL;
132 }
133 }
134
135 /*
136 +------------------------------------------------------------------------------
137 | Function : sig_any_tra_dn_send_break_req
138 +------------------------------------------------------------------------------
139 | Description : Process signal SIG_MGT_DN_SEND_BREAK_REQ received
140 | from process uplink.
141 |
142 |
143 | Parameters : -
144 |
145 |
146 | Return : -
147 +------------------------------------------------------------------------------
148 */
149
150 GLOBAL void sig_any_tra_dn_send_break_req(void)
151 {
152 T_TRA_DN *ddl = &tra_data->dn;
153
154 TRACE_FUNCTION ("sig_any_tra_dn_send_break_req");
155
156 switch (GET_STATE (DN))
157 {
158 case DN_WAIT:
159 if (ddl->Brk_dti_data_ind NEQ NULL)
160 {
161 dti_send_data(l2r_hDTI, TRA_DTI_UP_INSTANCE, TRA_DTI_UP_INTERFACE, TRA_DTI_UP_CHANNEL, ddl->Brk_dti_data_ind);
162 ddl->Brk_dti_data_ind = NULL; /* do not send it twice .. */
163 SET_STATE (DN, DN_IDLE);
164 }
165 break;
166
167 default:
168 TRACE_ERROR ("[sig_any_tra_dn_send_break_req] unexpected state");
169 break;
170 }
171 }
172
173 GLOBAL void sig_mgt_tra_dn_break_req(void)
174 {
175 T_TRA_DN *ddl = &tra_data->dn;
176
177 TRACE_FUNCTION ("sig_mgt_tra_dn_break_req()");
178
179 switch (GET_STATE (DN))
180 {
181 case DN_SEND:
182 SET_STATE (DN, DN_IDLE);
183 /* Fall through */
184
185 case DN_IDLE:
186 case DN_WAIT:
187 if (ddl->prim NEQ NULL) /* free allocated prims and their lists */
188 {
189 PFREE_DESC2(ddl->prim)
190 ddl->prim = NULL;
191 }
192 ddl->list_end = NULL;
193 ddl->sa = FL_INACTIVE;
194 ddl->sb = FL_INACTIVE;
195 ddl->x = FL_INACTIVE;
196 break;
197 }
198 }
199