comparison src/g23m-gprs/upm/upm_sndcp_output_handler.c @ 197:2cf312e56ee7

src/g23m-gprs/upm: import from LoCosto source
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 14 Oct 2016 01:21:46 +0000
parents
children
comparison
equal deleted inserted replaced
196:a04cde1fb771 197:2cf312e56ee7
1 /*----------------------------------------------------------------------------
2 | Project : 3G PS
3 | Module : UPM
4 +-----------------------------------------------------------------------------
5 | Copyright 2003 Texas Instruments.
6 | All rights reserved.
7 |
8 | This file is confidential and a trade secret of Texas
9 | Instruments .
10 | The receipt of or possession of this file does not convey
11 | any rights to reproduce or disclose its contents or to
12 | manufacture, use, or sell anything it may describe, in
13 | whole, or in part, without the specific written consent of
14 | Texas Instruments.
15 +-----------------------------------------------------------------------------
16 | Purpose: Output functions for primitives from UPM to the MM entity.
17 | For design details, see:
18 | 8010.939 UPM Detailed Specification
19 +---------------------------------------------------------------------------*/
20
21 /*==== DECLARATION CONTROL =================================================*/
22
23 /*==== INCLUDES ============================================================*/
24
25 #include "upm.h"
26
27 #include "upm_sndcp_output_handler.h"
28 #include "upm_mm_output_handler.h"
29 #ifndef UPM_WITHOUT_USER_PLANE
30 #include "upm_dti_output_handler.h"
31 #endif /* UPM_WITHOUT_USER_PLANE */
32
33 /*==== CONSTS ===============================================================*/
34
35 /*==== TYPES ================================================================*/
36
37 /*==== LOCALS ===============================================================*/
38
39 /*==== PUBLIC FUNCTIONS =====================================================*/
40
41 /*
42 +------------------------------------------------------------------------------
43 | Function : send_sn_activate_req
44 +------------------------------------------------------------------------------
45 | Description : Allocate, pack and send SN_ACTIVATE_REQ primitive.
46 |
47 | Parameters : ptr_context_data - context data
48 | active - active/passive establishment flag to SNDCP
49 +------------------------------------------------------------------------------
50 */
51 void send_sn_activate_req(struct T_CONTEXT_DATA *ptr_context_data,
52 T_NAS_comp_params *comp_params, BOOL active)
53 {
54 (void)TRACE_FUNCTION("send_sn_activate_req");
55
56 {
57 struct T_UPM_CONTEXT_DATA_GPRS *gprs_data = &ptr_context_data->gprs_data;
58 PALLOC(prim, SN_ACTIVATE_REQ);
59
60 /*lint -e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
61 prim->nsapi = ptr_context_data->nsapi;
62 prim->sapi = gprs_data->sndcp_llc_sapi;
63 prim->radio_prio = gprs_data->sndcp_radio_prio;
64 prim->snsm_qos.delay = gprs_data->sndcp_delay;
65 prim->snsm_qos.relclass = gprs_data->sndcp_relclass;
66 prim->snsm_qos.peak = gprs_data->sndcp_peak_bitrate;
67 prim->snsm_qos.preced = gprs_data->sndcp_preced;
68 prim->snsm_qos.mean = gprs_data->sndcp_mean;
69
70 prim->establish = (active ? (U8)SN_ACTIVE_ESTABLISHMENT :
71 (U8)SN_PASSIVE_ESTABLISHMENT);
72 if (comp_params != NULL)
73 {
74 memcpy(&prim->comp_params, comp_params, sizeof(T_NAS_comp_params));
75 } else {
76 memset(&prim->comp_params, 0, sizeof(T_NAS_comp_params));
77 }
78 prim->pkt_flow_id = (U16)gprs_data->pkt_flow_id;
79 /*lint +e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
80 (void)PSEND(hCommSNDCP, prim);
81 }
82 }
83
84 /*
85 +------------------------------------------------------------------------------
86 | Function : send_sn_count_req
87 +------------------------------------------------------------------------------
88 | Description : Allocate, pack and send SN_COUNT_REQ primitive.
89 |
90 | Parameters : nsapi - NSAPI
91 | reset - Reset indicator
92 +------------------------------------------------------------------------------
93 */
94 void send_sn_count_req(U8 nsapi, U8 reset)
95 {
96 (void)TRACE_FUNCTION("send_sn_count_req");
97
98 {
99 PALLOC(prim, SN_COUNT_REQ);
100 /*lint -e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
101 prim->nsapi = nsapi;
102 prim->reset = reset;
103
104 /*lint +e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
105 (void)PSEND(hCommSNDCP, prim);
106 }
107 }
108
109 /*
110 +------------------------------------------------------------------------------
111 | Function : send_sn_deactivate_req
112 +------------------------------------------------------------------------------
113 | Description : Allocate, pack and send SN_DEACTIVATE_REQ primitive.
114 |
115 | Parameters : nsapi - NSAPI to deactivate
116 | rel_ind - local release indicator for SNDCP
117 +------------------------------------------------------------------------------
118 */
119 void send_sn_deactivate_req(U8 nsapi, U8 rel_ind)
120 {
121 (void)TRACE_FUNCTION("send_sn_deactivate_req");
122
123 {
124 PALLOC(prim, SN_DEACTIVATE_REQ);
125 /*lint -e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
126 prim->nsapi = nsapi;
127 prim->rel_ind = rel_ind;
128 /*lint +e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
129 (void)PSEND(hCommSNDCP, prim);
130 }
131 }
132
133 /*
134 +------------------------------------------------------------------------------
135 | Function : send_sn_modify_req
136 +------------------------------------------------------------------------------
137 | Description : Allocate, pack and send SN_MODIFY_REQ primitive.
138 |
139 | Parameters : ptr_context_data - context data
140 +------------------------------------------------------------------------------
141 */
142 void send_sn_modify_req(struct T_CONTEXT_DATA *ptr_context_data)
143 {
144 (void)TRACE_FUNCTION("send_sn_modify_req");
145
146 {
147 struct T_UPM_CONTEXT_DATA_GPRS *gprs_data = &ptr_context_data->gprs_data;
148 PALLOC(prim, SN_MODIFY_REQ);
149
150 /*lint -e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
151 prim->nsapi = ptr_context_data->nsapi;
152 prim->sapi = gprs_data->sndcp_llc_sapi;
153 prim->radio_prio = gprs_data->sndcp_radio_prio;
154 prim->snsm_qos.delay = gprs_data->sndcp_delay;
155 prim->snsm_qos.relclass = gprs_data->sndcp_relclass;
156 prim->snsm_qos.peak = gprs_data->sndcp_peak_bitrate;
157 prim->snsm_qos.preced = gprs_data->sndcp_preced;
158 prim->snsm_qos.mean = gprs_data->sndcp_mean;
159 prim->pkt_flow_id = (U16)gprs_data->pkt_flow_id;
160 /*lint +e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
161 (void)PSEND(hCommSNDCP, prim);
162 }
163 }
164
165 /*
166 +------------------------------------------------------------------------------
167 | Function : send_sn_sequence_req
168 +------------------------------------------------------------------------------
169 | Description : Allocate, pack and send SN_SEQUENCE_REQ primitive.
170 |
171 | Parameters : mmpm_sequence_ind - MMPM primitive containing sequence numbers
172 +------------------------------------------------------------------------------
173 */
174 void send_sn_sequence_req(T_MMPM_SEQUENCE_IND *mmpm_sequence_ind)
175 {
176 U16 index;
177 (void)TRACE_FUNCTION("send_sn_sequence_req");
178
179 {
180 PALLOC(prim, SN_SEQUENCE_REQ);
181 /*lint -e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
182 prim->c_receive_no_list = mmpm_sequence_ind->c_npdu_list;
183
184 for (index = 0; index < (U16)mmpm_sequence_ind->c_npdu_list; index++)
185 {
186 prim->receive_no_list[index].nsapi = mmpm_sequence_ind->npdu_list[index].nsapi;
187 prim->receive_no_list[index].receive_no = mmpm_sequence_ind->npdu_list[index].receive_n_pdu_number_val;
188 }
189 /*lint +e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
190 (void)PSEND(hCommSNDCP, prim);
191 }
192 }
193
194 /*
195 +------------------------------------------------------------------------------
196 | Function : send_sn_get_pending_pdu_req
197 +------------------------------------------------------------------------------
198 | Description : Allocate, pack and send SN_GET_PENDING_PDU_REQ primitive.
199 |
200 | Parameters : None
201 +------------------------------------------------------------------------------
202 */
203 #ifdef TI_DUAL_MODE
204 void send_sn_get_pending_pdu_req(void)
205 {
206 (void)TRACE_FUNCTION("send_sn_get_pending_pdu_req");
207
208 {
209 PALLOC(prim, SN_GET_PENDING_PDU_REQ);
210
211 /*lint +e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
212 (void)PSEND(hCommSNDCP, prim);
213 }
214 }
215 #endif /* TI_DUAL_MODE */
216
217 /*==== END OF FILE ==========================================================*/