comparison gsm-fw/g23m-gsm/mm/mm_mmp.c @ 723:1f78e5fda218

mm_mmp.c compiles
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sat, 04 Oct 2014 20:36:23 +0000
parents 2f7df7a314f8
children
comparison
equal deleted inserted replaced
722:0e4567b020b9 723:1f78e5fda218
20 */ 20 */
21 21
22 #ifndef MM_MMP_C 22 #ifndef MM_MMP_C
23 #define MM_MMP_C 23 #define MM_MMP_C
24 24
25 #include "config.h"
26 #include "fixedconf.h"
27 #include "condat-features.h"
28
25 #define ENTITY_MM 29 #define ENTITY_MM
26 30
27 /*==== INCLUDES ===================================================*/ 31 /*==== INCLUDES ===================================================*/
28 #if defined (NEW_FRAME) 32 #if defined (NEW_FRAME)
29 33
295 { 299 {
296 #if defined (FF_EOTD) AND defined (REL99) 300 #if defined (FF_EOTD) AND defined (REL99)
297 /*check the flag rrlp_lcs_started value. True if rrlp is running, False if no rrlp is runnig.*/ 301 /*check the flag rrlp_lcs_started value. True if rrlp is running, False if no rrlp is runnig.*/
298 if(mm_data->rrlp_lcs_started EQ TRUE) 302 if(mm_data->rrlp_lcs_started EQ TRUE)
299 { 303 {
300 /* 304 /*
301 * Enter state MM_RR_CONN_RELEASE_NOT_ALLOWED only if the last 305 * Enter state MM_RR_CONN_RELEASE_NOT_ALLOWED only if the last
302 * active MM connection has been released by the CM layer 306 * active MM connection has been released by the CM layer
303 * and there is rrlp service on going. 307 * and there is rrlp service on going.
304 */ 308 */
305 TIMERSTART (T3241, T_3241_VALUE); 309 TIMERSTART (T3241, T_3241_VALUE);
306 SET_STATE (STATE_MM, MM_RR_CONN_RELEASE_NOT_ALLOWED); 310 SET_STATE (STATE_MM, MM_RR_CONN_RELEASE_NOT_ALLOWED);
307 } 311 }
308 else 312 else
309 #endif /* (FF_EOTD) AND defined (REL99) */ 313 #endif /* (FF_EOTD) AND defined (REL99) */
310 { 314 {
311 /* 315 /*
312 * Enter state MM_WAIT_FOR_NW_CMD only if the last 316 * Enter state MM_WAIT_FOR_NW_CMD only if the last
313 * active MM connection has been released by the CM layer 317 * active MM connection has been released by the CM layer
314 * and there is no pending connection. Otherwise keep state. 318 * and there is no pending connection. Otherwise keep state.
315 */ 319 */
316 TIMERSTART (T3240, T_3240_VALUE); 320 TIMERSTART (T3240, T_3240_VALUE);
317 SET_STATE (STATE_MM, MM_WAIT_FOR_NW_CMD); 321 SET_STATE (STATE_MM, MM_WAIT_FOR_NW_CMD);
318 } 322 }
319 } 323 }
320 break; 324 break;
321 325
322 default: 326 default:
323 break; 327 break;
394 /* Find IDLE state after MM connection */ 398 /* Find IDLE state after MM connection */
395 mm_release_rr_connection (MMGMM_RESUMPTION_FAILURE); 399 mm_release_rr_connection (MMGMM_RESUMPTION_FAILURE);
396 } 400 }
397 else 401 else
398 { 402 {
399 /* 403 /*
400 * RR has already signalled a cell which is 404 * RR has already signalled a cell which is
401 * suitable for call reestablishment 405 * suitable for call reestablishment
402 * This could be explained to me. Why is in the release 406 * This could be explained to me. Why is in the release
403 * routine reestablishment performed. I never understood 407 * routine reestablishment performed. I never understood
404 * the problem which was solved here. Implementation problem? ... 408 * the problem which was solved here. Implementation problem? ...
405 */ 409 */
406 if (mm_data->reest_cell_avail) 410 if (mm_data->reest_cell_avail)
407 mm_reest (mm_data->reest_ti); 411 mm_reest (mm_data->reest_ti);
408 } 412 }
409 } 413 }
410 break; 414 break;
830 834
831 switch (mmcm_establish_req->org_entity) 835 switch (mmcm_establish_req->org_entity)
832 { 836 {
833 case MMCM_ORG_ENTITY_CC: 837 case MMCM_ORG_ENTITY_CC:
834 838
835 mm_mmxx_establish_req (CC_COMP, 839 mm_mmxx_establish_req (CC_COMP,
836 mmcm_establish_req->ti, 840 mmcm_establish_req->ti,
837 mmcm_establish_req->estcs, 841 mmcm_establish_req->estcs,
838 UNSPEC); 842 UNSPEC);
839 break; 843 break;
840 844
841 case MMCM_ORG_ENTITY_SS: 845 case MMCM_ORG_ENTITY_SS:
842 mm_mmxx_establish_req (SS_COMP, mmcm_establish_req->ti, 0,UNSPEC); 846 mm_mmxx_establish_req (SS_COMP, mmcm_establish_req->ti, 0,UNSPEC);
843 break; 847 break;
1090 mm_data->rr_abort_prior_to_tabort = FALSE; 1094 mm_data->rr_abort_prior_to_tabort = FALSE;
1091 break; 1095 break;
1092 } 1096 }
1093 1097
1094 1098
1095
1096
1097 if (rr_abort_ind->op.service EQ LIMITED_SERVICE) 1099 if (rr_abort_ind->op.service EQ LIMITED_SERVICE)
1098 mm_data->rf_power = rr_abort_ind->power; 1100 mm_data->rf_power = rr_abort_ind->power;
1099 1101
1100 switch (GET_STATE (STATE_MM)) 1102 switch (GET_STATE (STATE_MM))
1101 { 1103 {
1172 { 1174 {
1173 /* 1175 /*
1174 * The RR_ABORT_IND is not indicating the end of a search for 1176 * The RR_ABORT_IND is not indicating the end of a search for
1175 * available networks. 1177 * available networks.
1176 */ 1178 */
1177 TIMERSTOP (T3210); 1179 TIMERSTOP (T3210);
1178 mm_mdl_rel_req (); 1180 mm_mdl_rel_req ();
1179 if (rr_abort_ind->cause EQ RRCS_ABORT_CEL_SEL_FAIL) 1181 if (rr_abort_ind->cause EQ RRCS_ABORT_CEL_SEL_FAIL)
1180 { 1182 {
1181 TIMERSTOP (T3211); 1183 TIMERSTOP (T3211);
1182 TIMERSTOP (T3213); 1184 TIMERSTOP (T3213);
1183 mm_data->t3213_restart = 0; 1185 mm_data->t3213_restart = 0;
1184 mm_mmxx_rel_ind (rr_abort_ind->cause, CM_NOT_IDLE); 1186 mm_mmxx_rel_ind (rr_abort_ind->cause, CM_NOT_IDLE);
1185 mm_mmgmm_cm_release_ind (MMGMM_RESUMPTION_FAILURE); 1187 mm_mmgmm_cm_release_ind (MMGMM_RESUMPTION_FAILURE);
1186 switch (rr_abort_ind->op.service) 1188 switch (rr_abort_ind->op.service)
1187 { 1189 {
1188 case NO_SERVICE: 1190 case NO_SERVICE:
1189 SET_STATE (STATE_MM, MM_IDLE_NO_CELL_AVAILABLE); 1191 SET_STATE (STATE_MM, MM_IDLE_NO_CELL_AVAILABLE);
1190 break; 1192 break;
1191 1193
1192 case LIMITED_SERVICE: 1194 case LIMITED_SERVICE:
1193 SET_STATE (STATE_MM, MM_IDLE_LIMITED_SERVICE); 1195 SET_STATE (STATE_MM, MM_IDLE_LIMITED_SERVICE);
1194 break; 1196 break;
1195 1197
1196 default: /* eg. FULL_SERVICE and reg_rr_failure => nonsense */ 1198 default: /* eg. FULL_SERVICE and reg_rr_failure => nonsense */
1197 TRACE_ERROR (UNEXPECTED_DEFAULT); 1199 TRACE_ERROR (UNEXPECTED_DEFAULT);
1198 break; 1200 break;
1199 } 1201 }
1200 reg_rr_failure (rr_abort_ind); 1202 reg_rr_failure (rr_abort_ind);
1201 } 1203 }
1202 else 1204 else
1203 { 1205 {
1204 mm_lup_restart (); 1206 mm_lup_restart ();
1205 } 1207 }
1206 } 1208 }
1207 break; 1209 break;
1208 1210
1209 case MM_WAIT_FOR_RR_CONN_MM: 1211 case MM_WAIT_FOR_RR_CONN_MM:
1210 if (rr_abort_ind->op.func EQ FUNC_NET_SRCH_BY_MMI) 1212 if (rr_abort_ind->op.func EQ FUNC_NET_SRCH_BY_MMI)
1237 } 1239 }
1238 else 1240 else
1239 { 1241 {
1240 if (mm_data->pend_conn.cause EQ MMCM_ESTCS_EMERGE) 1242 if (mm_data->pend_conn.cause EQ MMCM_ESTCS_EMERGE)
1241 { 1243 {
1242 /* 1244 /*
1243 * Clash RR_ESTABLISH_REQ (emergency call) / 1245 * Clash RR_ESTABLISH_REQ (emergency call) /
1244 * RR_ABORT_IND (limited service). 1246 * RR_ABORT_IND (limited service).
1245 * RR dropped the RR_ESTABLISH_REQ. 1247 * RR dropped the RR_ESTABLISH_REQ.
1246 * Repeat the emergency call attempt. 1248 * Repeat the emergency call attempt.
1247 */ 1249 */
1248 mm_rr_est_req (mm_data->pend_conn.cause, 1250 mm_rr_est_req (mm_data->pend_conn.cause,
1249 mm_data->pend_conn.service, 1251 mm_data->pend_conn.service,
1250 mm_data->pend_conn.ti); 1252 mm_data->pend_conn.ti);
1251 /* Remain in state MM_WAIT_FOR_RR_CONN_MM */ 1253 /* Remain in state MM_WAIT_FOR_RR_CONN_MM */
1252 } 1254 }
1427 1429
1428 if (rr_abort_ind->cause EQ RRCS_ABORT_PTM) 1430 if (rr_abort_ind->cause EQ RRCS_ABORT_PTM)
1429 { 1431 {
1430 if(mm_data->net_search_count < 2) 1432 if(mm_data->net_search_count < 2)
1431 { 1433 {
1432 /* Since GPRS is in PTM there seems to be no need to inform 1434 /*
1433 * ACI of the Network list 1435 * Since GPRS is in PTM there seems to be no need to inform
1436 * ACI of the Network list
1434 * Also,MM should start with 10 secs timer and on the expiry of 1437 * Also,MM should start with 10 secs timer and on the expiry of
1435 * this timer should initiate the plmn scan search again 1438 * this timer should initiate the plmn scan search again
1436 */ 1439 */
1437 TIMERSTART(T_HPLMN,10000); 1440 TIMERSTART(T_HPLMN,10000);
1438 mm_data->net_search_count++; 1441 mm_data->net_search_count++;
1439 } 1442 }
1440 else 1443 else
1441 { 1444 {
1442 /* The user initiated network search should be repeated only twice 1445 /*
1446 * The user initiated network search should be repeated only twice
1443 * and empty PLMN list should be returned. But if the search was 1447 * and empty PLMN list should be returned. But if the search was
1444 * other than user initiated network scan allow repetions till PLMN 1448 * other than user initiated network scan allow repetions till
1445 * search is a success. This should be tried every 2 mins. 1449 * PLMN search is a success. This should be tried every 2 mins.
1446 */ 1450 */
1447 if ( mm_data->plmn_scan_mmi ) 1451 if ( mm_data->plmn_scan_mmi )
1448 reg_net_list (rr_abort_ind); 1452 reg_net_list (rr_abort_ind);
1449 else 1453 else
1450 TIMERSTART(T_HPLMN,120000); 1454 TIMERSTART(T_HPLMN,120000);
1453 else 1457 else
1454 { 1458 {
1455 mm_data->net_search_count = 0;/*Network Scan successful,reset couter*/ 1459 mm_data->net_search_count = 0;/*Network Scan successful,reset couter*/
1456 reg_net_list (rr_abort_ind); /* Build and send the list */ 1460 reg_net_list (rr_abort_ind); /* Build and send the list */
1457 } 1461 }
1458 1462
1459
1460 if (GET_STATE (STATE_MM) NEQ MM_WAIT_FOR_RR_ACTIVE) 1463 if (GET_STATE (STATE_MM) NEQ MM_WAIT_FOR_RR_ACTIVE)
1461 { 1464 {
1462 /* 1465 /*
1463 * reg_net_list () didn't select a different PLMN. 1466 * reg_net_list () didn't select a different PLMN.
1464 * Check whether MM needs a location update procedure. 1467 * Check whether MM needs a location update procedure.
2135 2138
2136 #ifdef GPRS 2139 #ifdef GPRS
2137 case MM_LOCATION_UPDATING_PENDING: 2140 case MM_LOCATION_UPDATING_PENDING:
2138 case MM_IMSI_DETACH_PENDING: 2141 case MM_IMSI_DETACH_PENDING:
2139 /* 2142 /*
2140 *What to do here?... 2143 * What to do here?...
2141 */ 2144 */
2142 assert (GET_STATE (STATE_REG_TYPE) EQ REG_CELL_SEARCH_ONLY); 2145 assert (GET_STATE (STATE_REG_TYPE) EQ REG_CELL_SEARCH_ONLY);
2143 TRACE_EVENT ("This needs still discussion"); 2146 TRACE_EVENT ("This needs still discussion");
2144 /*FALLTHROUGH*/ 2147 /*FALLTHROUGH*/
2145 /* lint -fallthrough */ 2148 /* lint -fallthrough */
2146 #endif /* GPRS */ 2149 #endif /* GPRS */
2217 switch (mm_data->rej_cause) 2220 switch (mm_data->rej_cause)
2218 { 2221 {
2219 case RRCS_MM_ABORTED: /* GSM 04.08 4.4.4.9 e), T3210 */ 2222 case RRCS_MM_ABORTED: /* GSM 04.08 4.4.4.9 e), T3210 */
2220 case RRCS_ABNORM_UNSPEC: /* GSM 04.08 4.4.4.9 f), ABNORM */ 2223 case RRCS_ABNORM_UNSPEC: /* GSM 04.08 4.4.4.9 f), ABNORM */
2221 /* 2224 /*
2222 * donīt start normal location updating if the state 2225 * don't start normal location updating if the state
2223 * has been entered after T3210 timeout or the network 2226 * has been entered after T3210 timeout or the network
2224 * released the RR connection with RR cause RRCS_ABNORM_UNSPEC. 2227 * released the RR connection with RR cause RRCS_ABNORM_UNSPEC.
2225 */ 2228 */
2226 perform_lup = FALSE; 2229 perform_lup = FALSE;
2227 break; 2230 break;
3379 3382
3380 default : 3383 default :
3381 break; 3384 break;
3382 } 3385 }
3383 PFREE (rr_rrlp_start_ind); 3386 PFREE (rr_rrlp_start_ind);
3384 } 3387 }
3385 3388
3386 3389
3387 /* 3390 /*
3388 +--------------------------------------------------------------------+ 3391 +--------------------------------------------------------------------+
3389 | PROJECT : GSM-PS (6147) MODULE : MM_MM | 3392 | PROJECT : GSM-PS (6147) MODULE : MM_MM |
3624 } 3627 }
3625 reg_rr_failure (rr_abort_ind); 3628 reg_rr_failure (rr_abort_ind);
3626 } 3629 }
3627 } 3630 }
3628 3631
3629
3630 #endif 3632 #endif