comparison src/g23m-fad/rlp/rlp_rcvs.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 +-----------------------------------------------------------------------------
3 | Project : CSD (8411)
4 | Modul : Rlp_rcvs.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 | Radio Link Protocol of the base station
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef RLP_RCVS_C
24 #define RLP_RCVS_C
25 #endif
26
27 #define ENTITY_RLP
28
29 /*==== INCLUDES ===================================================*/
30
31 #include <string.h>
32 #include "typedefs.h"
33 #include "vsi.h"
34 #include "macdef.h"
35 #include "custom.h"
36 #include "gsm.h"
37 #include "cus_rlp.h"
38 #include "prim.h"
39 #include "tok.h"
40 #include "rlp.h"
41
42 /*==== COnsT =======================================================*/
43
44 /*==== TYPES =======================================================*/
45
46 /*==== VAR EXPORT ==================================================*/
47
48 /*==== VAR LOCAL ===================================================*/
49
50 /*==== FUNCTIONS ===================================================*/
51
52 LOCAL void sig_rcv_ker_ui_ind(void)
53 {
54 TRACE_FUNCTION ("sig_rcv_ker_ui_ind()");
55
56 switch (GET_STATE (KER))
57 {
58 case RLP_ADM_AND_DETACHED:
59 /*
60 * processing for state RLP_ADM_AND_DETACHED
61 */
62 break;
63
64 default:
65 {
66 #ifdef _TARGET_
67 USHORT sduSize = rlp_data->ker.FrameSize<<3;
68 #else
69 USHORT sduSize = (rlp_data->ker.FrameSize + 3)<<3;
70 #endif
71 /*
72 * processing for any other kernel state
73 */
74 PALLOC_SDU (rlp_ui_ind, RLP_UI_IND, sduSize);
75
76 rlp_ui_ind->sdu.o_buf = 0;
77 rlp_ui_ind->sdu.l_buf = sduSize;
78
79 ker_copy_frame_to_sdu
80 (
81 rbm_get_current_frame (),
82 &rlp_ui_ind->sdu
83 );
84 /*
85 * clear the RLP header
86 */
87 memset (&rlp_ui_ind->sdu.buf[0], 0, HEADER_LEN); /*lint !e419 ( Apparent data overrun for function 'memset')*/
88
89 #ifdef _SIMULATION_ /* for test purpose clear the CRC trailer */
90 memset (&rlp_ui_ind->sdu.buf[(sduSize>>3)-3], 0, 3);
91 #endif
92
93 PSENDX (L2R, rlp_ui_ind);
94 break;
95 }
96 }
97 }
98
99 /*
100 +------------------------------------------------------------------------------
101 | Function : sig_ker_rcv_rawdata_res
102 +------------------------------------------------------------------------------
103 | Description : Process signal SIG_RAWDATA_RES received
104 | from process kernel.
105 |
106 |
107 | Parameters : pduType -
108 | cBit -
109 | pFBit -
110 | nr -
111 | ns -
112 | crc -
113 |
114 |
115 | Return : -
116 +------------------------------------------------------------------------------
117 */
118
119
120 GLOBAL void sig_ker_rcv_rawdata_res
121 (
122 T_PDU_TYPE pduType,
123 T_BIT cBit,
124 T_BIT pFBit,
125 T_FRAME_NUM nr,
126 T_FRAME_NUM ns,
127 BOOL crc
128 )
129 {
130 TRACE_FUNCTION ("sig_ker_rcv_rawdata_res()");
131
132 if (GET_STATE(RCV) NEQ RPDU_WAIT_FOR_A_BLOCK OR crc EQ FALSE)
133 return;
134
135 switch (pduType)
136 {
137 case PDU_SABM:
138 if (cBit NEQ 0 AND pFBit NEQ 0)
139 sig_rcv_ker_sabm_ind ();
140 break;
141
142 case PDU_DISC:
143 if (cBit NEQ 0)
144 sig_rcv_ker_disc_ind (pFBit);
145 break;
146
147 case PDU_UA:
148 if (cBit EQ 0)
149 sig_rcv_ker_ua_ind (pFBit);
150 break;
151
152 case PDU_DM:
153 if (cBit EQ 0)
154 sig_rcv_ker_dm_ind (pFBit);
155 break;
156
157 case PDU_TEST:
158 sig_rcv_ker_test_ind (cBit, pFBit);
159 break;
160
161 case PDU_XID:
162 sig_rcv_ker_xid_ind (cBit, pFBit);
163 break;
164
165 case PDU_UI:
166 sig_rcv_ker_ui_ind ();
167 break;
168
169 case PDU_RR_I:
170 sig_rcv_ker_rr_i_ind (cBit, pFBit, nr, ns);
171 break;
172
173 case PDU_RNR_I:
174 sig_rcv_ker_rnr_i_ind (cBit, pFBit, nr, ns);
175 break;
176
177 case PDU_SREJ_I:
178 sig_rcv_ker_srej_i_ind (cBit, pFBit, nr, ns);
179 break;
180
181 case PDU_REJ_I:
182 sig_rcv_ker_rej_i_ind (cBit, pFBit, nr, ns);
183 break;
184
185 case PDU_RR:
186 sig_rcv_ker_rr_ind (cBit, pFBit, nr);
187 break;
188
189 case PDU_RNR:
190 sig_rcv_ker_rnr_ind (cBit, pFBit, nr);
191 break;
192
193 case PDU_SREJ:
194 sig_rcv_ker_srej_ind (cBit, pFBit, nr);
195 break;
196
197 case PDU_REJ:
198 sig_rcv_ker_rej_ind (cBit, pFBit, nr);
199 break;
200
201 case PDU_REMAP:
202 if (cBit EQ 0 AND pFBit EQ 0)
203 sig_rcv_ker_remap_ind ();
204 break;
205
206 default: /* ignore block */
207 break;
208 }
209 }