FreeCalypso > hg > freecalypso-sw
comparison gsm-fw/g23m-gsm/rr/rr_cs.c @ 735:458366ab2d6d
rr_cs.c compiles
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Sun, 05 Oct 2014 08:52:20 +0000 |
parents | 2f7df7a314f8 |
children |
comparison
equal
deleted
inserted
replaced
734:abfc662e0082 | 735:458366ab2d6d |
---|---|
19 +----------------------------------------------------------------------------- | 19 +----------------------------------------------------------------------------- |
20 */ | 20 */ |
21 | 21 |
22 #ifndef RR_CS_C | 22 #ifndef RR_CS_C |
23 #define RR_CS_C | 23 #define RR_CS_C |
24 | |
25 #include "config.h" | |
26 #include "fixedconf.h" | |
27 #include "condat-features.h" | |
24 | 28 |
25 #define ENTITY_RR | 29 #define ENTITY_RR |
26 | 30 |
27 /*==== INCLUDES ===================================================*/ | 31 /*==== INCLUDES ===================================================*/ |
28 | 32 |
128 * Bit 8 BCCH info list flag | 132 * Bit 8 BCCH info list flag |
129 * --------------------------------- | 133 * --------------------------------- |
130 * 0 not member of the BCCH info list | 134 * 0 not member of the BCCH info list |
131 * 1 member of the BCCH info list | 135 * 1 member of the BCCH info list |
132 * | 136 * |
133 * The flag indicates whether a cell is member of the BCCH information list or not. | 137 * The flag indicates whether a cell is member of the BCCH information |
138 * list or not. | |
134 */ | 139 */ |
135 | 140 |
136 /* | 141 /* |
137 +--------------------------------------------------------------------+ | 142 +--------------------------------------------------------------------+ |
138 | PROJECT : GSM-PS (6147) MODULE : RR_CS | | 143 | PROJECT : GSM-PS (6147) MODULE : RR_CS | |
181 rr_data->dyn_config.tfast_cs_val = TFAST_CS_VALUE; | 186 rr_data->dyn_config.tfast_cs_val = TFAST_CS_VALUE; |
182 rr_data->dyn_config.tnormal_cs_val = TNORMAL_CS_VALUE; | 187 rr_data->dyn_config.tnormal_cs_val = TNORMAL_CS_VALUE; |
183 rr_data->dyn_config.lim_ser_nps_delay= DELAY_NON_PAR_SEARCH_LIM_SER; | 188 rr_data->dyn_config.lim_ser_nps_delay= DELAY_NON_PAR_SEARCH_LIM_SER; |
184 | 189 |
185 #if defined(_SIMULATION_FFS_) | 190 #if defined(_SIMULATION_FFS_) |
186 rr_csf_ffs_init(); | 191 rr_csf_ffs_init(); |
187 #endif | 192 #endif |
188 } | 193 } |
189 | 194 |
190 /* | 195 /* |
191 +--------------------------------------------------------------------+ | 196 +--------------------------------------------------------------------+ |
371 UBYTE freq_bands; | 376 UBYTE freq_bands; |
372 | 377 |
373 rr_csf_get_freq_bands (&freq_bands); | 378 rr_csf_get_freq_bands (&freq_bands); |
374 | 379 |
375 if (!pch_interrupt) | 380 if (!pch_interrupt) |
376 {/* | 381 { |
377 * Power measurements without PCH interruption => PLMN search | 382 /* |
378 * ---------------------------------------------------------- | 383 * Power measurements without PCH interruption => PLMN search |
379 * In this case we use the found and set value of 'std' for the frequency | 384 * ---------------------------------------------------------- |
380 * area to mask out not available frequencies from 'freq_bands'. | 385 * In this case we use the found and set value of 'std' for the frequency |
381 * Use only frequencies of the current area. | 386 * area to mask out not available frequencies from 'freq_bands'. |
382 */ | 387 * Use only frequencies of the current area. |
388 */ | |
383 switch (std) | 389 switch (std) |
384 { | 390 { |
385 case STD_900: | 391 case STD_900: |
386 freq_bands &= BAND_GSM_900; | 392 freq_bands &= BAND_GSM_900; |
387 break; | 393 break; |
444 UBYTE local_std = STD_GET_FROM_ARFCN(arfcn); | 450 UBYTE local_std = STD_GET_FROM_ARFCN(arfcn); |
445 UBYTE sc_band; | 451 UBYTE sc_band; |
446 | 452 |
447 if(local_std EQ STD_NOT_PRESENT) | 453 if(local_std EQ STD_NOT_PRESENT) |
448 { | 454 { |
449 /* Parallel search case */ | 455 /* Parallel search case */ |
450 #ifdef TI_PS_FF_QUAD_BAND_SUPPORT | 456 #ifdef TI_PS_FF_QUAD_BAND_SUPPORT |
451 local_std = std; | 457 local_std = std; |
452 #else | 458 #else |
453 local_std = std_bands[std-1]; | 459 local_std = std_bands[std-1]; |
454 #endif | 460 #endif |
455 } | 461 } |
456 | 462 |
457 switch (local_std) | 463 switch (local_std) |
458 { | 464 { |
735 /* Set the region */ | 741 /* Set the region */ |
736 mph_power_req->white_list.region = rr_data->cs_data.white_list.region; | 742 mph_power_req->white_list.region = rr_data->cs_data.white_list.region; |
737 | 743 |
738 /* White list is valid */ | 744 /* White list is valid */ |
739 mph_power_req->white_list.white_list_valid = TRUE; | 745 mph_power_req->white_list.white_list_valid = TRUE; |
740 | |
741 } | 746 } |
742 } | 747 } |
743 | 748 |
744 /* Handle the search mode timers based on the new search mode */ | 749 /* Handle the search mode timers based on the new search mode */ |
745 cs_handle_search_mode_timer(CS_GET_CURRENT_SEARCH_MODE); | 750 cs_handle_search_mode_timer(CS_GET_CURRENT_SEARCH_MODE); |
918 /* | 923 /* |
919 * for all channels of the power campaign list | 924 * for all channels of the power campaign list |
920 */ | 925 */ |
921 for (i=0;i<rr_data->cs_data.max_arfcn;i++) | 926 for (i=0;i<rr_data->cs_data.max_arfcn;i++) |
922 { | 927 { |
923 | |
924 /* | 928 /* |
925 * check only cells which have high/mid priority | 929 * check only cells which have high/mid priority |
926 */ | 930 */ |
927 if ((rr_data->cs_data.attributes [i] & CS_CHECK_FLAG) EQ 0 AND | 931 if ((rr_data->cs_data.attributes [i] & CS_CHECK_FLAG) EQ 0 AND |
928 (rr_data->cs_data.attributes [i] & CS_PRIORITY) NEQ 0) | 932 (rr_data->cs_data.attributes [i] & CS_PRIORITY) NEQ 0) |
1110 | 1114 |
1111 /* | 1115 /* |
1112 *start BSIC Reading;For fast search, the first scan is only on reasonably strong carriers.i.e carrires with rxlev>MEDIUM_RXLEV_THRESHOLD | 1116 *start BSIC Reading;For fast search, the first scan is only on reasonably strong carriers.i.e carrires with rxlev>MEDIUM_RXLEV_THRESHOLD |
1113 *This is as per the cell selection improvements document. Hence dont send BSIC request on white listed low power carrires for first scan. | 1117 *This is as per the cell selection improvements document. Hence dont send BSIC request on white listed low power carrires for first scan. |
1114 *(OMAPS00109145)*/ | 1118 *(OMAPS00109145)*/ |
1115 if( (rr_data->cs_data.previous_search_mode EQ FAST_SEARCH_MODE) AND (rr_data->cs_data.scan_mode NEQ CS_SECOND_SCAN) AND ( rr_data->cs_data.rxlev[x]<MEDIUM_RXLEV_THRESHOLD)) | 1119 if( (rr_data->cs_data.previous_search_mode EQ FAST_SEARCH_MODE) AND (rr_data->cs_data.scan_mode NEQ CS_SECOND_SCAN) AND ( rr_data->cs_data.rxlev[x]<MEDIUM_RXLEV_THRESHOLD)) |
1116 return FALSE; | 1120 return FALSE; |
1117 else | 1121 else |
1118 { | 1122 { |
1119 PALLOC (mph_bsic_req, MPH_BSIC_REQ); | 1123 PALLOC (mph_bsic_req, MPH_BSIC_REQ); |
1120 | 1124 |
1121 mph_bsic_req->arfcn = rr_data->cs_data.arfcn[x]; | 1125 mph_bsic_req->arfcn = rr_data->cs_data.arfcn[x]; |
1122 | 1126 |
1123 TRACE_EVENT_P3 ("BSIC REQ[%u]%u a=0x%x", | 1127 TRACE_EVENT_P3 ("BSIC REQ[%u]%u a=0x%x", |
1124 rr_data->cs_data.arfcn[x] & ARFCN_MASK, | 1128 rr_data->cs_data.arfcn[x] & ARFCN_MASK, |
1125 x, rr_data->cs_data.attributes[x]); | 1129 x, rr_data->cs_data.attributes[x]); |
1126 | 1130 |
1127 PSENDX (PL, mph_bsic_req); | 1131 PSENDX (PL, mph_bsic_req); |
1132 } | |
1133 return TRUE; | |
1128 } | 1134 } |
1129 return TRUE; | 1135 } |
1130 } | |
1131 } | |
1132 else | 1136 else |
1133 return FALSE; | 1137 return FALSE; |
1134 } | 1138 } |
1135 | 1139 |
1136 /* | 1140 /* |
1378 occured on current cell and at power levels < -100dB, this is because in the fast search mode we are not | 1382 occured on current cell and at power levels < -100dB, this is because in the fast search mode we are not |
1379 considering the low rxlev carriers. So this modification is required in order to come back to the network | 1383 considering the low rxlev carriers. So this modification is required in order to come back to the network |
1380 even after a down link failure has happened and if another BCCH carrer of less power become active and available | 1384 even after a down link failure has happened and if another BCCH carrer of less power become active and available |
1381 for the mobile to camp */ | 1385 for the mobile to camp */ |
1382 | 1386 |
1383 rxlev = rr_data->dyn_config.lower_rxlev_thr[x]; | 1387 rxlev = rr_data->dyn_config.lower_rxlev_thr[x]; |
1384 copy = TRUE; | 1388 copy = TRUE; |
1385 | 1389 |
1386 if((i >= mph_power_cnf->num_of_white_list_chan) AND | 1390 if((i >= mph_power_cnf->num_of_white_list_chan) AND |
1387 (mph_power_cnf->rx_lev[i] < rxlev)) | 1391 (mph_power_cnf->rx_lev[i] < rxlev)) |
1388 | 1392 |
1531 if(rr_data->cs_data.region NEQ new_region) | 1535 if(rr_data->cs_data.region NEQ new_region) |
1532 { | 1536 { |
1533 rr_data->cs_data.all_freq_area = TRUE; | 1537 rr_data->cs_data.all_freq_area = TRUE; |
1534 TRACE_EVENT("all_freq_area : 1"); | 1538 TRACE_EVENT("all_freq_area : 1"); |
1535 } | 1539 } |
1536 | |
1537 } | 1540 } |
1538 | 1541 |
1539 /* CSI-LLD section:4.1.1.3.12 | 1542 /* CSI-LLD section:4.1.1.3.12 |
1540 * This stores region in rr_data base by extracting from std | 1543 * This stores region in rr_data base by extracting from std |
1541 */ | 1544 */ |
1548 cs_remove_co_channels ((USHORT)(mph_bsic_cnf->arfcn&ARFCN_MASK)); | 1551 cs_remove_co_channels ((USHORT)(mph_bsic_cnf->arfcn&ARFCN_MASK)); |
1549 | 1552 |
1550 rr_data->cs_data.attributes [rr_data->cs_data.act_index] |= | 1553 rr_data->cs_data.attributes [rr_data->cs_data.act_index] |= |
1551 (CS_CHECK_FLAG | CS_BCCH_READ); | 1554 (CS_CHECK_FLAG | CS_BCCH_READ); |
1552 | 1555 |
1553 /* CSI-LLD section:4.1.1.11 | 1556 /* CSI-LLD section:4.1.1.11 |
1554 * Synchronisation succeeded. Remove the carrier from black list | 1557 * Synchronisation succeeded. Remove the carrier from black list |
1555 */ | 1558 */ |
1556 cs_del_from_black_list(rr_data->cs_data.region, | 1559 cs_del_from_black_list(rr_data->cs_data.region, |
1557 (U16)(mph_bsic_cnf->arfcn&ARFCN_MASK)); | 1560 (U16)(mph_bsic_cnf->arfcn&ARFCN_MASK)); |
1558 | 1561 |
1559 att_bsic_ind ((USHORT)(mph_bsic_cnf->arfcn&ARFCN_MASK), | 1562 att_bsic_ind ((USHORT)(mph_bsic_cnf->arfcn&ARFCN_MASK), |
1560 rr_data->cs_data.rxlev [rr_data->cs_data.act_index], | 1563 rr_data->cs_data.rxlev [rr_data->cs_data.act_index], |
1996 | 1999 |
1997 */ | 2000 */ |
1998 LOCAL void cs_add_current_network_to_found_list (void) | 2001 LOCAL void cs_add_current_network_to_found_list (void) |
1999 { | 2002 { |
2000 GET_INSTANCE_DATA; | 2003 GET_INSTANCE_DATA; |
2001 T_loc_area_ident *lai = &rr_data->nc_data[SC_INDEX].lai; | 2004 T_loc_area_ident *lai = &rr_data->nc_data[SC_INDEX].lai; |
2002 | 2005 |
2003 TRACE_FUNCTION ("cs_add_current_network_to_found_list()"); | 2006 TRACE_FUNCTION ("cs_add_current_network_to_found_list()"); |
2004 | 2007 |
2005 switch (rr_data->ms_data.rr_service) | 2008 switch (rr_data->ms_data.rr_service) |
2006 { | 2009 { |
2007 case LIMITED_SERVICE: | 2010 case LIMITED_SERVICE: |
2008 case FULL_SERVICE: | 2011 case FULL_SERVICE: |
2121 Cell Selection Improvements-LLD section:4.1.1.2 | 2124 Cell Selection Improvements-LLD section:4.1.1.2 |
2122 */ | 2125 */ |
2123 | 2126 |
2124 GLOBAL BOOL cs_check_arfcn_range(U16 arfcn) | 2127 GLOBAL BOOL cs_check_arfcn_range(U16 arfcn) |
2125 { | 2128 { |
2126 | |
2127 if(arfcn EQ CHANNEL_0) | 2129 if(arfcn EQ CHANNEL_0) |
2128 arfcn = CHANNEL_0_INTERNAL; | 2130 arfcn = CHANNEL_0_INTERNAL; |
2129 | 2131 |
2130 if((arfcn > CHANNEL_0) AND (arfcn <= CHANNEL_0_INTERNAL)) | 2132 if((arfcn > CHANNEL_0) AND (arfcn <= CHANNEL_0_INTERNAL)) |
2131 { | 2133 { |
2800 +----------------------------------------------------------------------+ | 2802 +----------------------------------------------------------------------+ |
2801 | PROJECT : GSM-PS (8403) MODULE : RR_CS | | 2803 | PROJECT : GSM-PS (8403) MODULE : RR_CS | |
2802 | STATE : code ROUTINE : cs_get_new_search_mode | | 2804 | STATE : code ROUTINE : cs_get_new_search_mode | |
2803 +----------------------------------------------------------------------+ | 2805 +----------------------------------------------------------------------+ |
2804 | 2806 |
2805 PURPOSE : This routine returns the new search mode depending on the timer active | 2807 PURPOSE : This routine returns the new search mode depending on the timer |
2806 and the previous search mode | 2808 active and the previous search mode |
2807 CSI-LLD section:4.1.3.4.1.1 | 2809 CSI-LLD section:4.1.3.4.1.1 |
2808 */ | 2810 */ |
2809 | 2811 |
2810 GLOBAL U8 cs_get_new_search_mode(void) | 2812 GLOBAL U8 cs_get_new_search_mode(void) |
2811 { | 2813 { |