changeset 680:04d1b20eb7b0

alr_main.c compiles
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 29 Sep 2014 17:47:47 +0000
parents a2a65fdc1a99
children 461ab5b255f5
files gsm-fw/g23m-gsm/alr/Makefile gsm-fw/g23m-gsm/alr/alr_main.c
diffstat 2 files changed, 77 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/g23m-gsm/alr/Makefile	Mon Sep 29 16:23:20 2014 +0000
+++ b/gsm-fw/g23m-gsm/alr/Makefile	Mon Sep 29 17:47:47 2014 +0000
@@ -5,7 +5,7 @@
 CPPFLAGS=-I. -I../../include -I../../include/condat -I../../gpf/inc \
 	-I../../cdginc
 
-OBJS=	alr_cbch.o alr_cs.o alr_csf.o alr_dedi.o alr_em.o
+OBJS=	alr_cbch.o alr_cs.o alr_csf.o alr_dedi.o alr_em.o alr_main.o
 
 all:	${OBJS}
 
--- a/gsm-fw/g23m-gsm/alr/alr_main.c	Mon Sep 29 16:23:20 2014 +0000
+++ b/gsm-fw/g23m-gsm/alr/alr_main.c	Mon Sep 29 17:47:47 2014 +0000
@@ -22,6 +22,10 @@
 #ifndef ALR_MAIN_C
 #define ALR_MAIN_C
 
+#include "config.h"
+#include "fixedconf.h"
+#include "condat-features.h"
+
 #define ENTITY_PL
 
 /*==== INCLUDES ===================================================*/
@@ -240,7 +244,6 @@
           alr_data->gprs_data.pbcch      = TRUE;
           nc_add_offset(); /* convert counters */
 
-
           rach_init ();
           rach_configure_power (idle->power);
           pch_configure (idle, PGM_NORMAL);
@@ -309,7 +312,6 @@
              */
             gprs_alr_init();
             alr_data->nc_sync_with_grr = TRUE;
-
 #endif
             pch_configure (idle, PGM_REORG);
             pch_save_pgm(PGM_REORG_CS); /* reset saved pgm to REORG_CS */
@@ -513,10 +515,11 @@
           }
           pch_configure (idle, SAVED_PGM);
 
-          /* For OMAPS#90692 - Move to MA_IDLE before configuring 
-            * the serving cell BCCH request, so as not to reset the
-            * si_bitmap again 
-            */
+	  /*
+           * For OMAPS#90692 - Move to MA_IDLE before configuring 
+           * the serving cell BCCH request, so as not to reset the
+           * si_bitmap again 
+           */
           trc_state_transition(__LINE__, MA_IDLE);
           SET_STATE (STATE_MA, MA_IDLE);
           pch_start_ccch_req();
@@ -532,7 +535,8 @@
           break;
         case MODE_CELL_RESELECTION:
           /* the last cell wasn't the right one, try again */
-          ma_stop_active_procs(STOP_PCH_READING);/* donīt forget to stop all processes */
+          ma_stop_active_procs(STOP_PCH_READING);
+	  /* don't forget to stop all processes */
 #ifdef GPRS
           gprs_alr_init();
 #endif
@@ -880,9 +884,9 @@
     mph_ext_meas_cnf->num_of_chan = 0;
     PSENDX ( RR, mph_ext_meas_cnf );
 
-	PFREE (mph_ext_meas_req);
+    PFREE (mph_ext_meas_req);
   }
-  }
+}
 
 /*
 +--------------------------------------------------------------------+
@@ -1184,7 +1188,9 @@
        * Full list power measurements for Cell Selection
        */
       alr_data->plmn_search_running = FALSE;
+#ifdef TI_PS_FF_QUAD_BAND_SUPPORT
       alr_multiband_std = NOT_PRESENT_8BIT;
+#endif
 #ifdef GPRS
       gprs_alr_init();
 #endif
@@ -1309,7 +1315,6 @@
   USHORT i;
   TRACE_EVENT("mph_meas_rep_req");
 
