FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/g23m-gsm/mm/mm_mms.c @ 724:9e777968b08f
mm_mms.c compiles
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sat, 04 Oct 2014 20:54:40 +0000 |
parents | 2f7df7a314f8 |
children |
comparison
equal
deleted
inserted
replaced
723:1f78e5fda218 | 724:9e777968b08f |
---|---|
19 +----------------------------------------------------------------------------- | 19 +----------------------------------------------------------------------------- |
20 */ | 20 */ |
21 | 21 |
22 #ifndef MM_MMS_C | 22 #ifndef MM_MMS_C |
23 #define MM_MMS_C | 23 #define MM_MMS_C |
24 | |
25 #include "config.h" | |
26 #include "fixedconf.h" | |
27 #include "condat-features.h" | |
24 | 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) |
738 * CM SERVICE REJECT by the network, cause #4: For some | 742 * CM SERVICE REJECT by the network, cause #4: For some |
739 * reason the IMSI is not attached in the VLR. This may happen | 743 * reason the IMSI is not attached in the VLR. This may happen |
740 * if there was a failure in the VLR's database. | 744 * if there was a failure in the VLR's database. |
741 * This is expected to happen seldom. | 745 * This is expected to happen seldom. |
742 * GSM 11.10 subclause 26.7.5.5 doesn't expect that a call is saved | 746 * GSM 11.10 subclause 26.7.5.5 doesn't expect that a call is saved |
743 * and established is performed later in this condition. Choosing this | 747 * and established is performed later in this condition. |
748 * Choosing this | |
744 * implementation option complicates the protocol here too much. | 749 * implementation option complicates the protocol here too much. |
745 * (danger of introducing bugs, especially if GPRS is also present) | 750 * (danger of introducing bugs, especially if GPRS is also present) |
746 * The next thing to do is a NORMAL UPDATE. | 751 * The next thing to do is a NORMAL UPDATE. |
747 */ | 752 */ |
748 | |
749 | 753 |
750 /* | 754 /* |
751 * If cause value #4 is received, the mobile station aborts any | 755 * If cause value #4 is received, the mobile station aborts any |
752 * MM connection, deletes any TMSI, LAI and ciphering key | 756 * MM connection, deletes any TMSI, LAI and ciphering key |
753 * sequence number in the SIM, changes the update status to | 757 * sequence number in the SIM, changes the update status to |
863 EVENT_ENTRY, | 867 EVENT_ENTRY, |
864 NULL, | 868 NULL, |
865 UNSPEC); | 869 UNSPEC); |
866 #if defined (FF_EOTD) AND defined (REL99) | 870 #if defined (FF_EOTD) AND defined (REL99) |
867 /* | 871 /* |
868 *If there is no MM connection & rrlp is started, start the timer3241 | 872 * If there is no MM connection & rrlp is started, start the |
869 *and move MM to state MM_RR_CONN_RELEASE_NOT_ALLOWED | 873 * timer3241 and move MM to state MM_RR_CONN_RELEASE_NOT_ALLOWED |
870 */ | 874 */ |
871 if(mm_data->rrlp_lcs_started EQ TRUE) | 875 if(mm_data->rrlp_lcs_started EQ TRUE) |
872 { | 876 { |
873 TIMERSTART(T3241,T_3241_VALUE); | 877 TIMERSTART(T3241,T_3241_VALUE); |
874 SET_STATE(STATE_MM, MM_RR_CONN_RELEASE_NOT_ALLOWED); | 878 SET_STATE(STATE_MM, MM_RR_CONN_RELEASE_NOT_ALLOWED); |
889 mm_mmxx_rel_ind (mm_data->rej_cause, CM_PENDING); | 893 mm_mmxx_rel_ind (mm_data->rej_cause, CM_PENDING); |
890 if (mm_count_connections (CM_ACTIVE) EQ 0) | 894 if (mm_count_connections (CM_ACTIVE) EQ 0) |
891 { | 895 { |
892 #if defined (FF_EOTD) AND defined (REL99) | 896 #if defined (FF_EOTD) AND defined (REL99) |
893 /* | 897 /* |
894 *If there is no MM connection & rrlp is started, start the timer3241 | 898 * If there is no MM connection & rrlp is started, start the |
895 *and move MM to state MM_RR_CONN_RELEASE_NOT_ALLOWED | 899 * timer3241 and move MM to state MM_RR_CONN_RELEASE_NOT_ALLOWED |
896 */ | 900 */ |
897 if(mm_data->rrlp_lcs_started EQ TRUE) | 901 if(mm_data->rrlp_lcs_started EQ TRUE) |
898 { | 902 { |
899 TIMERSTART(T3241,T_3241_VALUE); | 903 TIMERSTART(T3241,T_3241_VALUE); |
900 SET_STATE(STATE_MM, MM_RR_CONN_RELEASE_NOT_ALLOWED); | 904 SET_STATE(STATE_MM, MM_RR_CONN_RELEASE_NOT_ALLOWED); |
901 } | 905 } |
1014 GLOBAL void mm_loc_upd_acc (T_D_LOC_UPD_ACCEPT *loc_upd_accept) | 1018 GLOBAL void mm_loc_upd_acc (T_D_LOC_UPD_ACCEPT *loc_upd_accept) |
1015 { | 1019 { |
1016 GET_INSTANCE_DATA; | 1020 GET_INSTANCE_DATA; |
1017 TRACE_FUNCTION ("mm_loc_upd_acc()"); | 1021 TRACE_FUNCTION ("mm_loc_upd_acc()"); |
1018 | 1022 |
1019 | |
1020 /* Semantical checks and preprocessing */ | 1023 /* Semantical checks and preprocessing */ |
1021 if (loc_upd_accept->loc_area_ident.c_mnc EQ 2) | 1024 if (loc_upd_accept->loc_area_ident.c_mnc EQ 2) |
1022 { | 1025 { |
1023 loc_upd_accept->loc_area_ident.mnc[2] = 0xf; | 1026 loc_upd_accept->loc_area_ident.mnc[2] = 0xf; |
1024 } | 1027 } |
1025 | 1028 |
1026 | |
1027 | |
1028 switch (GET_STATE (STATE_MM)) | 1029 switch (GET_STATE (STATE_MM)) |
1029 { | 1030 { |
1030 case MM_LUP_INITIATED: | 1031 case MM_LUP_INITIATED: |
1031 TRACE_EVENT ("*** LUP ACCEPTED ***"); | 1032 TRACE_EVENT ("*** LUP ACCEPTED ***"); |
1032 | 1033 |
1143 | 1144 |
1144 break; | 1145 break; |
1145 } | 1146 } |
1146 case 2: /*TYPE_IMEI:*/ | 1147 case 2: /*TYPE_IMEI:*/ |
1147 { | 1148 { |
1148 /* Implements Measure 29 and streamline encoding */ | 1149 /* Implements Measure 29 and streamline encoding */ |
1149 mm_send_status(RC_INCORRECT_MESSAGE); | 1150 mm_send_status(RC_INCORRECT_MESSAGE); |
1150 /* Implementation problem: This should be handled like | 1151 /* Implementation problem: This should be handled like |
1151 LOCATION UPDATING REJECT received with cause NETWORK FAILURE. | 1152 LOCATION UPDATING REJECT received with cause NETWORK FAILURE. |
1152 The same may be true for all negative asserts in the field | 1153 The same may be true for all negative asserts in the field |
1153 in the whole function */ | 1154 in the whole function */ |
1259 else | 1260 else |
1260 { | 1261 { |
1261 mm_data->loc_upd_type.follow = FOR_PENDING_NO; | 1262 mm_data->loc_upd_type.follow = FOR_PENDING_NO; |
1262 /* PATCH LE 02.12.99 | 1263 /* PATCH LE 02.12.99 |
1263 * | 1264 * |
1264 * Donīt stop connection if not follow on proceed | 1265 * Don't stop connection if not follow on proceed |
1265 * | 1266 * |
1266 * mm_mmxx_rel_ind (RELCS_UNSPECIFIED, CM_PENDING); | 1267 * mm_mmxx_rel_ind (RELCS_UNSPECIFIED, CM_PENDING); |
1267 * mm_mmxx_rel_ind (RELCS_UNSPECIFIED, CM_NOT_IDLE); | 1268 * mm_mmxx_rel_ind (RELCS_UNSPECIFIED, CM_NOT_IDLE); |
1268 * | 1269 * |
1269 * END PATCH LE 02.12.99 | 1270 * END PATCH LE 02.12.99 |
1373 { | 1374 { |
1374 GET_INSTANCE_DATA; | 1375 GET_INSTANCE_DATA; |
1375 TRACE_FUNCTION ("mm_mm_status()"); | 1376 TRACE_FUNCTION ("mm_mm_status()"); |
1376 /* Semantical checks and preprocessing */ | 1377 /* Semantical checks and preprocessing */ |
1377 /* MSG(B_MM_STATUS)->rej_cause = for_check_reject_cause (MSG(B_MM_STATUS)->rej_cause); nobody cares */ | 1378 /* MSG(B_MM_STATUS)->rej_cause = for_check_reject_cause (MSG(B_MM_STATUS)->rej_cause); nobody cares */ |
1378 | |
1379 | |
1380 | 1379 |
1381 switch (GET_STATE (STATE_MM)) | 1380 switch (GET_STATE (STATE_MM)) |
1382 { | 1381 { |
1383 case MM_LUP_INITIATED: | 1382 case MM_LUP_INITIATED: |
1384 case MM_WAIT_FOR_OUTG_MM_CONN: | 1383 case MM_WAIT_FOR_OUTG_MM_CONN: |
1663 * request the RR sublayer to establish an RR connection, otherwise the | 1662 * request the RR sublayer to establish an RR connection, otherwise the |
1664 * IMSI detach is aborted. | 1663 * IMSI detach is aborted. |
1665 * [Here the situation is that RR is searching for a cell and no cell is | 1664 * [Here the situation is that RR is searching for a cell and no cell is |
1666 * yet available, but one may be found in a period lesser than 20 seconds | 1665 * yet available, but one may be found in a period lesser than 20 seconds |
1667 * and according to the standard an IMSI DETACH shall be performed. | 1666 * and according to the standard an IMSI DETACH shall be performed. |
1668 * This MM implementation is more simple here, if still searching for a cell, | 1667 * This MM implementation is more simple here, if still searching for a |
1669 * the IMSI detach is not done. This may not cause any harm to the | 1668 * cell. the IMSI detach is not done. This may not cause any harm to the |
1670 * mobile user, however, it is a minor violation of GSM 04.08.] | 1669 * mobile user, however, it is a minor violation of GSM 04.08.] |
1671 */ | 1670 */ |
1672 switch (nreg_cause) | 1671 switch (nreg_cause) |
1673 { | 1672 { |
1674 case CS_POW_OFF: /* switch off mobile */ | 1673 case CS_POW_OFF: /* switch off mobile */ |
2139 PALLOC (prompt_ind, MMCM_PROMPT_IND); /* T_MMCM_PROMPT_IND */ | 2138 PALLOC (prompt_ind, MMCM_PROMPT_IND); /* T_MMCM_PROMPT_IND */ |
2140 PSENDX (CC, prompt_ind); | 2139 PSENDX (CC, prompt_ind); |
2141 } | 2140 } |
2142 #ifdef REL99 | 2141 #ifdef REL99 |
2143 /* | 2142 /* |
2144 *Stop timer t3241 if it is ruuning. *As per the spec 24.008, Timer T3241 | 2143 * Stop timer t3241 if it is running. *As per the spec 24.008, Timer |
2145 *is stopped and reset (but not started) when the MM state | 2144 * T3241 is stopped and reset (but not started) when the MM state |
2146 *RR CONNECTION RELEASE NOT ALLOWED is left. | 2145 * RR CONNECTION RELEASE NOT ALLOWED is left. |
2147 */ | 2146 */ |
2148 TIMERSTOP(T3241); | 2147 TIMERSTOP(T3241); |
2149 #endif | 2148 #endif |
2150 | 2149 |
2151 SET_STATE (STATE_MM, MM_PROCESS_PROMPT); | 2150 SET_STATE (STATE_MM, MM_PROCESS_PROMPT); |