FreeCalypso > hg > fc-magnetite
comparison src/aci2/aci_dti_mng/dti_conn_mng.h @ 3:93999a60b835
src/aci2, src/condat2: import of g23m/condat source pieces from TCS211
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 26 Sep 2016 00:29:36 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2:c41a534f33c6 | 3:93999a60b835 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : GSM-PS | |
4 | Modul : dti_conn_mng.h | |
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 : Header file for DTI Connection Manager | |
18 +----------------------------------------------------------------------------- | |
19 */ | |
20 | |
21 #ifndef DTI_CONN_H | |
22 #define DTI_CONN_H | |
23 | |
24 #define DTI_DTI_ID_NOTPRESENT NOT_PRESENT_8BIT | |
25 | |
26 #define DTI_TUPLE_NO_NOTPRESENT NOT_PRESENT_8BIT | |
27 | |
28 #define DTI_LINK_ID_NOTPRESENT NOT_PRESENT_32BIT | |
29 | |
30 | |
31 #define NUM_OF_PEERS 2 | |
32 | |
33 #define MAX_DTI_CONN_TUPLES 5 /* max. number of tuples in an end-to-end connection */ | |
34 | |
35 #define MAX_DTI_CONN_ENTIES_PER_CHANNEL MAX_DTI_CONN_TUPLES+1 | |
36 | |
37 #define MAX_DTI_CONN_CHANNELS 32 /* can be max 32 because of tst_id, max number of end-to-end connections */ | |
38 | |
39 #define MAX_DTI_CONN_LINK_IDS MAX_DTI_CONN_TUPLES*MAX_DTI_CONN_CHANNELS /* max number of link ids */ | |
40 | |
41 | |
42 | |
43 #define EXTRACT_TUPLE_NO( link_id )\ | |
44 (UBYTE)(link_id & 0x000000FF) | |
45 | |
46 #define EXTRACT_DTI_ID( link_id )\ | |
47 (UBYTE)((link_id & 0x0000FF00) >> 8) | |
48 | |
49 #define DTI_CONNECT 0x00 | |
50 #define DTI_DISCONNECT 0x01 | |
51 | |
52 typedef ULONG T_DTI_CONN_LINK_ID; | |
53 | |
54 | |
55 typedef enum | |
56 { | |
57 DTI_ENTITY_INVALID = -1, | |
58 #ifdef GPRS | |
59 DTI_ENTITY_SNDCP, | |
60 #endif | |
61 DTI_ENTITY_ACI, | |
62 DTI_ENTITY_UART, | |
63 DTI_ENTITY_PPPS, | |
64 DTI_ENTITY_PPPC, | |
65 DTI_ENTITY_L2R, | |
66 DTI_ENTITY_T30, | |
67 DTI_ENTITY_IP, | |
68 DTI_ENTITY_TRA, | |
69 DTI_ENTITY_UDP, | |
70 #ifdef FF_GPF_TCPIP | |
71 DTI_ENTITY_TCPIP, | |
72 #endif | |
73 | |
74 DTI_ENTITY_WAP, | |
75 DTI_ENTITY_MTST, | |
76 DTI_ENTITY_BLUETOOTH, | |
77 DTI_ENTITY_SIM, | |
78 DTI_ENTITY_NULL, | |
79 DTI_ENTITY_AAA, | |
80 #ifdef GPRS | |
81 DTI_ENTITY_PKTIO, | |
82 #endif | |
83 DTI_ENTITY_PSI, | |
84 DTI_ENTITY_MAX | |
85 } T_DTI_ENTITY_ID; | |
86 | |
87 typedef struct | |
88 { | |
89 CHAR *name; | |
90 T_DTI_ENTITY_ID id; | |
91 } T_DTI_ENTITY_NAME; | |
92 /* | |
93 * the XXX_NAME are defined in custom.h and gprs.h | |
94 */ | |
95 static const T_DTI_ENTITY_NAME dti_entity_name[] = | |
96 { | |
97 #ifdef GPRS | |
98 {SNDCP_NAME, DTI_ENTITY_SNDCP }, | |
99 #endif | |
100 {ACI_NAME, DTI_ENTITY_ACI }, | |
101 {UART_NAME, DTI_ENTITY_UART }, | |
102 {PPP_NAME, DTI_ENTITY_PPPS }, | |
103 {PPP_NAME, DTI_ENTITY_PPPC }, | |
104 {L2R_NAME, DTI_ENTITY_L2R }, | |
105 {T30_NAME, DTI_ENTITY_T30 }, | |
106 {IP_NAME, DTI_ENTITY_IP }, | |
107 {TRA_NAME, DTI_ENTITY_TRA }, | |
108 {UDP_NAME, DTI_ENTITY_UDP }, | |
109 #ifdef FF_GPF_TCPIP | |
110 {TCPIP_NAME, DTI_ENTITY_TCPIP }, | |
111 #endif | |
112 | |
113 | |
114 {WAP_NAME, DTI_ENTITY_WAP }, | |
115 {MTST_NAME, DTI_ENTITY_MTST }, | |
116 {BTI_NAME, DTI_ENTITY_BLUETOOTH }, | |
117 {SIM_NAME, DTI_ENTITY_SIM }, | |
118 {NULL_NAME, DTI_ENTITY_NULL }, | |
119 {RIV_NAME, DTI_ENTITY_AAA }, /* entity AAA is an AT cmd gate only, but for DTI it is "RIV" */ | |
120 #ifdef GPRS | |
121 {PKTIO_NAME, DTI_ENTITY_PKTIO }, | |
122 #endif | |
123 {PSI_NAME, DTI_ENTITY_PSI}, | |
124 {"", DTI_ENTITY_MAX } | |
125 }; | |
126 | |
127 | |
128 typedef enum | |
129 { | |
130 SPLIT = 0, | |
131 APPEND | |
132 } T_DTI_CONN_MODE; | |
133 | |
134 | |
135 typedef enum { | |
136 DTI_CONN_STATE_UNKNOWN = -1, | |
137 DTI_CONN_STATE_CONNECTING, | |
138 DTI_CONN_STATE_CONNECTED, | |
139 DTI_CONN_STATE_DISCONNECTING, | |
140 DTI_CONN_STATE_DISCONNECTED, | |
141 DTI_CONN_STATE_ERROR | |
142 } T_DTI_CONN_STATE; | |
143 | |
144 typedef enum | |
145 { | |
146 DTI_OK, | |
147 DTI_ERROR | |
148 } T_DTI_CONN_RESULT; | |
149 | |
150 typedef struct { | |
151 T_DTI_CONN_STATE state; | |
152 T_DTI_ENTITY_ID ent_id; | |
153 } T_DTI_CONN_PEER; | |
154 | |
155 | |
156 typedef struct { | |
157 UBYTE tuple_no; | |
158 T_DTI_CONN_STATE state; | |
159 T_DTI_CONN_PEER peers[NUM_OF_PEERS]; | |
160 } T_DTI_CONN_TUPLE; | |
161 | |
162 | |
163 typedef BOOL T_DTI_CONN_CB (UBYTE dti_id, | |
164 T_DTI_CONN_STATE result_type ); | |
165 | |
166 typedef BOOL T_DTI_CONN_MNG_ENT_CB( T_DTI_CONN_LINK_ID link_id, | |
167 T_DTI_ENTITY_ID entity_id, | |
168 T_DTI_ENTITY_ID peer_entity_id, | |
169 UBYTE dti_conn); | |
170 | |
171 | |
172 typedef struct { | |
173 BOOL erase_channel; | |
174 UBYTE dti_id; | |
175 UBYTE num_of_conns; | |
176 T_DTI_CONN_CB* conn_cb; | |
177 T_DTI_CONN_TUPLE tuple_list[MAX_DTI_CONN_TUPLES]; | |
178 T_DTI_CONN_STATE state; | |
179 } T_DTI_CONN_CHANNEL; | |
180 | |
181 | |
182 typedef struct { | |
183 T_DTI_CONN_MNG_ENT_CB* mng_ent_cb; | |
184 T_DTI_CONN_CB* conn_cb; | |
185 UBYTE num_entities; | |
186 T_DTI_ENTITY_ID entity_list_buf[MAX_DTI_CONN_ENTIES_PER_CHANNEL]; | |
187 } T_DTI_CONN_PARAMS; | |
188 | |
189 | |
190 | |
191 EXTERN T_DTI_CONN_LINK_ID dti_conn_compose_link_id ( UBYTE dummy, | |
192 UBYTE assoc, | |
193 UBYTE dti_id, | |
194 UBYTE tuple_no); | |
195 | |
196 EXTERN void dti_conn_init( T_DTI_CONN_MNG_ENT_CB* mng_ent_cb ); | |
197 | |
198 EXTERN UBYTE dti_conn_new( UBYTE dti_id ); | |
199 | |
200 EXTERN void dti_conn_erase_entry( UBYTE dti_id ); | |
201 | |
202 | |
203 EXTERN BOOL dti_conn_est_dpath( UBYTE dti_id, | |
204 T_DTI_ENTITY_ID* entity_list, | |
205 UBYTE num_entities, | |
206 T_DTI_CONN_MODE mode, | |
207 T_DTI_CONN_CB* cb ); | |
208 | |
209 EXTERN BOOL dti_conn_close_dpath( UBYTE dti_id ); | |
210 | |
211 | |
212 EXTERN BOOL dti_conn_is_dti_channel_connected( T_DTI_ENTITY_ID ent_id, UBYTE dti_id ); | |
213 | |
214 EXTERN BOOL dti_conn_is_dti_channel_disconnected( UBYTE dti_id ); | |
215 | |
216 | |
217 EXTERN void dti_conn_entity_connected( T_DTI_CONN_LINK_ID link_id, | |
218 T_DTI_ENTITY_ID ent_id, | |
219 T_DTI_CONN_RESULT result ); | |
220 | |
221 EXTERN void dti_conn_entity_disconnected( T_DTI_CONN_LINK_ID link_id, | |
222 T_DTI_ENTITY_ID ent_id ); | |
223 | |
224 EXTERN void dti_conn_close_all_connections ( ); | |
225 | |
226 #endif /* DTI_CONN_H */ |