IF_Module.h 3.56 KB
Newer Older
1
/*
2 3 4 5
 * 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
6
 * the OAI Public License, Version 1.1  (the "License"); you may not use this file
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
 * 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
64
  nfapi_harq_indication_t harq_ind;
65 66

  /// crc indication list
67
  nfapi_crc_indication_t crc_ind;
68 69

  /// SR indication list
70
  nfapi_sr_indication_t sr_ind;
71 72

  /// CQI indication list
73
  nfapi_cqi_indication_body_t cqi_ind;
74 75

  /// RACH indication list
76
  nfapi_rach_indication_t rach_ind;
77

78 79
#ifdef Rel14
  /// RACH indication list for BR UEs
80
  nfapi_rach_indication_t rach_ind_br;
81 82
#endif

83
  /// SRS indication list
84
  nfapi_srs_indication_body_t srs_ind;
85 86

  /// RX indication
87
  nfapi_rx_indication_t rx_ind;
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103

} 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
104
  nfapi_dl_config_request_t *DL_req;
105
  /// nFAPI UL Config Request
106
  nfapi_ul_config_request_t *UL_req;
107
  /// nFAPI HI_DCI Request
108
  nfapi_hi_dci0_request_t *HI_DCI0_req;
109
  /// Pointers to DL SDUs
110
  nfapi_tx_request_t *TX_req;
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
}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