comparison src/g23m-gprs/sndcp/sndcp_mgs.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 : sndcp_mgs.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 SNDCP and implements all
18 | functions to handles the incoming process internal signals as
19 | described in the SDL-documentation (MG-statemachine)
20 +-----------------------------------------------------------------------------
21 */
22
23 /*---- HISTORY --------------------------------------------------------------*/
24
25 #define ENTITY_SNDCP
26
27 /*==== INCLUDES =============================================================*/
28
29 #include "typedefs.h" /* to get Condat data types */
30 #include "vsi.h" /* to get a lot of macros */
31 #include "macdef.h"
32 #include "gsm.h" /* to get a lot of macros */
33 #include "prim.h" /* to get the definitions of used SAP and directions */
34
35 #include "dti.h"
36
37 #include "sndcp.h" /* to get the global entity definitions */
38 #include "sndcp_f.h" /* to get the functions to access the global arrays*/
39
40 #include "sndcp_nus.h" /* to get the internal signals to service nu */
41 #include "sndcp_nds.h" /* to get the internal signals to service nd */
42 #include "sndcp_sdas.h" /* to get the internal signals to service sda */
43 #include "sndcp_sus.h" /* to get the internal signals to service su */
44 #include "sndcp_suas.h" /* to get the internal signals to service sua */
45 #include "sndcp_mgf.h" /* to get the functions for mg service */
46
47
48 /*==== CONST ================================================================*/
49
50 /*==== LOCAL VARS ===========================================================*/
51
52 /*==== PRIVATE FUNCTIONS ====================================================*/
53
54 /*==== PUBLIC FUNCTIONS =====================================================*/
55
56
57 /*
58 +------------------------------------------------------------------------------
59 | Function : sig_sda_mg_re_est
60 +------------------------------------------------------------------------------
61 | Description : Handles the internal signal SIG_SDA_MG_RE_EST
62 |
63 | Parameters : UBYTE sapi: the affected SAPI
64 |
65 +------------------------------------------------------------------------------
66 */
67 GLOBAL void sig_sda_mg_re_est (UBYTE sapi, UBYTE nsapi)
68 {
69 UBYTE sapi_index = 0;
70
71 TRACE_ISIG( "sig_sda_mg_re_est" );
72
73 switch( GET_STATE( MG ) )
74 {
75 case MG_DEFAULT:
76 {
77 PALLOC_SDU(ll_establish_req,
78 LL_ESTABLISH_REQ,
79 SNDCP_XID_BLOCK_BIT_LEN);
80
81 ll_establish_req->sapi = sapi;
82 /*
83 * Set the establishment states of sapi, nsapi.
84 */
85 sndcp_set_sapi_state(sapi, MG_EST);
86 /*
87 * Data transfer on SAPI is completely suspended
88 */
89 sig_mg_su_suspend(sapi);
90 sig_mg_sua_suspend(sapi);
91 mg_suspend_affected_nus(sapi);
92 /*
93 * Fill the XID block. Implementation dependent.
94 */
95 sndcp_get_sapi_index(sapi, &sapi_index);
96 mg_set_xid_params(ll_establish_req->sapi,
97 &ll_establish_req->sdu,
98 sndcp_data->mg.req_xid_block[sapi_index]);
99 /*
100 * Send prim to LLC.
101 */
102 sig_mg_sda_start_est(sapi);
103
104 PSEND(hCommLLC, ll_establish_req);
105
106 }
107
108 break;
109 default:
110 TRACE_ERROR( "SIG_SDA_MG_RE_EST unexpected" );
111 break;
112 }
113 } /* sig_sda_mg_re_est() */
114
115
116 /*
117 +------------------------------------------------------------------------------
118 | Function : sig_nd_mg_rec_no
119 +------------------------------------------------------------------------------
120 | Description : Handles the internal signal SIG_ND_MG_REC_NO
121 |
122 | Parameters : nsapi, receive npdu number
123 |
124 +------------------------------------------------------------------------------
125 */
126 GLOBAL void sig_nd_mg_rec_no (UBYTE nsapi, UBYTE npdu_number)
127 {
128
129 TRACE_ISIG( "sig_nd_mg_rec_no" );
130
131 switch( GET_STATE( MG ) )
132 {
133 case MG_DEFAULT:
134 TRACE_EVENT_P1( " SEQ_RES rec_no: %d", npdu_number);
135 sig_mg_nd_resume(nsapi);
136 sig_mg_nu_resume(nsapi);
137 {
138 #ifndef SNDCP_UPM_INCLUDED
139 PALLOC(snsm_sequence_res, SNSM_SEQUENCE_RES);
140 snsm_sequence_res->nsapi = nsapi;
141 snsm_sequence_res->rec_no = npdu_number;
142 PSEND(hCommSM, snsm_sequence_res);
143 #endif /* #ifdef SNDCP_UPM_INCLUDED */
144
145 }
146 break;
147 default:
148 TRACE_ERROR( "SIG_ND_MG_REC_NO unexpected" );
149 break;
150 }
151 } /* sig_nd_mg_rec_no() */
152
153
154