comparison src/g23m-gprs/sndcp/sndcp_pdp.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_pdp.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 primitives as described in
19 | the SDL-documentation (PD-statemachine)
20 +-----------------------------------------------------------------------------
21 */
22
23 #define ENTITY_SNDCP
24
25 /*==== INCLUDES =============================================================*/
26
27 #include "typedefs.h" /* to get Condat data types */
28 #include "vsi.h" /* to get a lot of macros */
29 #include "macdef.h"
30 #include "prim.h" /* to get the definitions of used SAP and directions */
31
32 #include "dti.h"
33
34 #include "sndcp.h" /* to get the global entity definitions */
35 #include "sndcp_f.h" /* to get the functions to access the global arrays*/
36
37 #include "sndcp_sds.h" /* to get the signals to sd. */
38
39
40 /*==== CONST ================================================================*/
41
42 /*==== LOCAL VARS ===========================================================*/
43
44 /*==== PRIVATE FUNCTIONS ====================================================*/
45
46 /*==== PUBLIC FUNCTIONS =====================================================*/
47
48
49
50 /*
51 +------------------------------------------------------------------------------
52 | Function : pd_ll_unitdata_ind
53 +------------------------------------------------------------------------------
54 | Description : Handles the primitive LL_UNITDATA_IND
55 |
56 | Parameters : *ll_unitdata_ind - Ptr to primitive payload
57 |
58 +------------------------------------------------------------------------------
59 */
60 GLOBAL void pd_ll_unitdata_ind ( T_LL_UNITDATA_IND *ll_unitdata_ind )
61 {
62 UBYTE sapi_index = 0;
63
64
65 #ifdef FLOW_TRACE
66 sndcp_trace_flow_control(FLOW_TRACE_SNDCP,
67 FLOW_TRACE_DOWN,
68 FLOW_TRACE_BOTTOM,
69 FALSE);
70 #endif
71 TRACE_FUNCTION( "pd_ll_unitdata_ind" );
72
73 /*
74 * set service instance according to sapi in primitive
75 */
76 sndcp_get_sapi_index(ll_unitdata_ind->sapi, &sapi_index);
77 sndcp_data->pd = & sndcp_data->pd_base[sapi_index];
78
79 switch( GET_STATE( PD ) )
80 {
81 case PD_DEFAULT:
82 #ifdef SNDCP_TRACE_ALL
83 TRACE_EVENT_P1("downlink at LL SAP: %d octets",
84 ll_unitdata_ind->sdu.l_buf >> 3);
85
86 sndcp_trace_sdu(& ll_unitdata_ind->sdu);
87
88 #endif
89 sig_pd_sd_unitdata_ind(ll_unitdata_ind);
90 break;
91 default:
92 TRACE_ERROR( "LL_UNITDATA_IND unexpected" );
93 if (ll_unitdata_ind != NULL) {
94 PFREE (ll_unitdata_ind);
95 }
96 break;
97 }
98
99 } /* pd_ll_unitdata_ind() */
100
101