comparison src/g23m-aci/aci/gaci.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 :
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 : Definitions for GPRS command handler and protocol stack adapter.
18 +-----------------------------------------------------------------------------
19 */
20
21 #include "dti.h"
22 #ifdef GPRS
23 #include "gaci_cmh.h"
24 #endif
25 #ifndef GACI_H
26 #define GACI_H
27
28
29
30 /*** T_CONTEXT_STATE changed to T_PDP_CONTEXT_STATE and moved to gaci_cmh.h ***/
31
32 #define NSAPI_TO_CID(A) ( (U8)((A)-4) )
33 #define CID_TO_NSAPI(A) ( (U16)((A)+4) )
34
35
36 typedef enum
37 {
38 AS_INVALID_STATE = 0, /* invalid value */
39 AS_MOBILE_OFF, /* the protocol stack is off before +CFUN=1 */
40 AS_DETACHED, /* GPRS detached */
41 AS_ATTACHED, /* GPRS attached */
42 AS_ATTACHING, /* attaching GPRS */
43 AS_DETACHING, /* detaching GPRS */
44 AS_SUSPENTED /* GPRS suspended */
45
46 } T_ATTACH_STATE;
47
48 typedef enum
49 {
50 GC_TYPE_NONE = -1, /* no connection */
51 GC_TYPE_DATA_LINK = 0, /* Data connection over PPP */
52 GC_TYPE_NULL, /* Data connection with NULL Device */
53 GC_TYPE_SIM, /* Data connection with SIM */
54 GC_TYPE_WAP, /* Data connection for the WAP browser */
55 #if defined (FF_PKTIO) OR defined (FF_TCP_IP) || defined(FF_GPF_TCPIP) OR defined (FF_PSI)
56 GC_TYPE_PKT, /* Data connection for PKTIO */
57 #endif /* FF_PKTIO OR FF_TCP_IP || FF_GPF_TCPIP OR FF_PSI */
58 GC_TYPE_EMAIL /* Data connection for an Email - Client */
59
60 } T_GPRS_CONNECT_TYPE;
61
62 #ifdef GPRS
63 typedef struct
64 {
65 T_PDP_CONTEXT_STATE state;
66 UBYTE smreg_ti;
67 T_DTI_ENTITY_ID entity_id;
68 T_DTI_CONN_LINK_ID link_id; /* link_id for SNDCP */
69 T_DTI_CONN_LINK_ID link_id_uart;
70 T_DTI_CONN_LINK_ID link_id_new;
71 USHORT upper_tui;
72 T_ACI_CMD_SRC owner;
73 T_NAS_ip pdp_address_allocated;
74 T_PDP_CONTEXT_PCO user_pco; /* setup with %CGPCO=... */
75 T_PDP_CONTEXT_PCO network_pco;
76 T_SMREG_PDP_ACTIVATE_CNF *p_pdp_activate_cnf;
77
78 } T_PDP_CONTEXT_INTERNAL_DATA;
79
80
81 typedef struct _T_PDP_CONTEXT_INTERNAL
82 {
83 T_PDP_CONTEXT_TYPE type;
84 U8 cid; /* PDP context id */
85 T_PDP_CONTEXT_INTERNAL_DATA internal_data;
86 T_PDP_CONTEXT attributes;
87 T_PS_ctrl_qos ctrl_qos;
88 T_PS_qos qos;
89 T_PS_ctrl_min_qos ctrl_min_qos;
90 T_PS_min_qos min_qos;
91 T_PS_ctrl_qos ctrl_neg_qos; /* holds the negotiated qos, set with smreg_pdp_activate_cnf is received */
92 T_PS_qos neg_qos; /* holds the negotiated qos, set with smreg_pdp_activate_cnf is received */
93 T_TFT_INTERNAL *p_tft_pf;
94 BOOL tft_changed; /* True if the TFT is changed while a PDP context is activated */
95 //T_TFT_INTERNAL *p_tft_pf_active;
96 //T_TFT_MODIFICATION_ACTION tft_modify;
97
98 struct _T_PDP_CONTEXT_INTERNAL *p_next;
99
100 } T_PDP_CONTEXT_INTERNAL;
101
102
103
104 EXTERN T_PDP_CONTEXT_STATE get_state_over_cid ( U8 cid );
105 EXTERN void set_state_over_cid ( U8 cid, T_PDP_CONTEXT_STATE c_state );
106 EXTERN T_PDP_CONTEXT_STATE get_state_working_cid ( void );
107 EXTERN void set_state_working_cid ( T_PDP_CONTEXT_STATE c_state );
108 EXTERN T_ACI_CAL_OWN get_owner_over_cid ( U8 cid );
109 EXTERN T_PDP_CONTEXT_STATE get_state_over_nsapi_set( USHORT *nsapi_set, U8 *cid );
110
111
112 EXTERN T_PDP_CONTEXT_INTERNAL *pdp_context_create_node( U8 cid );
113 EXTERN int pdp_context_remove_node( U8 cid );
114 EXTERN T_PDP_CONTEXT_INTERNAL *pdp_context_find_node_from_cid( U8 cid );
115 EXTERN T_PDP_CONTEXT_INTERNAL *pdp_context_find_node_from_smreg_ti( U8 smreg_ti );
116 EXTERN T_PDP_CONTEXT_INTERNAL *pdp_context_find_node_from_dti_id( U8 dti_id );
117 EXTERN T_PDP_CONTEXT_INTERNAL *pdp_context_find_matching_node( T_SMREG_VAL_pdp_type smreg_pdp_type, T_NAS_ctrl_ip_address ctrl_ip_addr, T_NAS_ip_address *ip_addr );
118
119 EXTERN T_TFT_INTERNAL *pdp_context_add_tft_pf ( U8 cid, U8 tft_pf_id );
120 EXTERN BOOL pdp_context_del_tft_pf ( U8 cid, U8 tft_pf_id );
121 EXTERN T_TFT_INTERNAL *pdp_context_find_tft_pf( U8 cid, U8 tft_pf_id );
122 EXTERN U8 pdp_context_get_no_of_tft_pfs( U8 cid );
123 EXTERN void pdp_context_copy_tft_to_active_list( U8 cid );
124 //EXTERN T_TFT_MODIFICATION pdp_context_get_modification_action( U8 cid );
125 EXTERN void pdp_context_clear_tft_active_list( U8 cid );
126 //EXTERN T_TFT_MODIFICATION pdp_context_compare_tft( U8 cid );
127 EXTERN U8 pdp_context_check_if_nodes_exists( U8 *cid_array );
128 EXTERN U8 pdp_context_validate_pdp_type ( U8 *cid_array, T_PDP_TYPE pdp_type );
129
130 #endif /*GPRS */
131
132 EXTERN void gaci_init ( void );
133 EXTERN void gaci_reset ( void );
134 EXTERN void gaci_finit ( void );
135
136 #ifdef DTI
137 EXTERN SHORT gaci_get_cid_over_link_id ( T_DTI_CONN_LINK_ID link_id );
138 EXTERN SHORT gaci_get_cid_over_dti_id ( UBYTE dti_id );
139 EXTERN T_DTI_CONN_LINK_ID gaci_get_link_id_over_peer ( T_DTI_ENTITY_ID entity_id );
140 #endif
141
142 EXTERN void cmhSM_disconnect_cid ( SHORT cid, T_GPRS_CONNECT_TYPE type );
143 EXTERN BOOL uart_is_mt_te_link( void );
144
145 /* for ATZ */
146 EXTERN T_ACI_RETURN sGprsAT_Z ( T_ACI_CMD_SRC srcId );
147 EXTERN BOOL gaci_isATZcmd ( void );
148
149
150 EXTERN U8 pdp_context_get_free_cid( void );
151
152
153 EXTERN void gaci_RAT_caller ( SHORT rat_id, SHORT cid, UBYTE cmdBuf, UBYTE cme_err );
154 EXTERN void gaci_SAT_err(USHORT cause);
155
156 #endif /* GACI_H */
157