Commit 04d2e40c authored by Nick Ho's avatar Nick Ho 💬

Fix the Auth Downlink scheduling issue, UE can decode it

parent 3d4e9240
...@@ -80,7 +80,7 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_ ...@@ -80,7 +80,7 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
logical_chan_id_t logical_channel; // logical_chan_id_t logical_channel; //
uint32_t subheader_length=2; uint32_t subheader_length=3;
uint32_t payload_offset; // uint32_t payload_offset; //
...@@ -88,8 +88,8 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_ ...@@ -88,8 +88,8 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
uint32_t search_space_end_sf, h_temp, f_temp, sf_temp; uint32_t search_space_end_sf, h_temp, f_temp, sf_temp;
mac_rlc_status_resp_t rlc_status; //Declare rlc_status mac_rlc_status_resp_t rlc_status; //Declare rlc_status
//I_mcs = get_I_mcs(UE_info->CE_level); I_mcs = get_I_mcs(UE_info->CE_level);
I_mcs = 6; //I_mcs = 6;
I_tbs = I_mcs; I_tbs = I_mcs;
//get max TBS //get max TBS
TBS = get_max_tbs(I_tbs); TBS = get_max_tbs(I_tbs);
...@@ -145,7 +145,7 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_ ...@@ -145,7 +145,7 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
memcpy(UE_info->DLSCH_pdu.payload+payload_offset, sdu_temp, mac_sdu_size); memcpy(UE_info->DLSCH_pdu.payload+payload_offset, sdu_temp, mac_sdu_size);
printf("print the MAC DATA PDU including length payload \n"); printf("print the MAC DATA PDU including length payload, we have header %d byte \n",payload_offset);
int y; int y;
for (y=0;y<mac_sdu_size+payload_offset;y++){ for (y=0;y<mac_sdu_size+payload_offset;y++){
printf("%02x ",UE_info->DLSCH_pdu.payload[y]); printf("%02x ",UE_info->DLSCH_pdu.payload[y]);
...@@ -509,10 +509,21 @@ uint32_t generate_dlsch_header_NB_IoT(uint8_t *pdu, uint32_t num_sdu, logical_ch ...@@ -509,10 +509,21 @@ uint32_t generate_dlsch_header_NB_IoT(uint8_t *pdu, uint32_t num_sdu, logical_ch
{ {
if(sdu_length[i]<128) if(sdu_length[i]<128)
{ {
LOG_N(MAC,"Pack the header here\n");
/*mac_header->E=0;
mac_header->LCID = DCCH0_NB_IoT;
//mac_header->LCID = 1;
//mac_header->F2=0;
mac_header->R=0;
offset++;
mac_header+=1;*/
((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->LCID = DCCH0_NB_IoT; ((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->LCID = DCCH0_NB_IoT;
((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->F2=0; ((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->F2=0;
((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->R=0; ((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->R=0;
((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->E=0; ((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->E=1;
//((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->E=1; //((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->E=1;
((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->F=0; ((SCH_SUBHEADER_SHORT_NB_IoT*)mac_header)->F=0;
...@@ -520,6 +531,8 @@ uint32_t generate_dlsch_header_NB_IoT(uint8_t *pdu, uint32_t num_sdu, logical_ch ...@@ -520,6 +531,8 @@ uint32_t generate_dlsch_header_NB_IoT(uint8_t *pdu, uint32_t num_sdu, logical_ch
num_subheader--; num_subheader--;
mac_header+=2; mac_header+=2;
offset+=2; offset+=2;
} }
else else
{ {
...@@ -536,7 +549,7 @@ uint32_t generate_dlsch_header_NB_IoT(uint8_t *pdu, uint32_t num_sdu, logical_ch ...@@ -536,7 +549,7 @@ uint32_t generate_dlsch_header_NB_IoT(uint8_t *pdu, uint32_t num_sdu, logical_ch
} }
} }
} }
/*
if(flag_end_padding==1) if(flag_end_padding==1)
{ {
mac_header->LCID=PADDING; mac_header->LCID=PADDING;
...@@ -546,7 +559,7 @@ uint32_t generate_dlsch_header_NB_IoT(uint8_t *pdu, uint32_t num_sdu, logical_ch ...@@ -546,7 +559,7 @@ uint32_t generate_dlsch_header_NB_IoT(uint8_t *pdu, uint32_t num_sdu, logical_ch
mac_header++; mac_header++;
offset++; offset++;
} }
*/
return offset; return offset;
} }
void fill_DCI_N1(DCIFormatN1_t *DCI_N1, UE_TEMPLATE_NB_IoT *UE_info, UE_SCHED_CTRL_NB_IoT_t *UE_sched_ctrl_info) void fill_DCI_N1(DCIFormatN1_t *DCI_N1, UE_TEMPLATE_NB_IoT *UE_info, UE_SCHED_CTRL_NB_IoT_t *UE_sched_ctrl_info)
...@@ -576,7 +589,7 @@ void generate_scheduling_result_DL(uint32_t NPDCCH_sf_end, uint32_t NPDCCH_sf_st ...@@ -576,7 +589,7 @@ void generate_scheduling_result_DL(uint32_t NPDCCH_sf_end, uint32_t NPDCCH_sf_st
NPDCCH_result->rnti=rnti; NPDCCH_result->rnti=rnti;
NPDCCH_result->output_subframe = NPDCCH_sf_start; NPDCCH_result->output_subframe = NPDCCH_sf_start;
NPDCCH_result->end_subframe = NPDCCH_sf_end; NPDCCH_result->end_subframe = NPDCCH_sf_end;
NPDCCH_result->sdu_length = TBS; NPDCCH_result->sdu_length = 0;
NPDCCH_result->direction = 1; NPDCCH_result->direction = 1;
NPDCCH_result->rnti_type = 3; NPDCCH_result->rnti_type = 3;
NPDCCH_result->DLSCH_pdu = NULL; NPDCCH_result->DLSCH_pdu = NULL;
...@@ -591,7 +604,7 @@ void generate_scheduling_result_DL(uint32_t NPDCCH_sf_end, uint32_t NPDCCH_sf_st ...@@ -591,7 +604,7 @@ void generate_scheduling_result_DL(uint32_t NPDCCH_sf_end, uint32_t NPDCCH_sf_st
//NPDSCH_result->output_subframe = NPDSCH_subframe; //NPDSCH_result->output_subframe = NPDSCH_subframe;
NPDSCH_result->output_subframe = NPDSCH_sf_start; NPDSCH_result->output_subframe = NPDSCH_sf_start;
NPDSCH_result->end_subframe = NPDSCH_sf_end; NPDSCH_result->end_subframe = NPDSCH_sf_end;
NPDSCH_result->sdu_length = TBS; NPDSCH_result->sdu_length = TBS*8;
NPDSCH_result->DLSCH_pdu = DLSCH_pdu; NPDSCH_result->DLSCH_pdu = DLSCH_pdu;
//NPDSCH_result->DLSCH_pdu = NULL; //NPDSCH_result->DLSCH_pdu = NULL;
NPDSCH_result->direction = 1; NPDSCH_result->direction = 1;
......
...@@ -1426,13 +1426,14 @@ boolean_t pdcp_data_req_NB_IoT( ...@@ -1426,13 +1426,14 @@ boolean_t pdcp_data_req_NB_IoT(
(unsigned char*)&pdcp_pdu_p->data[0], (unsigned char*)&pdcp_pdu_p->data[0],
sdu_buffer_sizeP); sdu_buffer_sizeP);
#endif #endif
/*
int x; int x;
printf("print the data in pdcp_data_req_NB_IoT\n"); printf("print the data in pdcp_data_req_NB_IoT\n");
for (x=0;x<sdu_buffer_sizeP;x++){ for (x=0;x<sdu_buffer_sizeP;x++){
printf("%02x ",pdcp_pdu_p->data[x]); printf("%02x ",pdcp_pdu_p->data[x]);
} }
printf("\n"); printf("\n");
*/
rlc_status = rlc_data_req_NB_IoT(ctxt_pP, srb_flagP, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p); rlc_status = rlc_data_req_NB_IoT(ctxt_pP, srb_flagP, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p);
//MP: if all ok rlc_status = RLC_OP_STATUS_OK //MP: if all ok rlc_status = RLC_OP_STATUS_OK
...@@ -2578,12 +2579,14 @@ rlc_op_status_t rlc_data_req_NB_IoT (const protocol_ctxt_t* const ctxt_pP, ...@@ -2578,12 +2579,14 @@ rlc_op_status_t rlc_data_req_NB_IoT (const protocol_ctxt_t* const ctxt_pP,
#ifdef DEBUG_RLC_DATA_REQ #ifdef DEBUG_RLC_DATA_REQ
LOG_D(RLC,"RLC_MODE_AM\n"); LOG_D(RLC,"RLC_MODE_AM\n");
#endif #endif
/*
printf("print the data in AM before new_sdu_p in rlc_data_req_NB_IoT\n"); printf("print the data in AM before new_sdu_p in rlc_data_req_NB_IoT\n");
for (x=0;x<sdu_sizeP;x++){ for (x=0;x<sdu_sizeP;x++){
printf("%02x ",sdu_pP->data[x]); printf("%02x ",sdu_pP->data[x]);
} }
printf("\n"); printf("\n");
*/
new_sdu_p = get_free_mem_block (sdu_sizeP + sizeof (struct rlc_am_data_req_alloc), __func__); new_sdu_p = get_free_mem_block (sdu_sizeP + sizeof (struct rlc_am_data_req_alloc), __func__);
if (new_sdu_p != NULL) { if (new_sdu_p != NULL) {
...@@ -2596,20 +2599,23 @@ rlc_op_status_t rlc_data_req_NB_IoT (const protocol_ctxt_t* const ctxt_pP, ...@@ -2596,20 +2599,23 @@ rlc_op_status_t rlc_data_req_NB_IoT (const protocol_ctxt_t* const ctxt_pP,
((struct rlc_am_data_req *) (new_sdu_p->data))->mui = muiP; ((struct rlc_am_data_req *) (new_sdu_p->data))->mui = muiP;
((struct rlc_am_data_req *) (new_sdu_p->data))->data_offset = sizeof (struct rlc_am_data_req_alloc); ((struct rlc_am_data_req *) (new_sdu_p->data))->data_offset = sizeof (struct rlc_am_data_req_alloc);
free_mem_block(sdu_pP, __func__); free_mem_block(sdu_pP, __func__);
/*
printf("print the data after new_sdu_p in rlc_data_req_NB_IoT\n"); printf("print the data after new_sdu_p in rlc_data_req_NB_IoT\n");
for (x=0;x<sdu_sizeP;x++){ for (x=0;x<sdu_sizeP;x++){
printf("%02x ",new_sdu_p->data[x]); printf("%02x ",new_sdu_p->data[x]);
} }
printf("\n"); printf("\n");
*/
rlc_am_data_req(ctxt_pP, &rlc_union_p->rlc.am, new_sdu_p); rlc_am_data_req(ctxt_pP, &rlc_union_p->rlc.am, new_sdu_p);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
/*
printf("printf the data after rlc_am_data_req (in L2_interface_NB_IoT)\n"); printf("printf the data after rlc_am_data_req (in L2_interface_NB_IoT)\n");
for (x=0;x<sdu_sizeP;x++){ for (x=0;x<sdu_sizeP;x++){
printf("%02x ",new_sdu_p->data[x]); printf("%02x ",new_sdu_p->data[x]);
} }
printf("\n"); printf("\n");
*/
return RLC_OP_STATUS_OK; return RLC_OP_STATUS_OK;
} else { } else {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RLC_DATA_REQ,VCD_FUNCTION_OUT);
......
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