comparison src/aci2/aci/psa_smf.c @ 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 :
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 : This module defines the functions for the protocol
18 | stack adapter for the registration part of session
19 | management ( SM ).
20 +-----------------------------------------------------------------------------
21 */
22
23 #if defined (GPRS) && defined (DTI)
24
25 #ifndef PSA_SMF_C
26 #define PSA_SMF_C
27 #endif
28
29 #include "aci_all.h"
30
31 #undef TRACING
32 /*==== INCLUDES ===================================================*/
33 #include "dti.h" /* functionality of the dti library */
34 #include "aci_cmh.h"
35 #include "ati_cmd.h"
36 #include "aci_cmd.h"
37 #include "aci.h"
38
39 #include "dti_conn_mng.h"
40 #include "dti_cntrl_mng.h"
41
42 #include "gaci.h"
43 #include "psa.h"
44 #include "gaci_cmh.h"
45 #include "psa_sm.h"
46 #include "cmh.h"
47 #include "cmh_sm.h"
48
49
50 /*==== CONSTANTS ==================================================*/
51
52 /*==== TYPES ======================================================*/
53
54 /*==== EXPORT =====================================================*/
55
56 /*==== VARIABLES ==================================================*/
57
58 /*==== FUNCTIONS ==================================================*/
59
60
61 /*
62 +-------------------------------------------------------------------+
63 | PROJECT : GPRS (8441) MODULE : PSA_GMMF |
64 | ROUTINE : psaGMM_Init |
65 +-------------------------------------------------------------------+
66
67 PURPOSE : initialize the protocol stack adapter for GMM.
68
69 */
70
71
72 GLOBAL void psaSM_Init ( void )
73 {
74 /* UBYTE LpCnt;*/ /* holds loop counter for macro */
75
76 /*
77 *-------------------------------------------------------------------
78 * set default parms
79 *-------------------------------------------------------------------
80 */
81 smShrdPrm.owner = (UBYTE) OWN_NONE;
82 }
83
84 GLOBAL void psaSNDCP_Dti_Req( T_DTI_CONN_LINK_ID link_id, UBYTE peer )
85 {
86 TRACE_FUNCTION("psaSNDCP_Dti_Req()");
87
88 switch ( peer )
89 {
90 case DTI_ENTITY_PPPS:
91 /* do nothing, because this will be implicit doing psaGPPPS_Dti_Req( link_id, UNIT_UART ) */
92 break;
93 #ifdef FF_TCP_IP
94 case DTI_ENTITY_AAA:
95 #endif /* FF_TCP_IP */
96 #ifdef FF_GPF_TCPIP
97 case DTI_ENTITY_TCPIP:
98 #endif
99 case DTI_ENTITY_NULL:
100 case DTI_ENTITY_IP:
101 #ifdef FF_SAT_E
102 case DTI_ENTITY_SIM:
103 #endif /* FF_SAT_E */
104 case DTI_ENTITY_PKTIO:
105 case DTI_ENTITY_PSI:
106 pdp_context[work_cids[cid_pointer] - 1].link_id_new = link_id;
107 {
108 UBYTE ppp_hc = 0;
109 UBYTE msid = 0;
110 cmhSM_connect_context(gaci_get_cid_over_link_id( link_id ),
111 peer, ppp_hc, msid);
112 }
113 break;
114 }
115 }
116
117
118 #if 0
119 /*
120 +-------------------------------------------------------------------+
121 | PROJECT : GSM-PS (6147) MODULE : PSA_SMF |
122 | ROUTINE : psaSM_shrPrmDump |
123 +-------------------------------------------------------------------+
124
125 PURPOSE : this function dumps the shared parameter to the debug
126 output.
127 */
128
129 GLOBAL void psaSM_shrPrmDump ( void )
130 {
131 #ifdef TRACING
132
133 char lnBuf [80]; /* holds buffer for output line */
134 char mccBuf[SIZE_MCC + 1]; /* MCC converted to printable C-string */
135 char mncBuf[SIZE_MNC + 1]; /* MNC converted to printable C-string */
136 SHORT chrNr; /* holds number of processed chars */
137 SHORT cnt; /* holds a counter */
138
139 /* --- PLMN list ------------------------------------------------*/
140 for( cnt = 0; cnt<MAX_PLMN_ID AND
141 mmShrdPrm.PLMNLst[cnt].v_plmn NEQ INVLD_PLMN; cnt++ )
142 {
143 chrNr = sprintf( lnBuf, "%*.*s[%2d]", HDR_WDT, HDR_WDT, " PLMN list",cnt );
144 utl_BCD2String (mccBuf, mmShrdPrm.PLMNLst[cnt].mcc, SIZE_MCC);
145 utl_BCD2String (mncBuf, mmShrdPrm.PLMNLst[cnt].mnc, SIZE_MNC);
146 chrNr += sprintf( lnBuf+chrNr, "%*s %*s",
147 ITM_WDT/2, ITM_WDT/2, mccBuf, mncBuf);
148 TRACE_EVENT( lnBuf );
149 }
150
151 /* --- used PLMN ------------------------------------------------*/
152 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, " used PLMN" );
153 if( mmShrdPrm.usedPLMN.v_plmn EQ VLD_PLMN )
154 {
155 utl_BCD2String (mccBuf, mmShrdPrm.usedPLMN.mcc, SIZE_MCC);
156 utl_BCD2String (mncBuf, mmShrdPrm.usedPLMN.mnc, SIZE_MNC);
157 chrNr += sprintf( lnBuf+chrNr, "%*s %*s",
158 ITM_WDT/2, ITM_WDT/2, mccBuf, mncBuf);
159 }
160 else
161 {
162 chrNr += sprintf( lnBuf+chrNr, "%*s", ITM_WDT, "none" );
163 }
164 TRACE_EVENT( lnBuf );
165
166 /* --- registration mode ----------------------------------------*/
167 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, "rgstr mode" );
168 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT,
169 mmShrdPrm.setPrm[0].regMode );
170 TRACE_EVENT( lnBuf );
171
172 /* --- registration status --------------------------------------*/
173 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, "rgstr stat" );
174 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT,
175 mmShrdPrm.regStat );
176 TRACE_EVENT( lnBuf );
177
178 /* --- search result --------------------------------------------*/
179 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, " srch rslt" );
180 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT,
181 mmShrdPrm.srchRslt );
182 TRACE_EVENT( lnBuf );
183
184 /* --- de-registration cause ------------------------------------*/
185 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, "dereg caus" );
186 chrNr += sprintf( lnBuf+chrNr, "%*X", ITM_WDT,
187 mmShrdPrm.deregCs );
188 TRACE_EVENT( lnBuf );
189
190 #endif /* of #ifdef TRACING */
191 }
192 #endif /* #if 0 */
193
194 #endif /* GPRS */
195 /*==== EOF ========================================================*/
196