FreeCalypso > hg > fc-magnetite
comparison src/g23m-gprs/upm/upm_sm_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 SM 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 /*==== CONSTS ===============================================================*/ | |
28 | |
29 /*==== TYPES ================================================================*/ | |
30 | |
31 /*==== LOCALS ===============================================================*/ | |
32 | |
33 /*==== PUBLIC FUNCTIONS =====================================================*/ | |
34 | |
35 /* | |
36 +------------------------------------------------------------------------------ | |
37 | Function : send_sm_activate_res | |
38 +------------------------------------------------------------------------------ | |
39 | Description : Allocate, pack and send SM_ACTIVATE_RES primitive. | |
40 | | |
41 | Parameters : ptr_context_data - Pointer to context data | |
42 +------------------------------------------------------------------------------ | |
43 */ | |
44 | |
45 void send_sm_activate_res(struct T_CONTEXT_DATA *ptr_context_data, void* data) | |
46 { | |
47 (void)TRACE_FUNCTION("send_sm_activate_res"); | |
48 | |
49 { | |
50 PALLOC(prim, SM_ACTIVATE_RES); | |
51 | |
52 prim->nsapi = ptr_context_data->nsapi; | |
53 | |
54 if (data == NULL) /*Possible for UMTS*/ | |
55 { | |
56 prim->v_comp_params = (U8)FALSE; | |
57 } else { | |
58 if( (((T_SN_ACTIVATE_CNF*)data)->comp_params.dcomp != 0) || | |
59 (((T_SN_ACTIVATE_CNF*)data)->comp_params.hcomp != 0) ) | |
60 { | |
61 prim->v_comp_params = (U8)TRUE; | |
62 prim->comp_params.dcomp = ((T_SN_ACTIVATE_CNF*)data)->comp_params.dcomp; | |
63 prim->comp_params.hcomp = ((T_SN_ACTIVATE_CNF*)data)->comp_params.hcomp; | |
64 prim->comp_params.msid = ((T_SN_ACTIVATE_CNF*)data)->comp_params.msid; | |
65 } else { | |
66 prim->v_comp_params = (U8)FALSE; | |
67 } | |
68 } | |
69 | |
70 (void)PSEND(hCommSM, prim); | |
71 } | |
72 } | |
73 | |
74 /* | |
75 +------------------------------------------------------------------------------ | |
76 | Function : send_sm_modify_res | |
77 +------------------------------------------------------------------------------ | |
78 | Description : Allocate, pack and send SM_MODIFY_RES primitive. | |
79 | | |
80 | Parameters : ptr_context_data - Pointer to context data | |
81 +------------------------------------------------------------------------------ | |
82 */ | |
83 void send_sm_modify_res(struct T_CONTEXT_DATA *ptr_context_data) | |
84 { | |
85 (void)TRACE_FUNCTION("send_sm_modify_res"); | |
86 | |
87 { | |
88 PALLOC(prim, SM_MODIFY_RES); | |
89 | |
90 /*lint !e613 (Warning -- Possible use of null pointer) */ | |
91 prim->nsapi = ptr_context_data->nsapi; | |
92 | |
93 (void)PSEND(hCommSM, prim); | |
94 } | |
95 } | |
96 | |
97 /* | |
98 +------------------------------------------------------------------------------ | |
99 | Function : send_sm_deactivate_res | |
100 +------------------------------------------------------------------------------ | |
101 | Description : Allocate, pack and send SM_DEACTIVATE_RES primitive. | |
102 | | |
103 | Parameters : ptr_context_data - Pointer to context data | |
104 +------------------------------------------------------------------------------ | |
105 */ | |
106 void send_sm_deactivate_res(U16 nsapi_set) | |
107 { | |
108 (void)TRACE_FUNCTION("send_sm_deactivate_res"); | |
109 | |
110 { | |
111 PALLOC(prim, SM_DEACTIVATE_RES); | |
112 | |
113 prim->nsapi_set = nsapi_set; | |
114 | |
115 (void)PSEND(hCommSM, prim); | |
116 } | |
117 } | |
118 | |
119 /* | |
120 +------------------------------------------------------------------------------ | |
121 | Function : send_sm_status_req | |
122 +------------------------------------------------------------------------------ | |
123 | Description : Allocate, pack and send SM_STATUS_REQ primitive. | |
124 | | |
125 | Parameters : ptr_context_data - Pointer to context data | |
126 +------------------------------------------------------------------------------ | |
127 */ | |
128 void send_sm_status_req(U16 nsapi_set, T_PS_sapi llc_sapi, | |
129 T_CAUSE_ctrl_value ctrl, U16 cause) | |
130 { | |
131 (void)TRACE_FUNCTION("send_sm_status_req"); | |
132 | |
133 { | |
134 PALLOC(prim, SM_STATUS_REQ); | |
135 | |
136 prim->nsapi_set = nsapi_set; | |
137 prim->sapi = (U8)llc_sapi; | |
138 prim->ps_cause.ctrl_value = ctrl; | |
139 prim->ps_cause.value.upm_cause = cause; | |
140 | |
141 (void)PSEND(hCommSM, prim); | |
142 } | |
143 } |