Look up xran_fh_init/xran_fh_config through driver instead of peaking into xran internals. Note that xran writes values back into these structs during initialization, and hence it is important to store them _after initialization_. Some remarks regarding less obvious changes: - slotnum is replaced by slots_in_sf: SLOTNUM_PER_SUBFRAME uses the time duration of a slot (=interval_us_local) to calculate the numbers of slots in a subframe, which can be done with a simple shift instead - The prach duration should be queried from the PRACH configuration table. The function to query the occasion info is part of the MAC layer code while this information can be used outside of this layer. Use header `nr_prach_config.h` to not duplicate functionality. Co-authored-by: Romain Beurdouche <romain.beurdouche@eurecom.fr>
68 lines
2.9 KiB
C
68 lines
2.9 KiB
C
/*
|
|
* 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
|
|
*/
|
|
|
|
#ifndef ORAN_INIT_H
|
|
#define ORAN_INIT_H
|
|
|
|
typedef struct oran_bufs {
|
|
struct xran_flat_buffer tx[XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN][XRAN_NUM_OF_SYMBOL_PER_SLOT];
|
|
struct xran_flat_buffer tx_prbmap[XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN];
|
|
struct xran_flat_buffer rx[XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN][XRAN_NUM_OF_SYMBOL_PER_SLOT];
|
|
struct xran_flat_buffer rx_prbmap[XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN];
|
|
|
|
struct xran_flat_buffer prach[XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN][XRAN_NUM_OF_SYMBOL_PER_SLOT];
|
|
struct xran_flat_buffer prachdecomp[XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN][XRAN_NUM_OF_SYMBOL_PER_SLOT];
|
|
} oran_bufs_t;
|
|
|
|
typedef struct oran_buf_list {
|
|
// xran API requires buffer lists as structs of arrays
|
|
struct xran_buffer_list src[XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN];
|
|
struct xran_buffer_list srccp[XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN];
|
|
struct xran_buffer_list dst[XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN];
|
|
struct xran_buffer_list dstcp[XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN];
|
|
|
|
struct xran_buffer_list prachdst[XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN];
|
|
struct xran_buffer_list prachdstdecomp[XRAN_MAX_ANTENNA_NR][XRAN_N_FE_BUF_LEN];
|
|
|
|
oran_bufs_t bufs;
|
|
} oran_buf_list_t;
|
|
|
|
typedef struct oran_port_instance_t {
|
|
oran_buf_list_t *buf_list;
|
|
void *instanceHandle;
|
|
//uint32_t dpdkPoolIndex[MAX_SW_XRAN_INTERFACE_NUM];
|
|
|
|
struct xran_cb_tag prach_tag;
|
|
struct xran_cb_tag pusch_tag;
|
|
} oran_port_instance_t;
|
|
|
|
extern struct xran_fh_config gxran_fh_config[XRAN_PORTS_NUM];
|
|
extern void *gxran_handle;
|
|
|
|
int *oai_oran_initialize(struct xran_fh_init *fh_init, struct xran_fh_config *fh_config);
|
|
|
|
oran_buf_list_t *get_xran_buffers(uint32_t port_id);
|
|
struct xran_fh_init *get_xran_fh_init(void);
|
|
struct xran_fh_config *get_xran_fh_config(uint32_t port_id);
|
|
uint32_t get_prach_conf_duration(uint32_t port_id);
|
|
|
|
#endif /* ORAN_INIT_H */
|