FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/g23m-aci/aci/dti_cntrl_mng.h @ 775:eedbf248bac0
gsm-fw/g23m-aci subtree: initial import from LoCosto source
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 12 Oct 2014 01:45:14 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
774:40a721fd9854 | 775:eedbf248bac0 |
---|---|
1 /* | |
2 +----------------------------------------------------------------------------- | |
3 | Project : ... | |
4 | Modul : dti_cntrl_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 : This modul ... | |
18 +----------------------------------------------------------------------------- | |
19 */ | |
20 | |
21 /* #define DTI_CPBLTY_NO 0x00 used as initial value */ | |
22 /* #define DTI_CPBLTY_CMD 0x01 AT cmd capability */ | |
23 /* #define DTI_CPBLTY_PKT 0x02 packet capability */ | |
24 /* #define DTI_CPBLTY_SER 0x04 serial capability */ | |
25 | |
26 #define DTI_MODE_DELETE 0x00 /* delete redirection mode */ | |
27 #define DTI_MODE_ONCE 0x01 /* redirection mode once */ | |
28 #define DTI_MODE_PERM 0x02 /* redirection mode permanent */ | |
29 #define DTI_MODE_NIL 0xFF /* redirection mode reset */ | |
30 | |
31 #define DTI_DEV_IS_REDIRECTED 0x00 /* data transmission is redirected to another device */ | |
32 #define DTI_DEV_I_AM_THE_ONE 0x01 /* I am the device for the data transmission */ | |
33 | |
34 #define DTI_DIRECTION_NOTPRESENT 0xFF /* no direction available */ | |
35 #define DTI_SRC_ID_NOTPRESENT 0xFF /* non valid AT source Id */ | |
36 #define DTI_CID_NOTPRESENT 0xFF /* no PDP context id */ | |
37 #define DTI_PORT_NUMBER_NOTPRESENT 0xFF /* no port number (psa_aaa) */ | |
38 #define DTI_DRIVER_ID_NOTPRESENT 0xFF /* no driver id available */ | |
39 #define DTI_DIO_ID_NOTPRESENT 0xFF /* no dio controlled combination id available */ | |
40 | |
41 | |
42 #define DTI_MAX_EXT_CB 3 /* max external call backs */ | |
43 /* one cb for a external entity */ | |
44 /* so, customer can have up to */ | |
45 /* 3 own (external) entities */ | |
46 #ifdef GPRS | |
47 #define DTI_MAX_REDIRECTIONS 3 | |
48 #else | |
49 #define DTI_MAX_REDIRECTIONS 1 | |
50 #endif | |
51 | |
52 | |
53 #define T_DTI_CNTRL struct dti_cntrl /* need a forward definition */ | |
54 | |
55 typedef struct | |
56 { | |
57 UBYTE mode; /* once/permanent */ | |
58 T_DTI_CNTRL *redirection; /* points to redirected device */ | |
59 } T_DTI_CNTRL_REDIRECT_INTERN_TYPE; | |
60 | |
61 /* | |
62 * index to [ser|par]_redirect is controlled by cid (PDP context) | |
63 * cid = 0 --> no PDP context, cid = 1|2 --> there is a PDP WINWORD.EXEcontext | |
64 * currently (Nov.2002) MAX_CID = 3 | |
65 */ | |
66 typedef struct | |
67 { | |
68 T_DTI_CNTRL_REDIRECT_INTERN_TYPE ser_redirect[DTI_MAX_REDIRECTIONS]; /* redirect to serial device (related to a PDP context) */ | |
69 T_DTI_CNTRL_REDIRECT_INTERN_TYPE pkt_redirect[DTI_MAX_REDIRECTIONS]; /* redirect to packet device (related to a PDP context) */ | |
70 } T_DTI_CNTRL_REDIRECT_INTERN; | |
71 | |
72 typedef struct | |
73 { | |
74 UBYTE cid; /* PDP context */ | |
75 UBYTE mode; /* once/permanent */ | |
76 UBYTE capability; /* CMD,PKT,SER */ | |
77 UBYTE direction; /* src|dst of redirection */ | |
78 } T_DTI_CNTRL_REDIRECT_EXTERN; | |
79 | |
80 typedef union | |
81 { | |
82 T_DTI_CNTRL_REDIRECT_INTERN *tbl; /* intern */ | |
83 T_DTI_CNTRL_REDIRECT_EXTERN info; /* what the external sees */ | |
84 } T_DTI_CNTRL_REDIRECT; | |
85 | |
86 /* | |
87 * the main maintenance structure of the DTI Control Manager | |
88 */ | |
89 T_DTI_CNTRL | |
90 { | |
91 T_DTI_ENTITY_ID dev_id; /* id(name) of device */ | |
92 UBYTE dev_no; /* instance of device */ | |
93 UBYTE sub_no; /* instance with multiplexed ch. */ | |
94 UBYTE capability; /* capability of device */ | |
95 UBYTE src_id; /* what ACI sees as AT cmd src */ | |
96 UBYTE dti_id; /* id of the DTI channel */ | |
97 UBYTE port_number; /* used by psa_aaa */ | |
98 UBYTE cur_cap; /* capability of the DTI channel */ | |
99 UBYTE driver_id; /* driver specific id like USB,...*/ | |
100 UBYTE dio_ctrl_id; /* device combination id controlled by DIO Interface Layer, v4 */ | |
101 T_DTI_CNTRL_REDIRECT redirect_info; /* union for redirection */ | |
102 #ifdef FF_TCP_IP | |
103 UBYTE had_aaa_dti_rsp ; /* AAA_DTI_RSP has been received. */ | |
104 /* When (pseudo-)connecting to AAA, the DTI connect request to the data | |
105 * entity has to be delayed until the AAA_DTI_RSP has been received. Here we | |
106 * save the parameters needed to call dti_cntrl_maintain_entity_connect() | |
107 * again. */ | |
108 T_DTI_CONN_LINK_ID save_link_id ; | |
109 T_DTI_ENTITY_ID save_cur_ent_id; /* entity to connect (peer is AAA) */ | |
110 UBYTE save_dti_conn ; | |
111 #endif /* FF_TCP_IP */ | |
112 }; | |
113 | |
114 | |
115 typedef BOOL T_DTI_EXT_CB (ULONG link_id, T_DTI_ENTITY_ID peer_entity_id, UBYTE dti_conn); | |
116 | |
117 typedef struct | |
118 { | |
119 T_DTI_ENTITY_ID ent_id; | |
120 T_DTI_EXT_CB *fct; | |
121 } T_DTI_CNTRL_REGISTERED_EXT_CB; | |
122 | |
123 /****************** DTI Control Manager Interface Functions ******************/ | |
124 | |
125 EXTERN void dti_cntrl_init (void); | |
126 | |
127 EXTERN UBYTE dti_cntrl_new_dti (UBYTE src_id); | |
128 | |
129 EXTERN BOOL dti_cntrl_new_device (UBYTE src_id, | |
130 UBYTE dev_id, | |
131 UBYTE dev_no, | |
132 UBYTE sub_no, | |
133 UBYTE port_num, | |
134 UBYTE capability, | |
135 UBYTE driver_id, | |
136 UBYTE dio_ctrl_id); | |
137 EXTERN void dti_cntrl_change_sub_no (UBYTE src_id, | |
138 UBYTE sub_no); | |
139 | |
140 EXTERN BOOL dti_cntrl_est_dpath (UBYTE dti_id, | |
141 T_DTI_ENTITY_ID *entity_list, | |
142 UBYTE num_entities, | |
143 T_DTI_CONN_MODE mode, | |
144 T_DTI_CONN_CB *cb); | |
145 | |
146 EXTERN BOOL dti_cntrl_est_dpath_indirect (UBYTE src_id, | |
147 T_DTI_ENTITY_ID *entity_list, | |
148 UBYTE num_entities, | |
149 T_DTI_CONN_MODE mode, | |
150 T_DTI_CONN_CB *cb, | |
151 UBYTE capability, | |
152 UBYTE cid); | |
153 | |
154 EXTERN BOOL dti_cntrl_is_dti_channel_connected (T_DTI_ENTITY_ID ent_id, | |
155 UBYTE dti_id); | |
156 | |
157 EXTERN BOOL dti_cntrl_is_dti_channel_disconnected (UBYTE dti_id); | |
158 | |
159 EXTERN BOOL dti_cntrl_close_dpath_from_src_id (UBYTE src_id); | |
160 | |
161 EXTERN BOOL dti_cntrl_close_dpath_from_dti_id (UBYTE dti_id); | |
162 | |
163 EXTERN BOOL dti_cntrl_get_info_from_src_id (UBYTE src_id, | |
164 T_DTI_CNTRL *info); | |
165 | |
166 EXTERN BOOL dti_cntrl_get_info_from_dti_id (UBYTE dti_id, | |
167 T_DTI_CNTRL *info); | |
168 | |
169 EXTERN BOOL dti_cntrl_get_info_from_dev_id (T_DTI_ENTITY_ID dev_id, | |
170 UBYTE dev_no, | |
171 UBYTE sub_no, | |
172 T_DTI_CNTRL *info); | |
173 | |
174 EXTERN BOOL dti_cntrl_set_redirect_from_src (UBYTE src_id, | |
175 UBYTE mode, | |
176 T_DTI_ENTITY_ID dst_dev_id, | |
177 UBYTE dst_dev_no, | |
178 UBYTE dst_sub_no, | |
179 UBYTE capability, | |
180 UBYTE cid); | |
181 | |
182 EXTERN BOOL dti_cntrl_set_redirect_from_device (UBYTE mode, | |
183 T_DTI_ENTITY_ID dst_dev_id, | |
184 UBYTE dst_dev_no, | |
185 UBYTE dst_sub_no, | |
186 T_DTI_ENTITY_ID src_dev_id, | |
187 UBYTE src_dev_no, | |
188 UBYTE src_sub_no, | |
189 UBYTE capability, | |
190 UBYTE cid); | |
191 | |
192 EXTERN BOOL dti_cntrl_get_first_device (T_DTI_CNTRL *info); | |
193 EXTERN BOOL dti_cntrl_get_next_device (T_DTI_CNTRL *info); | |
194 EXTERN BOOL dti_cntrl_get_first_redirection (UBYTE src_id, | |
195 UBYTE capability, | |
196 T_DTI_CNTRL *redirection); | |
197 | |
198 EXTERN BOOL dti_cntrl_get_next_redirection (UBYTE src_id, | |
199 UBYTE cid, | |
200 UBYTE capability, | |
201 T_DTI_CNTRL *redirection); | |
202 | |
203 EXTERN void dti_cntrl_entity_connected (ULONG link_id, | |
204 T_DTI_ENTITY_ID entity_id, | |
205 T_DTI_CONN_RESULT result); | |
206 | |
207 EXTERN void dti_cntrl_entity_disconnected (ULONG link_id, | |
208 T_DTI_ENTITY_ID entity_id); | |
209 | |
210 EXTERN BOOL dti_cntrl_reg_new_fct (T_DTI_ENTITY_ID entity_id, | |
211 T_DTI_EXT_CB *fct); | |
212 | |
213 EXTERN void dti_cntrl_erase_entry (UBYTE dti_id); | |
214 | |
215 | |
216 EXTERN BOOL dti_cntrl_search_dti_id (UBYTE dti_id, void *elem); | |
217 | |
218 EXTERN void dti_cntrl_close_all_connections (void); | |
219 | |
220 EXTERN void dti_cntrl_connect_after_aaa_dti_rsp(UBYTE dti_id) ; | |
221 | |
222 | |
223 EXTERN void dti_cntrl_set_dti_id_to_reconnect (UBYTE dti_id); | |
224 | |
225 EXTERN void dti_cntrl_clear_dti_id_to_reconnect (UBYTE dti_id); | |
226 | |
227 EXTERN BOOL dti_cntrl_is_dti_id_to_reconnect (UBYTE dti_id); | |
228 | |
229 /* | |
230 * special temporary stuff | |
231 */ | |
232 #define DTI_DEV_NO_NOTPRESENT NOT_PRESENT_8BIT | |
233 | |
234 #define DTI_SUB_NO_NOTPRESENT NOT_PRESENT_8BIT | |
235 | |
236 #define DTI_INSTANCE_NOTPRESENT NOT_PRESENT_8BIT | |
237 | |
238 | |
239 typedef struct | |
240 { | |
241 T_DTI_CONN_LINK_ID link_id; | |
242 T_DTI_ENTITY_ID ent_id1; | |
243 T_DTI_ENTITY_ID ent_id2; | |
244 UBYTE dev_no1; | |
245 UBYTE dev_no2; | |
246 UBYTE sub_no1; | |
247 UBYTE sub_no2; | |
248 } T_DTI_CNTRL_DATA; | |
249 | |
250 | |
251 #ifdef DTI_CNTRL_MNG_C | |
252 T_DTI_CNTRL_DATA dti_aci_data_base[MAX_DTI_CONN_LINK_IDS]; | |
253 #else | |
254 EXTERN T_DTI_CNTRL_DATA dti_aci_data_base[]; | |
255 #endif | |
256 | |
257 EXTERN T_DTI_CONN_LINK_ID dti_cntrl_get_link_id( T_DTI_ENTITY_ID ent_id, | |
258 UBYTE dev_no, | |
259 UBYTE sub_no ); | |
260 | |
261 | |
262 EXTERN T_DTI_ENTITY_ID dti_cntrl_get_peer( T_DTI_ENTITY_ID ent_id, | |
263 UBYTE dev_no, | |
264 UBYTE sub_no ); | |
265 | |
266 | |
267 EXTERN BOOL dti_cntrl_set_conn_parms( T_DTI_CONN_LINK_ID link_id, | |
268 T_DTI_ENTITY_ID ent_id, | |
269 UBYTE dev_no, | |
270 UBYTE sub_no ); | |
271 | |
272 | |
273 EXTERN void dti_cntrl_clear_conn_parms( UBYTE dti_id ); | |
274 | |
275 |