Commit 0bd5978e authored by David Price's avatar David Price

Both MIB and SIB1 are coming out on san jole. SIB2/3 is missing

parent fbd450ee
//#include "fapi_stub.h"
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
......@@ -146,522 +145,7 @@ extern "C"
#if defined(__cplusplus)
}
#endif
#if 0
//DJP
void send_uplink_indications(fapi_internal_t* instance, uint16_t sfn_sf)
{
fapi_harq_ind_t harq_ind;
(instance->callbacks.fapi_harq_ind)(&(instance->_public), &harq_ind);
fapi_crc_ind_t crc_ind;
crc_ind.header.message_id = FAPI_CRC_INDICATION;
crc_ind.header.length = 0; //??;
crc_ind.sfn_sf = sfn_sf;
crc_ind.body.number_of_crcs = 1;
crc_ind.body.pdus[0].rx_ue_info.handle = 0; //??
crc_ind.body.pdus[0].rx_ue_info.rnti = 0; //??
crc_ind.body.pdus[0].rel8_pdu.crc_flag = 1;
(instance->callbacks.fapi_crc_ind)(&(instance->_public), &crc_ind);
if(!instance->fapi->rx_buffer_empty())
{
fapi_rx_ulsch_ind_t rx_ind;
memset(&rx_ind, 0, sizeof(rx_ind));
rx_ind.header.message_id = FAPI_RX_ULSCH_INDICATION;
rx_ind.sfn_sf = sfn_sf;
phy_pdu* buff = 0;
int i = 0;
std::list<phy_pdu*> free_list;
do
{
buff = instance->fapi->pop_rx_buffer();
if(buff != 0)
{
if(buff->len == 0)
{
printf("[FAPI] Buffer length = 0\n");
}
rx_ind.body.pdus[i].rx_ue_info.handle = 0xDEADBEEF;
rx_ind.body.pdus[i].rx_ue_info.rnti = 0x4242;
rx_ind.body.pdus[i].rel8_pdu.length = buff->len;
//rx_ind.pdus[i].rel8_pdu.data_offset;
//rx_ind.pdus[i].rel8_pdu.ul_cqi;
//rx_ind.pdus[i].rel8_pdu.timing_advance;
rx_ind.body.data[i] = buff->buffer;
rx_ind.body.number_of_pdus++;
i++;
instance->fapi->byte_count += buff->len;
free_list.push_back(buff);
}
}while(buff != 0 && i < 8);
(instance->callbacks.fapi_rx_ulsch_ind)(&(instance->_public), &rx_ind);
for(phy_pdu* pdu : free_list)
{
instance->fapi->release_phy_pdu(pdu);
//free(tx_req.tx_request_body.tx_pdu_list[j].segments[0].segment_data);
}
}
else
{
fapi_rx_ulsch_ind_t rx_ind;
memset(&rx_ind, 0, sizeof(rx_ind));
rx_ind.header.message_id = FAPI_RX_ULSCH_INDICATION;
rx_ind.sfn_sf = sfn_sf;
(instance->callbacks.fapi_rx_ulsch_ind)(&(instance->_public), &rx_ind);
}
fapi_rx_cqi_ind_t cqi_ind;
cqi_ind.sfn_sf = sfn_sf;
(instance->callbacks.fapi_rx_cqi_ind)(&(instance->_public), &cqi_ind);
fapi_rx_sr_ind_t sr_ind;
sr_ind.sfn_sf = sfn_sf;
(instance->callbacks.fapi_rx_sr_ind)(&(instance->_public), &sr_ind);
fapi_rach_ind_t rach_ind;
rach_ind.sfn_sf = sfn_sf;
(instance->callbacks.fapi_rach_ind)(&(instance->_public), &rach_ind);
fapi_srs_ind_t srs_ind;
srs_ind.sfn_sf = sfn_sf;
(instance->callbacks.fapi_srs_ind)(&(instance->_public), &srs_ind);
/*
nfapi_lbt_dl_indication_t lbt_ind;
memset(&lbt_ind, 0, sizeof(lbt_ind));
lbt_ind.header.message_id = NFAPI_LBT_DL_INDICATION;
lbt_ind.header.phy_id = config->phy_id;
lbt_ind.sfn_sf = sfn_sf;
nfapi_pnf_p7_lbt_dl_ind(config, &lbt_ind);
vendor_ext_p7_ind ve_p7_ind;
memset(&ve_p7_ind, 0, sizeof(ve_p7_ind));
ve_p7_ind.header.message_id = P7_VENDOR_EXT_IND;
ve_p7_ind.header.phy_id = config->phy_id;
ve_p7_ind.error_code = NFAPI_MSG_OK;
nfapi_pnf_p7_vendor_extension(config, &(ve_p7_ind.header));
*/
fapi_nb_harq_ind_t nb_harq_ind;
nb_harq_ind.sfn_sf = sfn_sf;
(instance->callbacks.fapi_nb_harq_ind)(&(instance->_public), &nb_harq_ind);
fapi_nrach_ind_t nrach_ind;
nrach_ind.sfn_sf = sfn_sf;
(instance->callbacks.fapi_nrach_ind)(&(instance->_public), &nrach_ind);
}
#endif
#if 0
void* fapi_thread_start(void* ptr)
{
set_thread_priority(81);
fapi_internal_t* instance = (fapi_internal_t*)ptr;
uint16_t sfn_sf_dec = 0;
uint32_t last_tv_usec = 0;
uint32_t last_tv_sec = 0;
uint32_t millisec;
uint32_t last_millisec = -1;
uint16_t catchup = 0;
while(1)
{
// get the time
struct timeval sf_start;
(void)gettimeofday(&sf_start, NULL);
uint16_t sfn_sf = ((((sfn_sf_dec) / 10) << 4) | (((sfn_sf_dec) - (((sfn_sf_dec) / 10) * 10)) & 0xF));
// increment the sfn/sf - for the next subframe
sfn_sf_dec++;
if(sfn_sf_dec > 10239)
sfn_sf_dec = 0;
fapi_subframe_ind_t ind;
ind.sfn_sf = sfn_sf;
if(instance->fapi->first_dl_config)
{
//DJP send_uplink_indications(instance, sfn_sf);
}
if(instance->tick == 1000)
{
if(instance->tx_byte_count > 0)
{
printf("[FAPI] Tx rate %d bytes/sec\n", instance->tx_byte_count);
instance->tx_byte_count = 0;
}
instance->tick = 0;
}
instance->tick++;
(instance->callbacks.fapi_subframe_ind)(&(instance->_public), &ind);
{
//DJP phy_pdu* pdu = instance->fapi->allocate_phy_pdu();
phy_pdu* pdu = (phy_pdu*)malloc(sizeof(phy_pdu));
int len = recvfrom(instance->rx_sock, pdu->buffer, pdu->buffer_len, MSG_DONTWAIT, 0, 0);
if(len > 0)
{
pdu->len = len;
//DJP instance->fapi->push_rx_buffer(pdu);
}
else
{
//DJP instance->fapi->release_phy_pdu(pdu);
}
}
if(catchup)
{
catchup--;
}
else
{
struct timespec now_ts;
struct timespec sleep_ts;
struct timespec sleep_rem_ts;
// get the current time
clock_gettime(CLOCK_MONOTONIC, &now_ts);
// determine how long to sleep before the start of the next 1ms
sleep_ts.tv_sec = 0;
sleep_ts.tv_nsec = 1e6 - (now_ts.tv_nsec % 1000000);
int nanosleep_result = nanosleep(&sleep_ts, &sleep_rem_ts);
if(nanosleep_result != 0)
printf("*** nanosleep failed or was interrupted\n");
clock_gettime(CLOCK_MONOTONIC, &now_ts);
millisec = now_ts.tv_nsec / 1e6;
if(last_millisec != -1 && ((last_millisec + 1 ) % 1000) != millisec)
{
printf("*** missing millisec %d %d\n", last_millisec, millisec);
catchup = millisec - last_millisec - 1;
}
last_millisec = millisec;
}
}
}
#endif
#if defined(__cplusplus)
extern "C" {
#endif
#if 0
fapi_t* fapi_create(fapi_cb_t* callbacks, fapi_config_t* config)
{
fapi_internal_t* instance = (fapi_internal_t*)calloc(1, sizeof(fapi_internal_t));
instance->callbacks = *callbacks;
instance->config = *config;
instance->state = 0;
// DJP instance->fapi = new fapi_private();
instance->fapi = (fapi_t*)malloc(sizeof(fapi_private));
return (fapi_t*)instance;
}
#endif
#if 0
void fapi_destroy(fapi_t* fapi)
{
fapi_internal_t* instance = (fapi_internal_t*)fapi;
//DJP delete instance->fapi;
free(instance);
}
#endif
#if 0
void* fapi_rx_thread_start(void* ptr)
{
set_thread_priority(60);
fapi_internal_t* instance = (fapi_internal_t*)ptr;
while(1)
{
//DJP phy_pdu* pdu = instance->fapi->allocate_phy_pdu();
phy_pdu* pdu = (phy_pdu*)malloc(sizeof(phy_pdu));
int len = recvfrom(instance->rx_sock, pdu->buffer, pdu->buffer_len, 0, 0, 0);
if(len > 0)
{
pdu->len = len;
//instance->fapi->push_rx_buffer(pdu);
}
else
{
//instance->fapi->release_phy_pdu(pdu);
}
}
}
#endif
#if 0
void fapi_start_data(fapi_t* fapi, unsigned rx_port, const char* tx_address, unsigned tx_port)
{
fapi_internal_t* instance = (fapi_internal_t*)fapi;
printf("[FAPI] Rx Data from %d\n", rx_port);
printf("[FAPI] Tx Data to %s:%d\n", tx_address, tx_port);
instance->rx_sock = socket(AF_INET, SOCK_DGRAM, 0);
if(instance->rx_sock < 0)
{
printf("[FAPI] Failed to create socket\n");
return;
}
struct sockaddr_in addr;
memset(&addr, 0, sizeof(addr));
addr.sin_family = AF_INET;
addr.sin_port = htons(rx_port);
addr.sin_addr.s_addr = INADDR_ANY;
int bind_result = bind(instance->rx_sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in));
if(bind_result == -1)
{
printf("[FAPI] Failed to bind to port %d\n", rx_port);
close(instance->rx_sock);
return ;
}
instance->tx_sock = socket(AF_INET, SOCK_DGRAM, 0);
instance->tx_addr.sin_family = AF_INET;
instance->tx_addr.sin_port = htons(tx_port);
instance->tx_addr.sin_addr.s_addr = inet_addr(tx_address);
}
#endif
void fill_tlv(fapi_tlv_t tlvs[], uint8_t count, uint8_t tag, uint8_t len, uint16_t value)
{
tlvs[count].tag = tag;
tlvs[count].value = value;
tlvs[count].length = len;
}
#if 0
int fapi_param_request(fapi_t* fapi, fapi_param_req_t* req)
{
fapi_internal_t* instance = (fapi_internal_t*)fapi;
fapi_param_resp_t resp;
resp.header.message_id = FAPI_PARAM_RESPONSE;
resp.error_code = FAPI_MSG_OK;
resp.number_of_tlvs = 0;
fill_tlv(resp.tlvs, resp.number_of_tlvs++, FAPI_PHY_STATE_TAG, 2, instance->state);
#if 0
//DJP
if(instance->state == 0)
{
if(instance->config.duplex_mode == 0)
{
// -- TDD
// Downlink Bandwidth Support
// Uplink Bandwidth Support
// Downlink Modulation Support
// Uplink Modulation Support
// PHY Antenna Capability
// Release Capability
// MBSFN Capability
}
else if(instance->config.duplex_mode == 1)
{
// -- FDD
// Downlink Bandwidth Support
fill_tlv(resp.tlvs, resp.number_of_tlvs++, FAPI_PHY_CAPABILITIES_DL_BANDWIDTH_SUPPORT_TAG, 2, instance->config.dl_channel_bw_support);
// Uplink Bandwidth Support
fill_tlv(resp.tlvs, resp.number_of_tlvs++, FAPI_PHY_CAPABILITIES_UL_BANDWIDTH_SUPPORT_TAG, 2, instance->config.ul_channel_bw_support);
// Downlink Modulation Support
// Uplink Modulation Support
// PHY Antenna Capability
// Release Capability
// MBSFN Capability
// LAA Capability
}
}
else
{
if(instance->config.duplex_mode == 0)
{
// -- TDD
// Downlink Bandwidth Support
// Uplink Bandwidth Support
// Downlink Modulation Support
// Uplink Modulation Support
// PHY Antenna Capability
// Release Capability
// MBSFN Capability
// Duplexing Mode
// PCFICH Power Offset
// P-B
// DL Cyclic Prefix Type
// UL Cyclic Prefix Type
// RF Config
// PHICH Config
// SCH Config
// PRACH Config
// PUSCH Config
// PUCCH Config
// SRS Config
// Uplink Reference Signal Config
// TDD Frame Structure Config
// Data Report Mode
}
else if(instance->config.duplex_mode == 1)
{
// FDD
// Downlink Bandwidth Support
// Uplink Bandwidth Support
// Downlink Modulation Support
// Uplink Modulation Support
// PHY Antenna Capability
// Release Capability
// MBSFN Capability
// LAA Capability
// Duplexing Mode
// PCFICH Power Offset
// P-B
// DL Cyclic Prefix Type
// UL Cyclic Prefix Type
// RF Config
// PHICH Config
// SCH Config
// PRACH Config
// PUSCH Config
// PUCCH Config
// SRS Config
// Uplink Reference Signal Config
// Data Report Mode
}
}
#endif
//todo fill
(instance->callbacks.fapi_param_response)(fapi, &resp);
return 0;
}
#endif
#if 0
int fapi_config_request(fapi_t* fapi, fapi_config_req_t* req)
{
fapi_internal_t* instance = (fapi_internal_t*)fapi;
fapi_config_resp_t resp;
resp.header.message_id = FAPI_CONFIG_RESPONSE;
resp.error_code = FAPI_MSG_OK;
(instance->callbacks.fapi_config_response)(fapi, &resp);
return 0;
}
#endif
#if 0
int fapi_start_request(fapi_t* fapi, fapi_start_req_t* req)
{
fapi_internal_t* instance = (fapi_internal_t*)fapi;
pthread_t fapi_thread;
pthread_create(&fapi_thread, NULL, &fapi_thread_start, instance);
return 0;
}
#endif
#if 0
int fapi_dl_config_request(fapi_t* fapi, fapi_dl_config_req_t* req)
{
fapi_internal_t* instance = (fapi_internal_t*)fapi;
//DJP instance->fapi->first_dl_config = true;
instance->fapi->first_dl_config = 1;
return 0;
}
#endif
#if 0
int fapi_ul_config_request(fapi_t* fapi, fapi_ul_config_req_t* req)
{
fapi_internal_t* instance = (fapi_internal_t*)fapi;
return 0;
}
#endif
#if 0
int fapi_hi_dci0_request(fapi_t* fapi, fapi_hi_dci0_req_t* req)
{
fapi_internal_t* instance = (fapi_internal_t*)fapi;
return 0;
}
#endif
#if 0
int fapi_tx_request(fapi_t* fapi, fapi_tx_req_t* req)
{
fapi_internal_t* instance = (fapi_internal_t*)fapi;
for(int i = 0; i < req->body.number_of_pdus; ++i)
{
uint16_t len = req->body.pdus[i].pdu_length;
uint32_t* data = req->body.pdus[i].tlvs[0].value;
//printf("[FAPI] sfnsf:%d len:%d\n", req->sfn_sf,len);
//
instance->tx_byte_count += len;
int sendto_result = sendto(instance->tx_sock, data, len, 0, (struct sockaddr*)&(instance->tx_addr), sizeof(instance->tx_addr));
if(sendto_result == -1)
{
// error
}
}
return 0;
}
#endif
#if defined(__cplusplus)
}
#endif
#endif
void set_thread_priority(int priority)
{
......@@ -690,4 +174,3 @@ void set_thread_priority(int priority)
printf("failed to set sched param\n");
}
}
......@@ -26,6 +26,7 @@ extern RAN_CONTEXT_t RC;
#define NUM_P5_PHY 2
extern void phy_init_RU(RU_t*);
extern int mac_top_init_eNB(void);
......@@ -575,7 +576,6 @@ int param_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi
nfapi_resp.header.phy_id = req->header.phy_id;
nfapi_resp.error_code = 0; // DJP - what value???
char local_addr[80];
struct sockaddr_in pnf_p7_sockaddr;
pnf_p7_sockaddr.sin_addr.s_addr = inet_addr(pnf->phys[0].local_addr);
......@@ -866,18 +866,37 @@ void pnf_phy_deallocate_p7_vendor_ext(nfapi_p7_message_header_t* header)
free(header);
}
int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req)
{
//printf("[PNF] ul config request\n");
//phy_info* phy = (phy_info*)(pnf_p7->user_data);
return 0;
}
int pnf_phy_hi_dci0_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* req)
{
//printf("[PNF] hi dci0 request\n");
//phy_info* phy = (phy_info*)(pnf_p7->user_data);
return 0;
}
nfapi_dl_config_request_pdu_t* dlsch_pdu=0;
int pnf_phy_dl_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_t* req)
{
#if 0
printf("[PNF] dl config request sfn_sf:%d(%d) pdcch:%u dci:%u pdu:%d pdsch_rnti:%d pcfich:%u - DO NOTHING\n",
req->sfn_sf,
NFAPI_SFNSF2DEC(req->sfn_sf),
req->dl_config_request_body.number_pdcch_ofdm_symbols,
req->dl_config_request_body.number_dci,
req->dl_config_request_body.number_pdu,
req->dl_config_request_body.number_pdsch_rnti,
req->dl_config_request_body.transmission_power_pcfich
);
#if 1
if (NFAPI_SFNSF2SF(req->sfn_sf)==5)
printf("[PNF] dl config request sfn_sf:%d(%d) pdcch:%u dci:%u pdu:%d pdsch_rnti:%d pcfich:%u\n",
req->sfn_sf,
NFAPI_SFNSF2DEC(req->sfn_sf),
req->dl_config_request_body.number_pdcch_ofdm_symbols,
req->dl_config_request_body.number_dci,
req->dl_config_request_body.number_pdu,
req->dl_config_request_body.number_pdsch_rnti,
req->dl_config_request_body.transmission_power_pcfich
);
#endif
if (RC.ru == 0)
......@@ -901,31 +920,55 @@ int pnf_phy_dl_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request
}
//int sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
//int sf = NFAPI_SFNSF2SF(req->sfn_sf);
int sf = NFAPI_SFNSF2SF(req->sfn_sf);
//struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
//int num_pdcch_symbols = eNB->pdcch_vars[sf&1].num_pdcch_symbols;
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
eNB_rxtx_proc_t *proc = &eNB->proc.proc_rxtx[0];
nfapi_dl_config_request_pdu_t* dl_config_pdu_list = req->dl_config_request_body.dl_config_pdu_list;
int total_number_of_pdus = req->dl_config_request_body.number_pdu;
eNB->pdcch_vars[sf&1].num_pdcch_symbols = req->dl_config_request_body.number_pdcch_ofdm_symbols;
eNB->pdcch_vars[sf&1].num_dci = 0;
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn_sf:%d DCI:%d PDU:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), req->dl_config_request_body.number_dci, req->dl_config_request_body.number_pdu);
if(req->vendor_extension)
free(req->vendor_extension);
// DJP - force proc to look like current frame!
proc->frame_tx = NFAPI_SFNSF2SFN(req->sfn_sf);
proc->subframe_tx = NFAPI_SFNSF2SF(req->sfn_sf);
return 0;
}
for (int i=0;i<total_number_of_pdus;i++)
{
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PDU[%d]:\n", __FUNCTION__, i);
int pnf_phy_ul_config_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req)
{
//printf("[PNF] ul config request\n");
//phy_info* phy = (phy_info*)(pnf_p7->user_data);
if (dl_config_pdu_list[i].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE)
{
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() DCI:\n", __FUNCTION__);
return 0;
}
handle_nfapi_dci_dl_pdu(eNB,proc,&dl_config_pdu_list[i]);
int pnf_phy_hi_dci0_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_hi_dci0_request_t* req)
{
//printf("[PNF] hi dci0 request\n");
//phy_info* phy = (phy_info*)(pnf_p7->user_data);
eNB->pdcch_vars[sf&1].num_dci++; // Is actually number of DCI PDUs
}
else if (dl_config_pdu_list[i].pdu_type == NFAPI_DL_CONFIG_BCH_PDU_TYPE)
{
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH:\n", __FUNCTION__);
}
else if (dl_config_pdu_list[i].pdu_type == NFAPI_DL_CONFIG_DLSCH_PDU_TYPE)
{
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() DLSCH:\n", __FUNCTION__);
dlsch_pdu = &dl_config_pdu_list[i];
//handle_nfapi_dlsch_pdu(eNB,proc,dl_config_pdu, dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1, TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data);
}
else
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() UNKNOWN:%d\n", __FUNCTION__, dl_config_pdu_list[i].pdu_type);
}
}
if(req->vendor_extension)
free(req->vendor_extension);
return 0;
}
......@@ -967,19 +1010,27 @@ int pnf_phy_tx_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
uint16_t sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
uint16_t sf = NFAPI_SFNSF2SF(req->sfn_sf);
LTE_DL_FRAME_PARMS *fp = &RC.ru[0]->frame_parms;
//int ONE_SUBFRAME_OF_SAMPLES = fp->ofdm_symbol_size*fp->symbols_per_tti;
int ONE_SUBFRAME_OF_SAMPLES = fp->ofdm_symbol_size*fp->symbols_per_tti;
//int ONE_SUBFRAME_OF_SAMPLES = fp->symbols_per_tti;
//int ONE_SUBFRAME_OF_SAMPLES = fp->ofdm_symbol_size*fp->symbols_per_tti*sizeof(int32_t);
//int offset = sf * ONE_SUBFRAME_OF_SAMPLES;
int offset = sf * ONE_SUBFRAME_OF_SAMPLES;
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
//int aa;
//DJP - the proc does not seem to be getting filled - so let fill it
eNB->proc.proc_rxtx[0].frame_tx = sfn;
eNB->proc.proc_rxtx[0].subframe_tx = sf;
// clear the transmit data array for the current subframe
#if 0
for (aa=0; aa<fp->nb_antenna_ports_eNB; aa++) {
memset(&eNB->common_vars.txdataF[aa][offset], 0, ONE_SUBFRAME_OF_SAMPLES);
for (int aa=0; aa<fp->nb_antenna_ports_eNB; aa++) {
memset(&eNB->common_vars.txdataF[aa][offset], 0, ONE_SUBFRAME_OF_SAMPLES * sizeof(int32_t));
}
// clear previous allocation information for all UEs
for (int i=0; i<NUMBER_OF_UE_MAX; i++) {
if (eNB->dlsch[i][0])
eNB->dlsch[i][0]->subframe_tx[sf] = 0;
}
#endif
if (
0
......@@ -1000,12 +1051,12 @@ int pnf_phy_tx_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
eNB->pbch_pdu[1] = req->tx_request_body.tx_pdu_list[i].segments[j].segment_data[1];
eNB->pbch_pdu[0] = req->tx_request_body.tx_pdu_list[i].segments[j].segment_data[2];
eNB->pbch_configured=1;
eNB->pbch_configured=1;
if (
1
//&& NFAPI_SFNSF2DEC(req->sfn_sf) % 500 == 0
)
1
//&& NFAPI_SFNSF2DEC(req->sfn_sf) % 500 == 0
)
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() [PDU:%u] len:%u pdu_index:%u num_segments:%u segment[0]_length:%u pbch_pdu:%x %x %x\n",
__FUNCTION__, i, req->tx_request_body.tx_pdu_list[i].pdu_length, req->tx_request_body.tx_pdu_list[i].pdu_index, req->tx_request_body.tx_pdu_list[i].num_segments,
req->tx_request_body.tx_pdu_list[i].segments[0].segment_length,
......@@ -1016,45 +1067,36 @@ int pnf_phy_tx_req(nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
}
else
{
int num_dci = 1; // DJP -HACK!!!!
int frame = sfn;
int subframe = sf;
int num_pdcch_symbols = 1; // DJP HARD CODe HACK - this is zero - eNB->pdcch_vars[subframe&1].num_pdcch_symbols;
if (num_dci > 0)
LOG_E(PHY,"SFN/SF:%d/%d num_dci:%d num_pdcch_symbols:%d\n", frame, subframe, num_dci, num_pdcch_symbols);
generate_dci_top(num_pdcch_symbols,
num_dci,
&eNB->pdcch_vars[subframe&1].dci_alloc[0],
0,
AMP,
fp,
eNB->common_vars.txdataF,
subframe);
// Not bch
handle_nfapi_dlsch_pdu(
eNB,
&eNB->proc.proc_rxtx[0],
dlsch_pdu,
dlsch_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks-1,
req->tx_request_body.tx_pdu_list[dlsch_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data
);
}
}
}
#if 0
{
int sched_sfn = sf==0?sfn-1:sfn-0;
int sched_sf = sf==0?9:sf-1;
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn_sf:%u sfn:%u sf:%u SCHED:%d/%d calling common_signal_procedures\n",
__FUNCTION__,
NFAPI_SFNSF2DEC(req->sfn_sf),
sfn, sf,
sched_sfn, sched_sf
);
common_signal_procedures(eNB, sched_sfn, sched_sf);
common_signal_procedures(eNB, sfn, sf);
if (eNB->pdcch_vars[sf&1].num_dci > 0)
{
LOG_E(PHY,"SFN/SF:%d/%d eNB->pdcch_vars[sf&1].num_dci:%d num_pdcch_symbols:%d\n", sfn, sf, eNB->pdcch_vars[sf&1].num_dci, eNB->pdcch_vars[sf&1].num_pdcch_symbols);
}