FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/g23m-aci/aci/psa_smf.c @ 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 : | |
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) CMD_SRC_NONE; | |
82 } | |
83 | |
84 #if 0 | |
85 GLOBAL void psaSNDCP_Dti_Req( T_DTI_CONN_LINK_ID link_id, UBYTE peer ) | |
86 { | |
87 TRACE_FUNCTION("psaSNDCP_Dti_Req()"); | |
88 | |
89 switch ( peer ) | |
90 { | |
91 case DTI_ENTITY_PPPS: | |
92 /* do nothing, because this will be implicit doing psaGPPPS_Dti_Req( link_id, UNIT_UART ) */ | |
93 break; | |
94 #ifdef FF_TCP_IP | |
95 case DTI_ENTITY_AAA: | |
96 #endif /* FF_TCP_IP */ | |
97 #ifdef FF_GPF_TCPIP | |
98 case DTI_ENTITY_TCPIP: | |
99 #endif | |
100 case DTI_ENTITY_NULL: | |
101 case DTI_ENTITY_IP: | |
102 #ifdef FF_SAT_E | |
103 case DTI_ENTITY_SIM: | |
104 #endif /* FF_SAT_E */ | |
105 case DTI_ENTITY_PKTIO: | |
106 case DTI_ENTITY_PSI: | |
107 pdp_context[work_cids[cid_pointer] - 1].link_id_new = link_id; | |
108 { | |
109 UBYTE ppp_hc = 0; | |
110 UBYTE msid = 0; | |
111 cmhSM_connect_context(gaci_get_cid_over_link_id( link_id ), | |
112 (T_DTI_ENTITY_ID)peer, ppp_hc, msid); | |
113 } | |
114 break; | |
115 } | |
116 } | |
117 | |
118 | |
119 #if 0 | |
120 /* | |
121 +-------------------------------------------------------------------+ | |
122 | PROJECT : GSM-PS (6147) MODULE : PSA_SMF | | |
123 | ROUTINE : psaSM_shrPrmDump | | |
124 +-------------------------------------------------------------------+ | |
125 | |
126 PURPOSE : this function dumps the shared parameter to the debug | |
127 output. | |
128 */ | |
129 | |
130 GLOBAL void psaSM_shrPrmDump ( void ) | |
131 { | |
132 #ifdef TRACING | |
133 | |
134 char lnBuf [80]; /* holds buffer for output line */ | |
135 char mccBuf[SIZE_MCC + 1]; /* MCC converted to printable C-string */ | |
136 char mncBuf[SIZE_MNC + 1]; /* MNC converted to printable C-string */ | |
137 SHORT chrNr; /* holds number of processed chars */ | |
138 SHORT cnt; /* holds a counter */ | |
139 | |
140 /* --- PLMN list ------------------------------------------------*/ | |
141 for( cnt = 0; cnt<MAX_PLMN_ID AND | |
142 mmShrdPrm.PLMNLst[cnt].v_plmn NEQ INVLD_PLMN; cnt++ ) | |
143 { | |
144 chrNr = sprintf( lnBuf, "%*.*s[%2d]", HDR_WDT, HDR_WDT, " PLMN list",cnt ); | |
145 utl_BCD2String (mccBuf, mmShrdPrm.PLMNLst[cnt].mcc, SIZE_MCC); | |
146 utl_BCD2String (mncBuf, mmShrdPrm.PLMNLst[cnt].mnc, SIZE_MNC); | |
147 chrNr += sprintf( lnBuf+chrNr, "%*s %*s", | |
148 ITM_WDT/2, ITM_WDT/2, mccBuf, mncBuf); | |
149 TRACE_EVENT( lnBuf ); | |
150 } | |
151 | |
152 /* --- used PLMN ------------------------------------------------*/ | |
153 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, " used PLMN" ); | |
154 if( mmShrdPrm.usedPLMN.v_plmn EQ VLD_PLMN ) | |
155 { | |
156 utl_BCD2String (mccBuf, mmShrdPrm.usedPLMN.mcc, SIZE_MCC); | |
157 utl_BCD2String (mncBuf, mmShrdPrm.usedPLMN.mnc, SIZE_MNC); | |
158 chrNr += sprintf( lnBuf+chrNr, "%*s %*s", | |
159 ITM_WDT/2, ITM_WDT/2, mccBuf, mncBuf); | |
160 } | |
161 else | |
162 { | |
163 chrNr += sprintf( lnBuf+chrNr, "%*s", ITM_WDT, "none" ); | |
164 } | |
165 TRACE_EVENT( lnBuf ); | |
166 | |
167 /* --- registration mode ----------------------------------------*/ | |
168 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, "rgstr mode" ); | |
169 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT, | |
170 mmShrdPrm.setPrm[0].regMode ); | |
171 TRACE_EVENT( lnBuf ); | |
172 | |
173 /* --- registration status --------------------------------------*/ | |
174 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, "rgstr stat" ); | |
175 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT, | |
176 mmShrdPrm.regStat ); | |
177 TRACE_EVENT( lnBuf ); | |
178 | |
179 /* --- search result --------------------------------------------*/ | |
180 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, " srch rslt" ); | |
181 chrNr += sprintf( lnBuf+chrNr, "%*hd", ITM_WDT, | |
182 mmShrdPrm.srchRslt ); | |
183 TRACE_EVENT( lnBuf ); | |
184 | |
185 /* --- de-registration cause ------------------------------------*/ | |
186 chrNr = sprintf( lnBuf, "%*.*s", HDR_WDT, HDR_WDT, "dereg caus" ); | |
187 chrNr += sprintf( lnBuf+chrNr, "%*X", ITM_WDT, | |
188 mmShrdPrm.deregCs ); | |
189 TRACE_EVENT( lnBuf ); | |
190 | |
191 #endif /* of #ifdef TRACING */ | |
192 } | |
193 #endif /* #if 0 */ | |
194 #endif /* #if 0 */ | |
195 #endif /* GPRS */ | |
196 /*==== EOF ========================================================*/ | |
197 |