Commit c4250dcd authored by Ejaz Ahmed's avatar Ejaz Ahmed

Fixed MAC subpdu header; fixed multiple interface issue

parents c534570e 4c4a667f
...@@ -696,7 +696,7 @@ void nr_ue_process_mac_sl_pdu(int module_idP, ...@@ -696,7 +696,7 @@ void nr_ue_process_mac_sl_pdu(int module_idP,
harq_proc->feedback_frame = sched_frame; harq_proc->feedback_frame = sched_frame;
harq_proc->is_active = true; harq_proc->is_active = true;
LOG_I(NR_MAC, "harq pid: %d:%d psfch_period %ld, delta_slots %d, feedback frame:slot %d:%d, frame:slot %d:%d, time_gap %d, harq feedback %d\n", LOG_D(NR_MAC, "harq pid: %d:%d psfch_period %ld, delta_slots %d, feedback frame:slot %d:%d, frame:slot %d:%d, time_gap %d, harq feedback %d\n",
harq_pid, harq_pid,
mac->sl_info.list[0]->UE_sched_ctrl.sl_harq_processes[harq_pid].is_active, mac->sl_info.list[0]->UE_sched_ctrl.sl_harq_processes[harq_pid].is_active,
psfch_period, psfch_period,
...@@ -745,12 +745,15 @@ void nr_ue_process_mac_sl_pdu(int module_idP, ...@@ -745,12 +745,15 @@ void nr_ue_process_mac_sl_pdu(int module_idP,
if ((rx_ind->rx_indication_body + pdu_id)->rx_slsch_pdu.ack_nack == 0) if ((rx_ind->rx_indication_body + pdu_id)->rx_slsch_pdu.ack_nack == 0)
return; return;
LOG_I(NR_MAC, "In %s : processing PDU %d (with length %d) of %d total number of PDUs...\n", __FUNCTION__, pdu_id, pdu_len, rx_ind->number_pdus); LOG_D(NR_MAC, "In %s : processing PDU %d (with length %d) of %d total number of PDUs...\n", __FUNCTION__, pdu_id, pdu_len, rx_ind->number_pdus);
NR_SLSCH_MAC_SUBHEADER_FIXED *sl_sch_subheader = (NR_SLSCH_MAC_SUBHEADER_FIXED *) pduP;
while (!done && pdu_len > 0){ LOG_D(NR_PHY, "Rx V %d R %d SRC %d DST %d\n", sl_sch_subheader->V, sl_sch_subheader->R, sl_sch_subheader->SRC, sl_sch_subheader->DST);
pduP += sizeof(*sl_sch_subheader);
pdu_len -= sizeof(*sl_sch_subheader);
while (!done && pdu_len > 0) {
uint16_t mac_len = 0x0000; uint16_t mac_len = 0x0000;
uint16_t mac_subheader_len = 0x0001; // default to fixed-length subheader = 1-oct uint16_t mac_subheader_len = 0x0001; // default to fixed-length subheader = 1-oct
uint8_t rx_lcid = ((NR_MAC_SUBHEADER_LONG *)(pduP + sizeof(NR_SLSCH_MAC_SUBHEADER_FIXED)))->LCID; uint8_t rx_lcid = ((NR_MAC_SUBHEADER_LONG *)(pduP))->LCID;
LOG_I(NR_MAC, "[UE %x] LCID %d, PDU length %d\n", mac->src_id, rx_lcid, pdu_len); LOG_I(NR_MAC, "[UE %x] LCID %d, PDU length %d\n", mac->src_id, rx_lcid, pdu_len);
switch(rx_lcid){ switch(rx_lcid){
......
...@@ -3384,8 +3384,8 @@ bool nr_ue_sl_pssch_scheduler(NR_UE_MAC_INST_t *mac, ...@@ -3384,8 +3384,8 @@ bool nr_ue_sl_pssch_scheduler(NR_UE_MAC_INST_t *mac,
//nr_ue_get_sdu_mac_ce_pre updates all mac_ce related header field related to length //nr_ue_get_sdu_mac_ce_pre updates all mac_ce related header field related to length
mac_ce_p->tot_mac_ce_len = nr_ue_get_sdu_mac_ce_pre(0, 0, frame, slot, 0, pdu, buflen, mac_ce_p); mac_ce_p->tot_mac_ce_len = nr_ue_get_sdu_mac_ce_pre(0, 0, frame, slot, 0, pdu, buflen, mac_ce_p);
buflen_remain -= mac_ce_p->tot_mac_ce_len; buflen_remain -= mac_ce_p->tot_mac_ce_len;
pdu += mac_ce_p->tot_mac_ce_len;
LOG_I(NR_PHY, "buflen_remain %d, total_mac_pdu_header_len %d, adding tot_mac_ce_len %d, \n", buflen_remain, mac_ce_p->total_mac_pdu_header_len, mac_ce_p->tot_mac_ce_len); LOG_D(NR_PHY, "buflen_remain %d, total_mac_pdu_header_len %d, adding tot_mac_ce_len %d, \n", buflen_remain, mac_ce_p->total_mac_pdu_header_len, mac_ce_p->tot_mac_ce_len);
} }
if (buflen_remain > 0) { if (buflen_remain > 0) {
......
...@@ -824,7 +824,12 @@ int nr_ue_process_sci2_indication_pdu(NR_UE_MAC_INST_t *mac, module_id_t mod_id, ...@@ -824,7 +824,12 @@ int nr_ue_process_sci2_indication_pdu(NR_UE_MAC_INST_t *mac, module_id_t mod_id,
sl_res_pool, sl_res_pool,
sl_mac_params); sl_mac_params);
rx_config.sl_rx_config_list[0].pdu_type = SL_NR_CONFIG_TYPE_RX_PSSCH_SLSCH; rx_config.sl_rx_config_list[0].pdu_type = SL_NR_CONFIG_TYPE_RX_PSSCH_SLSCH;
if (sci_pdu->csi_req) { sl_nr_phy_config_request_t *sl_cfg = &mac->SL_MAC_PARAMS->sl_phy_config.sl_config_req;
uint8_t mu = sl_cfg->sl_bwp_config.sl_scs;
uint8_t slots_per_frame = nr_slots_per_frame[mu];
if ((!mac->SL_MAC_PARAMS->sl_CSI_Acquisition) &&
sci_pdu->csi_req) {
sl_nr_phy_config_request_t *sl_cfg = &sl_mac_params->sl_phy_config.sl_config_req; sl_nr_phy_config_request_t *sl_cfg = &sl_mac_params->sl_phy_config.sl_config_req;
uint8_t mu = sl_cfg->sl_bwp_config.sl_scs; uint8_t mu = sl_cfg->sl_bwp_config.sl_scs;
nr_ue_sl_csi_rs_scheduler(mac, mu, mac->sl_bwp, NULL, &rx_config, NULL); nr_ue_sl_csi_rs_scheduler(mac, mu, mac->sl_bwp, NULL, &rx_config, NULL);
......
...@@ -242,7 +242,7 @@ static void prepare_NR_SL_ResourcePool(NR_SL_ResourcePool_r16_t *sl_res_pool, ...@@ -242,7 +242,7 @@ static void prepare_NR_SL_ResourcePool(NR_SL_ResourcePool_r16_t *sl_res_pool,
config_get(SL_POOLPARAMS,sizeof(SL_POOLPARAMS)/sizeof(paramdef_t),aprefix); config_get(SL_POOLPARAMS,sizeof(SL_POOLPARAMS)/sizeof(paramdef_t),aprefix);
struct NR_SL_PSFCH_Config_r16 *nr_sl_psfch_config = sl_res_pool->sl_PSFCH_Config_r16->choice.setup; struct NR_SL_PSFCH_Config_r16 *nr_sl_psfch_config = sl_res_pool->sl_PSFCH_Config_r16->choice.setup;
if (*nr_sl_psfch_config->sl_PSFCH_Period_r16 > 0) { if (*nr_sl_psfch_config->sl_PSFCH_Period_r16 > 0) {
const uint8_t psfch_periods[] = {0,1,2,4}; const uint8_t psfch_periods[] = {0,1,2,4};
AssertFatal(*nr_sl_psfch_config->sl_PSFCH_Period_r16 < 4, "sl_PSFCH_Period_r16 index must be less than 4\n"); AssertFatal(*nr_sl_psfch_config->sl_PSFCH_Period_r16 < 4, "sl_PSFCH_Period_r16 index must be less than 4\n");
LOG_I(NR_PHY,"Configuring PSFCH Period %d\n",*nr_sl_psfch_config->sl_PSFCH_Period_r16); LOG_I(NR_PHY,"Configuring PSFCH Period %d\n",*nr_sl_psfch_config->sl_PSFCH_Period_r16);
...@@ -261,9 +261,8 @@ static void prepare_NR_SL_ResourcePool(NR_SL_ResourcePool_r16_t *sl_res_pool, ...@@ -261,9 +261,8 @@ static void prepare_NR_SL_ResourcePool(NR_SL_ResourcePool_r16_t *sl_res_pool,
if ( num_prbs % 8 != 0 ) if ( num_prbs % 8 != 0 )
sl_res_pool->sl_PSFCH_Config_r16->choice.setup->sl_PSFCH_RB_Set_r16->buf[num_prbs/8] = remaining_prbs; sl_res_pool->sl_PSFCH_Config_r16->choice.setup->sl_PSFCH_RB_Set_r16->buf[num_prbs/8] = remaining_prbs;
LOG_D(RRC, "M: %d, PRBs %d, size in bytes %d, unused bits %d, full size bytes %d, remaining prbs %d\n", prod_numCh_period, num_prbs, num_bytes, (num_prbs % 8) ? 8 - (num_prbs % 8) : 0, num_prbs / 8, remaining_prbs); LOG_D(RRC, "M: %d, PRBs %d, size in bytes %d, unused bits %d, full size bytes %d, remaining prbs %d\n", prod_numCh_period, num_prbs, num_bytes, (num_prbs % 8) ? 8 - (num_prbs % 8) : 0, num_prbs / 8, remaining_prbs);
} } else {
else { LOG_I(NR_RRC,"Freeing sl_PSFCH_Config_r16\n");
LOG_I(NR_RRC,"Freeing sl_PSFCH_Config_r16\n");
free(sl_res_pool->sl_PSFCH_Config_r16->choice.setup->sl_PSFCH_CandidateResourceType_r16); free(sl_res_pool->sl_PSFCH_Config_r16->choice.setup->sl_PSFCH_CandidateResourceType_r16);
free(sl_res_pool->sl_PSFCH_Config_r16->choice.setup->sl_PSFCH_HopID_r16); free(sl_res_pool->sl_PSFCH_Config_r16->choice.setup->sl_PSFCH_HopID_r16);
free(sl_res_pool->sl_PSFCH_Config_r16->choice.setup->sl_MinTimeGapPSFCH_r16); free(sl_res_pool->sl_PSFCH_Config_r16->choice.setup->sl_MinTimeGapPSFCH_r16);
...@@ -590,7 +589,8 @@ void nr_UE_configure_Sidelink(uint8_t id, uint8_t is_sync_source) { ...@@ -590,7 +589,8 @@ void nr_UE_configure_Sidelink(uint8_t id, uint8_t is_sync_source) {
sprintf(aprefix, "%s.[%i].%s.[%i]", SL_CONFIG_STRING_SL_PRECONFIGURATION, 0, SL_CONFIG_STRING_UEINFO, 0); sprintf(aprefix, "%s.[%i].%s.[%i]", SL_CONFIG_STRING_SL_PRECONFIGURATION, 0, SL_CONFIG_STRING_UEINFO, 0);
config_get(SL_UEINFO,sizeof(SL_UEINFO)/sizeof(paramdef_t),aprefix); config_get(SL_UEINFO,sizeof(SL_UEINFO)/sizeof(paramdef_t),aprefix);
LOG_I(NR_RRC,"SL L2 SRCid %x, SL ipv4 addr X.X.%d.%d\n",ueinfo.srcid,ueinfo.thirdOctet,ueinfo.fourthOctet); LOG_I(NR_RRC,"SL L2 SRCid %x, SL ipv4 addr X.X.%d.%d\n",ueinfo.srcid,ueinfo.thirdOctet,ueinfo.fourthOctet);
nas_config(1+ueinfo.srcid,ueinfo.thirdOctet,ueinfo.fourthOctet,"oai_sl_tun"); nas_config(1,ueinfo.thirdOctet,ueinfo.fourthOctet,"oai_sl_tun");
nas_config(1 + ueinfo.srcid,ueinfo.thirdOctet,ueinfo.fourthOctet + ueinfo.srcid,"oai_sl_tun");
nr_rrc_mac_config_req_sl_preconfig(id, sl_preconfig, sync_source, ueinfo.srcid); nr_rrc_mac_config_req_sl_preconfig(id, sl_preconfig, sync_source, ueinfo.srcid);
......
...@@ -8,7 +8,7 @@ SIDELINK_PRECONFIGURATION = ( ...@@ -8,7 +8,7 @@ SIDELINK_PRECONFIGURATION = (
sl_nrofUplinkSymbols = 4; sl_nrofUplinkSymbols = 4;
sl_csi_rs = ( sl_csi_rs = (
{ {
symb_l0 = 4; symb_l0 = 5;
# csi_type 2 is not supported 38211, 8.4.1.5.3 # csi_type 2 is not supported 38211, 8.4.1.5.3
csi_Type = 1; csi_Type = 1;
sl_powerControlOffset = 1; sl_powerControlOffset = 1;
...@@ -38,9 +38,10 @@ SIDELINK_PRECONFIGURATION = ( ...@@ -38,9 +38,10 @@ SIDELINK_PRECONFIGURATION = (
{ {
#RB start 0, RB size = 106. occupies complete Bw. #RB start 0, RB size = 106. occupies complete Bw.
sl_locationAndBandwidth = 28875; sl_locationAndBandwidth = 28875;
#Num Symbols used for Sidelink in an uplink slot # Num Symbols used for Sidelink in an uplink slot
#Value can be between symbols 7 to 14 # Herein, sl_LengthSymbols represents an index; not the number of symbols.
sl_LengthSymbols = 7; # This index value can be from 0 to 7 representing the (7 to 14 symbols)
sl_LengthSymbols = 5;
#Sidelink Starting symbol in a slot #Sidelink Starting symbol in a slot
#Value can be between symbols 0 to 7 #Value can be between symbols 0 to 7
sl_StartSymbol = 0; sl_StartSymbol = 0;
...@@ -76,7 +77,7 @@ SIDELINK_PRECONFIGURATION = ( ...@@ -76,7 +77,7 @@ SIDELINK_PRECONFIGURATION = (
sl_NumSubchannel = 1; sl_NumSubchannel = 1;
# period of PSFCH resource in units of slots within this resource pool # period of PSFCH resource in units of slots within this resource pool
# Possible values sl0 means no PSFCH resource, {sl0, sl1, sl2, sl4} # Possible values sl0 means no PSFCH resource, {sl0, sl1, sl2, sl4}
sl_PSFCH_Period = 3; //sl4 sl_PSFCH_Period = 0; //sl0
# Number of cyclic shift pairs used for a PSFCH transmission that can be multiplexed in a PRB # Number of cyclic shift pairs used for a PSFCH transmission that can be multiplexed in a PRB
# Possible values {n1, n2, n3, n4} # Possible values {n1, n2, n3, n4}
sl_NumMuxCS_Pair = 1; sl_NumMuxCS_Pair = 1;
...@@ -107,7 +108,7 @@ SIDELINK_PRECONFIGURATION = ( ...@@ -107,7 +108,7 @@ SIDELINK_PRECONFIGURATION = (
sl_NumSubchannel = 1; sl_NumSubchannel = 1;
# period of PSFCH resource in units of slots within this resource pool # period of PSFCH resource in units of slots within this resource pool
# Possible values sl0 means no PSFCH resource, {sl0, sl1, sl2, sl4} # Possible values sl0 means no PSFCH resource, {sl0, sl1, sl2, sl4}
sl_PSFCH_Period = 3; //sl4 sl_PSFCH_Period = 0; //sl0
# Number of cyclic shift pairs used for a PSFCH transmission that can be multiplexed in a PRB # Number of cyclic shift pairs used for a PSFCH transmission that can be multiplexed in a PRB
# Possible values {n1, n2, n3, n4} # Possible values {n1, n2, n3, n4}
sl_NumMuxCS_Pair = 1; sl_NumMuxCS_Pair = 1;
...@@ -122,7 +123,7 @@ SIDELINK_PRECONFIGURATION = ( ...@@ -122,7 +123,7 @@ SIDELINK_PRECONFIGURATION = (
sl_UEINFO = ( sl_UEINFO = (
{ {
srcid = 0; srcid = 1;
thirdOctet = 0; thirdOctet = 0;
fourthOctet = 1; fourthOctet = 1;
} }
......
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