annotate gsm-fw/L1/stand/l1_pei.c @ 1030:194967e11b2b

fc-shell: tch record and tch play reworked for libgsm-compatible file format
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 31 May 2016 18:39:06 +0000
parents 4d40f9a99445
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
614
4274171eabd2 gsm-fw/L1/stand/l1_pei.c: getting close to passing compilation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 613
diff changeset
1 /*
4274171eabd2 gsm-fw/L1/stand/l1_pei.c: getting close to passing compilation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 613
diff changeset
2 * This is a bastardized version of L1 PEI that will be used only when
4274171eabd2 gsm-fw/L1/stand/l1_pei.c: getting close to passing compilation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 613
diff changeset
3 * building FreeCalypso in the standalone L1 configuration; see README.
4274171eabd2 gsm-fw/L1/stand/l1_pei.c: getting close to passing compilation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 613
diff changeset
4 */
613
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
5
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
6 #define L1_PEI_C
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
7
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
8 #define ENTITY_L1
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
9
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
10 #define CUST_OS_C
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
11 /*==== INCLUDES =============================================================*/
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
12
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
13 #include <string.h>
614
4274171eabd2 gsm-fw/L1/stand/l1_pei.c: getting close to passing compilation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 613
diff changeset
14 #include "typedefs.h" /* to get Condat data types */
613
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
15 #include "vsi.h" /* to get a lot of macros */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
16 #include "pei.h" /* to get PEI interface */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
17 #include "tools.h" /* to get common tools */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
18 #include "cust_os.h" /* to get cust_os definitions */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
19
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
20 /*==== CONSTS ================================================================*/
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
21
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
22 /*==== TYPES =================================================================*/
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
23
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
24 typedef struct
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
25 {
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
26 char *version;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
27 } T_MONITOR;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
28
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
29 /*==== LOCALS ================================================================*/
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
30
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
31 static T_MONITOR l1_mon;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
32 static USHORT first_access = TRUE;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
33
614
4274171eabd2 gsm-fw/L1/stand/l1_pei.c: getting close to passing compilation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 613
diff changeset
34 static T_HANDLE L1_Handle;
4274171eabd2 gsm-fw/L1/stand/l1_pei.c: getting close to passing compilation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 613
diff changeset
35
4274171eabd2 gsm-fw/L1/stand/l1_pei.c: getting close to passing compilation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 613
diff changeset
36 #define VSI_CALLER L1_Handle,
4274171eabd2 gsm-fw/L1/stand/l1_pei.c: getting close to passing compilation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 613
diff changeset
37
616
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
38 static T_HANDLE hCommL1 = VSI_ERROR;
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
39 static T_HANDLE hCommFWD = VSI_ERROR;
614
4274171eabd2 gsm-fw/L1/stand/l1_pei.c: getting close to passing compilation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 613
diff changeset
40
613
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
41 /*==== PROTOTYPES ============================================================*/
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
42
614
4274171eabd2 gsm-fw/L1/stand/l1_pei.c: getting close to passing compilation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 613
diff changeset
43 void l1_create_HISR (void);
613
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
44 void l1a_task(unsigned arcg, void *argv);
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
45
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
46 /*==== PRIVATE FUNCTIONS =====================================================*/
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
47
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
48
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
49 /*
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
50 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
51 | Function : pei_init
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
52 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
53 | Description : Initialize Protocol Stack Entity
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
54 |
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
55 | Parameters : handle - task handle
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
56 |
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
57 | Return : PEI_OK - entity initialised
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
58 | PEI_ERROR - entity not (yet) initialised
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
59 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
60 */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
61 LOCAL SHORT pei_init ( T_HANDLE Handle )
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
62 {
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
63 L1_Handle = Handle;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
64
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
65 if ( first_access == TRUE )
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
66 {
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
67 first_access = FALSE;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
68 _osx_init();
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
69 }
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
70 /*
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
71 * Associate own "queue" handle (a task handle in the end) with L1_QUEUE,
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
72 * in order to be able to receive primitives.
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
73 */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
74 if (hCommL1 < VSI_OK)
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
75 {
614
4274171eabd2 gsm-fw/L1/stand/l1_pei.c: getting close to passing compilation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 613
diff changeset
76 if ((hCommL1 = vsi_c_open (VSI_CALLER "L1")) < VSI_OK)
613
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
77 return PEI_ERROR;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
78 _osx_open (VSI_CALLER L1_QUEUE, hCommL1);
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
79 }
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
80
616
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
81 /*
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
82 * Redirect all L1-> outbound messages to our special forwarder
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
83 * entity; see README for the explanation.
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
84 */
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
85
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
86 if (hCommFWD < VSI_OK)
613
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
87 {
616
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
88 if ((hCommFWD = vsi_c_open (VSI_CALLER "L1IF")) < VSI_OK)
613
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
89 return PEI_ERROR;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
90 }
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
91
616
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
92 _osx_open (VSI_CALLER DL_QUEUE, hCommFWD);
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
93 _osx_open (VSI_CALLER RR_QUEUE, hCommFWD);
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
94 _osx_open (VSI_CALLER GPF_ACI_QUEUE, hCommFWD);
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
95 _osx_open (VSI_CALLER GRR_QUEUE, hCommFWD);
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
96 _osx_open (VSI_CALLER LLC_QUEUE, hCommFWD);
4d40f9a99445 gsm-fw/L1/stand: plan to use L1IF forwarder entity
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 614
diff changeset
97 _osx_open (VSI_CALLER SNDCP_QUEUE, hCommFWD);
613
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
98
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
99 /*
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
100 * Register VSI_CALLER as generic caller entity.
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
101 */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
102 _osx_open (VSI_CALLER 0, 0);
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
103
614
4274171eabd2 gsm-fw/L1/stand/l1_pei.c: getting close to passing compilation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 613
diff changeset
104 l1_create_HISR ();
613
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
105
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
106 return PEI_OK;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
107 }
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
108
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
109 /*
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
110 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
111 | Function : pei_run
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
112 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
113 | Description : Process Primitives, main loop is located in the
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
114 | Protocol Stack Entity.
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
115 | Only needed in active body variant
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
116 |
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
117 | Parameters : taskhandle - handle of current process
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
118 | comhandle - queue handle of current process
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
119 |
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
120 | Return : PEI_OK - sucessful
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
121 | PEI_ERROR - not successful
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
122 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
123 */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
124 LOCAL SHORT pei_run ( T_HANDLE taskhandle, T_HANDLE comhandle )
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
125 {
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
126 hCommL1 = comhandle;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
127
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
128 l1a_task (0, NULL);
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
129 return PEI_OK;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
130 }
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
131
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
132 /*
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
133 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
134 | Function : pei_config
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
135 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
136 | Description : Dynamic Configuration.
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
137 |
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
138 | Parameters : in_string - configuration string
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
139 |
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
140 | Return : PEI_OK - sucessful
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
141 | PEI_ERROR - not successful
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
142 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
143 */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
144 LOCAL SHORT pei_config (T_PEI_CONFIG inString)
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
145 {
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
146
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
147
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
148 if ( _osx_config ( inString ) == OSX_OK )
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
149 return PEI_OK;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
150 else
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
151 return PEI_ERROR;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
152 }
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
153
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
154 /*
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
155 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
156 | Function : pei_monitor
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
157 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
158 | Description : Monitoring of physical Parameters.
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
159 |
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
160 | Parameters : out_monitor - return the address of the data to be monitored
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
161 |
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
162 | Return : PEI_OK - sucessful (address in out_monitor is valid)
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
163 | PEI_ERROR - not successful
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
164 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
165 */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
166 LOCAL SHORT pei_monitor (void ** monitor)
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
167 {
614
4274171eabd2 gsm-fw/L1/stand/l1_pei.c: getting close to passing compilation
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents: 613
diff changeset
168 l1_mon.version = "FC standalone L1";
613
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
169 *monitor = &l1_mon;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
170
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
171 return PEI_OK;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
172 }
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
173
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
174
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
175 /*==== PUBLIC FUNCTIONS =====================================================*/
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
176
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
177 /*
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
178 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
179 | Function : pei_create
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
180 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
181 | Description : Create the Protocol Stack Entity.
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
182 |
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
183 | Parameters : info - Pointer to the structure of entity parameters
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
184 |
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
185 | Return : PEI_OK - entity created successfully
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
186 |
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
187 +------------------------------------------------------------------------------
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
188 */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
189 GLOBAL SHORT l1_pei_create ( T_PEI_INFO **info )
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
190 {
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
191 static T_PEI_INFO pei_info =
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
192 {
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
193 "L1",
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
194 {
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
195 pei_init,
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
196 NULL,
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
197 NULL, /* no primitive function */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
198 NULL, /* no timeout function */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
199 NULL, /* no signal function */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
200 pei_run,
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
201 pei_config,
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
202 pei_monitor,
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
203 },
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
204 2800, /* Stack Size */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
205 10, /* Queue Entries */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
206 235, /* Priority */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
207 0, /* number of timer */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
208 COPY_BY_REF|TRC_NO_SUSPEND|PRIM_NO_SUSPEND /* flags */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
209 };
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
210
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
211 /*
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
212 * export startup configuration data
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
213 */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
214 *info = &pei_info;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
215 /*
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
216 * Initialize entity data
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
217 */
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
218
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
219 return PEI_OK;
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
220 }
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
221
9e605ec89ed0 gsm-fw/L1/stand: starting work on our version of standalone L1
Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
parents:
diff changeset
222 /*==== END OF FILE ==========================================================*/