-
   switch(mph_meas_rep_req->cause)
   {
     case NC_START_MEAS:
@@ -3154,7 +3159,7 @@
 GLOBAL void ma_mphc_sync_ho_cnf (T_MPHC_SYNC_HO_CON* sync_ho_cnf)
 {
   PFREE (sync_ho_cnf);
-   dedi_ho_cnf(HO_TYPE_SYNC);
+  dedi_ho_cnf(HO_TYPE_SYNC);
 }
 
 /*
@@ -3311,8 +3316,13 @@
 
 GLOBAL void ma_mphc_adc_ind (T_MPHC_ADC_IND *adc_results)
 {
+  /*
+   * FreeCalypso note: in the TCS211 version this function forwarded
+   * the ADC results to the CST entity, but in the LoCosto version
+   * that code has been deleted w/o explanation.  The proper course
+   * of action for FreeCalypso remains to be decided.
+   */
   PFREE (adc_results);
-
 }
 
 /* -------------------------------------------------------------------
@@ -3676,9 +3686,9 @@
 
 GLOBAL void ma_nc_report_res (T_MPH_MEASUREMENT_IND *mph_measurement_ind)
 {
-/* Implements Measure#32: Row 112 */
   GET_INSTANCE_DATA;
-  TRACE_ASSERT((GET_STATE(STATE_MA) NEQ MA_NULL) OR (GET_STATE(STATE_MA) NEQ MA_CELL_SELECTION));
+  TRACE_ASSERT((GET_STATE(STATE_MA) NEQ MA_NULL) OR
+               (GET_STATE(STATE_MA) NEQ MA_CELL_SELECTION));
 
   switch (GET_STATE (STATE_MA))
   {
@@ -4645,13 +4655,30 @@
 }
 
 /*
-+--------------------------------------------------------------------+
-| PROJECT : GSM-PS (6103)       MODULE  : ALR_MAIN                   |
-| STATE   : code                ROUTINE : convert_arfcn_to_l1        |
-+--------------------------------------------------------------------+
-
-  PURPOSE : Convert_arfcn_to_l1 converts the arfcn given by the upper
-            layer (ETSI GSM spec.) to the internal format of layer 1.
+ * The following two functions convert ARFCNs between the official GSM
+ * spec notation and the numbering scheme used by TI's L1.  The latter
+ * scheme changed with the new way of multiband handling found in the
+ * LoCosto source, but not in TCS211.
+ *
+ * The original L1 frequency channel numbering scheme (used in TCS211)
+ * looks like this:
+
+            Frequency Band    config.       ETSI GSM spec.  coding used in L1
+            GSM 900           STD_900       1-124           1-124
+            E-GSM             STD_EGSM      1-124,          1-124,
+                                            975-1023, 0     125-174
+            PCS 1900          STD_1900      512-810         512-810
+            DCS 1800          STD_1800      512-885         512-885
+            GSM 900/DCS 1800  STD_DUAL      1-124,          1-124,
+                                            512-885         125-498
+            E-GSM/DCS 1800    STD_DUAL_EGSM 1-124,          1-124,
+                                            975-1023,0      125-174,
+                                            512-885         175-548
+            GSM 850           STD_850       128-251         128-251
+            GSM 850/PCS 1900  STD_DUAL_US   128-251,        1-124,
+                                            512-810         125-424
+
+ * The new-fangled scheme found in the LoCosto source looks like this:
 
             Frequency Band    config.       ETSI GSM spec.  coding used in L1
             GSM 900           STD_900       1-124           1-124
@@ -4671,6 +4698,21 @@
                                             512-885         512-885
             GSM 900/PCS 1900  STD_900_1900  1-124,          1-124,
                                             512-810         1024-1322
+
+ * The implementation of the two functions below, taken from the
+ * LoCosto source, has interspersed #ifdef TI_PS_FF_QUAD_BAND_SUPPORT
+ * conditionals, selecting between the two possible configurations.
+ */
+
+/*
++--------------------------------------------------------------------+
+| PROJECT : GSM-PS (6103)       MODULE  : ALR_MAIN                   |
+| STATE   : code                ROUTINE : convert_arfcn_to_l1        |
++--------------------------------------------------------------------+
+
+  PURPOSE : Convert_arfcn_to_l1 converts the arfcn given by the upper
+            layer (ETSI GSM spec.) to the internal format of layer 1.
+
 */
 
 GLOBAL USHORT convert_arfcn_to_l1 (USHORT arfcn, UBYTE local_std)
