Cleanup before merge
The clean up includes removing white space changes, adding logs, adding comments to make various changes more obvious, etc.
This commit is contained in:
@@ -421,8 +421,7 @@ int phy_subframe_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id,
|
||||
}
|
||||
|
||||
int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indication_t *ind) {
|
||||
LOG_I(MAC, "%s() NFAPI Frame: %d Subframe: %d number_of_preambles:%u\n", __FUNCTION__,
|
||||
NFAPI_SFNSF2SFN(ind->sfn_sf), NFAPI_SFNSF2SF(ind->sfn_sf), ind->rach_indication_body.number_of_preambles);
|
||||
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_preambles:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rach_indication_body.number_of_preambles);
|
||||
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
|
||||
printf("[VNF] RACH_IND eNB:%p sfn_sf:%d number_of_preambles:%d\n", eNB, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rach_indication_body.number_of_preambles);
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
@@ -486,11 +485,8 @@ int phy_harq_indication(struct nfapi_vnf_p7_config *config, nfapi_harq_indicatio
|
||||
|
||||
UL_RCC_INFO.harq_ind[index] = *ind;
|
||||
|
||||
if (ind->harq_indication_body.number_of_harqs > 0) {
|
||||
if (ind->harq_indication_body.number_of_harqs > 0)
|
||||
UL_RCC_INFO.harq_ind[index].harq_indication_body.harq_pdu_list = malloc(sizeof(nfapi_harq_indication_pdu_t)*ind->harq_indication_body.number_of_harqs );
|
||||
LOG_D(MAC, "%s() NFAPI sfn_sf = %d.%d number_of_harqs: %u\n", __FUNCTION__, NFAPI_SFNSF2SFN(ind->sfn_sf),
|
||||
NFAPI_SFNSF2SF(ind->sfn_sf), ind->harq_indication_body.number_of_harqs);
|
||||
}
|
||||
for (int i=0; i<ind->harq_indication_body.number_of_harqs; i++) {
|
||||
memcpy(&UL_RCC_INFO.harq_ind[index].harq_indication_body.harq_pdu_list[i], &ind->harq_indication_body.harq_pdu_list[i], sizeof(nfapi_harq_indication_pdu_t));
|
||||
}
|
||||
@@ -510,8 +506,6 @@ int phy_harq_indication(struct nfapi_vnf_p7_config *config, nfapi_harq_indicatio
|
||||
|
||||
int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_t *ind) {
|
||||
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
|
||||
LOG_I(MAC, "Got into phy_crc_indication Frame: %d Subframe: %d\n",
|
||||
NFAPI_SFNSF2SFN(ind->sfn_sf), NFAPI_SFNSF2SF(ind->sfn_sf));
|
||||
pthread_mutex_lock(&eNB->UL_INFO_mutex);
|
||||
if(NFAPI_MODE == NFAPI_MODE_VNF){
|
||||
int8_t index = NFAPI_SFNSF2SF(ind->sfn_sf);
|
||||
@@ -539,8 +533,8 @@ int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_
|
||||
dest_ind->crc_indication_body.crc_pdu_list = dest_pdu_list;
|
||||
|
||||
if (ind->crc_indication_body.number_of_crcs==0)
|
||||
LOG_D(MAC, "%s() NFAPI sfn_sf = %d.%d number_of_crcs: %u\n", __FUNCTION__, NFAPI_SFNSF2SFN(ind->sfn_sf),
|
||||
NFAPI_SFNSF2SF(ind->sfn_sf), ind->crc_indication_body.number_of_crcs);
|
||||
LOG_D(MAC, "%s() NFAPI SFN/SF:%d IND:number_of_crcs:%u UL_INFO:crcs:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->crc_indication_body.number_of_crcs,
|
||||
eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs);
|
||||
|
||||
for (int i=0; i<ind->crc_indication_body.number_of_crcs; i++) {
|
||||
memcpy(&dest_ind->crc_indication_body.crc_pdu_list[i], &ind->crc_indication_body.crc_pdu_list[i], sizeof(ind->crc_indication_body.crc_pdu_list[0]));
|
||||
@@ -558,37 +552,9 @@ int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_
|
||||
return 1;
|
||||
}
|
||||
|
||||
const char *hexdump(const void *data, size_t data_len, char *out, size_t out_len)
|
||||
{
|
||||
char *p = out;
|
||||
char *endp = out + out_len;
|
||||
const uint8_t *q = data;
|
||||
snprintf(p, endp - p, "[%zu]", data_len);
|
||||
p += strlen(p);
|
||||
for (size_t i = 0; i < data_len; ++i)
|
||||
{
|
||||
if (p >= endp)
|
||||
{
|
||||
static const char ellipses[] = "...";
|
||||
char *s = endp - sizeof(ellipses);
|
||||
if (s >= p)
|
||||
{
|
||||
strcpy(s, ellipses);
|
||||
}
|
||||
break;
|
||||
}
|
||||
snprintf(p, endp - p, " %02X", *q++);
|
||||
p += strlen(p);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t *ind) {
|
||||
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
|
||||
|
||||
LOG_I(MAC, "Got into phy_rx_indication Frame: %d Subframe: %d\n",
|
||||
NFAPI_SFNSF2SFN(ind->sfn_sf), NFAPI_SFNSF2SF(ind->sfn_sf));
|
||||
|
||||
if (ind->rx_indication_body.number_of_pdus==0) {
|
||||
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_pdus:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rx_indication_body.number_of_pdus);
|
||||
}
|
||||
@@ -599,11 +565,8 @@ int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t
|
||||
|
||||
UL_RCC_INFO.rx_ind[index] = *ind;
|
||||
|
||||
if (ind->rx_indication_body.number_of_pdus > 0) {
|
||||
if (ind->rx_indication_body.number_of_pdus > 0)
|
||||
UL_RCC_INFO.rx_ind[index].rx_indication_body.rx_pdu_list = malloc(sizeof(nfapi_rx_indication_pdu_t)*ind->rx_indication_body.number_of_pdus );
|
||||
LOG_I(MAC, "%s() NFAPI Frame: %d Subframe: %d number_of_pdus: %u\n", __FUNCTION__, NFAPI_SFNSF2SFN(ind->sfn_sf),
|
||||
NFAPI_SFNSF2SF(ind->sfn_sf), ind->rx_indication_body.number_of_pdus);
|
||||
}
|
||||
|
||||
for (int i=0; i<ind->rx_indication_body.number_of_pdus; i++) {
|
||||
nfapi_rx_indication_pdu_t *dest_pdu = &UL_RCC_INFO.rx_ind[index].rx_indication_body.rx_pdu_list[i];
|
||||
@@ -676,11 +639,8 @@ int phy_sr_indication(struct nfapi_vnf_p7_config *config, nfapi_sr_indication_t
|
||||
|
||||
UL_RCC_INFO.sr_ind[index] = *ind;
|
||||
LOG_D(MAC,"%s() UL_INFO[%d].sr_ind.sr_indication_body.number_of_srs:%d\n", __FUNCTION__, index, eNB->UL_INFO.sr_ind.sr_indication_body.number_of_srs);
|
||||
if (ind->sr_indication_body.number_of_srs > 0) {
|
||||
if (ind->sr_indication_body.number_of_srs > 0)
|
||||
UL_RCC_INFO.sr_ind[index].sr_indication_body.sr_pdu_list = malloc(sizeof(nfapi_sr_indication_pdu_t)*ind->sr_indication_body.number_of_srs );
|
||||
LOG_D(MAC, "%s() NFAPI sfn_sf = %d.%d number_of_srs: %u\n", __FUNCTION__, NFAPI_SFNSF2SFN(ind->sfn_sf),
|
||||
NFAPI_SFNSF2SF(ind->sfn_sf), ind->sr_indication_body.number_of_srs);
|
||||
}
|
||||
|
||||
for (int i=0; i<ind->sr_indication_body.number_of_srs; i++) {
|
||||
nfapi_sr_indication_pdu_t *dest_pdu = &UL_RCC_INFO.sr_ind[index].sr_indication_body.sr_pdu_list[i];
|
||||
@@ -752,15 +712,14 @@ int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_
|
||||
if (ind->cqi_indication_body.number_of_cqis > 0){
|
||||
UL_RCC_INFO.cqi_ind[index].cqi_indication_body.cqi_pdu_list = malloc(sizeof(nfapi_cqi_indication_pdu_t)*ind->cqi_indication_body.number_of_cqis );
|
||||
UL_RCC_INFO.cqi_ind[index].cqi_indication_body.cqi_raw_pdu_list = malloc(sizeof(nfapi_cqi_indication_raw_pdu_t)*ind->cqi_indication_body.number_of_cqis );
|
||||
LOG_I(MAC, "%s() NFAPI Frame: %d Subframe: %d, num_cqis: %u\n", __FUNCTION__, NFAPI_SFNSF2SFN(ind->sfn_sf),
|
||||
NFAPI_SFNSF2SF(ind->sfn_sf), ind->cqi_indication_body.number_of_cqis);
|
||||
}
|
||||
|
||||
analyze_cqi_pdus_for_duplicates(ind);
|
||||
|
||||
for (int i=0; i < ind->cqi_indication_body.number_of_cqis; i++) {
|
||||
nfapi_cqi_indication_pdu_t *src_pdu = &ind->cqi_indication_body.cqi_pdu_list[i];
|
||||
|
||||
for (int i=0; i<ind->cqi_indication_body.number_of_cqis; i++) {
|
||||
nfapi_cqi_indication_pdu_t *src_pdu = &ind->cqi_indication_body.cqi_pdu_list[i];
|
||||
LOG_D(MAC, "SR_IND[PDU:%d][rnti:%x cqi:%d channel:%d]\n", i, src_pdu->rx_ue_information.rnti,
|
||||
src_pdu->ul_cqi_information.ul_cqi, src_pdu->ul_cqi_information.channel);
|
||||
memcpy(&UL_RCC_INFO.cqi_ind[index].cqi_indication_body.cqi_pdu_list[i],
|
||||
src_pdu, sizeof(nfapi_cqi_indication_pdu_t));
|
||||
|
||||
@@ -1173,7 +1132,6 @@ int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) {
|
||||
NFAPI_SFNSF2SFN(dl_config_req->sfn_sf),NFAPI_SFNSF2SF(dl_config_req->sfn_sf), dl_config_req->dl_config_request_body.number_pdu);
|
||||
if (dl_config_req->dl_config_request_body.number_pdu > 0)
|
||||
{
|
||||
// TODO: Decide if we really need these logs in the future:
|
||||
for (int i = 0; i < dl_config_req->dl_config_request_body.number_pdu; i++)
|
||||
{
|
||||
uint8_t pdu_type = dl_config_req->dl_config_request_body.dl_config_pdu_list[i].pdu_type;
|
||||
@@ -1223,8 +1181,7 @@ int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req)
|
||||
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
|
||||
tx_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||
tx_req->header.message_id = NFAPI_TX_REQUEST;
|
||||
LOG_I(PHY, "[VNF] %s() TX_REQ sfn_sf:%d_%d number_of_pdus:%d\n", __FUNCTION__,
|
||||
NFAPI_SFNSF2SFN(tx_req->sfn_sf),NFAPI_SFNSF2SF(tx_req->sfn_sf), tx_req->tx_request_body.number_of_pdus);
|
||||
//LOG_D(PHY, "[VNF] %s() TX_REQ sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(tx_req->sfn_sf), tx_req->tx_request_body.number_of_pdus);
|
||||
int retval = nfapi_vnf_p7_tx_req(p7_config, tx_req);
|
||||
|
||||
if (retval!=0) {
|
||||
@@ -1277,9 +1234,7 @@ int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) {
|
||||
ul_config_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
|
||||
ul_config_req->header.message_id = NFAPI_UL_CONFIG_REQUEST;
|
||||
//LOG_D(PHY, "[VNF] %s() header message_id:%02x\n", __FUNCTION__, ul_config_req->header.message_id);
|
||||
LOG_D(PHY, "[VNF] %s() UL_CONFIG Frame: %d Subframe: %d PDUs:%d rach_prach_frequency_resources:%d srs_present:%d\n",
|
||||
__FUNCTION__, NFAPI_SFNSF2SFN(ul_config_req->sfn_sf), NFAPI_SFNSF2SF(ul_config_req->sfn_sf), ul_config_req->ul_config_request_body.number_of_pdus,
|
||||
ul_config_req->ul_config_request_body.rach_prach_frequency_resources, ul_config_req->ul_config_request_body.srs_present);
|
||||
//LOG_D(PHY, "[VNF] %s() UL_CONFIG sfn_sf:%d PDUs:%d rach_prach_frequency_resources:%d srs_present:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(ul_config_req->sfn_sf), ul_config_req->ul_config_request_body.number_of_pdus, ul_config_req->ul_config_request_body.rach_prach_frequency_resources, ul_config_req->ul_config_request_body.srs_present);
|
||||
|
||||
int num_pdus = ul_config_req->ul_config_request_body.number_of_pdus;
|
||||
nfapi_ul_config_request_pdu_t *pdu_list = ul_config_req->ul_config_request_body.ul_config_pdu_list;
|
||||
|
||||
Reference in New Issue
Block a user