comparison src/g23m-fad/l2r/l2r_mgts.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_mgts.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 L2R_MGTS_C
24 #define L2R_MGTS_C
25 #endif
26
27 #define ENTITY_L2R
28
29 /*==== INCLUDES ===================================================*/
30
31 #include <string.h>
32 #include "typedefs.h"
33 #include "pconst.cdg"
34 #include "vsi.h"
35 #include "macdef.h"
36 #include "custom.h"
37 #include "gsm.h"
38 #include "cus_l2r.h"
39 #include "cnf_l2r.h"
40 #include "mon_l2r.h"
41 #include "prim.h"
42 #include "pei.h"
43 #include "tok.h"
44 #include "dti.h" /* functionality of the dti library */
45
46 #include "cl_ribu.h"
47 #include "l2r.h"
48
49 /*==== CONST =======================================================*/
50
51 /*==== TYPES =======================================================*/
52
53 /*==== VAR EXPORT ==================================================*/
54
55 /*==== VAR LOCAL ===================================================*/
56
57 /*==== FUNCTIONS ===================================================*/
58
59 /*
60 +------------------------------------------------------------------------------
61 | Function : sig_dn_mgt_break_ind
62 +------------------------------------------------------------------------------
63 | Description : Process signal SIG_DN_MGT_BREAK_IND received from process DN.
64 |
65 | Parameters : sa -
66 | sb
67 | flow
68 |
69 | Return :
70 +------------------------------------------------------------------------------
71 */
72
73 GLOBAL void sig_dn_mgt_break_ind(T_BIT sa, T_BIT sb, T_FLOW flow)
74 {
75 TRACE_FUNCTION ("sig_dn_mgt_break_ind()");
76 {
77 PALLOC (dti_data_ind, DTI2_DATA_IND);
78
79 dti_data_ind->parameters.st_lines.st_line_sa = sa;
80 dti_data_ind->parameters.st_lines.st_line_sb = sb;
81
82 switch (flow)
83 {
84 case FL_ACTIVE:
85 dti_data_ind->parameters.st_lines.st_flow = DTI_FLOW_OFF;
86 break;
87 case FL_INACTIVE:
88 dti_data_ind->parameters.st_lines.st_flow = DTI_FLOW_ON;
89 break;
90 }
91 dti_data_ind->desc_list2.first = 0;
92 dti_data_ind->desc_list2.list_len = 0;
93 dti_data_ind->parameters.st_lines.st_break_len = L2R_BREAK_LEN;
94 dti_data_ind->link_id = l2r_data->mgt.link_id;
95 dti_data_ind->parameters.p_id = DTI_PID_UOS;
96
97 l2r_data->dn.Brk_dti_data_ind = dti_data_ind;
98 sig_mgt_dn_send_break_req();
99 }
100 sig_mgt_up_clear_req();
101 }
102
103 /*
104 +----------------------------------------------------------------------------------
105 | Function : sig_dn_mgt_first_data_ind
106 +----------------------------------------------------------------------------------
107 | Description : Process signal SIG_DN_MGT_FIRST_DATA_IND received from process DN.
108 |
109 | Parameters : -
110 |
111 |
112 | Return : -
113 +----------------------------------------------------------------------------------
114 */
115
116 GLOBAL void sig_dn_mgt_first_data_ind(void)
117 {
118 TRACE_FUNCTION ("sig_dn_mgt_first_data_ind()");
119
120 if (GET_STATE (MGT) EQ MGT_CONNECTED)
121 {
122 if (l2r_data->mgt.ConnectPrimType EQ L2R_CONNECT_IND)
123 {
124 PALLOC (l2r_connect_ind, L2R_CONNECT_IND);
125 PSENDX (CTRL, l2r_connect_ind);
126 }
127 else
128 {
129 mgt_l2r_connect_cnf(L2R_ACK);
130 }
131 }
132 }
133
134 /*
135 +------------------------------------------------------------------------------
136 | Function : sig_up_mgt_break_ind
137 +------------------------------------------------------------------------------
138 | Description : Process signal SIG_UP_MGT_BREAK_IND received from process DN.
139 |
140 | Parameters : T_DTI2_DATA_REQ *dti_data_req
141 |
142 |
143 | Return : -
144 +------------------------------------------------------------------------------
145 */
146
147 GLOBAL void sig_up_mgt_break_ind(T_DTI2_DATA_REQ *dti_data_req)
148 {
149 T_FLOW flow = FL_INVALID;
150
151 TRACE_FUNCTION ("sig_up_mgt_break_ind()");
152
153 PACCESS (dti_data_req);
154
155 if (GET_STATE (MGT) EQ MGT_CONNECTED)
156 {
157 switch (GET_STATE (BREAK))
158 {
159 case IW_WAIT:
160 break;
161 case IW_IDLE:
162 switch (dti_data_req->parameters.st_lines.st_flow)
163 {
164 case DTI_FLOW_ON:
165 flow = FL_INACTIVE;
166 break;
167 case DTI_FLOW_OFF:
168 flow = FL_ACTIVE;
169 break;
170 }
171 sig_mgt_dn_break_req();
172
173 sig_mgt_up_break_req
174 (
175 (UBYTE)(dti_data_req->parameters.st_lines.st_line_sa EQ DTI_SA_ON ? DTI_SA_ON : DTI_SA_OFF),
176 (UBYTE)(dti_data_req->parameters.st_lines.st_line_sb EQ DTI_SB_ON ? DTI_SB_ON : DTI_SB_OFF),
177 flow);
178
179 SET_STATE (BREAK, IW_WAIT);
180 }
181 }
182 }