annotate src/g23m-gsm/l1/l1_pei.c @ 104:27a4235405c6

src/g23m-gsm: import from LoCosto source
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 04 Oct 2016 18:24:05 +0000
parents
children 267cefdca4b6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
104
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 +-----------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 | Project :
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 | Modul :
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 +-----------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 | Copyright 2002 Texas Instruments Berlin, AG
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 | All rights reserved.
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 | This file is confidential and a trade secret of Texas
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 | Instruments Berlin, AG
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 | The receipt of or possession of this file does not convey
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 | any rights to reproduce or disclose its contents or to
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 | manufacture, use, or sell anything it may describe, in
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 | whole, or in part, without the specific written consent of
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 | Texas Instruments Berlin, AG.
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 +-----------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 | Purpose : This module implements the process body interface
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 | for the entity L1.
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 +-----------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 #define L1_PEI_C
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 #define ENTITY_L1
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 #define CUST_OS_C
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 /*==== INCLUDES =============================================================*/
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 #if 1
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 #include <string.h>
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 #if defined (NEW_FRAME)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 #include "typedefs.h" /* to get Condat data types */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 #else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 #include "stddefs.h" /* to get Condat data types */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 #include "vsi.h" /* to get a lot of macros */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 #include "custom.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 #ifdef GPRS
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 #include "macdef.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 #include "gprs.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 #include "gsm.h" /* to get a lot of macros */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 #include "prim.h" /* to get the definitions of used SAP and directions */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 #include "pei.h" /* to get PEI interface */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 #include "tools.h" /* to get common tools */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 #include "l1.h" /* to get the global entity definitions */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 #include "cust_os.h" /* to get cust_os definitions */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 #else /* 1 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 #if defined NEW_FRAME
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 #include <string.h>
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 #include <stdio.h>
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 #include "typedefs.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 #include "pconst.cdg"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 #include "mconst.cdg"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 #include "message.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 #include "ccdapi.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 #include "vsi.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 #include "custom.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 #include "gsm.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 #include "prim.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 #include "cnf_l1.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 #include "mon_l1.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 #include "cus_l1.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 #include "pei.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 #include "tok.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 #include "l1.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 #else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 #include <string.h>
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 #include <stdio.h>
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 #include "stddefs.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 #include "pconst.cdg"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 #include "mconst.cdg"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 #include "message.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 #include "ccdapi.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 #include "custom.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 #include "gsm.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 #include "prim.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 #include "cnf_l1.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 #include "mon_l1.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 #include "vsi.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 #include "pei.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 #include "tok.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 #include "l1.h"
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 #endif /* 1 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 /*==== CONSTS ================================================================*/
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 /*==== TYPES =================================================================*/
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 typedef struct
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 char *version;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 } T_MONITOR;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 /*==== LOCALS ================================================================*/
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 static T_MONITOR l1_mon;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 static USHORT first_access = TRUE;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 /*==== PROTOTYPES ============================================================*/
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 SHORT pei_create (T_PEI_INFO **info);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 void l1_create_ISR (void);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 void l1a_task(unsigned arcg, void *argv);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 /*==== PRIVATE FUNCTIONS =====================================================*/
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 /*
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 | Function : pei_primitive
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 | Description : Process protocol specific primitive.
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 | Parameters : prim - pointer to the received primitive
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 | Return : PEI_OK - function succeeded
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 | PEI_ERROR - function failed
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 | |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 PL PPC(GPRS only) UPLINK
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 | |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132 +------v-----------v-------+
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 | |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 | L1 ASYNC |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 | |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 +-------------^------------+
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 L1 SYNC DOWNLINK
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 #if defined (NEW_FRAME)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143 LOCAL SHORT pei_primitive (void * ptr)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 #else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 EXPORT T_PEI_RETURN pei_primitive (T_PRIM * prim)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 #if defined (NEW_FRAME)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 T_PRIM *prim = (T_PRIM*)ptr;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 USHORT opc = prim->custom.opc;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 /*
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 * primitive is not a GSM primitive - forward it to the environment
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 if (opc & SYS_MASK)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 vsi_c_primitive (VSI_CALLER prim);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159 else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161 PFREE (P2D(prim));
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 return PEI_ERROR;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 return PEI_OK;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 /*
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 | Function : pei_init
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172 | Description : Initialize Protocol Stack Entity
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 | Parameters : handle - task handle
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 | Return : PEI_OK - entity initialised
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 | PEI_ERROR - entity not (yet) initialised
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 #if defined (NEW_FRAME)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 LOCAL SHORT pei_init ( T_HANDLE Handle )
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 #else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 T_PEI_RETURN pei_init (void)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 #if defined (NEW_FRAME)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 L1_Handle = Handle;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192 #ifdef TI_PS_HCOMM_CHANGE
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193 #ifdef NEW_FRAME
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 if ( first_access == TRUE )
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 first_access = FALSE;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 _osx_init();
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201 if (!cl_hcom_all_handles_open()) return PEI_ERROR;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 #ifdef NEW_FRAME
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 _osx_open (VSI_CALLER L1_QUEUE, _hCommL1);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 _osx_open (VSI_CALLER DL_QUEUE, _hCommPL);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 _osx_open (VSI_CALLER RR_QUEUE, _hCommPL);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209 _osx_open (VSI_CALLER GPF_ACI_QUEUE, _hCommMMI);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 #else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211 #ifdef NEW_FRAME
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 if ( first_access == TRUE )
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 first_access = FALSE;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215 _osx_init();
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 /*
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218 * Associate own "queue" handle (a task handle in the end) with L1_QUEUE,
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219 * in order to be able to receive primitives.
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221 if (hCommL1 < VSI_OK)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223 if ((hCommL1 = vsi_c_open (VSI_CALLER L1_NAME)) < VSI_OK)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224 return PEI_ERROR;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225 _osx_open (VSI_CALLER L1_QUEUE, hCommL1);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229 if (hCommPL < VSI_OK)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231 if ((hCommPL = vsi_c_open (VSI_CALLER PL_NAME)) < VSI_OK)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232 return PEI_ERROR;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233 _osx_open (VSI_CALLER DL_QUEUE, hCommPL);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234 _osx_open (VSI_CALLER RR_QUEUE, hCommPL);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237 if (hCommACI < VSI_OK)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239 if ((hCommACI = vsi_c_open (VSI_CALLER ACI_NAME)) < VSI_OK)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240 return PEI_ERROR;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241 _osx_open (VSI_CALLER GPF_ACI_QUEUE, hCommACI);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243 #endif /* TI_PS_HCOMM_CHANGE */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245 #ifdef GPRS
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246 if (hCommGRR < VSI_OK)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 if ((hCommGRR = vsi_c_open (VSI_CALLER GRR_NAME)) < VSI_OK)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249 return PEI_ERROR;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250 _osx_open (VSI_CALLER GRR_QUEUE, hCommGRR);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253 if (hCommLLC < VSI_OK)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255 if ((hCommLLC = vsi_c_open (VSI_CALLER LLC_NAME)) < VSI_OK)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256 return PEI_ERROR;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257 _osx_open (VSI_CALLER LLC_QUEUE, hCommLLC);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
260 if (hCommSNDCP < VSI_OK)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262 if ((hCommSNDCP = vsi_c_open (VSI_CALLER SNDCP_NAME)) < VSI_OK)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263 return PEI_ERROR;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
264 _osx_open (VSI_CALLER SNDCP_QUEUE, hCommSNDCP);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
265 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
266 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
267
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
268 /*
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
269 * Register VSI_CALLER as generic caller entity.
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
270 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271 _osx_open (VSI_CALLER 0, 0);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
272
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
273 l1_create_ISR ();
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
274
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
275 return PEI_OK;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
276 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
277
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
278 /*
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
279 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
280 | Function : pei_timeout
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
281 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
282 | Description : Process timeout.
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
283 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
284 | Parameters : index - timer index
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
285 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
286 | Return : PEI_OK - timeout processed
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
287 | PEI_ERROR - timeout not processed
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
288 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
289 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
290 #if !defined (NEW_FRAME)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
291
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
292 T_PEI_RETURN l1_pei_timeout (T_VSI_THANDLE handle)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
293 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
294 TRACE_FUNCTION ("pei_timeout()")
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
295
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
296 return PEI_OK;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
297 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
298
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
299 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
300
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
301 /*
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
302 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
303 | Function : pei_exit
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
304 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
305 | Description : Close Resources and terminate.
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
306 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
307 | Parameters : -
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
308 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
309 | Return : PEI_OK - exit sucessful
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
310 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
311 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
312 #if defined (NEW_FRAME)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
313 LOCAL SHORT pei_exit (void)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
314 #else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
315 T_PEI_RETURN l1_pei_exit (void)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
316 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
317 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
318
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
319
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
320
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
321 #ifdef TI_PS_HCOMM_CHANGE
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
322 #else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
323 vsi_c_close (VSI_CALLER hCommPL);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
324 hCommPL = VSI_ERROR;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
325 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
326 return PEI_OK;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
327 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
328
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
329 /*
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
330 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
331 | Function : pei_run
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
332 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
333 | Description : Process Primitives, main loop is located in the
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
334 | Protocol Stack Entity.
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
335 | Only needed in active body variant
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
336 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
337 | Parameters : taskhandle - handle of current process
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
338 | comhandle - queue handle of current process
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
339 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
340 | Return : PEI_OK - sucessful
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
341 | PEI_ERROR - not successful
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
342 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
343 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
344 #if defined (NEW_FRAME)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
345 LOCAL SHORT pei_run ( T_HANDLE taskhandle, T_HANDLE comhandle )
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
346 #else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
347 T_PEI_RETURN l1_pei_run (T_VSI_CHANDLE comhandle)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
348 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
349 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
350
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351 #ifdef TI_PS_HCOMM_CHANGE
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352 #else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353 hCommL1 = comhandle;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
355
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
356
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
357 l1a_task (0, NULL);
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
358 return PEI_OK;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
359 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
360
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
361 /*
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363 | Function : pei_config
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
365 | Description : Dynamic Configuration.
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
366 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
367 | Parameters : in_string - configuration string
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
368 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
369 | Return : PEI_OK - sucessful
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
370 | PEI_ERROR - not successful
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
371 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
372 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
373 LOCAL SHORT pei_config (T_PEI_CONFIG inString)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
374 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
375
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
376
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
377 if ( _osx_config ( inString ) == OSX_OK )
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
378 return PEI_OK;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
379 else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
380 return PEI_ERROR;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
381 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
382
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
383 /*
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
384 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
385 | Function : pei_monitor
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
386 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
387 | Description : Monitoring of physical Parameters.
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
388 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
389 | Parameters : out_monitor - return the address of the data to be monitored
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
390 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
391 | Return : PEI_OK - sucessful (address in out_monitor is valid)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
392 | PEI_ERROR - not successful
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
393 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
394 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
395 #if defined (NEW_FRAME)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
396 LOCAL SHORT pei_monitor (void ** monitor)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
397 #else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
398 T_PEI_RETURN l1_pei_monitor (void ** monitor)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
399 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
400 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
401
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
402
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
403 l1_mon.version = "ALR 2.0.0";
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
404 *monitor = &l1_mon;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
405
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
406 return PEI_OK;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
407 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
408
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
409
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
410 /*==== PUBLIC FUNCTIONS =====================================================*/
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
411
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
412 /*
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
413 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
414 | Function : pei_create
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
415 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
416 | Description : Create the Protocol Stack Entity.
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
417 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
418 | Parameters : info - Pointer to the structure of entity parameters
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
419 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
420 | Return : PEI_OK - entity created successfully
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
421 |
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
422 +------------------------------------------------------------------------------
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
423 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
424 #if defined (NEW_FRAME)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
425
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
426 GLOBAL SHORT l1_pei_create ( T_PEI_INFO **info )
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
427 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
428 static T_PEI_INFO pei_info =
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
429 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
430 "L1",
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
431 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
432 pei_init,
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
433 #ifdef _SIMULATION_
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
434 pei_exit,
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
435 #else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
436 NULL,
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
437 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
438 NULL, /* no primitive function */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
439 NULL, /* no timeout function */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
440 NULL, /* no signal function */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
441 pei_run,
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
442 pei_config,
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
443 pei_monitor,
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
444 },
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
445 #if defined (GPRS)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
446 2800, /* Stack Size */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
447 #else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
448 #if defined (FAX_AND_DATA)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
449 2800, /* Stack Size */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
450 #else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
451 1805, /* Stacksize */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
452 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
453 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
454 10, /* Queue Entries */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
455 235, /* Priority */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
456 0, /* number of timer */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
457 #ifdef GPRS
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
458 COPY_BY_REF|TRC_NO_SUSPEND|PRIM_NO_SUSPEND /* flags */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
459 #else
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
460 COPY_BY_REF|TRC_NO_SUSPEND|PRIM_NO_SUSPEND /* flags */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
461 #endif
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
462 };
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
463
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
464 /*
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
465 * export startup configuration data
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
466 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
467 *info = &pei_info;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
468 /*
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
469 * Initialize entity data
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
470 */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
471
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
472 return PEI_OK;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
473 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
474
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
475 #else /* NEW_FRAME */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
476
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
477 T_PEI_RETURN pei_create (T_VSI_CNAME * name)
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
478 {
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
479 TRACE_FUNCTION ("pei_create()")
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
480
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
481 *name = L1_NAME;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
482
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
483 return PEI_OK;
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
484 }
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
485
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
486 #endif /* NEW_FRAME */
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
487
27a4235405c6 src/g23m-gsm: import from LoCosto source
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
488 /*==== END OF FILE ==========================================================*/