Commit 65303301 authored by Raymond Knopp's avatar Raymond Knopp

integration of SL configuration after time resynch

parent 58864d2b
......@@ -1209,6 +1209,7 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/rar_tools.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/print_stats.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/initial_sync.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/initial_syncSL.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if4_tools.c
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/if5_tools.c
${OPENAIR1_DIR}/PHY/MODULATION/ofdm_mod.c
......
......@@ -44,6 +44,7 @@ int initial_syncSL(PHY_VARS_UE *ue) {
int index;
int64_t psslevel;
int64_t avglevel;
int frame,subframe;
ue->rx_offsetSL = lte_sync_timeSL(ue,
&index,
......
......@@ -2353,8 +2353,8 @@ void phy_procedures_UE_SL_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc) {
AssertFatal(frame_tx>=0 && frame_tx < 1024, "frame_tx %d is not in 0...1023\n");
AssertFatal(subframe_tx>=0 && subframe_tx < 10, "frame_tx %d is not in 0...1023\n");
AssertFatal(frame_tx>=0 && frame_tx < 1024, "frame_tx %d is not in 0...1023\n",frame_tx);
AssertFatal(subframe_tx>=0 && subframe_tx < 10, "frame_tx %d is not in 0...9\n",subframe_tx);
LOG_D(PHY,"****** start Sidelink TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, subframe_tx);
......
......@@ -140,8 +140,10 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
,config_action_t config_action
,const uint32_t * const sourceL2Id
,const uint32_t * const destinationL2Id,
SL_Preconfiguration_r12_t *SL_Preconfiguration_r12
SL_Preconfiguration_r12_t *SL_Preconfiguration_r12,
uint32_t directFrameNumber_r12,
long directSubframeNumber_r12,
long *sl_Bandwidth_r12
#endif
)
{
......@@ -666,7 +668,10 @@ rrc_mac_config_req_ue(module_id_t Mod_idP,
"PSCCH bitmap limited to 42 bits\n");
UE_mac_inst[Mod_idP].slsch.SubframeBitmapSL_length = SubframeBitmapSL[preconfigpool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.present];
UE_mac_inst[Mod_idP].slsch.bitmap1 = *((uint64_t*)preconfigpool->sc_TF_ResourceConfig_r12.subframeBitmap_r12.choice.bs40_r12.buf);
}
}
if (directFrameNumber_r12<1025) UE_mac_inst[Mod_idP].directFrameNumber_r12 = directFrameNumber_r12;
if (directSubframeNumber_r12<11) UE_mac_inst[Mod_idP].directSubframeNumber_r12 = directSubframeNumber_r12;
if (sl_Bandwidth_r12) UE_mac_inst[Mod_idP].sl_Bandwidth_r12 = *sl_Bandwidth_r12;
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
......
......@@ -1318,7 +1318,6 @@ typedef struct {
uint16_t extendedBSR_Sizes_r10;
/// default value is false
uint16_t extendedPHR_r10;
//Bj bucket usage per lcid
int16_t Bj[MAX_NUM_LCID];
// Bucket size per lcid
......@@ -1326,31 +1325,31 @@ typedef struct {
} UE_SCHEDULING_INFO;
/*!\brief Top level UE MAC structure */
typedef struct {
uint16_t Node_id;
/// RX frame counter
frame_t rxFrame;
/// RX subframe counter
sub_frame_t rxSubframe;
/// TX frame counter
frame_t txFrame;
/// TX subframe counter
sub_frame_t txSubframe;
/// C-RNTI of UE
uint16_t crnti;
/// C-RNTI of UE before HO
rnti_t crnti_before_ho; ///user id (rnti) of connected UEs
/// uplink active flag
uint8_t ul_active;
/// pointer to RRC PHY configuration
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon;
/// pointer to RACH_ConfigDedicated (NULL when not active, i.e. upon HO completion or T304 expiry)
struct RACH_ConfigDedicated *rach_ConfigDedicated;
/// pointer to RRC PHY configuration
struct PhysicalConfigDedicated *physicalConfigDedicated;
uint16_t Node_id;
/// RX frame counter
frame_t rxFrame;
/// RX subframe counter
sub_frame_t rxSubframe;
/// TX frame counter
frame_t txFrame;
/// TX subframe counter
sub_frame_t txSubframe;
/// C-RNTI of UE
uint16_t crnti;
/// C-RNTI of UE before HO
rnti_t crnti_before_ho; ///user id (rnti) of connected UEs
/// uplink active flag
uint8_t ul_active;
/// pointer to RRC PHY configuration
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon;
/// pointer to RACH_ConfigDedicated (NULL when not active, i.e. upon HO completion or T304 expiry)
struct RACH_ConfigDedicated *rach_ConfigDedicated;
/// pointer to RRC PHY configuration
struct PhysicalConfigDedicated *physicalConfigDedicated;
#if defined(Rel10) || defined(Rel14)
/// pointer to RRC PHY configuration SCEll
struct PhysicalConfigDedicatedSCell_r10
*physicalConfigDedicatedSCell_r10;
/// pointer to RRC PHY configuration SCEll
struct PhysicalConfigDedicatedSCell_r10
*physicalConfigDedicatedSCell_r10;
#endif
#if defined(Rel14)
/// Preconfiguration for Sidelink
......@@ -1408,6 +1407,9 @@ typedef struct {
SLSS_t slss;
ULSCH_PDU slsch_pdu;
int slsch_lcid;
uint32_t directFrameNumber_r12;
long directSubframeNumber_r12;
long sl_Bandwidth_r12;
#endif
/// number of attempt for rach
......
......@@ -1030,7 +1030,10 @@ int rrc_mac_config_req_ue(module_id_t module_idP,
,config_action_t config_action,
const uint32_t * const sourceL2Id,
const uint32_t * const destinationL2Id,
SL_Preconfiguration_r12_t *SL_Preconfiguration_r12_t
SL_Preconfiguration_r12_t *SL_Preconfiguration_r12_t,
uint32_t directFrame_r12,
long directSubframe_r12,
long *sl_Bandwidth_r12
#endif
);
......
......@@ -612,6 +612,10 @@ ue_decode_si(module_id_t module_idP, int CC_id, frame_t frameP,
SI_RNTI,
MIBSLCH, (uint8_t *) pdu, len, eNB_index,
0);
// copy frame/subframe
*frame = UE_mac_inst[module_idP].directFrameNumber_r12;
*subframe = UE_mac_inst[module_idP].directSubframeNumber_r12;
LOG_I(MAC,"SL: Resetting SF.SFN to %d.%d\n",*frame,*subframe);
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME
(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_DECODE_SI, VCD_FUNCTION_OUT);
......
......@@ -1104,8 +1104,9 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req)
i, sfn, sf, sfn, sf, dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.transport_blocks, dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index, tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data);
if(tx_request_pdu_list + dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index!= NULL){
ue_decode_si(Mod_id, 0, sfn, 0,
tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data,
tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_length);
tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data,
tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_length,
NULL,NULL,NULL);
i++;
}
}
......
......@@ -143,7 +143,7 @@ mac_rrc_data_req_ue(
int8_t
mac_rrc_data_ind_ue(
const module_id_t module_idP,
const int CC_id,
const int CC_idP,
const frame_t frameP,
const sub_frame_t sub_frameP,
const rnti_t rntiP,
......@@ -272,17 +272,13 @@ mac_rrc_data_ind_ue(
#endif // Rel10 || Rel14
#ifdef Rel14
if (srb_idP == MIBSLCH) {
LOG_I(RRC,"[UE %d] Received SDU for MIBSL\n");
if (decode_MIB_SL(&ctxt,sduP,5)>=0) {
// rrc_mac_config_request();
}
else {
}
if (decode_MIB_SL(&ctxt,sduP,5)>=0) LOG_E(RRC,"Received MIB_SL\n");
else LOG_E(RRC,"Received bogus MIB_SL\n");
}
//TTN (for D2D)
if(srb_idP == SL_DISCOVERY) {
LOG_I(RRC,"[UE %d] Received SDU (%d bytes) for SL_DISCOVERY on SRB %d from eNB %d\n",module_idP, sdu_lenP, srb_idP,eNB_indexP);
......
......@@ -1019,6 +1019,9 @@ rrc_ue_process_measConfig(
0,
NULL,
NULL,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
);
......@@ -1539,6 +1542,9 @@ rrc_ue_process_radioResourceConfigDedicated(
0,
NULL,
NULL,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
);
......@@ -1605,6 +1611,9 @@ rrc_ue_process_radioResourceConfigDedicated(
0,
NULL,
NULL,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
);
......@@ -1720,6 +1729,9 @@ rrc_ue_process_radioResourceConfigDedicated(
0,
NULL,
NULL,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
);
......@@ -2306,6 +2318,9 @@ rrc_ue_process_mobilityControlInfo(
0,
NULL,
NULL,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
);
......@@ -3175,6 +3190,9 @@ int decode_SIB1( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index,
0,
NULL,
NULL,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
);
......@@ -3861,6 +3879,9 @@ uint64_t arfcn_to_freq(long arfcn) {
0,
NULL,
NULL,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
);
......@@ -4048,6 +4069,9 @@ uint64_t arfcn_to_freq(long arfcn) {
0,
NULL,
NULL,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
);
......@@ -4555,6 +4579,9 @@ int decode_MCCH_Message( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB
0,
NULL,
NULL,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
);
......@@ -5162,7 +5189,10 @@ openair_rrc_top_init_ue(
,CONFIG_ACTION_NULL,
(const uint32_t *)NULL,
(const uint32_t *)NULL,
UE_rrc_inst[module_id].SL_Preconfiguration[0]
UE_rrc_inst[module_id].SL_Preconfiguration[0],
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
#endif
......@@ -5655,40 +5685,43 @@ void *rrc_control_socket_thread_fct(void *arg)
//configure MAC with sourceL2Id/groupL2ID
rrc_mac_config_req_ue(module_id,0,0, //eNB_index =0
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
#if defined(Rel10) || defined(Rel14)
(SCellToAddMod_r10_t *)NULL,
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
#endif
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
3, //LCID
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
(MobilityControlInfo_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
(SCellToAddMod_r10_t *)NULL,
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
#endif
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
3, //LCID
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
(TDD_Config_t *)NULL,
(MobilityControlInfo_t *)NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
#if defined(Rel10) || defined(Rel14)
,0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
,0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
#endif
#ifdef CBA
,
0,
0
,
0,
0
#endif
#if defined(Rel10) || defined(Rel14)
,CONFIG_ACTION_ADD,
&sourceL2Id,
&groupL2Id,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
);
......@@ -5762,6 +5795,9 @@ void *rrc_control_socket_thread_fct(void *arg)
,CONFIG_ACTION_REMOVE,
&sourceL2Id,
&destinationL2Id,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
......@@ -5941,6 +5977,9 @@ void *rrc_control_socket_thread_fct(void *arg)
,CONFIG_ACTION_ADD,
&sourceL2Id,
&destinationL2Id,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
);
......@@ -6127,6 +6166,9 @@ void *rrc_control_socket_thread_fct(void *arg)
,CONFIG_ACTION_ADD,
&sourceL2Id,
&destinationL2Id,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
);
......@@ -6167,6 +6209,9 @@ void *rrc_control_socket_thread_fct(void *arg)
,CONFIG_ACTION_ADD,
&sourceL2Id,
NULL,
NULL,
1025, // indicates that there is no update in the frame number
11, // /indicates that there isno update in the subframe number
NULL
#endif
);
......@@ -6228,6 +6273,50 @@ int decode_MIB_SL( const protocol_ctxt_t* const ctxt_pP,
LOG_E(RRC,"[UE %d] Frame %d : Failed to decode SBCCH_SL_BCH_Message (%zu bytes)\n",ctxt_pP->module_id,ctxt_pP->frame,dec_rval.consumed);
return -1;
}
rrc_mac_config_req_ue(ctxt_pP->module_id, 0, 0,
(RadioResourceConfigCommonSIB_t *)NULL,
(struct PhysicalConfigDedicated *)NULL,
#if defined(Rel10) || defined(Rel14)
(SCellToAddMod_r10_t *)NULL,
//(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
#endif
(MeasObjectToAddMod_t **)NULL,
(MAC_MainConfig_t *)NULL,
0,
(struct LogicalChannelConfig *)NULL,
(MeasGapConfig_t *)NULL,
NULL,
(MobilityControlInfo_t *) NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
(MBSFN_SubframeConfigList_t *)NULL
#if defined(Rel10) || defined(Rel14)
,0,
(MBSFN_AreaInfoList_r9_t *)NULL,
(PMCH_InfoList_r9_t *)NULL
#endif
#ifdef CBA
,
0,
0
#endif
#if defined(Rel14)
,
0,
NULL,
NULL,
NULL,
BIT_STRING_to_uint32(&UE_rrc_inst[ctxt_pP->module_id].SL_mib[0]->message.directFrameNumber_r12), // indicates that there is no update in the frame number
UE_rrc_inst[ctxt_pP->module_id].SL_mib[0]->message.directSubframeNumber_r12, // /indicates that there isno update in the subframe number
&UE_rrc_inst[ctxt_pP->module_id].SL_mib[0]->message.sl_Bandwidth_r12
#endif
);
return(0);
}
//-----------------------------------------------------------------------------
......
......@@ -704,7 +704,7 @@ static void *UE_thread_synchSL(void *arg)
AssertFatal ( 0== pthread_mutex_unlock(&UE->proc.mutex_synchSL), "");
// Do initial synch here
if (initial_synchSL(UE) >= 0)
if (initial_syncSL(UE) >= 0)
AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synchSL), "");
UE->proc.instance_cnt_synchSL--;
......
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