• Bi-Ruei, Chiu's avatar
    Compare version number using MAKE_VERSION macro to provide better SW configuration: · 5c23af77
    Bi-Ruei, Chiu authored
    1. Previous SW configuration for different RRC version relies on whether macro Rel10,
       Rel14 defined or not by checking #ifdef Rel14 or #if defined(Rel10) || defined(R14).
       Whenever there is a newer RRC version, e.g. Rel15, it will be very a tedious and
       error-prone job to add defined(Rel15) in every place.
    
    2. Some RRC messages are defined in release 13 instead of release 14, NB-IoT
       feature is one of such example. Our code shall reflect this fact instead of using
       an afterward version number in software configuration.
    
    3. Some RRC messages or some fields of certain RRC messages are added in the middle
       a release, e.g. SystemInformationBlockType1_v1310_IEs_t defined in RRC 13.1.0
       and RRC 9.2.0 made some changes to SIB12 and SIB13 so we have sib12_v920 and
       sib13_v920 fields in SIB12 and SIB13's struct.
       We need a finer grain of control when using ASN1 from different RRC version.
    
    4. S1AP also has this problem that it use UPDATE_RELEASE_9 and UPDATE_RELEASE_10 to
       differentiate between various S1AP version.
    
    This commit propose using MAKE_VERSION(x,y,z) to designate the version number and
    modify current conditional compilation accordingly.
    
    Note: 2018/04/16, Modified based on Cedric's comment.
    5c23af77
IF_Module.h 3.59 KB
/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
 * except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */

/*! \file openair2/PHY_INTERFACE/IF_Module.h
* \brief data structures for PHY/MAC interface modules
* \author EURECOM/NTUST
* \date 2017
* \version 0.1
* \company Eurecom
* \email: raymond.knopp@eurecom.fr
* \note
* \warning
*/
#ifndef __IF_MODULE__H__
#define __IF_MODULE__H__


#include <stdint.h>
#include "openair1/PHY/LTE_TRANSPORT/defs.h"
#include "nfapi_interface.h"


#define MAX_NUM_DL_PDU 100
#define MAX_NUM_UL_PDU 100
#define MAX_NUM_HI_DCI0_PDU 100
#define MAX_NUM_TX_REQUEST_PDU 100

#define MAX_NUM_HARQ_IND 100
#define MAX_NUM_CRC_IND 100
#define MAX_NUM_SR_IND 100
#define MAX_NUM_CQI_IND 100
#define MAX_NUM_RACH_IND 100
#define MAX_NUM_SRS_IND 100

typedef struct{
  /// Module ID
  module_id_t module_id;
  /// CC ID
  int CC_id;
  /// frame 
  frame_t frame;
  /// subframe
  sub_frame_t subframe;

  /// harq indication list
  nfapi_harq_indication_t harq_ind;

  /// crc indication list
  nfapi_crc_indication_t crc_ind;

  /// SR indication list
  nfapi_sr_indication_t sr_ind;

  /// CQI indication list
  nfapi_cqi_indication_body_t cqi_ind;

  /// RACH indication list
  nfapi_rach_indication_t rach_ind;

#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
  /// RACH indication list for BR UEs
  nfapi_rach_indication_t rach_ind_br;
#endif

  /// SRS indication list
  nfapi_srs_indication_body_t srs_ind;

  /// RX indication
  nfapi_rx_indication_t rx_ind;

} UL_IND_t;

// Downlink subframe P7


typedef struct{
  /// Module ID
  module_id_t module_id; 
  /// CC ID
  uint8_t CC_id;
  /// frame
  frame_t frame;
  /// subframe
  sub_frame_t subframe;
  /// nFAPI DL Config Request
  nfapi_dl_config_request_t *DL_req;
  /// nFAPI UL Config Request
  nfapi_ul_config_request_t *UL_req;
  /// nFAPI HI_DCI Request
  nfapi_hi_dci0_request_t *HI_DCI0_req;
  /// Pointers to DL SDUs
  nfapi_tx_request_t *TX_req;
}Sched_Rsp_t;

typedef struct {
    uint8_t Mod_id;
    int CC_id;
    nfapi_config_request_t *cfg;
}PHY_Config_t;

typedef struct IF_Module_s{
//define the function pointer
  void (*UL_indication)(UL_IND_t *UL_INFO);
  void (*schedule_response)(Sched_Rsp_t *Sched_INFO);
  void (*PHY_config_req)(PHY_Config_t* config_INFO);
  uint32_t CC_mask;
  uint16_t current_frame;
  uint8_t current_subframe;
  pthread_mutex_t if_mutex;
}IF_Module_t;

/*Initial */
IF_Module_t *IF_Module_init(int Mod_id);
void IF_Module_kill(int Mod_id);

/*Interface for uplink, transmitting the Preamble(list), ULSCH SDU, NAK, Tick (trigger scheduler)
 */
void UL_indication(UL_IND_t *UL_INFO);

/*Interface for Downlink, transmitting the DLSCH SDU, DCI SDU*/
void Schedule_Response(Sched_Rsp_t *Sched_INFO);

#endif