changeset 737:f35b7d34153a

rr_datf.c compiles
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sun, 05 Oct 2014 19:03:38 +0000
parents c64af13c976f
children 9924ad35640f
files gsm-fw/g23m-gsm/rr/Makefile gsm-fw/g23m-gsm/rr/rr_datf.c
diffstat 2 files changed, 111 insertions(+), 123 deletions(-) [+]
line wrap: on
line diff
--- a/gsm-fw/g23m-gsm/rr/Makefile	Sun Oct 05 17:08:49 2014 +0000
+++ b/gsm-fw/g23m-gsm/rr/Makefile	Sun Oct 05 19:03:38 2014 +0000
@@ -5,7 +5,7 @@
 CPPFLAGS=-I. -I../../include -I../../include/condat -I../../gpf/inc \
 	-I../../cdginc
 
-OBJS=	rr_attf.o rr_attp.o rr_atts.o rr_cs.o rr_csf.o
+OBJS=	rr_attf.o rr_attp.o rr_atts.o rr_cs.o rr_csf.o rr_datf.o
 
 all:	${OBJS}
 
--- a/gsm-fw/g23m-gsm/rr/rr_datf.c	Sun Oct 05 17:08:49 2014 +0000
+++ b/gsm-fw/g23m-gsm/rr/rr_datf.c	Sun Oct 05 19:03:38 2014 +0000
@@ -22,6 +22,10 @@
 #ifndef RR_DATF_C
 #define RR_DATF_C
 
+#include "config.h"
+#include "fixedconf.h"
+#include "condat-features.h"
+
 #define ENTITY_RR
 
 /*==== INCLUDES ===================================================*/
@@ -402,8 +406,6 @@
   if (rr_data->ms_data.error.cs NEQ 0 AND
       rr_data->ms_data.error.cs NEQ OPTIONAL_INFO_ERROR)
   {
-
-  
     if (send_rr_status)
     {
       /*
@@ -412,10 +414,7 @@
        */
 /* Implements RR Clone findings #23 */
       dat_send_rr_status_msg(rr_data->ms_data.error.cs);
-
- 
     }
-   
   }
 
   switch (rr_data->ms_data.error.cs)
@@ -600,7 +599,6 @@
    */
   meas->msg_type                = U_MEAS_REP;
 
-
   if (report->valid)
   {
     /*
@@ -643,7 +641,7 @@
 #else
     /*
      * report ncells only if BA complete or
-     * itīs a expansion (5ter) and the 5/5bis are sent before
+     * it's an expansion (5ter) and the 5/5bis are sent before
      */
     if ( (rr_data->sc_data.cd.sys_info_read &  (SYS_INFO_5_READ | SYS_INFO_5BIS_READ))
                                             EQ (SYS_INFO_5_READ | SYS_INFO_5BIS_READ) )
@@ -785,7 +783,7 @@
 
   /*
    *  configure layer 1 with multi-rate configuration if present
-  */
+   */
   if ( rr_data->sc_data.ch_mode EQ CM_AMR )
   {
     int i;
@@ -980,7 +978,7 @@
   dedicated_req->tr_para.mode  = rr_data->sc_data.ch_mode;
 
   RR_EM_GET_HOPPING_CHANNEL(dedicated_req->ch_type.ma,dedicated_req->ch_type2.ma,
-	                            dedicated_req->start.v_start,maio);
+                            dedicated_req->start.v_start,maio);
 
   PSENDX (PL, dedicated_req);
 }
@@ -1134,7 +1132,7 @@
    * channel type is SACCH if the main channel (sapi = 0)
    * is FACCH, else it is SDCCH.
    */
-  dl_data_req->ch_type = (chan_type < CH_SDCCH_4_0)\
+  dl_data_req->ch_type = (chan_type < CH_SDCCH_4_0)
                          ? L2_CHANNEL_SACCH : L2_CHANNEL_SDCCH;
 }
 
@@ -1443,8 +1441,6 @@
   }
 }
 
-
-
 /*
 +--------------------------------------------------------------------+
 | PROJECT : GSM-PS (6147)       MODULE  : RR_DAT                     |
@@ -1491,18 +1487,18 @@
      * If all matches the immediate assignment (extended)
      * message is identified for the MS.
      */
