Commit 68925645 authored by Matthieu Kanj's avatar Matthieu Kanj

RX and CRC indication

parent 44037b0c
......@@ -1709,17 +1709,17 @@ void decode_NPUSCH_msg_NB_IoT(PHY_VARS_eNB *eNB,
offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0));
}
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,0); // indicate ACK to MAC
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,1,1); // indicate ACK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag);
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag,1);
printf(" MSG3 OK");
//return 1;
} else {
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,1); // indicate NAK to MAC
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,0,0); // indicate NAK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag);
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag,0);
printf(" MSG3 NOT OK");
//return 0;
......@@ -1762,16 +1762,16 @@ void decode_NPUSCH_msg_NB_IoT(PHY_VARS_eNB *eNB,
if (counter_ack>8) //hard decision
{
printf(" decoded msg5: ACK ");
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,0); // indicate ACK to MAC
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,1,1); // indicate ACK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag);
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag,1);
//return 1;
} else if (counter_ack<8) { //hard decision
printf(" decoded msg5: NACK ");
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,1); // indicate NAK to MAC
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,0,0); // indicate NAK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag);
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag,0);
//return 0;
} else { //when equality (8 bits 0 vs 8 bits 1), soft decision
......@@ -1785,16 +1785,16 @@ void decode_NPUSCH_msg_NB_IoT(PHY_VARS_eNB *eNB,
{
printf(" decoded msg5 (soft): ACK ");
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,0); // indicate ACK to MAC
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,1,1); // indicate ACK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag);
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag,1);
//return 1;
} else {
printf(" decoded msg5 (soft): NACK ");
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,1); // indicate NAK to MAC
fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,0,0); // indicate NAK to MAC
//fill_rx_indication_NB_IoT(eNB,i,frame,subframe); // indicate SDU to MAC
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag);
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,ulsch_NB_IoT->Msg3_flag,1);
//return 0;
}
}
......
......@@ -53,9 +53,9 @@ uint32_t rx_nprach_NB_IoT(PHY_VARS_eNB *eNB,int frame, uint8_t subframe, uint16_
void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
////////////////// NB-IoT testing ////////////////////
void fill_rx_indication_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control, uint8_t msg3_flag);
void fill_rx_indication_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control, uint8_t msg3_flag, uint8_t ACK_NACK);
void fill_crc_indication_NB_IoT(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag);
void fill_crc_indication_NB_IoT(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag, uint8_t ACK_NACK);
#endif
......
......@@ -1549,7 +1549,7 @@ uint32_t rx_nprach_NB_IoT(PHY_VARS_eNB *eNB, int frame, uint8_t subframe, uint16
}
void fill_crc_indication_NB_IoT(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag) {
void fill_crc_indication_NB_IoT(PHY_VARS_eNB *eNB,int UE_id,int frame,int subframe,uint8_t crc_flag, uint8_t ACK_NACK) {
pthread_mutex_lock(&eNB->UL_INFO_mutex);
// nfapi_crc_indication_pdu_t* crc_pdu_list
......@@ -1566,20 +1566,30 @@ void fill_crc_indication_NB_IoT(PHY_VARS_eNB *eNB,int UE_id,int frame,int subfra
//////////////////////////pdu->crc_indication_rel8.tl.tag = NFAPI_CRC_INDICATION_REL8_TAG;
pdu->crc_indication_rel8.crc_flag = crc_flag;
eNB->UL_INFO.crc_ind.number_of_crcs++;
if(ACK_NACK == 1)
{
eNB->UL_INFO.crc_ind.number_of_crcs++;
} else {
eNB->UL_INFO.crc_ind.number_of_crcs =0;
}
//LOG_D(PHY, "%s() rnti:%04x crcs:%d crc_flag:%d\n", __FUNCTION__, pdu->rx_ue_information.rnti, eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs, crc_flag);
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
}
void fill_rx_indication_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control, uint8_t msg3_flag)
void fill_rx_indication_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control, uint8_t msg3_flag, uint8_t ACK_NACK)
{
nfapi_rx_indication_pdu_t *pdu;
pthread_mutex_lock(&eNB->UL_INFO_mutex);
eNB->UL_INFO.RX_NPUSCH.number_of_pdus = 1;
if(ACK_NACK == 1)
{
eNB->UL_INFO.RX_NPUSCH.number_of_pdus = 1;
} else {
eNB->UL_INFO.RX_NPUSCH.number_of_pdus = 0;
}
//eNB->UL_INFO.RX_NPUSCH.rx_pdu_list.rx_ue_information.tl.tag = NFAPI_RX_INDICATION_BODY_TAG; // do we need this ??
//eNB->UL_INFO.RX_NPUSCH.rx_pdu_list.rx_ue_information.rnti = rnti; // rnti should be got from eNB structure
//pdu = &eNB->UL_INFO.RX_NPUSCH.rx_pdu_list[eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
......
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