Commit 9624fce0 authored by Nick Ho's avatar Nick Ho

Get RLC payload at first time scheduling

parent bbf01e70
......@@ -227,7 +227,6 @@ int generate_NDLSCH_NB_IoT(PHY_VARS_eNB *eNB,
if( RAR->active == 1 )
{
printf("data : %p********(In RAR->active=1)\n", RAR);
uint8_t *RAR_pdu = RAR->harq_process->pdu;
if(RAR->active_msg2 == 1 && RAR_pdu!=NULL)
......@@ -251,16 +250,11 @@ int generate_NDLSCH_NB_IoT(PHY_VARS_eNB *eNB,
if( (counter_rep == rep) && (counter_sf_rep == 0) && (pointer_to_sf == 0) )
{
printf("Going to do dlsch_encoding_NB_IoT() & dlsch_scrambling_Gen_NB_IoT() in generate_NDLSCH_NB_IoT*************************************\n");
printf("RAR_pdu : %u********\n", RAR_pdu);
printf("RAR flag : %p********\n", RAR);
printf("number_of_subframes_for_resource_assignment(NSF) : %d********\n", Nsf);
printf("G : %d********\n", G);
dlsch_encoding_NB_IoT(RAR_pdu,
RAR,
Nsf, ///// number_of_subframes_required
G); //// this vallue is fixed, should take into account in future the case of stand-alone & guard-band
printf("Finish doing generate_NDLSCH_NB_IoT() !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
dlsch_scrambling_Gen_NB_IoT(frame_parms,
RAR,
......@@ -270,12 +264,10 @@ int generate_NDLSCH_NB_IoT(PHY_VARS_eNB *eNB,
RAR->rnti,
release_v13_5_0,
0);
printf("Finish doing dlsch_encoding_NB_IoT() & dlsch_scrambling_Gen_NB_IoT()\n");
}
if( (counter_rep != rep) && (counter_sf_rep == 0) && (pointer_to_sf == 0) )
{
printf("Do dlsch_scrambling_Gen_NB_IoT when (counter_rep != rep) && (counter_sf_rep == 0) && (pointer_to_sf == 0)\n");
dlsch_scrambling_Gen_NB_IoT(frame_parms,
RAR,
......@@ -321,7 +313,6 @@ int generate_NDLSCH_NB_IoT(PHY_VARS_eNB *eNB,
}
}
printf("The value after done generate_NDLSCH_NB_IoT in if : %d\n*********************",done);
} else {
......@@ -351,7 +342,6 @@ int generate_NDLSCH_NB_IoT(PHY_VARS_eNB *eNB,
}
}
printf("The value after done generate_NDLSCH_NB_IoT in else : %d\n*********************",done);
}
}
return(done);
......
......@@ -110,7 +110,7 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
1,
0,
DCCH0_NB_IoT,
0);
TBS-subheader_length);
data_size = rlc_status.bytes_in_buffer;
LOG_N(MAC,"[NB-IoT] RLC indicate to MAC that the data size is : %d\n",data_size);
......@@ -127,25 +127,20 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
LOG_I(MAC,"[NB-IoT][DCCH] Got %d bytes from RLC\n",mac_sdu_size);
// for testing
/*data_size = 200;
data_size=0;
int ue_index;
for(ue_index=0;ue_index<UE_NUM_SIM;++ue_index)
{
if(UE_info_sim[ue_index].tc_rnti==UE_info->rnti)
data_size = UE_info_sim[ue_index].data_size;
}*/
/*
mac_sdu_size = mac_rlc_data_req_eNB_NB_IoT(module_id, UE_info->rnti, 0, frame_start, 0, DCCH0_NB_IoT, sdu_temp);
//Generate header
payload_offset = generate_dlsch_header_NB_IoT(UE_info->DLSCH_pdu.payload, 1, &logical_channel, &mac_sdu_size, 0, 0, TBS);
//Complete MAC PDU
memcpy(UE_info->DLSCH_pdu.payload+payload_offset, sdu_temp, mac_sdu_size);
UE_info->DLSCH_pdu.pdu_size=TBS;
*/
printf("print the MAC DATA PDU including length payload \n");
int y;
for (y=0;y<mac_sdu_size+payload_offset;y++){
printf("%02x ",UE_info->DLSCH_pdu.payload[y]);
}
printf("\n");
}
/*Retransmission*/
else
......@@ -241,7 +236,7 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
//New transmission need to request data from RLC and generate new MAC PDU
UE_info->I_mcs_dl = I_mcs;
/*
//Request data from RLC layer
rlc_status = mac_rlc_status_ind(
module_id,
......@@ -254,32 +249,13 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
DCCH0_NB_IoT,
TBS-subheader_length);
/***************************************************************************************/
data_size = rlc_status.bytes_in_buffer;
LOG_N(MAC,"[NB-IoT] RLC indicate to MAC that the data size is : %d\n",data_size);
/***************************************************************************************/
mac_sdu_size = mac_rlc_data_req(module_id, UE_info->rnti, module_id, frame_start, 1, 0, DCCH0_NB_IoT, TBS, (char *)&sdu_temp[0]);
*/
//channel=DCCH0_NB_IoT;
//Generate header
payload_offset = generate_dlsch_header_NB_IoT(UE_info->DLSCH_pdu.payload, 1, &logical_channel, &mac_sdu_size, 0, 0, TBS);
//Complete MAC PDU
memcpy(UE_info->DLSCH_pdu.payload+payload_offset, sdu_temp, mac_sdu_size);
/*****************************************************************************/
LOG_I(MAC,"[NB-IoT][DCCH] Got %d bytes from RLC 2nd time\n",mac_sdu_size);
/*****************************************************************************/
/*******************************************************************/
printf("print the payload 2nd time (mac_sdu_size) !!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
int y;
for (y=0;y<mac_sdu_size;y++){
printf("%02x ",sdu_temp[y]);
}
printf("\n");
/*******************************************************************/
//UE_info->DLSCH_pdu.pdu_size=TBS;
UE_sched_ctrl_info->NPDCCH_sf_end=NPDCCH_info->sf_end;
UE_sched_ctrl_info->NPDCCH_sf_start=NPDCCH_info->sf_start;
......
......@@ -422,6 +422,7 @@ rlc_am_get_pdus (
case RLC_DATA_TRANSFER_READY_STATE:
printf("rlc_pP->nb_bytes_requested_by_mac=%d\n",rlc_pP->nb_bytes_requested_by_mac);
printf("rlc_pP->status_requested=%u\n",rlc_pP->status_requested);
/*
// TRY TO SEND CONTROL PDU FIRST
if ((rlc_pP->nb_bytes_requested_by_mac >= 2) &&
((rlc_pP->status_requested) && !(rlc_pP->status_requested & RLC_AM_STATUS_NO_TX_MASK))) {
......@@ -452,7 +453,7 @@ rlc_am_get_pdus (
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),
rlc_pP->nb_bytes_requested_by_mac,rlc_pP->t_status_prohibit.ms_time_out,(rlc_pP->status_requested & RLC_AM_STATUS_TRIGGERED_DELAYED));
}
*/
// THEN TRY TO SEND RETRANS PDU
if ((rlc_pP->retrans_num_bytes_to_retransmit) && (rlc_pP->nb_bytes_requested_by_mac > 2)) {
LOG_I(RLC,"[NB-IoT] RLC SEND RETRANS DATA PDU\n");
......
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