Commit 992024b2 authored by Danil Ruban's avatar Danil Ruban Committed by jperaldi

bugz #123365 fix missing SF in SRB msgs

parent d1db574c
...@@ -3406,7 +3406,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info, ...@@ -3406,7 +3406,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
for (int i = 0; i < mac_sdu_len; i++) { for (int i = 0; i < mac_sdu_len; i++) {
LOG_D(NR_MAC, "%d: 0x%x\n", i, pduP[mac_subheader_len + i]); LOG_D(NR_MAC, "%d: 0x%x\n", i, pduP[mac_subheader_len + i]);
} }
nr_mac_rrc_data_ind_ue(module_idP, CC_id, gNB_index, frameP, 0, mac->crnti, CCCH, pduP+mac_subheader_len, mac_sdu_len); nr_mac_rrc_data_ind_ue(module_idP, CC_id, gNB_index, frameP, slot >> 1, mac->crnti, CCCH, pduP+mac_subheader_len, mac_sdu_len);
} }
break; break;
case DL_SCH_LCID_TCI_STATE_ACT_UE_SPEC_PDSCH: case DL_SCH_LCID_TCI_STATE_ACT_UE_SPEC_PDSCH:
......
...@@ -473,7 +473,7 @@ int nr_process_mac_pdu(module_id_t module_idP, ...@@ -473,7 +473,7 @@ int nr_process_mac_pdu(module_id_t module_idP,
nr_mac_rrc_data_ind(module_idP, nr_mac_rrc_data_ind(module_idP,
CC_id, CC_id,
frameP, frameP,
0, slot >> 1,
0, 0,
UE_info->rnti[UE_id], UE_info->rnti[UE_id],
CCCH, CCCH,
......
...@@ -353,7 +353,7 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP, ...@@ -353,7 +353,7 @@ int8_t nr_mac_rrc_data_ind(const module_id_t module_idP,
LOG_D(NR_RRC, "[gNB %d] Received SDU for CCCH on SRB %ld\n", module_idP, srb_idP); LOG_D(NR_RRC, "[gNB %d] Received SDU for CCCH on SRB %ld\n", module_idP, srb_idP);
ctxt.brOption = brOption; ctxt.brOption = brOption;
if (sdu_lenP > 0) { if (sdu_lenP > 0) {
LOG_I(RRC,"RRC Sending CCCH PDU_IND to SS \n"); LOG_I(RRC,"RRC Sending CCCH PDU_IND to SS @ [SFN: %d, SF: %d] \n", ctxt.frame, ctxt.subframe);
MessageDef *message_p = itti_alloc_new_message (TASK_SS_SRB, INSTANCE_DEFAULT, SS_NRRRC_PDU_IND); MessageDef *message_p = itti_alloc_new_message (TASK_SS_SRB, INSTANCE_DEFAULT, SS_NRRRC_PDU_IND);
if (message_p) { if (message_p) {
/* Populate the message to SS */ /* Populate the message to SS */
......
...@@ -46,6 +46,57 @@ enum MsgUserId ...@@ -46,6 +46,57 @@ enum MsgUserId
char *vtp_local_address = "127.0.0.1"; char *vtp_local_address = "127.0.0.1";
int vtp_proxy_send_port = 7776; int vtp_proxy_send_port = 7776;
int vtp_proxy_recv_port = 7777; int vtp_proxy_recv_port = 7777;
static void _ss_log_vt(struct VirtualTimeInfo_Type* virtualTime, const char* prefix) {
if (virtualTime->Enable) {
char _msg[512] = {};
char* _msg_end = _msg;
if (virtualTime->TimingInfo.SFN.d) {
_msg_end += snprintf(_msg_end, sizeof(_msg) - (_msg_end - _msg), "SFN: %d ",
virtualTime->TimingInfo.SFN.v.Number);
}
if (virtualTime->TimingInfo.HSFN.d) {
_msg_end += snprintf(_msg_end, sizeof(_msg) - (_msg_end - _msg), "HSFN: %d ",
virtualTime->TimingInfo.HSFN.v.Number);
}
if (virtualTime->TimingInfo.Subframe.d) {
_msg_end += snprintf(_msg_end, sizeof(_msg) - (_msg_end - _msg), "SubFrame: %d ",
virtualTime->TimingInfo.Subframe.v.Number);
}
if (virtualTime->TimingInfo.Slot.d == SlotTimingInfo_Type_SlotOffset) {
_msg_end += snprintf(_msg_end, sizeof(_msg) - (_msg_end - _msg), "mu: %d ", virtualTime->TimingInfo.Slot.v.SlotOffset.d - 1);
switch(virtualTime->TimingInfo.Slot.v.SlotOffset.d) {
case SlotOffset_Type_Numerology0: break;
case SlotOffset_Type_Numerology1:
_msg_end += snprintf(_msg_end, sizeof(_msg) - (_msg_end - _msg), "slot(1): %d", virtualTime->TimingInfo.Slot.v.SlotOffset.v.Numerology1);
break;
case SlotOffset_Type_Numerology2:
_msg_end += snprintf(_msg_end, sizeof(_msg) - (_msg_end - _msg), "slot(2): %d", virtualTime->TimingInfo.Slot.v.SlotOffset.v.Numerology2);
break;
case SlotOffset_Type_Numerology3:
_msg_end += snprintf(_msg_end, sizeof(_msg) - (_msg_end - _msg), "slot(3): %d", virtualTime->TimingInfo.Slot.v.SlotOffset.v.Numerology3);
break;
case SlotOffset_Type_Numerology4:
_msg_end += snprintf(_msg_end, sizeof(_msg) - (_msg_end - _msg), "slot(4): %d", virtualTime->TimingInfo.Slot.v.SlotOffset.v.Numerology4);
break;
default:
LOG_E(GNB_APP, "Wrong MU\r\n");
break;
}
}
LOG_A(GNB_APP, "[SS-VTP] %s %s\n", prefix, _msg);
} else {
LOG_A(GNB_APP, "[SS-VTP] disabled \n");
}
}
/* /*
* Function : sys_send_init_udp * Function : sys_send_init_udp
* Description: Sends the UDP_INIT message to UDP_TASK to create the receiving socket * Description: Sends the UDP_INIT message to UDP_TASK to create the receiving socket
...@@ -93,6 +144,7 @@ void ss_vtp_send_tinfo( ...@@ -93,6 +144,7 @@ void ss_vtp_send_tinfo(
virtualTime.TimingInfo.Slot.d = tinfo->mu > 0 ? SlotTimingInfo_Type_SlotOffset : SlotTimingInfo_Type_UNBOUND_VALUE; virtualTime.TimingInfo.Slot.d = tinfo->mu > 0 ? SlotTimingInfo_Type_SlotOffset : SlotTimingInfo_Type_UNBOUND_VALUE;
virtualTime.TimingInfo.Slot.v.SlotOffset.d = (enum SlotOffset_Type_Sel) (tinfo->mu + 1); virtualTime.TimingInfo.Slot.v.SlotOffset.d = (enum SlotOffset_Type_Sel) (tinfo->mu + 1);
switch(virtualTime.TimingInfo.Slot.v.SlotOffset.d) { switch(virtualTime.TimingInfo.Slot.v.SlotOffset.d) {
case SlotOffset_Type_Numerology0: break; case SlotOffset_Type_Numerology0: break;
case SlotOffset_Type_Numerology1: case SlotOffset_Type_Numerology1:
...@@ -122,9 +174,7 @@ void ss_vtp_send_tinfo( ...@@ -122,9 +174,7 @@ void ss_vtp_send_tinfo(
virtualTime.TimingInfo.HSFN.d = false; virtualTime.TimingInfo.HSFN.d = false;
virtualTime.TimingInfo.HSFN.v.Number = 0; virtualTime.TimingInfo.HSFN.v.Number = 0;
/** TODO: Always marking as first slot, need to check this */ _ss_log_vt(&virtualTime, " <= ");
virtualTime.TimingInfo.Slot.d = SlotTimingInfo_Type_FirstSlot;
virtualTime.TimingInfo.Slot.v.FirstSlot = 0;
/* Encode message /* Encode message
*/ */
...@@ -147,7 +197,6 @@ void ss_vtp_send_tinfo( ...@@ -147,7 +197,6 @@ void ss_vtp_send_tinfo(
return; return;
} }
LOG_A(GNB_APP, "[SS-VTP] VTP_Send Success SFN %d SF %d virtualTime.Enable %d mu: %d slot: %d\n",tinfo->sfn,tinfo->sf,virtualTime.Enable, tinfo->mu, tinfo->slot);
SS_context.vtinfo = *tinfo; SS_context.vtinfo = *tinfo;
// Free allocated buffer // Free allocated buffer
...@@ -199,14 +248,14 @@ static void vtp_send_proxy(void *msg, int msgLen) ...@@ -199,14 +248,14 @@ static void vtp_send_proxy(void *msg, int msgLen)
IPV4_STR_ADDR_TO_INT_NWBO(vtp_local_address, peerIpAddr, " BAD IP Address"); IPV4_STR_ADDR_TO_INT_NWBO(vtp_local_address, peerIpAddr, " BAD IP Address");
LOG_A(GNB_APP, "\nCell Config End of Buffer\n "); LOG_A(GNB_APP, "\nCell Config End of Buffer\n ");
/** Send to proxy */ /** Send to proxy */
vtp_send_udp_msg((uint8_t *)msg, msgLen, 0, peerIpAddr, peerPort); vtp_send_udp_msg((uint8_t *)msg, msgLen, 0, peerIpAddr, peerPort);
return; return;
} }
static inline void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime) static void ss_send_vtp_resp(struct VirtualTimeInfo_Type *virtualTime)
{ {
VtpCmdReq_t *req = (VtpCmdReq_t *)malloc(sizeof(VtpCmdReq_t)); VtpCmdReq_t *req = (VtpCmdReq_t *)malloc(sizeof(VtpCmdReq_t));
LOG_A(GNB_APP,"itti_alloc %p\n", req); LOG_A(GNB_APP,"itti_alloc %p\n", req);
...@@ -305,58 +354,14 @@ static inline uint8_t ss_gNB_read_from_vtp_socket(acpCtx_t ctx) ...@@ -305,58 +354,14 @@ static inline uint8_t ss_gNB_read_from_vtp_socket(acpCtx_t ctx)
break; break;
} }
{
if (virtualTime->Enable) {
ss_send_vtp_resp(virtualTime); ss_send_vtp_resp(virtualTime);
_ss_log_vt(virtualTime, " => ");
if (virtualTime->TimingInfo.SFN.d) {
LOG_A(GNB_APP, "[SS-VTP] SFN: %d\n ",
virtualTime->TimingInfo.SFN.v.Number);
}
if (virtualTime->TimingInfo.HSFN.d) {
LOG_A(GNB_APP, "[SS-VTP] HSFN: %d\n ",
virtualTime->TimingInfo.HSFN.v.Number);
}
if (virtualTime->TimingInfo.Subframe.d) {
LOG_A(GNB_APP, "[SS-VTP] SubFrame: %d\n ",
virtualTime->TimingInfo.Subframe.v.Number);
}
if (virtualTime->TimingInfo.Slot.d == SlotTimingInfo_Type_SlotOffset) {
LOG_A(GNB_APP, "[SS-VTP] mu: %d\n ", virtualTime->TimingInfo.Slot.v.SlotOffset.d);
switch(virtualTime->TimingInfo.Slot.v.SlotOffset.d) {
case SlotOffset_Type_Numerology0: break;
case SlotOffset_Type_Numerology1:
LOG_A(GNB_APP, "[SS-VTP] slot: %d\n ", virtualTime->TimingInfo.Slot.v.SlotOffset.v.Numerology1);
break;
case SlotOffset_Type_Numerology2:
LOG_A(GNB_APP, "[SS-VTP] slot: %d\n ", virtualTime->TimingInfo.Slot.v.SlotOffset.v.Numerology2);
break;
case SlotOffset_Type_Numerology3:
LOG_A(GNB_APP, "[SS-VTP] slot: %d\n ", virtualTime->TimingInfo.Slot.v.SlotOffset.v.Numerology3);
break;
case SlotOffset_Type_Numerology4:
LOG_A(GNB_APP, "[SS-VTP] slot: %d\n ", virtualTime->TimingInfo.Slot.v.SlotOffset.v.Numerology4);
break;
default:
LOG_E(GNB_APP, "Wrong MU\r\n");
break;
}
}
} else {
ss_send_vtp_resp(virtualTime);
LOG_A(GNB_APP, "[SS-VTP] disabled \n");
}
acpSysVTEnquireTimingAckFreeSrv(virtualTime); acpSysVTEnquireTimingAckFreeSrv(virtualTime);
// TODo forward the message to sys_task ACK // TODo forward the message to sys_task ACK
break; break;
} }
} }
}
acpFree(buffer); acpFree(buffer);
return 0; return 0;
} }
...@@ -377,15 +382,12 @@ uint8_t ss_gNB_vtp_process_itti_msg(void) ...@@ -377,15 +382,12 @@ uint8_t ss_gNB_vtp_process_itti_msg(void)
ss_set_timinfo_t tinfo; ss_set_timinfo_t tinfo;
tinfo.sf = SS_UPD_TIM_INFO(received_msg).sf; tinfo.sf = SS_UPD_TIM_INFO(received_msg).sf;
tinfo.sfn = SS_UPD_TIM_INFO(received_msg).sfn; tinfo.sfn = SS_UPD_TIM_INFO(received_msg).sfn;
LOG_A(GNB_APP, "[VTP] received VTP_UPD_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf);
LOG_A(GNB_APP,"[VTP] received VTP_UPD_TIM_INFO SFN: %d SF: %d\n", tinfo.sfn, tinfo.sf);
if (SS_context.vtp_enabled == 1) { if (SS_context.vtp_enabled == 1) {
ss_vtp_send_tinfo(TASK_VTP, &tinfo); ss_vtp_send_tinfo(TASK_VTP, &tinfo);
} }
}; break; }; break;
case SS_NRUPD_TIM_INFO: case SS_NRUPD_TIM_INFO:
{ {
LOG_W(GNB_APP, "[SS-VTP] VTP received SS_NRUPD_TIM_INFO with sfn=%d slot=%d\n", SS_NRUPD_TIM_INFO(received_msg).sfn, SS_NRUPD_TIM_INFO(received_msg).slot);
ss_set_timinfo_t tinfo; ss_set_timinfo_t tinfo;
tinfo.slot = SS_NRUPD_TIM_INFO(received_msg).slot % 2; tinfo.slot = SS_NRUPD_TIM_INFO(received_msg).slot % 2;
tinfo.mu = 1; tinfo.mu = 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