* INTC Contribution to the O-RAN F Release for O-DU Low
[o-du/phy.git] / fapi_5g / source / api / fapi2phy / p7 / nr5g_fapi_fapi2phy_p7_pvt_proc.h
1 /******************************************************************************
2 *
3 *   Copyright (c) 2021 Intel.
4 *
5 *   Licensed under the Apache License, Version 2.0 (the "License");
6 *   you may not use this file except in compliance with the License.
7 *   You may obtain a copy of the License at
8 *
9 *       http://www.apache.org/licenses/LICENSE-2.0
10 *
11 *   Unless required by applicable law or agreed to in writing, software
12 *   distributed under the License is distributed on an "AS IS" BASIS,
13 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 *   See the License for the specific language governing permissions and
15 *   limitations under the License.
16 *
17 *******************************************************************************/
18
19 /**
20  * @file
21  * This file consist of macros, structures and prototypes of all FAPI
22  * to PHY P7 messages
23  *
24  **/
25
26 #ifndef _NR5G_FAPI_FAP2PHY_P7_PVT_PROC_H_
27 #define _NR5G_FAPI_FAP2PHY_P7_PVT_PROC_H_
28
29 #include "nr5g_mac_phy_api.h"
30 #include "fapi_interface.h"
31 #include "fapi_vendor_extension.h"
32 #include "nr5g_fapi_framework.h"
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 // DL/UL_TTI.req common
39 uint8_t nr5g_fapi_calc_n_rbg_size(
40     uint16_t bwp_size);
41
42 uint32_t nr5g_fapi_calc_rbg_index(
43     const uint8_t rb_bitmap[FAPI_RB_BITMAP_SIZE],
44     uint16_t bwp_start,
45     uint16_t bwp_size,
46     uint32_t(*get_rbg_index_mask)(uint32_t nth_bit));
47
48 uint16_t nr5g_fapi_get_rb_bits_for_rbg(
49     const uint8_t rb_bitmap[FAPI_RB_BITMAP_SIZE],
50     uint32_t rbg_bit,
51     uint8_t rbg_size,
52     uint16_t rb_bitmap_mask);
53
54 // DL_TTI.req
55 uint8_t nr5g_fapi_dl_tti_req_to_phy_translation(
56     p_nr5g_fapi_phy_instance_t p_phy_instance,
57     fapi_dl_tti_req_t * p_fapi_req,
58     fapi_vendor_msg_t * p_fapi_vendor_msg,
59     PDLConfigRequestStruct p_ia_dl_config_req);
60
61 void nr5g_fapi_dl_tti_req_to_phy_translation_vendor_ext(
62     p_nr5g_fapi_phy_instance_t p_phy_instance,
63     fapi_vendor_msg_t * p_fapi_vendor_msg,
64     PDLConfigRequestStruct p_ia_dl_config_req);
65
66 void nr5g_fapi_fill_dci_pdu(
67     p_nr5g_fapi_phy_instance_t p_phy_instance,
68     fapi_dl_pdcch_pdu_t * p_pdcch_pdu,
69     PDCIPDUStruct p_dci_pdu);
70
71 void nr5g_fapi_fill_pdsch_pdu(
72     p_nr5g_fapi_phy_instance_t p_phy_instance,
73     fapi_dl_pdsch_pdu_t * p_pdsch_pdu,
74     PDLSCHPDUStruct p_dlsch_pdu);
75
76 uint16_t nr5g_fapi_calculate_nEpreRatioOfPDCCHToSSB(
77     uint8_t beta_pdcch_1_0);
78
79 uint16_t nr5g_fapi_calculate_nEpreRatioOfDmrsToSSB(
80     uint8_t power_control_offset_ss);
81
82 uint16_t nr5g_fapi_calculate_nEpreRatioOfPDSCHToSSB(
83     uint8_t power_control_offset);
84
85 uint32_t nr5g_fapi_calc_pdsch_rbg_index(
86     const uint8_t rb_bitmap[FAPI_RB_BITMAP_SIZE],
87     uint16_t bwp_start,
88     uint16_t bwp_size);
89
90 void nr5g_fapi_fill_ssb_pdu(
91     p_nr5g_fapi_phy_instance_t p_phy_instance,
92     PBCHPDUStruct p_bch_pdu,
93     fapi_dl_ssb_pdu_t * p_ssb_pdu);
94
95 void nr5g_fapi_fill_csi_rs_pdu(
96     p_nr5g_fapi_phy_instance_t p_phy_instance,
97     fapi_dl_csi_rs_pdu_t * p_csi_rs_pdu,
98     PCSIRSPDUStruct pCSIRSPdu);
99
100 // UL_TTI.req
101 uint32_t nr5g_fapi_calc_pusch_rbg_index(
102     const uint8_t rb_bitmap[FAPI_RB_BITMAP_SIZE],
103     uint16_t bwp_start,
104     uint16_t bwp_size);
105
106 void nr5g_fapi_pusch_data_to_phy_ulsch_translation(
107     nr5g_fapi_pusch_info_t * p_pusch_info,
108     fapi_pusch_data_t * p_pusch_data,
109     ULSCHPDUStruct * p_ul_data_chan);
110
111 void nr5g_fapi_pusch_uci_to_phy_ulsch_translation(
112     fapi_pusch_uci_t * p_pusch_uci,
113     ULSCHPDUStruct * p_ul_data_chan);
114
115 void nr5g_fapi_pusch_ptrs_to_phy_ulsch_translation(
116     fapi_pusch_ptrs_t * p_pusch_ptrs,
117     ULSCHPDUStruct * p_ul_data_chan);
118
119 void nr5g_fapi_pusch_to_phy_ulsch_translation(
120     p_nr5g_fapi_phy_instance_t p_phy_instance,
121     nr5g_fapi_pusch_info_t * p_pusch_info,
122     fapi_ul_pusch_pdu_t * p_pusch_pdu,
123     ULSCHPDUStruct * p_ul_data_chan);
124
125 uint8_t nr5g_get_pucch_resources_group_id(
126     uint8_t num_groups,
127     uint16_t initial_cyclic_shift,
128     uint8_t nr_of_symbols,
129     uint8_t start_symbol_index,
130     uint8_t time_domain_occ_idx,
131     nr5g_fapi_pucch_resources_t * p_pucch_resources);
132
133 void nr5g_fapi_pucch_to_phy_ulcch_uci_translation(
134     p_nr5g_fapi_phy_instance_t p_phy_instance,
135     nr5g_fapi_pucch_info_t * p_pucch_info,
136     fapi_ul_pucch_pdu_t * p_pucch_pdu,
137     ULCCHUCIPDUStruct * p_ul_ctrl_chan);
138
139 void nr5g_fapi_srs_to_phy_srs_translation(
140     p_nr5g_fapi_phy_instance_t p_phy_instance,
141     fapi_ul_srs_pdu_t * p_srs_pdu,
142     nr5g_fapi_srs_info_t * p_srs_info,
143     SRSPDUStruct * p_ul_srs_chan);
144
145 uint8_t nr5g_fapi_ul_tti_req_to_phy_translation(
146     bool is_urllc,
147     p_nr5g_fapi_phy_instance_t p_phy_instance,
148     fapi_ul_tti_req_t * p_fapi_req,
149     fapi_vendor_msg_t * p_fapi_vendor_msg,
150     PULConfigRequestStruct p_ia_ul_config_req);
151
152 void nr5g_fapi_ul_tti_req_to_phy_translation_vendor_ext(
153     fapi_vendor_msg_t * p_fapi_vendor_msg,
154     PULConfigRequestStruct p_ia_ul_config_req);
155
156 uint8_t nr5g_fapi_ul_tti_req_to_phy_translation_vendor_ext_symbol_no(
157     bool is_urllc,
158     fapi_vendor_msg_t * p_fapi_vendor_msg,
159     PULConfigRequestStruct p_ia_ul_config_req,
160     uint8_t* symbol_no);
161
162 uint8_t nr5g_fapi_ul_dci_req_to_phy_translation(
163     p_nr5g_fapi_phy_instance_t p_phy_instance,
164     fapi_ul_dci_req_t * p_fapi_req,
165     PULDCIRequestStruct p_ia_ul_dci_req);
166
167 void nr5g_fapi_ul_dci_req_to_phy_translation_vendor_ext(
168     p_nr5g_fapi_phy_instance_t p_phy_instance,
169     fapi_vendor_msg_t * p_fapi_vendor_msg,
170     PULDCIRequestStruct p_ia_ul_dci_req);
171
172 uint8_t nr5g_fapi_tx_data_req_to_phy_translation(
173     p_nr5g_fapi_phy_instance_t p_phy_instance,
174     fapi_tx_data_req_t * p_fapi_req,
175     fapi_vendor_msg_t * p_fapi_vendor_msg,
176     PTXRequestStruct p_ia_tx_req);
177
178 void nr5g_fapi_tx_data_req_to_phy_translation_vendor_ext(
179     fapi_vendor_msg_t * p_fapi_vendor_msg,
180     PTXRequestStruct p_phy_req);
181
182 #ifdef __cplusplus
183 }
184 #endif
185
186 #endif                          //_NR5G_FAPI_FAP2PHY_P7_PVT_PROC_H_