-     TRACE_EVENT_P5 ("with[%u]: %d %d %d 0x%02x", i,
+    TRACE_EVENT_P5 ("with[%u]: %d %d %d 0x%02x", i,
       rr_data->used_frame_no[i].t1, rr_data->used_frame_no[i].t2,
       rr_data->used_frame_no[i].t3, rr_data->used_channel_ref[i]);
 
-     if (rr_data->used_frame_no[i].t1 EQ req_ref->t1 AND
-         rr_data->used_frame_no[i].t2 EQ req_ref->t2 AND
-         rr_data->used_frame_no[i].t3 EQ req_ref->t3 AND
-         rr_data->used_channel_ref[i] EQ req_ref->ra)
-     {
-       *index = i;
-       return TRUE;
-     }
+    if (rr_data->used_frame_no[i].t1 EQ req_ref->t1 AND
+        rr_data->used_frame_no[i].t2 EQ req_ref->t2 AND
+        rr_data->used_frame_no[i].t3 EQ req_ref->t3 AND
+        rr_data->used_channel_ref[i] EQ req_ref->ra)
+    {
+      *index = i;
+      return TRUE;
+    }
   }
 
   /*
@@ -1809,7 +1805,7 @@
 };
 
 static void dat_get_background_and_bits (UBYTE     *background,
-                                        UBYTE     *bits)
+                                         UBYTE     *bits)
 {
   GET_INSTANCE_DATA;
 
@@ -1841,65 +1837,65 @@
     /*
      * check internal establishment cause
      */
-     if (rr_data->ms_data.establish_cause NEQ coding_table[i].cause)
-       continue;
-
-     /*
-      * check last used channel if applicable
-      */
-     if (coding_table[i].last_channel NEQ IG)
-     {
-       if (rr_data->ms_data.last_used_channel NEQ
-           coding_table[i].last_channel)
-         continue;
-     }
-
-     /*
-      * check new establishment cause indication flag if applicable
-      */
-     if (coding_table[i].neci_flag NEQ IG)
-     {
-       if (rr_data->nc_data[SC_INDEX].select_para.neci NEQ
-           coding_table[i].neci_flag)
-         continue;
-     }
-
-     /*
-      * check the channel needed indication of the paging messages
-      * if applicable
-      */
-     if (coding_table[i].channel_needed NEQ IG)
-     {
-       if (rr_data->ms_data.channel_needed NEQ
-           coding_table[i].channel_needed)
-         continue;
-     }
-
-     /*
-      * check the MS capability if applicable
-      */
-     if (coding_table[i].ms_capability NEQ IG)
-     {
-       if (ms_capability NEQ coding_table[i].ms_capability)
-         continue;
-     }
-
-     /*
-      * check the TCH Fullrate needed flag is applicable.
-      */
-     if (coding_table[i].tch_f_needed NEQ IG)
-     {
-       if ((rr_data->ms_data.establish_cause NEQ ESTCS_MOC_SPEECH) AND
-           (rr_data->ms_data.establish_cause NEQ ESTCS_MOC_DATA_HR_SUFF))
-         continue;
-     }
-
-     /*
-      * add this point all criterions are passed, so use the table contents.
-      */
-     *background = coding_table[i].background;
-     *bits       = coding_table[i].bits;
-     return;
+    if (rr_data->ms_data.establish_cause NEQ coding_table[i].cause)
+      continue;
+
+    /*
+     * check last used channel if applicable
+     */
+    if (coding_table[i].last_channel NEQ IG)
+    {
+      if (rr_data->ms_data.last_used_channel NEQ
+          coding_table[i].last_channel)
+        continue;
+    }
+
+    /*
+     * check new establishment cause indication flag if applicable
+     */
+    if (coding_table[i].neci_flag NEQ IG)
+    {
+      if (rr_data->nc_data[SC_INDEX].select_para.neci NEQ
+          coding_table[i].neci_flag)
+        continue;
+    }
+
+    /*
+     * check the channel needed indication of the paging messages
+     * if applicable
+     */
+    if (coding_table[i].channel_needed NEQ IG)
+    {
+      if (rr_data->ms_data.channel_needed NEQ
+          coding_table[i].channel_needed)
+        continue;
+    }
+
+    /*
+     * check the MS capability if applicable
+     */
+    if (coding_table[i].ms_capability NEQ IG)
+    {
+      if (ms_capability NEQ coding_table[i].ms_capability)
+        continue;
+    }
+
+    /*
+     * check the TCH Fullrate needed flag is applicable.
+     */
+    if (coding_table[i].tch_f_needed NEQ IG)
+    {
+      if ((rr_data->ms_data.establish_cause NEQ ESTCS_MOC_SPEECH) AND
+          (rr_data->ms_data.establish_cause NEQ ESTCS_MOC_DATA_HR_SUFF))
+        continue;
+    }
+
+    /*
+     * add this point all criterions are passed, so use the table contents.
+     */
+    *background = coding_table[i].background;
+    *bits       = coding_table[i].bits;
+    return;
   }
 }
 
