Commit 07d8ba2d authored by Siddharth Rana's avatar Siddharth Rana Committed by Vaibhav Shrivastava

Rebasing nfapi directory

parent c5fcab72
/*
* 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
*/
#include "gnb_ind_vars.h"
queue_t gnb_rach_ind_queue;
......
This diff is collapsed.
......@@ -41,6 +41,7 @@
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#include "executables/lte-softmodem.h"
#include "openair1/PHY/defs_gNB.h"
#include "common/ran_context.h"
#include "openair2/PHY_INTERFACE/queue_t.h"
......@@ -240,6 +241,13 @@ void oai_create_enb(void) {
FAPI_configured_for_a_CC = 1;
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() eNB Cell %d is now configured\n", __FUNCTION__,CC_id);
}
do {
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() Waiting for eNB to become configured (by RRC/PHY) - need to wait otherwise NFAPI messages won't contain correct values\n", __FUNCTION__);
usleep(50000);
} while(eNB->configured != 1);
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() eNB is now configured\n", __FUNCTION__);
}
void oai_enb_init(void) {
......@@ -665,9 +673,17 @@ int phy_subframe_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id,
} else {
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() RC.eNB:%p\n", __FUNCTION__, RC.eNB);
if (RC.eNB) NFAPI_TRACE(NFAPI_TRACE_INFO, "RC.eNB[0][CC_id]->configured:%d\n", RC.eNB[0][CC_id]->configured);
}
if (RC.eNB && RC.eNB[0][0]->configured) {
uint16_t sfn = NFAPI_SFNSF2SFN(sfn_sf);
uint16_t sf = NFAPI_SFNSF2SF(sfn_sf);
//LOG_D(PHY,"[VNF] subframe indication sfn_sf:%d sfn:%d sf:%d\n", sfn_sf, sfn, sf);
wake_eNB_rxtx(RC.eNB[0][0], sfn, sf);
} else {
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] %s() RC.eNB:%p\n", __FUNCTION__, RC.eNB);
if (RC.eNB) NFAPI_TRACE(NFAPI_TRACE_INFO, "RC.eNB[0][0]->configured:%d\n", RC.eNB[0][0]->configured);
}
return 0;
}
......@@ -1701,6 +1717,7 @@ int nr_config_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_config_re
nfapi_nr_start_request_scf_t req;
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Received NFAPI_CONFIG_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Calling oai_enb_init()\n");
oai_enb_init(); // TODO: change to gnb
memset(&req, 0, sizeof(req));
req.header.message_id = NFAPI_NR_PHY_MSG_TYPE_START_REQUEST;
req.header.phy_id = resp->header.phy_id;
......@@ -1722,13 +1739,24 @@ int config_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_config_response
}
int start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_start_response_t *resp) {
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Received NFAPI_START_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
vnf_info *vnf = (vnf_info *)(config->user_data);
pnf_info *pnf = vnf->pnfs;
phy_info *phy = pnf->phys;
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
nfapi_vnf_p7_add_pnf((p7_vnf->config), phy->remote_addr, htons(phy->remote_port), phy->id);
return 0;
NFAPI_TRACE(NFAPI_TRACE_INFO, "[VNF] Received NFAPI_START_RESP idx:%d phy_id:%d\n", p5_idx, resp->header.phy_id);
vnf_info *vnf = (vnf_info *)(config->user_data);
pnf_info *pnf = vnf->pnfs;
phy_info *phy = pnf->phys;
vnf_p7_info *p7_vnf = vnf->p7_vnfs;
uint16_t port =htons(phy->remote_port);
char *remote_addr = (char *) malloc(strlen(phy->remote_addr)+1);
memset(remote_addr, 0, strlen(phy->remote_addr)+1);
strncpy(remote_addr, phy->remote_addr, strlen(phy->remote_addr));
for(int i=0; i < pnf->num_phys; i++ )
{
nfapi_vnf_p7_add_pnf((p7_vnf->config), remote_addr, (int)port, phy->id);
LOG_D(NFAPI_VNF, "MultiCell: fxn:%d phy_id added:%d\n", p5_idx, resp->header.phy_id);
phy +=1;
}
free(remote_addr);
remote_addr = NULL;
return 0;
}
int nr_start_resp_cb(nfapi_vnf_config_t *config, int p5_idx, nfapi_nr_start_response_scf_t *resp) {
......@@ -1802,7 +1830,7 @@ void vnf_start_thread(void *ptr) {
static vnf_info vnf;
void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port) {
void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) {
nfapi_setmode(NFAPI_MODE_VNF);
memset(&vnf, 0, sizeof(vnf));
memset(vnf.p7_vnfs, 0, sizeof(vnf.p7_vnfs));
......@@ -1853,7 +1881,7 @@ void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port) {
}
void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port) {
void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port) {
nfapi_setmode(NFAPI_MODE_VNF);
memset(&vnf, 0, sizeof(vnf));
memset(vnf.p7_vnfs, 0, sizeof(vnf.p7_vnfs));
......@@ -2146,17 +2174,3 @@ int oai_nfapi_ue_release_req(nfapi_ue_release_request_t *release_req){
}
return retval;
}
int oai_nfapi_slot_ind(nfapi_nr_slot_indication_scf_t * slot_ind)
{
LOG_D(NR_PHY, "Entering oai_nfapi_slot_ind sfn:%d,slot:%d\n", slot_ind->sfn, slot_ind->slot);
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
slot_ind->header.message_id= NFAPI_NR_PHY_MSG_TYPE_SLOT_INDICATION;
int retval = nfapi_vnf_p7_nr_slot_ind(p7_config, slot_ind);
if (retval!=0) {
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
}
return retval;
}
\ No newline at end of file
......@@ -20,8 +20,8 @@
*/
void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port);
void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port);
void configure_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
void configure_nr_nfapi_vnf(char *vnf_addr, int vnf_p5_port, char *pnf_ip_addr, int pnf_p7_port, int vnf_p7_port);
uint32_t sfnslot_add_slot(uint16_t sfn, uint16_t slot, int offset);
......@@ -87,6 +87,7 @@ typedef struct {
typedef struct {
uint16_t rnti;
uint8_t dci_format;
uint8_t coreset_type;
int ss_type;
// n_CCE index of first CCE for PDCCH reception
int n_CCE;
......
......@@ -10,7 +10,7 @@
#define _NFAPI_NR_INTERFACE_H_
#include "nfapi_interface.h"
#include "nfapi_nr_interface_scf.h"
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface_scf.h"
#define NFAPI_NR_MAX_NB_CCE_AGGREGATION_LEVELS 5
#define NFAPI_NR_MAX_NB_TCI_STATES_PDCCH 64
......
......@@ -452,7 +452,7 @@ typedef struct
// ERROR enums
typedef enum { // Table 2-22
NFAPI_NR_PARAM_MSG_OK = 0,
NFAPI_NR_PARAM_MSG_INVALID_STATE
NFAPI_NR_PARAM_MSG_INVALID_STATE
} nfapi_nr_param_errors_e;
typedef enum { // Table 2-25
......@@ -463,7 +463,7 @@ typedef enum { // Table 2-25
typedef enum { // Table 2-27
NFAPI_NR_START_MSG_OK = 0,
NFAPI_NR_START_MSG_INVALID_STATE
NFAPI_NR_START_MSG_INVALID_STATE
} nfapi_nr_start_errors_e;
//PNF P5 NR
......@@ -679,9 +679,6 @@ typedef struct {
} nfapi_nr_slot_indication_scf_t;
/** VTUESLOT.indication sent from UE as an ACK in the virtual time scenario */
typedef nfapi_nr_slot_indication_scf_t nfapi_ue_slot_indication_vt_t;
// 3.4.2
//for pdcch_pdu:
......
This diff is collapsed.
......@@ -32,7 +32,7 @@
# if 1 // for hard-code (remove later)
#include "COMMON/platform_types.h"
#include "COMMON/platform_constants.h"
#include "common/platform_constants.h"
#include "common/ran_context.h"
#include "common/utils/LOG/log.h"
......@@ -831,7 +831,7 @@ void pnf_nr_handle_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
memset(&resp, 0, sizeof(resp));
resp.header.message_id = NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE;
resp.header.phy_id = req.header.phy_id;
resp.error_code = NFAPI_MSG_INVALID_STATE;
resp.error_code = NFAPI_NR_START_MSG_INVALID_STATE;
nfapi_nr_pnf_start_resp(config, &resp);
}
}
......@@ -841,7 +841,7 @@ void pnf_nr_handle_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
memset(&resp, 0, sizeof(resp));
resp.header.message_id = NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE;
resp.header.phy_id = req.header.phy_id;
resp.error_code = NFAPI_MSG_INVALID_CONFIG;
resp.error_code = NFAPI_NR_START_MSG_INVALID_STATE;
nfapi_nr_pnf_start_resp(config, &resp);
}
}
......@@ -851,7 +851,7 @@ void pnf_nr_handle_start_request(pnf_t* pnf, void *pRecvMsg, int recvMsgLen)
memset(&resp, 0, sizeof(resp));
resp.header.message_id = NFAPI_NR_PHY_MSG_TYPE_START_RESPONSE;
resp.header.phy_id = req.header.phy_id;
resp.error_code = NFAPI_MSG_INVALID_STATE;
resp.error_code = NFAPI_NR_START_MSG_INVALID_STATE;
nfapi_nr_pnf_start_resp(config, &resp);
}
}
......@@ -2309,7 +2309,7 @@ int pnf_message_pump(pnf_t* pnf)
}
// Drop back to idle if we have lost connection
pnf->_public.state = NFAPI_PNF_PHY_IDLE;
pnf->_public.state = NFAPI_PNF_IDLE;
// close the connection and socket
......@@ -2370,7 +2370,7 @@ int pnf_nr_message_pump(pnf_t* pnf)
}
// Drop back to idle if we have lost connection
pnf->_public.state = NFAPI_PNF_PHY_IDLE;
pnf->_public.state = NFAPI_PNF_IDLE;
// close the connection and socket
......
This diff is collapsed.
......@@ -27,8 +27,9 @@ typedef enum
P7_VENDOR_EXT_REQ,
P7_VENDOR_EXT_IND,
#if 1 /** TODO: FC Need clean up for OAI */
P7_CELL_SEARCH_IND
P7_CELL_SEARCH_IND
#endif
} vendor_ext_message_id_e;
typedef struct {
......
......@@ -950,16 +950,6 @@ int nfapi_vnf_p7_add_pnf(nfapi_vnf_p7_config_t* config, const char* pnf_p7_addr,
*/
int nfapi_vnf_p7_del_pnf(nfapi_vnf_p7_config_t* config, int phy_id);
/*! Send the SLOT_IND.request
* \param config A pointer to the vnf p7 configuration
* \param req A data structure for the decoded SLOT_IND.request.
* \return A status value. 0 equal success, -1 indicates failure
*
* The caller is responsiable for memory management of any pointers set in the req, which
* may be released after this function call has returned or at a later pointer
*/
int nfapi_vnf_p7_nr_slot_ind(nfapi_vnf_p7_config_t* config, nfapi_nr_slot_indication_scf_t* req);
/*! Send the DL_CONFIG.request
* \param config A pointer to the vnf p7 configuration
* \param req A data structure for the decoded DL_CONFIG.request.
......
......@@ -1511,7 +1511,7 @@ void vnf_handle_nr_slot_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf
}
else
{
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "%s: Handling NR SLOT Indication sfn:%d slot:%d\n", __FUNCTION__, ind.sfn, ind.slot);
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "%s: Handling NR SLOT Indication\n", __FUNCTION__);
if(vnf_p7->_public.nr_slot_indication)
{
(vnf_p7->_public.nr_slot_indication)(&ind);
......@@ -1537,7 +1537,7 @@ void vnf_handle_nr_rx_data_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t*
}
else
{
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling RX Indication sfn:%d slot:%d\n", __FUNCTION__, ind.sfn, ind.slot);
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling RX Indication\n", __FUNCTION__);
if(vnf_p7->_public.nr_rx_data_indication)
{
(vnf_p7->_public.nr_rx_data_indication)(&ind);
......@@ -1563,7 +1563,7 @@ void vnf_handle_nr_crc_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_
}
else
{
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling CRC Indication sfn:%d slot:%d\n", __FUNCTION__, ind.sfn, ind.slot);
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling CRC Indication\n", __FUNCTION__);
if(vnf_p7->_public.nr_crc_indication)
{
(vnf_p7->_public.nr_crc_indication)(&ind);
......@@ -1589,7 +1589,6 @@ void vnf_handle_nr_srs_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_
}
else
{
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling SRS Indication sfn:%d slot:%d\n", __FUNCTION__, ind.sfn, ind.slot);
if(vnf_p7->_public.nr_srs_indication)
{
(vnf_p7->_public.nr_srs_indication)(&ind);
......@@ -1615,7 +1614,7 @@ void vnf_handle_nr_uci_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_
}
else
{
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling UCI Indication sfn:%d slot:%d\n", __FUNCTION__, ind.sfn, ind.slot);
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling UCI Indication\n", __FUNCTION__);
if(vnf_p7->_public.nr_uci_indication)
{
(vnf_p7->_public.nr_uci_indication)(&ind);
......@@ -1641,7 +1640,7 @@ void vnf_handle_nr_rach_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf
}
else
{
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling RACH Indication sfn:%d slot:%d\n", __FUNCTION__, ind.sfn, ind.slot);
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling RACH Indication\n", __FUNCTION__);
if(vnf_p7->_public.nr_rach_indication)
{
(vnf_p7->_public.nr_rach_indication)(&ind);
......
......@@ -668,16 +668,6 @@ int nfapi_vnf_p7_del_pnf(nfapi_vnf_p7_config_t* config, int phy_id)
return 0;
}
int nfapi_vnf_p7_nr_slot_ind(nfapi_vnf_p7_config_t* config, nfapi_nr_slot_indication_scf_t* req)
{
if(config == 0 || req == 0)
return -1;
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
return vnf_nr_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
}
int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_request_t* req)
{
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(config:%p req:%p)\n", __FUNCTION__, config, req);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment