comparison g23m/condat/ms/src/aci/psa_gmm.h @ 0:509db1a7b7b8

initial import: leo2moko-r1
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 01 Jun 2015 03:24:05 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:509db1a7b7b8
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 the protocol stack adapter
18 | GPRS Mobility Management ( GMM ).
19 +-----------------------------------------------------------------------------
20 */
21
22 #ifdef GPRS
23
24 #ifndef PSA_GMM_H
25 #define PSA_GMM_H
26
27
28 /************************************************************************
29 ** GMM PRIMITIVE TRACE **
30 ************************************************************************/
31
32 #define GMM_PRIMITIVE_TRACES GMM_PRIMITIVE_TRACES
33 //#define GMM_PRIMITIVE_TRACES_ADVANCED GMM_PRIMITIVE_TRACES_ADVANCED
34
35 /************************************************************************
36 ** switching on of and mode over above mentioned defines **
37 ** ----------------------------------------------------- **
38 ** advanced means: a short string output of the parameter **
39 ** **
40 ** without advanced: only numbers **
41 ************************************************************************/
42
43 #ifdef GMM_PRIMITIVE_TRACES_ADVANCED
44
45 #define PARAMETER_STRING_1 "%s: %s"
46 #define PARAMETER_STRING_2 "%s: %s %s"
47
48 extern char* dbg_attachType(UBYTE attach_type);
49 extern char* dbg_detachType(UBYTE detach_type);
50 extern char* dbg_mobileClass(UBYTE mobile_class);
51 extern char* dbg_searchRunning(UBYTE search_running)
52 extern char* dbg_cellState(UBYTE cell_state)
53
54 #else
55
56 # define PARAMETER_STRING_1 "%d"
57 # define PARAMETER_STRING_2 "%d %d"
58
59 # define dbg_attachType
60 # define dbg_detachType
61 # define dbg_mobileClass
62 # define dbg_searchRunning
63 # define dbg_cellState
64
65 #endif /* GMM_PRIMITIVE_TRACES_ADVANCED */
66
67 #if defined GMM_PRIMITIVE_TRACES
68 # define GMM_PRIM_TRACE_1(a,b) TRACE_EVENT_P1(PARAMETER_STRING_1, b)
69 # define GMM_PRIM_TRACE_2(a,b,c) TRACE_EVENT_P2(PARAMETER_STRING_2, b, c)
70
71 #elif defined GMM_PRIMITIVE_TRACES_ADVANCED
72 # define GMM_PRIM_TRACE_1(a,b) TRACE_EVENT_P2(PARAMETER_STRING_1, a, b)
73 # define GMM_PRIM_TRACE_2(a,b,c) TRACE_EVENT_P3(PARAMETER_STRING_2, a, b, c)
74
75 #else
76 # define GMM_PRIM_TRACE_1(a,b)
77 # define GMM_PRIM_TRACE_2(a,b,c)
78 #endif /* GMM_PRIMITIVE_TRACES || GMM_PRIMITIVE_TRACES_ADVANCED */
79
80 /************************************************************************
81 ** GMM PRIMITIVE TRACE **
82 ************************************************************************/
83
84
85 /*==== CONSTANTS ==================================================*/
86 #define INVLD_PLMN (0xFF) /* marks an invalid PLMN */
87 #define ATTACH_TYPE_DETACHED 0
88
89 typedef enum /* PSA notification events */
90 {
91 GMM_NTF_ATT_CNF = 0, /* the attach was successful */
92 GMM_NTF_ATT_REJ, /* the attach has failed */
93 GMM_NTF_DET_CNF, /* the network confirmed the detach */
94 GMM_NTF_DET_IND, /* A network initiated detach */
95 GMM_NTF_PLMN_IND, /* indicate a PLMN list */
96 GMM_NTF_SUSP_IND, /* */
97 GMM_NTF_RES_IND, /* */
98 GMM_NTF_INFO_IND, /* transmit information */
99 GMM_NTF_MAX /* maximum MM notification event */
100
101 } T_GMM_NTF; /* finished */
102
103 typedef enum /* test parameter identifier */
104 {
105 GMM_OFF = 0, /* the */
106 GMM_DETACHED, /* detached */
107 GMM_ATTACHED, /* attached */
108 GMM_ATTACHING, /* will be attached */
109 GMM_DETACHING, /* will be detached */
110 GMM_SUSPENTED /* suspented */
111
112 } T_GMM_ATTACH_STATE;
113
114 /*==== TYPES ======================================================*/
115
116 typedef struct GMMShrdParm
117 {
118 /* state parameter */
119 UBYTE mobile_class; /* 0: A 1: B 2: C 3: CG 4: CC */
120 UBYTE service_mode;
121
122 /* set parameter */
123 UBYTE requested_mobile_class; /* 0: A 1: B 2: C 3: CG 4: CC */
124
125 /* answer parameter */
126 UBYTE gprs_status[MAX_PLMN_ID]; /* 0 - 2: which the PLMN supports */
127 UBYTE last_attach_type;
128 UBYTE current_attach_type;
129 UBYTE requested_attach_type;
130
131 /* GPRS registration status parameters */
132 T_CGREG_STAT cgreg_stat; /* +CGREG status */
133 T_P_CGREG_STAT p_cgreg_stat; /* %CGREG status */
134 USHORT lac; /* current cell coordinates */
135 USHORT cid;
136 T_ACI_P_CREG_GPRS_IND gprs_indicator; /* %CREG gprs indicator */
137 } T_GMM_SHRD_PRM;
138
139 /*==== PROTOTYPES =================================================*/
140
141 EXTERN void psaGMM_Init (UBYTE auto_attach, UBYTE auto_detach, UBYTE mobile_class );
142 EXTERN void psaGMM_NetworkRegistrationStatus ( ULONG prim, void* para);
143
144 EXTERN void psaGMM_Attach ( UBYTE mobile_class, UBYTE attach_type, UBYTE service_mode );
145 EXTERN void psaGMM_Detach ( UBYTE detach_type );
146 EXTERN void psaGMM_Net_Req ( void );
147 EXTERN void psaGMM_Plmn_res ( UBYTE mobile_class, UBYTE attach_type, T_plmn *plmn );
148 EXTERN void psaGMM_Plmn_mode_req ( UBYTE net_selection_mode );
149 EXTERN void psaGMM_Config_req( UBYTE cipher_on, UBYTE tlli_handling );
150
151 /*==== EXPORT =====================================================*/
152
153 #ifdef PSA_GMMF_C
154
155 GLOBAL T_GMM_SHRD_PRM gmmShrdPrm;
156
157 GLOBAL UBYTE default_mobile_class = GMMREG_CLASS_BG;
158 GLOBAL T_CGAATT_ATTACH_MODE automatic_attach_mode;
159 GLOBAL T_CGAATT_DETACH_MODE automatic_detach_mode;
160
161 #else
162
163 EXTERN T_GMM_SHRD_PRM gmmShrdPrm;
164
165 EXTERN UBYTE default_mobile_class;
166 EXTERN T_CGAATT_ATTACH_MODE automatic_attach_mode;
167 EXTERN T_CGAATT_DETACH_MODE automatic_detach_mode;
168
169 #endif /* PSA_GMMF_C */
170
171 #endif /* PSA_GMM_H */
172
173 #endif /* GPRS */
174 /*==== EOF =======================================================*/