NR_IF_Module.h 3.59 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
 * 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
 */

WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
22
/*! \file openair2/NR_PHY_INTERFACE/NR_IF_Module.h
23 24
* \brief data structures for PHY/MAC interface modules
* \author EURECOM/NTUST
WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
25
* \date 2018
26
* \version 0.1
WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
27 28
* \company Eurecom, NTUST
* \email: raymond.knopp@eurecom.fr, kroempa@gmail.com
29 30 31
* \note
* \warning
*/
WEI-TAI CHEN's avatar
WEI-TAI CHEN committed
32

33 34 35 36 37
#ifndef __NR_IF_MODULE__H__
#define __NR_IF_MODULE__H__

#include <stdint.h>
#include "nfapi_nr_interface.h"
38
#include "nfapi_nr_interface_scf.h"
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
#include "platform_constants.h"
#include "platform_types.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

54
typedef struct {
55 56 57 58
  /// Module ID
  module_id_t module_id;
  /// CC ID
  int CC_id;
59
  /// frame
60
  frame_t frame;
61 62
  /// slot
  slot_t slot;
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89

  /// 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;

  /// RACH indication list for BR UEs
  nfapi_rach_indication_t rach_ind_br;

  /// SRS indication list
  nfapi_srs_indication_body_t srs_ind;

  /// RX indication
  nfapi_rx_indication_t rx_ind;

} NR_UL_IND_t;

90
// Downlink slot P7
91 92


93
typedef struct {
94
  /// Module ID
95
  module_id_t module_id;
96 97 98 99
  /// CC ID
  uint8_t CC_id;
  /// frame
  frame_t frame;
100 101
  /// slot
  slot_t slot;
102
  /// nFAPI DL Config Request
Raymond Knopp's avatar
Raymond Knopp committed
103
  nfapi_nr_dl_tti_request_t *DL_req;
104
  /// nFAPI UL Config Request
105
  nfapi_nr_ul_tti_request_t *UL_tti_req;
Raymond Knopp's avatar
Raymond Knopp committed
106 107
  /// nFAPI UL_DCI Request
  nfapi_nr_ul_dci_request_t *UL_dci_req;
108
  /// Pointers to DL SDUs
Raymond Knopp's avatar
Raymond Knopp committed
109
  nfapi_nr_tx_data_request_t *TX_req;
110 111 112
} NR_Sched_Rsp_t;

typedef struct {
113 114
  uint8_t Mod_id;
  int CC_id;
115
  nfapi_nr_config_request_scf_t *cfg;
116 117
} NR_PHY_Config_t;

118 119
typedef struct NR_IF_Module_s {
  //define the function pointer
120 121
  void (*NR_UL_indication)(NR_UL_IND_t *UL_INFO);
  void (*NR_Schedule_response)(NR_Sched_Rsp_t *Sched_INFO);
122
  void (*NR_PHY_config_req)(NR_PHY_Config_t *config_INFO);
123 124
  uint32_t CC_mask;
  uint16_t current_frame;
125
  uint8_t current_slot;
126 127 128 129 130 131 132 133 134 135 136 137 138
  pthread_mutex_t if_mutex;
} NR_IF_Module_t;

/*Initial */
NR_IF_Module_t *NR_IF_Module_init(int Mod_id);

void NR_IF_Module_kill(int Mod_id);

void NR_UL_indication(NR_UL_IND_t *UL_INFO);

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

139
#endif /*_NFAPI_INTERFACE_NR_H_*/