Commit 30c76c6d authored by David Price's avatar David Price

Works up to rrc connection setup complete in nfapi mode

parent e10c0c08
......@@ -1140,8 +1140,8 @@ int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request
return -4;
}
uint16_t sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
uint16_t sf = NFAPI_SFNSF2SF(req->sfn_sf);
uint16_t curr_sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
uint16_t curr_sf = NFAPI_SFNSF2SF(req->sfn_sf);
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];
......@@ -1163,7 +1163,7 @@ int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request
{
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() handle_nfapi_ul_pdu() for PDU:%d\n", __FUNCTION__, i);
handle_nfapi_ul_pdu(eNB,proc,&ul_config_pdu_list[i],sfn,sf,req->ul_config_request_body.srs_present);
handle_nfapi_ul_pdu(eNB,proc,&ul_config_pdu_list[i],curr_sfn,curr_sf,req->ul_config_request_body.srs_present);
}
else
{
......
......@@ -289,7 +289,7 @@ index 74f29a0..7310fc0 100644
}
diff --git a/pnf/src/pnf_p7.c b/pnf/src/pnf_p7.c
index 0fd7828..5a87c6c 100644
index 0fd7828..6d9a332 100644
--- a/pnf/src/pnf_p7.c
+++ b/pnf/src/pnf_p7.c
@@ -25,12 +25,64 @@
......@@ -543,7 +543,7 @@ index 0fd7828..5a87c6c 100644
pnf_p7->sfn_sf_shift = 0;
}
@@ -558,77 +646,113 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
@@ -558,77 +646,119 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
nfapi_pnf_p7_subframe_buffer_t* subframe_buffer = &(pnf_p7->subframe_buffer[buffer_index]);
......@@ -657,7 +657,13 @@ index 0fd7828..5a87c6c 100644
+ tx_subframe_buffer->hi_dci0_req = 0;
+ }
+ }
+ else if(subframe_buffer->sfn_sf == sfn_sf)
+ else
+ {
+ // If we ever need to "send" a dummy ul_config this won't work!!!
+ send_dummy_subframe(pnf_p7, sfn_sf_tx);
+ }
+
+ if(subframe_buffer->sfn_sf == sfn_sf)
+ {
+
+ if(subframe_buffer->ul_config_req != 0)
......@@ -683,7 +689,7 @@ index 0fd7828..5a87c6c 100644
}
}
@@ -637,7 +761,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
@@ -637,7 +767,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
if(pnf_p7->_public.lbt_dl_config_req)
(pnf_p7->_public.lbt_dl_config_req)(&(pnf_p7->_public), subframe_buffer->lbt_dl_config_req);
......@@ -692,13 +698,16 @@ index 0fd7828..5a87c6c 100644
}
else
{
@@ -650,14 +774,42 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
@@ -650,14 +780,35 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
}
- memset(&(pnf_p7->subframe_buffer[buffer_index]), 0, sizeof(nfapi_pnf_p7_subframe_buffer_t));
- pnf_p7->subframe_buffer[buffer_index].sfn_sf = -1;
- }
- else
- {
- send_dummy_subframe(pnf_p7, sfn_sf);
+ //if(subframe_buffer->dl_config_req != 0)
+ //deallocate_nfapi_dl_config_request(subframe_buffer->dl_config_req, pnf_p7);
+ //if(subframe_buffer->tx_req != 0)
......@@ -717,21 +726,13 @@ index 0fd7828..5a87c6c 100644
+ subframe_buffer->lbt_dl_config_req = 0;
+ }
+ } // sfn_sf match
else
{
- send_dummy_subframe(pnf_p7, sfn_sf);
+ //printf("NOT CALLING //send_dummy_subframe\n");
+
+ send_dummy_subframe(pnf_p7, sfn_sf_tx);
}
+
+ if (subframe_buffer->dl_config_req == 0 && subframe_buffer->tx_req == 0 && subframe_buffer->ul_config_req == 0 && subframe_buffer->lbt_dl_config_req == 0)
+ {
+ memset(&(pnf_p7->subframe_buffer[buffer_index]), 0, sizeof(nfapi_pnf_p7_subframe_buffer_t));
+ pnf_p7->subframe_buffer[buffer_index].sfn_sf = -1;
+ }
+
}
+ //printf("pnf_p7->_public.timing_info_mode_periodic:%d pnf_p7->timing_info_period_counter:%d pnf_p7->_public.timing_info_period:%d\n", pnf_p7->_public.timing_info_mode_periodic, pnf_p7->timing_info_period_counter, pnf_p7->_public.timing_info_period);
+ //printf("pnf_p7->_public.timing_info_mode_aperiodic:%d pnf_p7->timing_info_aperiodic_send:%d\n", pnf_p7->_public.timing_info_mode_aperiodic, pnf_p7->timing_info_aperiodic_send);
+ //printf("pnf_p7->timing_info_ms_counter:%d\n", pnf_p7->timing_info_ms_counter);
......@@ -739,7 +740,7 @@ index 0fd7828..5a87c6c 100644
// send the periodic timing info if configured
if(pnf_p7->_public.timing_info_mode_periodic && (pnf_p7->timing_info_period_counter++) == pnf_p7->_public.timing_info_period)
{
@@ -678,14 +830,15 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
@@ -678,14 +829,15 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
}
else
{
......@@ -757,7 +758,7 @@ index 0fd7828..5a87c6c 100644
pnf_p7->stats.dl_conf_ontime, pnf_p7->stats.dl_conf_late,
pnf_p7->stats.ul_conf_ontime, pnf_p7->stats.ul_conf_late,
pnf_p7->stats.hi_dci0_ontime, pnf_p7->stats.hi_dci0_late,
@@ -694,6 +847,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
@@ -694,6 +846,7 @@ int pnf_p7_subframe_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn_sf)
memset(&pnf_p7->stats, 0, sizeof(pnf_p7->stats));
}
pnf_p7->tick++;
......@@ -765,7 +766,7 @@ index 0fd7828..5a87c6c 100644
if(pthread_mutex_unlock(&(pnf_p7->mutex)) != 0)
{
@@ -724,7 +878,7 @@ uint8_t is_p7_request_in_window(uint16_t sfnsf, const char* name, pnf_p7_t* phy)
@@ -724,7 +877,7 @@ uint8_t is_p7_request_in_window(uint16_t sfnsf, const char* name, pnf_p7_t* phy)
if(recv_sfn_sf_dec > ((current_sfn_sf_dec + timing_window) % NFAPI_MAX_SFNSFDEC))
{
// out of window
......@@ -774,7 +775,7 @@ index 0fd7828..5a87c6c 100644
}
else
{
@@ -736,7 +890,7 @@ uint8_t is_p7_request_in_window(uint16_t sfnsf, const char* name, pnf_p7_t* phy)
@@ -736,7 +889,7 @@ uint8_t is_p7_request_in_window(uint16_t sfnsf, const char* name, pnf_p7_t* phy)
else
{
// too late
......@@ -783,7 +784,7 @@ index 0fd7828..5a87c6c 100644
}
}
@@ -751,8 +905,8 @@ uint8_t is_p7_request_in_window(uint16_t sfnsf, const char* name, pnf_p7_t* phy)
@@ -751,8 +904,8 @@ uint8_t is_p7_request_in_window(uint16_t sfnsf, const char* name, pnf_p7_t* phy)
}
else
{
......@@ -794,7 +795,7 @@ index 0fd7828..5a87c6c 100644
}
}
@@ -785,15 +939,32 @@ void pnf_handle_dl_config_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_
@@ -785,15 +938,32 @@ void pnf_handle_dl_config_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_
return;
}
......@@ -832,7 +833,25 @@ index 0fd7828..5a87c6c 100644
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing dl_config_req at index %d (%d/%d)",
// pMyPhyInfo->sfnSf, bufferIdx,
// SFNSF2SFN(dreq->sfn_sf), SFNSF2SF(dreq->sfn_sf));
@@ -994,6 +1165,16 @@ void pnf_handle_tx_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
@@ -860,6 +1030,8 @@ void pnf_handle_ul_config_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_
uint32_t sfn_sf_dec = NFAPI_SFNSF2DEC(req->sfn_sf);
uint8_t buffer_index = sfn_sf_dec % pnf_p7->_public.subframe_buffer_size;
+ printf("%s() POPULATE UL_CONFIG_REQ sfn_sf:%d buffer_index:%d\n", __FUNCTION__, sfn_sf_dec, buffer_index);
+
if(pnf_p7->subframe_buffer[buffer_index].ul_config_req != 0)
{
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing ul_config_req at index %d (%d/%d)",
@@ -876,7 +1048,7 @@ void pnf_handle_ul_config_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_
}
else
{
- //NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] NOT storing ul_config_req SFN/SF %d/%d\n", pMyPhyInfo->sfnSf, SFNSF2SFN(req->sfn_sf), SFNSF2SF(req->sfn_sf));
+ NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] NOT storing ul_config_req OUTSIDE OF TRANSMIT BUFFER WINDOW SFN/SF %d\n", NFAPI_SFNSF2DEC(pnf_p7->sfn_sf), NFAPI_SFNSF2DEC(req->sfn_sf));
deallocate_nfapi_ul_config_request(req, pnf_p7);
if(pnf_p7->_public.timing_info_mode_aperiodic)
@@ -994,6 +1166,16 @@ void pnf_handle_tx_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
uint32_t sfn_sf_dec = NFAPI_SFNSF2DEC(req->sfn_sf);
uint8_t buffer_index = sfn_sf_dec % pnf_p7->_public.subframe_buffer_size;
......@@ -849,7 +868,7 @@ index 0fd7828..5a87c6c 100644
if(pnf_p7->subframe_buffer[buffer_index].tx_req != 0)
{
//NFAPI_TRACE(NFAPI_TRACE_NOTE, "[%d] Freeing tx_req at index %d (%d/%d)",
@@ -1010,6 +1191,8 @@ void pnf_handle_tx_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
@@ -1010,6 +1192,8 @@ void pnf_handle_tx_request(void* pRecvMsg, int recvMsgLen, pnf_p7_t* pnf_p7)
}
else
{
......@@ -858,7 +877,7 @@ index 0fd7828..5a87c6c 100644
deallocate_nfapi_tx_request(req, pnf_p7);
if(pnf_p7->_public.timing_info_mode_aperiodic)
@@ -1126,12 +1309,27 @@ uint32_t calculate_t2(uint32_t now_time_hr, uint16_t sfn_sf, uint32_t sf_start_t
@@ -1126,12 +1310,27 @@ uint32_t calculate_t2(uint32_t now_time_hr, uint16_t sfn_sf, uint32_t sf_start_t
uint32_t sf_time_us = get_sf_time(now_time_hr, sf_start_time_hr);
uint32_t t2 = (NFAPI_SFNSF2DEC(sfn_sf) * 1000) + sf_time_us;
......@@ -887,7 +906,7 @@ index 0fd7828..5a87c6c 100644
uint32_t sf_time_us = get_sf_time(now_time_hr, sf_start_time_hr);
@@ -1391,6 +1589,8 @@ void pnf_nfapi_p7_read_dispatch_message(pnf_p7_t* pnf_p7, uint32_t now_hr_time)
@@ -1391,6 +1590,8 @@ void pnf_nfapi_p7_read_dispatch_message(pnf_p7_t* pnf_p7, uint32_t now_hr_time)
// read the segment
recvfrom_result = recvfrom(pnf_p7->p7_sock, pnf_p7->rx_message_buffer, header.message_length, MSG_DONTWAIT, (struct sockaddr*)&remote_addr, &remote_addr_size);
......@@ -896,7 +915,7 @@ index 0fd7828..5a87c6c 100644
if(recvfrom_result > 0)
{
pnf_handle_p7_message(pnf_p7->rx_message_buffer, recvfrom_result, pnf_p7, now_hr_time);
@@ -1417,7 +1617,10 @@ void pnf_nfapi_p7_read_dispatch_message(pnf_p7_t* pnf_p7, uint32_t now_hr_time)
@@ -1417,7 +1618,10 @@ void pnf_nfapi_p7_read_dispatch_message(pnf_p7_t* pnf_p7, uint32_t now_hr_time)
// need to update the time as we would only use the value from the
// select
......@@ -908,7 +927,7 @@ index 0fd7828..5a87c6c 100644
}
while(recvfrom_result > 0);
}
@@ -1512,7 +1715,7 @@ int pnf_p7_message_pump(pnf_p7_t* pnf_p7)
@@ -1512,7 +1716,7 @@ int pnf_p7_message_pump(pnf_p7_t* pnf_p7)
selectRetval = select(pnf_p7->p7_sock+1, &rfds, NULL, NULL, &timeout);
......
......@@ -2315,9 +2315,10 @@ void fill_dci0(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,
void *dci_pdu = (void*)dci_alloc->dci_pdu;
LOG_D(PHY,"Filling DCI0 with cqi %d, mcs %d, hopping %d, rballoc %x (%d,%d) ndi %d TPC %d cshift %d\n",cqi_req,
mcs,hopping,rballoc,pdu->dci_pdu_rel8.resource_block_start,pdu->dci_pdu_rel8.number_of_resource_block,
ndi,TPC,cshift);
LOG_D(PHY,"Filling DCI0 with rnti %x cqi %d, mcs %d, hopping %d, rballoc %x (%d,%d) ndi %d TPC %d cshift %d\n",
pdu->dci_pdu_rel8.rnti,cqi_req, mcs,hopping,rballoc,
pdu->dci_pdu_rel8.resource_block_start,
pdu->dci_pdu_rel8.number_of_resource_block, ndi,TPC,cshift);
dci_alloc->format = format0;
dci_alloc->firstCCE = pdu->dci_pdu_rel8.cce_index;
......
......@@ -78,6 +78,9 @@ void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
{
int idx = proc->subframe_tx&1;
LTE_eNB_PDCCH *pdcch_vars = &eNB->pdcch_vars[idx];
LOG_D(PHY,"%s() Before num_dci:%d\n", __FUNCTION__, pdcch_vars->num_dci);
// copy dci configuration in to eNB structure
fill_dci0(eNB,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci], &hi_dci0_config_pdu->dci_pdu);
}
......@@ -88,7 +91,7 @@ void handle_nfapi_hi_dci0_hi_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
LTE_eNB_PHICH *phich = &eNB->phich_vars[proc->subframe_tx&1];
// copy dci configuration in to eNB structure
LOG_D(PHY,"Received HI PDU which value %d (rbstart %d,cshift %d)\n",
LOG_D(PHY,"Received HI PDU with value %d (rbstart %d,cshift %d)\n",
hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.hi_value,
hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.resource_block_start,
hi_dci0_config_pdu->hi_pdu.hi_pdu_rel8.cyclic_shift_2_for_drms);
......@@ -754,12 +757,17 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
{
for (int future_subframe=0;future_subframe<10;future_subframe++)
{
nfapi_ul_config_request_t *ul_req_tmp = &RC.mac[0]->UL_req_tmp[CC_id][future_subframe];
// DJP - indexing directly into the mac - not good - ??????
if (RC.mac[0]->UL_req_tmp[CC_id][future_subframe].ul_config_request_body.number_of_pdus > 0)
if (ul_req_tmp->ul_config_request_body.number_of_pdus > 0)
{
LOG_D(PHY,"UL_CONFIG for the future future_subframe:%d PDUs:%d\n", future_subframe, RC.mac[0]->UL_req_tmp[CC_id][future_subframe].ul_config_request_body.number_of_pdus);
LOG_D(PHY,"UL_CONFIG for the future future_subframe:%d UL_req_tmp[PDUs:%d SFN/SF:%d]\n",
future_subframe,
ul_req_tmp->ul_config_request_body.number_of_pdus,
NFAPI_SFNSF2DEC(ul_req_tmp->sfn_sf));
oai_nfapi_ul_config_req(&RC.mac[0]->UL_req_tmp[CC_id][future_subframe]);
oai_nfapi_ul_config_req(ul_req_tmp);
}
}
}
......
......@@ -1570,6 +1570,10 @@ int find_UE_id(module_id_t mod_idP, rnti_t rntiP)
UE_list_t *UE_list = &RC.mac[mod_idP]->UE_list;
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
LOG_D(PHY,"%s(mod_idP:%d, rntiP:%04x) UE_id:%d active:%d UE_PCCID(mod_idP,UE_id):%d UE_list->UE_template[UE_PCCID(mod_idP,UE_id)][UE_id].rnti:%04x\n",
__FUNCTION__, mod_idP, rntiP, UE_id, UE_list->active[UE_id], UE_PCCID(mod_idP,UE_id), UE_list->UE_template[UE_PCCID(mod_idP,UE_id)][UE_id].rnti);
if (UE_list->active[UE_id] != TRUE) continue;
if (UE_list->UE_template[UE_PCCID(mod_idP,UE_id)][UE_id].rnti==rntiP) {
return(UE_id);
......
......@@ -97,6 +97,8 @@ void rx_sdu(const module_id_t enb_mod_idP,
start_meas(&eNB->rx_ulsch_sdu);
LOG_D(PHY,"%s() rntiP:%04x UE_id:%d harq_pid:%d\n", __FUNCTION__, rntiP, UE_id, harq_pid);
if ((UE_id > NUMBER_OF_UE_MAX) || (UE_id == -1) )
for(ii=0; ii<NB_RB_MAX; ii++) {
rx_lengths[ii] = 0;
......@@ -372,7 +374,7 @@ abort();
}
for (i=0; i<num_sdu; i++) {
LOG_D(MAC,"SDU Number %d MAC Subheader SDU_LCID %d, length %d\n",i,rx_lcids[i],rx_lengths[i]);
LOG_D(MAC,"SDU Number %d MAC Subheader SDU_LCID %d, length %d UE_id %d\n",i,rx_lcids[i],rx_lengths[i],UE_id);
T(T_ENB_MAC_UE_UL_SDU, T_INT(enb_mod_idP), T_INT(CC_idP), T_INT(rntiP), T_INT(frameP), T_INT(subframeP),
T_INT(rx_lcids[i]), T_INT(rx_lengths[i]));
......
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