comparison src/g23m-gprs/sm/sm_upm_output_handler.c @ 183:219afcfc6250

src/g23m-gprs: initial import from TCS3.2/LoCosto
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 13 Oct 2016 04:24:13 +0000
parents
children
comparison
equal deleted inserted replaced
182:f02d0a0e1849 183:219afcfc6250
1 /*----------------------------------------------------------------------------
2 | Project : 3G PS
3 | Module : SM
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 SM to the UPM entity.
17 | For design details, see:
18 | 8010.908 SM Detailed Specification
19 +---------------------------------------------------------------------------*/
20
21 /*==== DECLARATION CONTROL =================================================*/
22
23 /*==== INCLUDES ============================================================*/
24
25 #include "sm.h"
26
27 #include "sm_upm_output_handler.h"
28 #include "sm_qos.h"
29
30 /*==== CONSTS ===============================================================*/
31
32 /*==== TYPES ================================================================*/
33
34 /*==== LOCALS ===============================================================*/
35
36 /*==== PUBLIC FUNCTIONS =====================================================*/
37
38 /*
39 +------------------------------------------------------------------------------
40 | Function : send_sm_activate_started_ind
41 +------------------------------------------------------------------------------
42 | Description : Allocate, pack and send SM_ACTIVATE_STARTED_IND primitive.
43 |
44 | Parameters : context - Pointer to context data
45 +------------------------------------------------------------------------------
46 */
47 void send_sm_activate_started_ind(struct T_SM_CONTEXT_DATA *context)
48 {
49 (void)TRACE_FUNCTION("send_sm_activate_started_ind");
50
51 {
52 PALLOC(prim, SM_ACTIVATE_STARTED_IND);
53
54 /*lint -e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
55 prim->nsapi = context->nsapi;
56 prim->rat = sm_get_current_rat();
57
58 (void)PSEND(hCommUPM, prim);
59 /*lint +e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
60 }
61 }
62
63 /*
64 +------------------------------------------------------------------------------
65 | Function : send_sm_activate_ind
66 +------------------------------------------------------------------------------
67 | Description : Allocate, pack and send SM_ACTIVATE_IND primitive.
68 |
69 | Parameters : context - Pointer to context data
70 +------------------------------------------------------------------------------
71 */
72 void send_sm_activate_ind(struct T_SM_CONTEXT_DATA *context)
73 {
74 (void)TRACE_FUNCTION("send_sm_activate_ind");
75
76 {
77 PALLOC(prim, SM_ACTIVATE_IND);
78
79 /*lint -e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
80 prim->nsapi = context->nsapi;
81 prim->sapi = context->sapi;
82 prim->radio_prio = context->radio_prio;
83 if (sm_is_pfi_included(context)) {
84 prim->pkt_flow_id = context->pfi;
85 } else {
86 prim->pkt_flow_id = (U8)PS_PKT_FLOW_ID_NOT_PRES;
87 }
88 sm_qos_copy_from_sm(&prim->qos, &context->accepted_qos, &prim->ctrl_qos);
89
90 if ((context->flags & SM_CONTEXT_FLAG_COMP_PARAMS) != (U8)0) {
91 prim->v_comp_params = (U8)TRUE;
92 memcpy(&prim->comp_params, &context->comp_params, sizeof(T_NAS_comp_params));
93 } else {
94 prim->v_comp_params = (U8)FALSE;
95 }
96
97 (void)PSEND(hCommUPM, prim);
98 /*lint +e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
99 }
100 }
101
102 /*
103 +------------------------------------------------------------------------------
104 | Function : send_sm_deactivate_ind
105 +------------------------------------------------------------------------------
106 | Description : Allocate, pack and send SM_DEACTIVATE_IND primitive.
107 |
108 | Parameters : context - Pointer to context data
109 +------------------------------------------------------------------------------
110 */
111 void send_sm_deactivate_ind(U16 nsapi_set, T_PS_rel_ind rel_ind)
112 {
113 (void)TRACE_FUNCTION("send_sm_deactivate_ind");
114
115 {
116 PALLOC(prim, SM_DEACTIVATE_IND);
117
118 /*lint -e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
119 prim->nsapi_set = nsapi_set;
120 prim->rel_ind = (U8)rel_ind;
121
122 (void)PSEND(hCommUPM, prim);
123 /*lint +e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
124 }
125 }
126
127 /*
128 +------------------------------------------------------------------------------
129 | Function : send_sm_modify_ind
130 +------------------------------------------------------------------------------
131 | Description : Allocate, pack and send SM_MODIFY_IND primitive.
132 |
133 | Parameters : context - Pointer to context data
134 +------------------------------------------------------------------------------
135 */
136 void send_sm_modify_ind(struct T_SM_CONTEXT_DATA *context)
137 {
138 (void)TRACE_FUNCTION("send_sm_modify_ind");
139
140 {
141 PALLOC(prim, SM_MODIFY_IND);
142
143 /*lint -e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
144 prim->nsapi = context->nsapi;
145 prim->sapi = context->sapi;
146 prim->radio_prio = context->radio_prio;
147 if (sm_is_pfi_included(context)) {
148 prim->pkt_flow_id = context->pfi;
149 } else {
150 prim->pkt_flow_id = (U8)PS_PKT_FLOW_ID_NOT_PRES;
151 }
152 sm_qos_copy_from_sm(&prim->qos, &context->accepted_qos, &prim->ctrl_qos);
153
154 (void)PSEND(hCommUPM, prim);
155 /*lint +e613 (Possible use of null pointer 'prim' in left argument to operator '->') */
156 }
157 }
158
159 /*==== END OF FILE ==========================================================*/