FreeCalypso > hg > fc-magnetite
comparison src/g23m-aci/aci_dti_mng/dti_conn_mng.h @ 162:53929b40109c
src/g23m-aci: initial import from TCS3.2/LoCosto
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Tue, 11 Oct 2016 02:02:43 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
161:4557e2a9c18e | 162:53929b40109c |
---|---|
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 /*lint -e528 (Warning -- Symbol not referenced*/ | |
96 static const T_DTI_ENTITY_NAME dti_entity_name[] = | |
97 { | |
98 #ifdef GPRS | |
99 {SNDCP_NAME, DTI_ENTITY_SNDCP }, | |
100 #endif | |
101 {ACI_NAME, DTI_ENTITY_ACI }, | |
102 {UART_NAME, DTI_ENTITY_UART }, | |
103 {PPP_NAME, DTI_ENTITY_PPPS }, | |
104 {PPP_NAME, DTI_ENTITY_PPPC }, | |
105 {L2R_NAME, DTI_ENTITY_L2R }, | |
106 {T30_NAME, DTI_ENTITY_T30 }, | |
107 {IP_NAME, DTI_ENTITY_IP }, | |
108 {TRA_NAME, DTI_ENTITY_TRA }, | |
109 {UDP_NAME, DTI_ENTITY_UDP }, | |
110 #ifdef FF_GPF_TCPIP | |
111 {TCPIP_NAME, DTI_ENTITY_TCPIP }, | |
112 #endif | |
113 | |
114 | |
115 {WAP_NAME, DTI_ENTITY_WAP }, | |
116 {MTST_NAME, DTI_ENTITY_MTST }, | |
117 {BTI_NAME, DTI_ENTITY_BLUETOOTH }, | |
118 {SIM_NAME, DTI_ENTITY_SIM }, | |
119 {NULL_NAME, DTI_ENTITY_NULL }, | |
120 {RIV_NAME, DTI_ENTITY_AAA }, /* entity AAA is an AT cmd gate only, but for DTI it is "RIV" */ | |
121 #ifdef GPRS | |
122 {PKTIO_NAME, DTI_ENTITY_PKTIO }, | |
123 #endif | |
124 {PSI_NAME, DTI_ENTITY_PSI}, | |
125 {"", DTI_ENTITY_MAX } | |
126 }; | |
127 | |
128 | |
129 typedef enum | |
130 { | |
131 SPLIT = 0, | |
132 APPEND | |
133 } T_DTI_CONN_MODE; | |
134 | |
135 | |
136 typedef enum { | |
137 DTI_CONN_STATE_UNKNOWN = -1, | |
138 DTI_CONN_STATE_CONNECTING, | |
139 DTI_CONN_STATE_CONNECTED, | |
140 DTI_CONN_STATE_DISCONNECTING, | |
141 DTI_CONN_STATE_DISCONNECTED, | |
142 DTI_CONN_STATE_ERROR | |
143 } T_DTI_CONN_STATE; | |
144 | |
145 typedef enum | |
146 { | |
147 DTI_OK, | |
148 DTI_ERROR | |
149 } T_DTI_CONN_RESULT; | |
150 | |
151 typedef struct { | |
152 T_DTI_CONN_STATE state; | |
153 T_DTI_ENTITY_ID ent_id; | |
154 } T_DTI_CONN_PEER; | |
155 | |
156 | |
157 typedef struct { | |
158 UBYTE tuple_no; | |
159 T_DTI_CONN_STATE state; | |
160 T_DTI_CONN_PEER peers[NUM_OF_PEERS]; | |
161 } T_DTI_CONN_TUPLE; | |
162 | |
163 | |
164 typedef BOOL T_DTI_CONN_CB (UBYTE dti_id, | |
165 T_DTI_CONN_STATE result_type ); | |
166 | |
167 typedef BOOL T_DTI_CONN_MNG_ENT_CB( T_DTI_CONN_LINK_ID link_id, | |
168 T_DTI_ENTITY_ID entity_id, | |
169 T_DTI_ENTITY_ID peer_entity_id, | |
170 UBYTE dti_conn); | |
171 | |
172 | |
173 typedef struct { | |
174 BOOL erase_channel; | |
175 UBYTE dti_id; | |
176 UBYTE num_of_conns; | |
177 T_DTI_CONN_CB* conn_cb; | |
178 T_DTI_CONN_TUPLE tuple_list[MAX_DTI_CONN_TUPLES]; | |
179 T_DTI_CONN_STATE state; | |
180 } T_DTI_CONN_CHANNEL; | |
181 | |
182 | |
183 typedef struct { | |
184 T_DTI_CONN_MNG_ENT_CB* mng_ent_cb; | |
185 T_DTI_CONN_CB* conn_cb; | |
186 UBYTE num_entities; | |
187 T_DTI_ENTITY_ID entity_list_buf[MAX_DTI_CONN_ENTIES_PER_CHANNEL]; | |
188 } T_DTI_CONN_PARAMS; | |
189 | |
190 | |
191 | |
192 EXTERN T_DTI_CONN_LINK_ID dti_conn_compose_link_id ( UBYTE dummy, | |
193 UBYTE assoc, | |
194 UBYTE dti_id, | |
195 UBYTE tuple_no); | |
196 | |
197 EXTERN void dti_conn_init( T_DTI_CONN_MNG_ENT_CB* mng_ent_cb ); | |
198 | |
199 EXTERN UBYTE dti_conn_new( UBYTE dti_id ); | |
200 | |
201 EXTERN void dti_conn_erase_entry( UBYTE dti_id ); | |
202 | |
203 | |
204 EXTERN BOOL dti_conn_est_dpath( UBYTE dti_id, | |
205 T_DTI_ENTITY_ID* entity_list, | |
206 UBYTE num_entities, | |
207 T_DTI_CONN_MODE mode, | |
208 T_DTI_CONN_CB* cb ); | |
209 | |
210 EXTERN BOOL dti_conn_close_dpath( UBYTE dti_id ); | |
211 | |
212 | |
213 EXTERN BOOL dti_conn_is_dti_channel_connected( T_DTI_ENTITY_ID ent_id, UBYTE dti_id ); | |
214 | |
215 EXTERN BOOL dti_conn_is_dti_channel_disconnected( UBYTE dti_id ); | |
216 | |
217 | |
218 EXTERN void dti_conn_entity_connected( T_DTI_CONN_LINK_ID link_id, | |
219 T_DTI_ENTITY_ID ent_id, | |
220 T_DTI_CONN_RESULT result ); | |
221 | |
222 EXTERN void dti_conn_entity_disconnected( T_DTI_CONN_LINK_ID link_id, | |
223 T_DTI_ENTITY_ID ent_id ); | |
224 | |
225 EXTERN void dti_conn_close_all_connections ( ); | |
226 | |
227 #endif /* DTI_CONN_H */ |