comparison src/g23m-gprs/gmm/gmm_txp.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 +-----------------------------------------------------------------------------
3 | Project : GPRS (8441)
4 | Modul : gmm_txp.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 is part of the entity GMM and implements all
18 | functions to handles the incoming primitives as described in
19 | the SDL-documentation (TX-statemachine)
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef GMM_TXP_C
24 #define GMM_TXP_C
25 #endif
26
27 #define ENTITY_GMM
28
29 /*==== INCLUDES =============================================================*/
30 #include <string.h> /* to get memcpy */
31 #include "typedefs.h" /* to get Condat data types */
32 #include "vsi.h" /* to get a lot of macros */
33 #include "macdef.h"
34 #include "gprs.h"
35 #include "gsm.h" /* to get a lot of macros */
36 #include "ccdapi.h" /* to get CCD API */
37 #include "cnf_gmm.h" /* to get cnf-definitions */
38 #include "mon_gmm.h" /* to get mon-definitions */
39 #include "prim.h" /* to get the definitions of used SAP and directions */
40 #include "gmm.h" /* to get the global entity definitions */
41 #include "gmm_txf.h" /* to get the local funktions */
42
43 /*==== CONST ================================================================*/
44
45 /*==== LOCAL VARS ===========================================================*/
46
47 /*==== PRIVATE FUNCTIONS ====================================================*/
48
49 /*==== PUBLIC FUNCTIONS =====================================================*/
50
51
52
53 /*
54 +------------------------------------------------------------------------------
55 | Function : tx_gmmsm_unitdata_req
56 +------------------------------------------------------------------------------
57 | Description : Handles the primitive GMMSM_UNITDATA_REQ
58 |
59 | Parameters : *gmmsm_unitdata_req - Ptr to primitive payload
60 |
61 +------------------------------------------------------------------------------
62 */
63 #ifdef GMM_TCS4
64 GLOBAL void tx_gmmsm_unitdata_req ( T_MMPM_UNITDATA_REQ* gmmsm_unitdata_req )
65 #else
66 GLOBAL void tx_gmmsm_unitdata_req ( T_GMMSM_UNITDATA_REQ* gmmsm_unitdata_req )
67 #endif
68 {
69 GMM_TRACE_FUNCTION( "tx_gmmsm_unitdata_req" );
70
71
72 switch( GET_STATE( TX ) )
73 {
74 case TX_READY:
75 {
76 /*
77 * The messages from SM are passed to LLC
78 */
79 /*
80 * PPASS (gmmsm_unitdata_req, ll_unitdata_req, LL_UNITDATA_REQ );
81 * is not possible, because of different parameters
82 */
83 PALLOC_SDU ( ll_unitdata_req, LL_UNITDATA_REQ, gmmsm_unitdata_req->sdu.l_buf);
84
85
86 tx_fill_unitdata_req ( ll_unitdata_req, LOCAL_TLLI, gmm_data->cipher );
87 memcpy (&ll_unitdata_req->sdu.buf[(ll_unitdata_req->sdu.o_buf)>>3],
88 &gmmsm_unitdata_req->sdu.buf[(gmmsm_unitdata_req->sdu.o_buf)>>3],
89 (gmmsm_unitdata_req->sdu.l_buf)>>3);
90
91
92
93 #ifdef TRACE_EVE
94 #ifndef GMM_TCS4
95 switch ( ll_unitdata_req->sdu.buf[((ll_unitdata_req->sdu.o_buf)>>3)+1])
96 {
97 case ACTIVATE_PDP_REQ:
98 TRACE_EVENT ( "OPar: ACTIVATE_PDP_REQ");break;
99 case ACTIVATE_PDP_ACC:
100 TRACE_EVENT ( "OPar: ACTIVATE_PDP_ACC");break;
101 case ACTIVATE_PDP_REJ:
102 TRACE_EVENT ( "OPar: ACTIVATE_PDP_REJ");break;
103 case REQ_PDP_ACT:
104 TRACE_EVENT ( "OPar: REQ_PDP_ACT");break;
105 case REQ_PDP_ACT_REJ:
106 TRACE_EVENT ( "OPar: REQ_PDP_ACT_REJ");break;
107 case MOD_PDP_REQ:
108 TRACE_EVENT ( "OPar: MOD_PDP_REQ");break;
109 case MOD_PDP_ACC:
110 TRACE_EVENT ( "OPar: MOD_PDP_ACC");break;
111 case DEACT_PDP_REQ:
112 TRACE_EVENT ( "OPar: DEACT_PDP_REQ");break;
113 case DEACT_PDP_ACC:
114 TRACE_EVENT ( "OPar: DEACT_PDP_ACC");break;
115 case SM_STATUS:
116 TRACE_EVENT ( "OPar: SM_STATUS");break;
117 default:
118 TRACE_EVENT ( "OPar: SNDCP unknown");break;
119 }
120 #else /*#ifndef GMM_TCS4*/
121 switch ( ll_unitdata_req->sdu.buf[((ll_unitdata_req->sdu.o_buf)>>3)+1])
122 {
123 case ACTIVATE_PDP_CONTEXT_REQUEST:
124 TRACE_EVENT ( "OPar: ACTIVATE_PDP_CONTEXT_REQUEST");break;
125 case ACTIVATE_PDP_CONTEXT_ACCEPT:
126 TRACE_EVENT ( "OPar: ACTIVATE_PDP_CONTEXT_ACCEPT");break;
127 case ACTIVATE_PDP_CONTEXT_REJECT:
128 TRACE_EVENT ( "OPar: ACTIVATE_PDP_CONTEXT_REJECT");break;
129 case REQUEST_PDP_CONTEXT_ACTIVATION:
130 TRACE_EVENT ( "OPar: REQUEST_PDP_CONTEXT_ACTIVATION");break;
131 case REQUEST_PDP_CONTEXT_ACTIVATION_REJECT:
132 TRACE_EVENT ( "OPar: REQUEST_PDP_CONTEXT_ACTIVATION_REJECT");break;
133 case U_MODIFY_PDP_CONTEXT_REQUEST:
134 TRACE_EVENT ( "OPar: U_MODIFY_PDP_CONTEXT_REQUEST");break;
135 case U_MODIFY_PDP_CONTEXT_ACCEPT:
136 TRACE_EVENT ( "OPar: U_MODIFY_PDP_CONTEXT_ACCEPT");break;
137 case DEACTIVATE_PDP_CONTEXT_REQUEST:
138 TRACE_EVENT ( "OPar: DEACTIVATE_PDP_CONTEXT_REQ");break;
139 case DEACTIVATE_PDP_CONTEXT_ACCEPT:
140 TRACE_EVENT ( "OPar: DEACTIVATE_PDP_CONTEXT_ACCEPT");break;
141 case SM_STATUS:
142 TRACE_EVENT ( "OPar: SM_STATUS");break;
143 default:
144 TRACE_EVENT ( "OPar: SNDCP unknown");break;
145 }
146 #endif /*#ifndef GMM_TCS4*/
147 #endif /* _SIMULATION_ */
148
149 PSEND ( hCommLLC, ll_unitdata_req );
150 PFREE ( gmmsm_unitdata_req );
151 break;
152 }
153 default:
154 PFREE (gmmsm_unitdata_req);
155 TRACE_ERROR( "GMMSM_UNITDATA_REQ unexpected" );
156 break;
157 }
158
159 } /* tx_gmmsm_unitdata_req() */