FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/g23m-gsm/alr/alr_main.c @ 680:04d1b20eb7b0
alr_main.c compiles
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Mon, 29 Sep 2014 17:47:47 +0000 |
parents | 2f7df7a314f8 |
children |
comparison
equal
deleted
inserted
replaced
679:a2a65fdc1a99 | 680:04d1b20eb7b0 |
---|---|
20 */ | 20 */ |
21 | 21 |
22 #ifndef ALR_MAIN_C | 22 #ifndef ALR_MAIN_C |
23 #define ALR_MAIN_C | 23 #define ALR_MAIN_C |
24 | 24 |
25 #include "config.h" | |
26 #include "fixedconf.h" | |
27 #include "condat-features.h" | |
28 | |
25 #define ENTITY_PL | 29 #define ENTITY_PL |
26 | 30 |
27 /*==== INCLUDES ===================================================*/ | 31 /*==== INCLUDES ===================================================*/ |
28 #include <string.h> | 32 #include <string.h> |
29 #include <stdlib.h> | 33 #include <stdlib.h> |
238 set_gprs_support(idle->gprs_support); | 242 set_gprs_support(idle->gprs_support); |
239 alr_data->nc_sync_with_grr = TRUE; | 243 alr_data->nc_sync_with_grr = TRUE; |
240 alr_data->gprs_data.pbcch = TRUE; | 244 alr_data->gprs_data.pbcch = TRUE; |
241 nc_add_offset(); /* convert counters */ | 245 nc_add_offset(); /* convert counters */ |
242 | 246 |
243 | |
244 rach_init (); | 247 rach_init (); |
245 rach_configure_power (idle->power); | 248 rach_configure_power (idle->power); |
246 pch_configure (idle, PGM_NORMAL); | 249 pch_configure (idle, PGM_NORMAL); |
247 alr_data->nc_sync_with_grr = TRUE; | 250 alr_data->nc_sync_with_grr = TRUE; |
248 SET_STATE(STATE_MA, MA_IDLE); | 251 SET_STATE(STATE_MA, MA_IDLE); |
307 * if going to a PBCCH cell we have to update the | 310 * if going to a PBCCH cell we have to update the |
308 * ncell states with GRR | 311 * ncell states with GRR |
309 */ | 312 */ |
310 gprs_alr_init(); | 313 gprs_alr_init(); |
311 alr_data->nc_sync_with_grr = TRUE; | 314 alr_data->nc_sync_with_grr = TRUE; |
312 | |
313 #endif | 315 #endif |
314 pch_configure (idle, PGM_REORG); | 316 pch_configure (idle, PGM_REORG); |
315 pch_save_pgm(PGM_REORG_CS); /* reset saved pgm to REORG_CS */ | 317 pch_save_pgm(PGM_REORG_CS); /* reset saved pgm to REORG_CS */ |
316 nc_start_reselect (idle->arfcn); | 318 nc_start_reselect (idle->arfcn); |
317 } | 319 } |
511 from_dedicated = FALSE; | 513 from_dedicated = FALSE; |
512 nc_add_offset (); | 514 nc_add_offset (); |
513 } | 515 } |
514 pch_configure (idle, SAVED_PGM); | 516 pch_configure (idle, SAVED_PGM); |
515 | 517 |
516 /* For OMAPS#90692 - Move to MA_IDLE before configuring | 518 /* |
517 * the serving cell BCCH request, so as not to reset the | 519 * For OMAPS#90692 - Move to MA_IDLE before configuring |
518 * si_bitmap again | 520 * the serving cell BCCH request, so as not to reset the |
519 */ | 521 * si_bitmap again |
522 */ | |
520 trc_state_transition(__LINE__, MA_IDLE); | 523 trc_state_transition(__LINE__, MA_IDLE); |
521 SET_STATE (STATE_MA, MA_IDLE); | 524 SET_STATE (STATE_MA, MA_IDLE); |
522 pch_start_ccch_req(); | 525 pch_start_ccch_req(); |
523 #ifdef GPRS | 526 #ifdef GPRS |
524 alr_data->nc_sync_with_grr=FALSE; | 527 alr_data->nc_sync_with_grr=FALSE; |
530 */ | 533 */ |
531 nc_start_monitoring (); | 534 nc_start_monitoring (); |
532 break; | 535 break; |
533 case MODE_CELL_RESELECTION: | 536 case MODE_CELL_RESELECTION: |
534 /* the last cell wasn't the right one, try again */ | 537 /* the last cell wasn't the right one, try again */ |
535 ma_stop_active_procs(STOP_PCH_READING);/* donīt forget to stop all processes */ | 538 ma_stop_active_procs(STOP_PCH_READING); |
539 /* don't forget to stop all processes */ | |
536 #ifdef GPRS | 540 #ifdef GPRS |
537 gprs_alr_init(); | 541 gprs_alr_init(); |
538 #endif | 542 #endif |
539 alr_data->bs_pa_mfrms = idle->bs_pa_mfrms; | 543 alr_data->bs_pa_mfrms = idle->bs_pa_mfrms; |
540 // nc_check_new_ncc_permitted (idle->ncc_permitted); | 544 // nc_check_new_ncc_permitted (idle->ncc_permitted); |
878 { | 882 { |
879 PALLOC ( mph_ext_meas_cnf, MPH_EXT_MEAS_CNF ); | 883 PALLOC ( mph_ext_meas_cnf, MPH_EXT_MEAS_CNF ); |
880 mph_ext_meas_cnf->num_of_chan = 0; | 884 mph_ext_meas_cnf->num_of_chan = 0; |
881 PSENDX ( RR, mph_ext_meas_cnf ); | 885 PSENDX ( RR, mph_ext_meas_cnf ); |
882 | 886 |
883 PFREE (mph_ext_meas_req); | 887 PFREE (mph_ext_meas_req); |
884 } | 888 } |
885 } | 889 } |
886 | 890 |
887 /* | 891 /* |
888 +--------------------------------------------------------------------+ | 892 +--------------------------------------------------------------------+ |
889 | PROJECT : GSM-PS (6302) MODULE : ALR_MAIN | | 893 | PROJECT : GSM-PS (6302) MODULE : ALR_MAIN | |
890 | STATE : code ROUTINE : ma_mph_tch_loop_req | | 894 | STATE : code ROUTINE : ma_mph_tch_loop_req | |
1182 case PCH_INTERRUPT: | 1186 case PCH_INTERRUPT: |
1183 /* | 1187 /* |
1184 * Full list power measurements for Cell Selection | 1188 * Full list power measurements for Cell Selection |
1185 */ | 1189 */ |
1186 alr_data->plmn_search_running = FALSE; | 1190 alr_data->plmn_search_running = FALSE; |
1191 #ifdef TI_PS_FF_QUAD_BAND_SUPPORT | |
1187 alr_multiband_std = NOT_PRESENT_8BIT; | 1192 alr_multiband_std = NOT_PRESENT_8BIT; |
1193 #endif | |
1188 #ifdef GPRS | 1194 #ifdef GPRS |
1189 gprs_alr_init(); | 1195 gprs_alr_init(); |
1190 #endif | 1196 #endif |
1191 switch (GET_STATE(STATE_MA)) | 1197 switch (GET_STATE(STATE_MA)) |
1192 { | 1198 { |
1306 GLOBAL void ma_mph_meas_rep_req(T_MPH_MEAS_REP_REQ * mph_meas_rep_req) | 1312 GLOBAL void ma_mph_meas_rep_req(T_MPH_MEAS_REP_REQ * mph_meas_rep_req) |
1307 { | 1313 { |
1308 GET_INSTANCE_DATA; | 1314 GET_INSTANCE_DATA; |
1309 USHORT i; | 1315 USHORT i; |
1310 TRACE_EVENT("mph_meas_rep_req"); | 1316 TRACE_EVENT("mph_meas_rep_req"); |
1311 | |
1312 | 1317 |
1313 switch(mph_meas_rep_req->cause) | 1318 switch(mph_meas_rep_req->cause) |
1314 { | 1319 { |
1315 case NC_START_MEAS: | 1320 case NC_START_MEAS: |
1316 /* | 1321 /* |
3152 */ | 3157 */ |
3153 | 3158 |
3154 GLOBAL void ma_mphc_sync_ho_cnf (T_MPHC_SYNC_HO_CON* sync_ho_cnf) | 3159 GLOBAL void ma_mphc_sync_ho_cnf (T_MPHC_SYNC_HO_CON* sync_ho_cnf) |
3155 { | 3160 { |
3156 PFREE (sync_ho_cnf); | 3161 PFREE (sync_ho_cnf); |
3157 dedi_ho_cnf(HO_TYPE_SYNC); | 3162 dedi_ho_cnf(HO_TYPE_SYNC); |
3158 } | 3163 } |
3159 | 3164 |
3160 /* | 3165 /* |
3161 +--------------------------------------------------------------------+ | 3166 +--------------------------------------------------------------------+ |
3162 | PROJECT : GSM-PS (6302) MODULE : ALR_MAIN | | 3167 | PROJECT : GSM-PS (6302) MODULE : ALR_MAIN | |
3309 */ | 3314 */ |
3310 | 3315 |
3311 | 3316 |
3312 GLOBAL void ma_mphc_adc_ind (T_MPHC_ADC_IND *adc_results) | 3317 GLOBAL void ma_mphc_adc_ind (T_MPHC_ADC_IND *adc_results) |
3313 { | 3318 { |
3319 /* | |
3320 * FreeCalypso note: in the TCS211 version this function forwarded | |
3321 * the ADC results to the CST entity, but in the LoCosto version | |
3322 * that code has been deleted w/o explanation. The proper course | |
3323 * of action for FreeCalypso remains to be decided. | |
3324 */ | |
3314 PFREE (adc_results); | 3325 PFREE (adc_results); |
3315 | |
3316 } | 3326 } |
3317 | 3327 |
3318 /* ------------------------------------------------------------------- | 3328 /* ------------------------------------------------------------------- |
3319 * ------------------------------------------------------------------- | 3329 * ------------------------------------------------------------------- |
3320 * SIGNAL Processing functions | 3330 * SIGNAL Processing functions |
3674 | 3684 |
3675 */ | 3685 */ |
3676 | 3686 |
3677 GLOBAL void ma_nc_report_res (T_MPH_MEASUREMENT_IND *mph_measurement_ind) | 3687 GLOBAL void ma_nc_report_res (T_MPH_MEASUREMENT_IND *mph_measurement_ind) |
3678 { | 3688 { |
3679 /* Implements Measure#32: Row 112 */ | |
3680 GET_INSTANCE_DATA; | 3689 GET_INSTANCE_DATA; |
3681 TRACE_ASSERT((GET_STATE(STATE_MA) NEQ MA_NULL) OR (GET_STATE(STATE_MA) NEQ MA_CELL_SELECTION)); | 3690 TRACE_ASSERT((GET_STATE(STATE_MA) NEQ MA_NULL) OR |
3691 (GET_STATE(STATE_MA) NEQ MA_CELL_SELECTION)); | |
3682 | 3692 |
3683 switch (GET_STATE (STATE_MA)) | 3693 switch (GET_STATE (STATE_MA)) |
3684 { | 3694 { |
3685 case MA_IDLE: | 3695 case MA_IDLE: |
3686 #ifdef GPRS | 3696 #ifdef GPRS |
4643 PSENDX ( RR, mph_dedi_cnf ); | 4653 PSENDX ( RR, mph_dedi_cnf ); |
4644 } | 4654 } |
4645 } | 4655 } |
4646 | 4656 |
4647 /* | 4657 /* |
4648 +--------------------------------------------------------------------+ | 4658 * The following two functions convert ARFCNs between the official GSM |
4649 | PROJECT : GSM-PS (6103) MODULE : ALR_MAIN | | 4659 * spec notation and the numbering scheme used by TI's L1. The latter |
4650 | STATE : code ROUTINE : convert_arfcn_to_l1 | | 4660 * scheme changed with the new way of multiband handling found in the |
4651 +--------------------------------------------------------------------+ | 4661 * LoCosto source, but not in TCS211. |
4652 | 4662 * |
4653 PURPOSE : Convert_arfcn_to_l1 converts the arfcn given by the upper | 4663 * The original L1 frequency channel numbering scheme (used in TCS211) |
4654 layer (ETSI GSM spec.) to the internal format of layer 1. | 4664 * looks like this: |
4665 | |
4666 Frequency Band config. ETSI GSM spec. coding used in L1 | |
4667 GSM 900 STD_900 1-124 1-124 | |
4668 E-GSM STD_EGSM 1-124, 1-124, | |
4669 975-1023, 0 125-174 | |
4670 PCS 1900 STD_1900 512-810 512-810 | |
4671 DCS 1800 STD_1800 512-885 512-885 | |
4672 GSM 900/DCS 1800 STD_DUAL 1-124, 1-124, | |
4673 512-885 125-498 | |
4674 E-GSM/DCS 1800 STD_DUAL_EGSM 1-124, 1-124, | |
4675 975-1023,0 125-174, | |
4676 512-885 175-548 | |
4677 GSM 850 STD_850 128-251 128-251 | |
4678 GSM 850/PCS 1900 STD_DUAL_US 128-251, 1-124, | |
4679 512-810 125-424 | |
4680 | |
4681 * The new-fangled scheme found in the LoCosto source looks like this: | |
4655 | 4682 |
4656 Frequency Band config. ETSI GSM spec. coding used in L1 | 4683 Frequency Band config. ETSI GSM spec. coding used in L1 |
4657 GSM 900 STD_900 1-124 1-124 | 4684 GSM 900 STD_900 1-124 1-124 |
4658 E-GSM STD_EGSM 1-124, 1-124, | 4685 E-GSM STD_EGSM 1-124, 1-124, |
4659 975-1023, 0 975-1023, 0 | 4686 975-1023, 0 975-1023, 0 |
4669 512-810 1024-1322 | 4696 512-810 1024-1322 |
4670 GSM 850/DCS 1800 STD_850_1800 128-251, 128-251, | 4697 GSM 850/DCS 1800 STD_850_1800 128-251, 128-251, |
4671 512-885 512-885 | 4698 512-885 512-885 |
4672 GSM 900/PCS 1900 STD_900_1900 1-124, 1-124, | 4699 GSM 900/PCS 1900 STD_900_1900 1-124, 1-124, |
4673 512-810 1024-1322 | 4700 512-810 1024-1322 |
4701 | |
4702 * The implementation of the two functions below, taken from the | |
4703 * LoCosto source, has interspersed #ifdef TI_PS_FF_QUAD_BAND_SUPPORT | |
4704 * conditionals, selecting between the two possible configurations. | |
4705 */ | |
4706 | |
4707 /* | |
4708 +--------------------------------------------------------------------+ | |
4709 | PROJECT : GSM-PS (6103) MODULE : ALR_MAIN | | |
4710 | STATE : code ROUTINE : convert_arfcn_to_l1 | | |
4711 +--------------------------------------------------------------------+ | |
4712 | |
4713 PURPOSE : Convert_arfcn_to_l1 converts the arfcn given by the upper | |
4714 layer (ETSI GSM spec.) to the internal format of layer 1. | |
4715 | |
4674 */ | 4716 */ |
4675 | 4717 |
4676 GLOBAL USHORT convert_arfcn_to_l1 (USHORT arfcn, UBYTE local_std) | 4718 GLOBAL USHORT convert_arfcn_to_l1 (USHORT arfcn, UBYTE local_std) |
4677 { | 4719 { |
4678 #ifdef WIN32 | 4720 #ifdef WIN32 |
4734 +--------------------------------------------------------------------+ | 4776 +--------------------------------------------------------------------+ |
4735 | 4777 |
4736 PURPOSE : Convert_arfcn_to_g23 converts the radio frequence given by | 4778 PURPOSE : Convert_arfcn_to_g23 converts the radio frequence given by |
4737 layer 1 to the common format of the upper layer (ETSI GSM spec.). | 4779 layer 1 to the common format of the upper layer (ETSI GSM spec.). |
4738 | 4780 |
4739 Frequency Band config. ETSI GSM spec. coding used in L1 | |
4740 GSM 900 STD_900 1-124 1-124 | |
4741 E-GSM STD_EGSM 1-124, 1-124, | |
4742 975-1023, 0 975-1023, 0 | |
4743 PCS 1900 STD_1900 512-810 1024-1322 | |
4744 DCS 1800 STD_1800 512-885 512-885 | |
4745 GSM 900/DCS 1800 STD_DUAL 1-124, 1-124, | |
4746 512-885 512-885 | |
4747 E-GSM/DCS 1800 STD_DUAL_EGSM 1-124, 1-124, | |
4748 975-1023,0 975-1023,0 | |
4749 512-885 512-885 | |
4750 GSM 850 STD_850 128-251 128-251 | |
4751 GSM 850/PCS 1900 STD_DUAL_US 128-251, 128-251, | |
4752 512-810 1024-1322 | |
4753 GSM 850/DCS 1800 STD_850_1800 128-251, 128-251, | |
4754 512-885 512-885 | |
4755 GSM 900/PCS 1900 STD_900_1900 1-124, 1-124, | |
4756 512-810 1024-1322 | |
4757 */ | 4781 */ |
4758 | 4782 |
4759 GLOBAL USHORT convert_arfcn_to_g23 (USHORT arfcn, UBYTE local_std) | 4783 GLOBAL USHORT convert_arfcn_to_g23 (USHORT arfcn, UBYTE local_std) |
4760 { | 4784 { |
4761 #ifdef WIN32 | 4785 #ifdef WIN32 |
5021 } | 5045 } |
5022 | 5046 |
5023 /* | 5047 /* |
5024 +--------------------------------------------------------------------+ | 5048 +--------------------------------------------------------------------+ |
5025 | PROJECT : GSM-PS (6103) MODULE : alr_MAIN | | 5049 | PROJECT : GSM-PS (6103) MODULE : alr_MAIN | |
5026 | STATE : code ROUTINE : ma_is_ptm | | 5050 | STATE : code ROUTINE : ma_is_ptm | |
5027 +--------------------------------------------------------------------+ | 5051 +--------------------------------------------------------------------+ |
5028 | 5052 |
5029 PURPOSE : Returns True if the current state is MA_PTM, | 5053 PURPOSE : Returns True if the current state is MA_PTM, |
5030 otherwise returns FALSE. | 5054 otherwise returns FALSE. |
5031 | 5055 |
5032 */ | 5056 */ |
5033 | 5057 |
5034 | 5058 |
5035 #ifdef GPRS | 5059 #ifdef GPRS |
5457 ==================================================================== | 5481 ==================================================================== |
5458 Type 1 0 BCCH Norm | 5482 Type 1 0 BCCH Norm |
5459 ----------------------------------------------------------------- | 5483 ----------------------------------------------------------------- |
5460 Type 2 1 BCCH Norm | 5484 Type 2 1 BCCH Norm |
5461 ----------------------------------------------------------------- | 5485 ----------------------------------------------------------------- |
5462 Type 2 bis 5 BCCH Norm | 5486 Type 2 bis 5 BCCH Norm |
5463 ----------------------------------------------------------------- | 5487 ----------------------------------------------------------------- |
5464 Type 2 ter 5 or 4 BCCH Norm | 5488 Type 2 ter 5 or 4 BCCH Norm |
5465 ----------------------------------------------------------------- | 5489 ----------------------------------------------------------------- |
5466 Type 2 quater 5 BCCH Norm | 5490 Type 2 quater 5 BCCH Norm |
5467 or | 5491 or |
5468 4or5 BCCH Ext | 5492 4or5 BCCH Ext |
5469 ----------------------------------------------------------------- | 5493 ----------------------------------------------------------------- |
5470 Type 3 2 and 6 BCCH Norm | 5494 Type 3 2 and 6 BCCH Norm |
5471 ----------------------------------------------------------------- | 5495 ----------------------------------------------------------------- |
5472 Type 4 3 and 7 BCCH Norm | 5496 Type 4 3 and 7 BCCH Norm |
5473 ----------------------------------------------------------------- | 5497 ----------------------------------------------------------------- |
5474 Type 7 7 BCCH Ext | 5498 Type 7 7 BCCH Ext |
5475 ----------------------------------------------------------------- | 5499 ----------------------------------------------------------------- |
5476 Type 8 3 BCCH Ext | 5500 Type 8 3 BCCH Ext |
5477 ----------------------------------------------------------------- | 5501 ----------------------------------------------------------------- |
5478 Type 9 4 BCCH Norm | 5502 Type 9 4 BCCH Norm |
5479 ----------------------------------------------------------------- | 5503 ----------------------------------------------------------------- |
5480 Type 13 4 BCCH Norm | 5504 Type 13 4 BCCH Norm |
5481 or | 5505 or |
5482 0 BCCH Ext | 5506 0 BCCH Ext |
5483 ----------------------------------------------------------------- | 5507 ----------------------------------------------------------------- |
5484 Type 16 6 BCCH Ext | 5508 Type 16 6 BCCH Ext |
5485 ----------------------------------------------------------------- | 5509 ----------------------------------------------------------------- |
5486 Type 17 2 BCCH Ext | 5510 Type 17 2 BCCH Ext |
5487 ----------------------------------------------------------------- | 5511 ----------------------------------------------------------------- |
5488 */ | 5512 */ |
5489 | 5513 |