comparison src/g23m-gprs/llc/llc_t200p.c @ 1:fa8dc04885d8

src/g23m-*: import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:25:50 +0000
parents
children
comparison
equal deleted inserted replaced
0:4e78acac3d88 1:fa8dc04885d8
1 /*
2 +-----------------------------------------------------------------------------
3 | Project :
4 | Modul :
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 LLC and implements all
18 | functions to handles the incoming primitives as described in
19 | the SDL-documentation (T200-statemachine)
20 +-----------------------------------------------------------------------------
21 */
22
23 #ifndef LLC_T200P_C
24 #define LLC_T200P_C
25 #endif
26
27 #define ENTITY_LLC
28
29 /*==== INCLUDES =============================================================*/
30
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 "cnf_llc.h" /* to get cnf-definitions */
37 #include "mon_llc.h" /* to get mon-definitions */
38 #include "prim.h" /* to get the definitions of used SAP and directions */
39 #include "llc.h" /* to get the global entity definitions */
40
41 #include "llc_t200f.h" /* to get local T200 functions */
42 #include "llc_us.h" /* to get signal interface to U */
43 #include "llc_f.h" /* to get llc functions */
44
45 /*==== CONST ================================================================*/
46
47 /*==== LOCAL VARS ===========================================================*/
48
49 /*==== PRIVATE FUNCTIONS ====================================================*/
50
51 /*==== PUBLIC FUNCTIONS =====================================================*/
52
53
54
55 /*
56 +------------------------------------------------------------------------------
57 | Function : t200_timer_t200
58 +------------------------------------------------------------------------------
59 | Description : Handles expiry of timer T200. This function is called from
60 | pei_primitive().
61 |
62 | Parameters : sapi - indicates the SAPI for which the timer has expired
63 |
64 +------------------------------------------------------------------------------
65 */
66 GLOBAL void t200_timer_t200 (UBYTE sapi)
67 {
68 #ifndef LL_DESC
69 T_LL_UNITDATA_REQ *frame;
70 #else
71 T_LL_UNITDESC_REQ *frame;
72 #endif
73 UBYTE cause;
74 T_SERVICE originator;
75
76 TRACE_FUNCTION( "t200_timer_t200" );
77
78 /*
79 * Switch all service incarnations of LLC according to sapi.
80 */
81 SWITCH_LLC (sapi);
82
83 switch (GET_STATE(T200))
84 {
85 case T200_RUNNING:
86 SET_STATE (T200, T200_RESET);
87
88 /*
89 * No frame with P bit set to 1 is currently outstanding
90 */
91 llc_data->sapi->pbit_outstanding = FALSE;
92
93 /*
94 * Get associated timer data (frame, cause, originating service)
95 * and send T200 expired signal, if originator is set. Otherwise
96 * just PFREE the frame.
97 */
98 t200_get_timer_data (&frame, &cause, &originator);
99 if (originator EQ SERVICE_U)
100 {
101 TRACE_0_INFO("T200 expired");
102 sig_t200_u_expired_ind (frame, cause, EXPIRY_TIMED);
103 }
104 else
105 {
106 TRACE_0_INFO("T200 expired, no service associated, frame discarded");
107 #ifdef LL_DESC
108 /*
109 * The descriptor contents of the primitive structure
110 * must be freed as well.
111 */
112 llc_cl_desc3_free((T_desc3*)llc_data->t200->frame->desc_list3.first);
113 #endif /* LL_DESC */
114 PFREE (frame);
115 }
116 break;
117
118 default:
119 t200_get_timer_data (&frame, &cause, &originator);
120 if (frame != NULL)
121 {
122 #ifdef LL_DESC
123 /*
124 * The descriptor contents of the primitive structure
125 * must be freed as well.
126 */
127 llc_cl_desc3_free((T_desc3*)llc_data->t200->frame->desc_list3.first);
128 #endif /* LL_DESC */
129 PFREE (frame);
130 }
131 TRACE_ERROR( "T200 unexpected" );
132 break;
133 }
134
135 } /* t200_timer_t200() */
136