@@ -1940,7 +1936,6 @@
       ((random_value & mask[bits - 2]) EQ 7)
     )
   {
-
     return (background + 6);
   }
 #endif
@@ -2020,7 +2015,6 @@
          50,  55,              41         /* 15 */
     };
 
-
 static UBYTE dat_get_delta (UBYTE i)
 {
   GET_INSTANCE_DATA;
@@ -2040,15 +2034,15 @@
     n = (i EQ 0) ? att_max (convert_table[index].t, 8) - 1
                : convert_table[index].t - 1;
 
-  /*
-   * calculate random value
-   */
-  result = dat_random ((USHORT)(n+1));
-
-  /*
-   * If it is not the first value, add left boarder S
-   */
-  if (i NEQ 0)
+    /*
+     * calculate random value
+     */
+    result = dat_random ((USHORT)(n+1));
+
+    /*
+     * If it is not the first value, add left boarder S
+     */
+    if (i NEQ 0)
     {
       /*
        * in according to GSM 4.08, section 10.5.2.11 (Control Channel Description)
@@ -2118,7 +2112,6 @@
 
   TRACE_FUNCTION("dat_eplmn_equal_req");
 
-  
   if(rr_data->ms_data.v_eq_plmn)
   {
     for(i = 0; i < RR_EPLMNLIST_SIZE; i++)
@@ -2211,9 +2204,8 @@
 
   return dat_plmn_equal_req (mcc, mnc,
                              &rr_data->ms_data.imsi.ident_dig[0],
-                             &rr_data->ms_data.imsi.ident_dig[3]);       
-   
- }
+                             &rr_data->ms_data.imsi.ident_dig[3]);
+}
 
 
 /*
@@ -2312,7 +2304,6 @@
     }
   }
   return ret;
-
 }
 
 /*
@@ -2447,25 +2438,25 @@
     if (! dat_hplmn (rr_data->nc_data[SC_INDEX].lai.mcc, 
                      rr_data->nc_data[SC_INDEX].lai.mnc))
     {
-     /*
-      * ignore bit 11 and 15 if not in the HPLMN
-      */
-        ms_classes   = ms_classes & 0x7000;
-        plmn_classes = plmn_classes & 0x7000;
+      /*
+       * ignore bit 11 and 15 if not in the HPLMN
+       */
+      ms_classes   = ms_classes & 0x7000;
+      plmn_classes = plmn_classes & 0x7000;
     }
 
     if (! dat_hplmn_country (rr_data->nc_data[SC_INDEX].lai.mcc))
     {
-     /*
-      * ignore bit 12 to 14 if not in the HPLMN country
-      */
-        ms_classes   = ms_classes & 0x8F00;
-        plmn_classes = plmn_classes & 0x8F00;
+      /*
+       * ignore bit 12 to 14 if not in the HPLMN country
+       */
+      ms_classes   = ms_classes & 0x8F00;
+      plmn_classes = plmn_classes & 0x8F00;
     }
 
-     /*
-      * check classes
-      */
+    /*
+     * check classes
+     */
     if ((ms_classes & (~plmn_classes)) NEQ 0)
       result = TRUE;
   }
@@ -2490,8 +2481,7 @@
 {
   GET_INSTANCE_DATA;
   T_TIME time_val;
-
-   static USHORT random_value = 0;
+  static USHORT random_value = 0;
 
   TRACE_FUNCTION ("dat_random()");
 
@@ -2552,7 +2542,7 @@
         break;
       }
       /* 
-       *DL establishment failure during immediate assignment
+       * DL establishment failure during immediate assignment
        */
       switch (rr_data->ms_data.establish_cause)
       {
@@ -2879,7 +2869,6 @@
 }
 
 
-
 /*
 +--------------------------------------------------------------------+
 | PROJECT : GSM-PS (6147)       MODULE  : RR_DAT                     |
@@ -2954,16 +2943,16 @@
         else
 #endif
         {
-        /* for MSC release R98 or old modulo 2 will be done.
-         * SAPI 0 message: set bit if vsd is 1, else no effect
-         * and increment V(S) modulo 2.
-         */
-        *msp |= (vsd++ << 6);
-        vsd &= 1;
+          /* for MSC release R98 or old modulo 2 will be done.
+           * SAPI 0 message: set bit if vsd is 1, else no effect
+           * and increment V(S) modulo 2.
+           */
+          *msp |= (vsd++ << 6);
+          vsd &= 1;
+        }
     }
   }
 }
-}
 
 /*
 +---------------------------------------------------------------------+
@@ -3527,7 +3516,6 @@
   } /*if*/
 } /* end of dat_update_common_rtd_struct() */
 
-
 #endif /* #if defined (TI_PS_FF_RTD) AND defined (REL99) */
 
 #endif