nr_dlsch.h 3.7 KB
Newer Older
1 2 3 4 5 6 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
/*
 * 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 PHY/LTE_TRANSPORT/defs.h
* \brief data structures for PDSCH/DLSCH/PUSCH/ULSCH physical and transport channel descriptors (TX/RX)
* \author R. Knopp
* \date 2011
* \version 0.1
* \company Eurecom
* \email: raymond.knopp@eurecom.fr, florian.kaltenberger@eurecom.fr, oscar.tonelli@yahoo.it
* \note
* \warning
*/

33 34
#ifndef __NR_DLSCH__H
#define __NR_DLSCH__H
35

36
#include "PHY/defs_gNB.h"
37

38
void nr_get_time_domain_allocation_type(nfapi_nr_config_request_t config,
Guy De Souza's avatar
Guy De Souza committed
39 40
                                        nfapi_nr_dl_config_dci_dl_pdu dci_pdu,
                                        nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu);
41 42 43

void nr_check_time_alloc(uint8_t S, uint8_t L, nfapi_nr_config_request_t config);

Guy De Souza's avatar
Guy De Souza committed
44 45 46 47
uint16_t get_RIV(uint16_t rb_start, uint16_t L, uint16_t N_RB);

uint16_t get_SLIV(uint8_t S, uint8_t L);

Guy De Souza's avatar
Guy De Souza committed
48 49 50 51 52
uint8_t nr_get_S(uint8_t row_idx, uint8_t CP, uint8_t time_alloc_type, uint8_t dmrs_typeA_position);

void nr_get_rbg_parms(NR_BWP_PARMS* bwp, uint8_t config_type);

void nr_get_rbg_list(uint32_t bitmap, uint8_t n_rbg, uint8_t* rbg_list);
Guy De Souza's avatar
Guy De Souza committed
53 54

void nr_get_PRG_parms(NR_BWP_PARMS* bwp, NR_gNB_DCI_ALLOC_t dci_alloc, uint8_t prb_bundling_type);
55

Guy De Souza's avatar
Guy De Souza committed
56
void nr_pdsch_codeword_scrambling(uint8_t *in,
57 58 59 60 61
                                  uint32_t size,
                                  uint8_t q,
                                  uint32_t Nid,
                                  uint32_t n_RNTI,
                                  uint32_t* out);
62

63 64 65 66 67 68
void nr_fill_dlsch(PHY_VARS_gNB *gNB,
                   int frame,
                   int slot,
                   nfapi_nr_dl_config_dlsch_pdu *dlsch_pdu,
                   unsigned char *sdu); 

69 70
uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch,
                          NR_gNB_DCI_ALLOC_t *dci_alloc,
Guy De Souza's avatar
Guy De Souza committed
71
                          uint32_t ***pdsch_dmrs,
Guy De Souza's avatar
Guy De Souza committed
72 73
                          int32_t** txdataF,
                          int16_t amp,
74 75
                          int frame,
                          uint8_t slot,
76
                          NR_DL_FRAME_PARMS *frame_parms,
77 78 79 80 81
                          nfapi_nr_config_request_t *config,
                          time_stats_t *dlsch_encoding_stats,
                          time_stats_t *dlsch_scrambling_stats,
                          time_stats_t *dlsch_modulation_stats);

Guy De Souza's avatar
Guy De Souza committed
82

yilmazt's avatar
yilmazt committed
83 84 85 86
void free_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);

void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);

87 88
void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch);

89 90 91 92
int16_t find_nr_dlsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type);

int nr_dlsch_encoding(unsigned char *a,int frame,
                     uint8_t slot,
Guy De Souza's avatar
Guy De Souza committed
93 94
                     NR_gNB_DLSCH_t *dlsch,
                     NR_DL_FRAME_PARMS* frame_parms);
95

96

97 98
void nr_emulate_dlsch_payload(uint8_t* payload, uint16_t size);

99
#endif