@@ -4736,24 +4778,6 @@
   PURPOSE : Convert_arfcn_to_g23 converts the radio frequence given by
             layer 1 to the common format of the upper layer (ETSI GSM spec.).
 
-            Frequency Band    config.       ETSI GSM spec.  coding used in L1
-            GSM 900           STD_900       1-124           1-124
-            E-GSM             STD_EGSM      1-124,          1-124,
-                                            975-1023, 0     975-1023, 0
-            PCS 1900          STD_1900      512-810         1024-1322
-            DCS 1800          STD_1800      512-885         512-885
-            GSM 900/DCS 1800  STD_DUAL      1-124,          1-124,
-                                            512-885         512-885
-            E-GSM/DCS 1800    STD_DUAL_EGSM 1-124,          1-124,
-                                            975-1023,0      975-1023,0
-                                            512-885         512-885
-            GSM 850           STD_850       128-251         128-251
-            GSM 850/PCS 1900  STD_DUAL_US   128-251,        128-251,
-                                            512-810         1024-1322
-            GSM 850/DCS 1800  STD_850_1800  128-251,        128-251,
-                                            512-885         512-885
-            GSM 900/PCS 1900  STD_900_1900  1-124,          1-124,
-                                            512-810         1024-1322
 */
 
 GLOBAL USHORT convert_arfcn_to_g23 (USHORT arfcn, UBYTE local_std)
@@ -5023,11 +5047,11 @@
 /*
 +--------------------------------------------------------------------+
 | PROJECT : GSM-PS (6103)       MODULE  : alr_MAIN                   |
-| STATE   : code                ROUTINE : ma_is_ptm		             |
+| STATE   : code                ROUTINE : ma_is_ptm	             |
 +--------------------------------------------------------------------+
 
 PURPOSE : Returns True if the current state is MA_PTM,
-		  otherwise returns FALSE.
+	  otherwise returns FALSE.
 
 */
 
@@ -5459,17 +5483,17 @@
 -----------------------------------------------------------------
       Type 2	                    1	               BCCH Norm
 -----------------------------------------------------------------
-      Type 2 bis	                5	               BCCH Norm
+      Type 2 bis                    5	               BCCH Norm
 -----------------------------------------------------------------
-      Type 2 ter	              5 or 4	           BCCH Norm
+      Type 2 ter                 5 or 4	               BCCH Norm
 -----------------------------------------------------------------
-      Type 2 quater	              5                BCCH Norm
-                                  or
-                                 4or5	             BCCH Ext
+      Type 2 quater                 5                  BCCH Norm
+                                   or
+                                  4or5                 BCCH Ext
 -----------------------------------------------------------------
-      Type 3	                  2 and 6	           BCCH Norm
+      Type 3	                  2 and 6              BCCH Norm
 -----------------------------------------------------------------
-      Type 4	                  3 and 7	           BCCH Norm
+      Type 4	                  3 and 7              BCCH Norm
 -----------------------------------------------------------------
       Type 7	                    7	               BCCH Ext
 -----------------------------------------------------------------
@@ -5477,11 +5501,11 @@
 -----------------------------------------------------------------
       Type 9	                    4	               BCCH Norm
 -----------------------------------------------------------------
-      Type 13	                    4                BCCH Norm
-                                  or
-                                  0	               BCCH Ext
+      Type 13	                    4                  BCCH Norm
+                                    or
+                                    0                  BCCH Ext
 -----------------------------------------------------------------
-		  Type 16	                    6	               BCCH Ext
+      Type 16	                    6	               BCCH Ext
 -----------------------------------------------------------------
       Type 17	                    2	               BCCH Ext
 -----------------------------------------------------------------