comparison src/g23m-fad/ppp/ppp_prxf.c @ 1:d393cd9bb723

src/g23m-*: initial import from Magnetite
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 15 Jul 2018 04:40:46 +0000
parents
children
comparison
equal deleted inserted replaced
0:b6a5e36de839 1:d393cd9bb723
1 /*
2 +-----------------------------------------------------------------------------
3 | Project :
4 | Modul :
5 +-----------------------------------------------------------------------------
6 | Copyright 2002 Texas Instruments Berlin, AG
7 | All rights reserved.
8 |
9 | This file is confidential and a trade secret of Texas
10 | Instruments Berlin, AG
11 | The receipt of or possession of this file does not convey
12 | any rights to reproduce or disclose its contents or to
13 | manufacture, use, or sell anything it may describe, in
14 | whole, or in part, without the specific written consent of
15 | Texas Instruments Berlin, AG.
16 +-----------------------------------------------------------------------------
17 | Purpose : This modul is part of the entity PPP and implements all
18 | procedures and functions as described in the
19 | SDL-documentation (PRX-statemachine)
20 +-----------------------------------------------------------------------------
21 */
22
23 #define ENTITY_PPP
24
25 /*==== INCLUDES =============================================================*/
26
27 #include "typedefs.h" /* to get Condat data types */
28 #include "vsi.h" /* to get a lot of macros */
29 #include "macdef.h" /* to get a lot of macros */
30 #include "custom.h" /* to get a lot of macros */
31 /*lint -efile(766,gsm.h) */
32 #include "gsm.h" /* to get a lot of macros */
33 /*lint -efile(766,cnf_ppp.h) */
34 #include "cnf_ppp.h" /* to get cnf-definitions */
35 /*lint -efile(766,mon_ppp.h) */
36 #include "mon_ppp.h" /* to get mon-definitions */
37 #include "prim.h" /* to get the definitions of used SAP and directions */
38 #include "dti.h" /* to get the DTILIB definitions */
39 #include "ppp.h" /* to get the global entity definitions */
40
41 #ifdef FF_STATUS_TE
42 #include "gdi.h" /* To include driver type-defines */
43 #include "ste.h" /* To include function interface for TE status driver */
44 #include "ppp_prxf.h" /* To include call-back function for TE status driver */
45 #endif /* FF_STATUS_TE */
46 /*==== CONST ================================================================*/
47
48 /*==== LOCAL VARS ===========================================================*/
49
50 /*==== PRIVATE FUNCTIONS ====================================================*/
51
52 /*==== PUBLIC FUNCTIONS =====================================================*/
53
54
55
56 /*
57 +------------------------------------------------------------------------------
58 | Function : prx_init
59 +------------------------------------------------------------------------------
60 | Description : The function prx_init() initializes Packet Receive (PRX)
61 |
62 | Parameters : no parameters
63 |
64 +------------------------------------------------------------------------------
65 */
66 GLOBAL void prx_init ()
67 {
68 TRACE_FUNCTION( "prx_init" );
69
70 #if defined FF_STATUS_TE
71 /*
72 * Init of the TE status driver - the handle is unique inside PPP only, SMN
73 * PPP handle-management are placed in the end of ppp.h
74 */
75 if (DRV_OK NEQ STE_Init( STE_HANDLE, cb_status_TE ))
76 {
77 /*
78 * Error during init of TE status driver - either it is already init or it has failed
79 */
80 TRACE_ERROR( "STE driver init. error" );
81 }
82 else
83 {
84
85 #ifdef _SIMULATION_
86 TRACE_EVENT( "Return DRV_OK from STE_Init()" );
87 #endif /* _SIMULATION_ */
88
89 /*
90 * Setup of used signal-types for driver to trig a callback
91 */
92 if (DRV_OK NEQ STE_SetSignal( DRV_SIGTYPE_READ ))
93 {
94 /*
95 * Error during signal-set - either signal illegal, not available or internal fail
96 */
97 TRACE_ERROR( "STE driver setup error" );
98 }
99 #ifdef _SIMULATION_
100 else
101 {
102 TRACE_EVENT( "Return DRV_OK from STE_SetSignal()" );
103 }
104 #endif /* _SIMULATION_ */
105 }
106 /*
107 * initialize variables
108 */
109 ppp_data->prx.TE_data_buffer_desc_list_first = NULL;
110 ppp_data->prx.TE_data_buffer_p_id = DTI_PID_UOS;
111 ppp_data->prx.TE_data_buffered = FALSE;
112 #endif /* FF_STATUS_TE */
113
114 INIT_STATE( PPP_SERVICE_PRX , PRX_DEAD );
115 } /* prx_init() */
116
117
118
119 #ifdef FF_STATUS_TE
120 /*
121 +------------------------------------------------------------------------------
122 | Function : cb_status_TE
123 +------------------------------------------------------------------------------
124 | Description : Handles the call-back from the TE status driver and sends the
125 | NEW_POWER_STATUS signal to the PS
126 |
127 | Parameters : None
128 |
129 +------------------------------------------------------------------------------
130 */
131 GLOBAL void cb_status_TE (T_DRV_SIGNAL * signal)
132 {
133
134 TRACE_FUNCTION( "cb_status_TE" );
135
136 if((signal->SignalType EQ DRV_SIGTYPE_READ) &&
137 (signal->DrvHandle EQ STE_HANDLE) &&
138 (*((USHORT*)signal->UserData) EQ STE_IDENTIFIER_POWER))
139 {
140 PSIGNAL(hCommPPP, NEW_POWER_STATUS, NULL);
141 }
142 else
143 {
144 TRACE_ERROR( "STE driver: Signal not supported" );
145 }
146 } /* cb_status_TE() */
147 #endif /* FF_STATUS_TE */