Commit 97c2aff9 authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

PC5-U - passing (source,destination) down to PDCP/RLC/MAC (first alternative -...

PC5-U - passing (source,destination) down to PDCP/RLC/MAC (first alternative - mapping of L2Ids form IP Addresses
parent 24d5700c
...@@ -372,10 +372,20 @@ typedef struct { ...@@ -372,10 +372,20 @@ typedef struct {
struct PMCH_InfoList_r9 *pmch_InfoList struct PMCH_InfoList_r9 *pmch_InfoList
#endif #endif
); );
unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, const unsigned int,char*); unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, const unsigned int,char*
#ifdef Rel14
,uint32_t
,uint32_t
#endif
);
void (*mac_rlc_data_ind)(module_id_t, logical_chan_id_t, char*, tb_size_t, num_tb_t, crc_t* ); void (*mac_rlc_data_ind)(module_id_t, logical_chan_id_t, char*, tb_size_t, num_tb_t, crc_t* );
mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, sub_frame_t subframeP, eNB_flag_t eNB_flagP, MBMS_flag_t MBMS_flagP, mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, sub_frame_t subframeP, eNB_flag_t eNB_flagP, MBMS_flag_t MBMS_flagP,
logical_chan_id_t channel_idP, tb_size_t tb_sizeP); logical_chan_id_t channel_idP, tb_size_t tb_sizeP
#ifdef Rel14
,uint32_t sourceL2Id
,uint32_t destinationL2Id
#endif
);
signed int (*rrc_rlc_data_req)(module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, char *); signed int (*rrc_rlc_data_req)(module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, char *);
void (*rrc_rlc_register_rrc) (void (*rrc_data_indP)(module_id_t , rb_id_t , sdu_size_t , char* ), void (*rrc_rlc_register_rrc) (void (*rrc_data_indP)(module_id_t , rb_id_t , sdu_size_t , char* ),
void (*rrc_data_confP) (module_id_t , rb_id_t , mui_t ) ) ; void (*rrc_data_confP) (module_id_t , rb_id_t , mui_t ) ) ;
......
...@@ -563,7 +563,11 @@ int flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t chann ...@@ -563,7 +563,11 @@ int flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t chann
rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id); rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id); uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id);
uint16_t subframe = (uint16_t) flexran_get_current_subframe(mod_id); uint16_t subframe = (uint16_t) flexran_get_current_subframe(mod_id);
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id,frame,subframe,ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0); mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id,frame,subframe,ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0
#ifdef Rel14
,0, 0
#endif
);
return rlc_status.bytes_in_buffer; return rlc_status.bytes_in_buffer;
} }
...@@ -571,7 +575,11 @@ int flexran_get_hol_delay(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_i ...@@ -571,7 +575,11 @@ int flexran_get_hol_delay(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_i
rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id); rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id);
uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id); uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id);
uint16_t subframe = (uint16_t) flexran_get_current_subframe(mod_id); uint16_t subframe = (uint16_t) flexran_get_current_subframe(mod_id);
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id, rnti, mod_id, frame, subframe, ENB_FLAG_YES, MBMS_FLAG_NO, channel_id, 0); mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id, rnti, mod_id, frame, subframe, ENB_FLAG_YES, MBMS_FLAG_NO, channel_id, 0
#ifdef Rel14
,0, 0
#endif
);
return rlc_status.head_sdu_creation_time; return rlc_status.head_sdu_creation_time;
} }
......
...@@ -1048,9 +1048,9 @@ rrc_mac_config_req_ue( ...@@ -1048,9 +1048,9 @@ rrc_mac_config_req_ue(
uint16_t cba_rnti uint16_t cba_rnti
#endif #endif
#if defined(Rel14) #if defined(Rel14)
,uint32_t *sourceL2Id, ,config_action_t config_action
uint32_t *groupL2Id, ,const uint32_t * const sourceL2Id
uint32_t *destinationL2Id ,const uint32_t * const destinationL2Id
#endif #endif
) )
...@@ -1374,14 +1374,29 @@ rrc_mac_config_req_ue( ...@@ -1374,14 +1374,29 @@ rrc_mac_config_req_ue(
//for D2D //for D2D
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
switch (config_action) {
case CONFIG_ACTION_ADD:
if (sourceL2Id){ if (sourceL2Id){
UE_mac_inst[Mod_idP].sourceL2Id = *sourceL2Id; UE_mac_inst[Mod_idP].sourceL2Id = *sourceL2Id;
} LOG_I(MAC,"[UE %d] Configure source L2Id 0x%08x \n", Mod_idP, *sourceL2Id );
if (groupL2Id) {
UE_mac_inst[Mod_idP].groupL2Id = *groupL2Id;
} }
if (destinationL2Id) { if (destinationL2Id) {
UE_mac_inst[Mod_idP].destinationL2Id = *destinationL2Id; LOG_I(MAC,"[UE %d] Configure destination L2Id 0x%08x\n", Mod_idP, *destinationL2Id );
int j = 0;
int i = 0;
for (i=0; i< MAX_NUM_DEST; i++) {
if ((UE_mac_inst[Mod_idP].destinationList[i] == 0) && (j == 0)) j = i+1;
if (UE_mac_inst[Mod_idP].destinationList[i] == *destinationL2Id) break; //destination already exists!
}
if ((i == MAX_NUM_DEST) && (j > 0)) UE_mac_inst[Mod_idP].destinationList[j-1] = *destinationL2Id;
UE_mac_inst[Mod_idP].numCommFlows++;
}
break;
case CONFIG_ACTION_REMOVE:
//TODO
break;
default:
break;
} }
#endif #endif
......
...@@ -445,6 +445,7 @@ typedef struct { ...@@ -445,6 +445,7 @@ typedef struct {
#define CC_ACT_DEACT 27 #define CC_ACT_DEACT 27
//TTN (for D2D) //TTN (for D2D)
#define SL_DISCOVERY 8 //LCID (fake) #define SL_DISCOVERY 8 //LCID (fake)
#define MAX_NUM_DEST 10
#endif #endif
// ULSCH LCHAN IDs // ULSCH LCHAN IDs
...@@ -1341,6 +1342,9 @@ typedef struct { ...@@ -1341,6 +1342,9 @@ typedef struct {
uint32_t groupL2Id; uint32_t groupL2Id;
//SL destinationL2Id //SL destinationL2Id
uint32_t destinationL2Id; uint32_t destinationL2Id;
//List of destinations
uint32_t destinationList[MAX_NUM_DEST];
uint8_t numCommFlows;
#endif #endif
/// pointer to TDD Configuration (NULL for FDD) /// pointer to TDD Configuration (NULL for FDD)
......
...@@ -849,7 +849,11 @@ schedule_ue_spec( ...@@ -849,7 +849,11 @@ schedule_ue_spec(
ENB_FLAG_YES, ENB_FLAG_YES,
MBMS_FLAG_NO, MBMS_FLAG_NO,
DCCH, DCCH,
(TBS-ta_len-header_len_dcch)); // transport block set size (TBS-ta_len-header_len_dcch) // transport block set size
#ifdef Rel14
,0, 0
#endif
);
sdu_lengths[0]=0; sdu_lengths[0]=0;
...@@ -865,7 +869,12 @@ schedule_ue_spec( ...@@ -865,7 +869,12 @@ schedule_ue_spec(
MBMS_FLAG_NO, MBMS_FLAG_NO,
DCCH, DCCH,
TBS, //not used TBS, //not used
(char *)&dlsch_buffer[0]); (char *)&dlsch_buffer[0]
#ifdef Rel14
,0,
0
#endif
);
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP), T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
T_INT(harq_pid), T_INT(DCCH), T_INT(sdu_lengths[0])); T_INT(harq_pid), T_INT(DCCH), T_INT(sdu_lengths[0]));
...@@ -902,7 +911,11 @@ schedule_ue_spec( ...@@ -902,7 +911,11 @@ schedule_ue_spec(
ENB_FLAG_YES, ENB_FLAG_YES,
MBMS_FLAG_NO, MBMS_FLAG_NO,
DCCH+1, DCCH+1,
(TBS-ta_len-header_len_dcch-sdu_length_total)); // transport block set size less allocations for timing advance and (TBS-ta_len-header_len_dcch-sdu_length_total) // transport block set size less allocations for timing advance and
#ifdef Rel14
,0, 0
#endif
);
// DCCH SDU // DCCH SDU
sdu_lengths[num_sdus] = 0; sdu_lengths[num_sdus] = 0;
...@@ -918,7 +931,12 @@ schedule_ue_spec( ...@@ -918,7 +931,12 @@ schedule_ue_spec(
MBMS_FLAG_NO, MBMS_FLAG_NO,
DCCH+1, DCCH+1,
TBS, //not used TBS, //not used
(char *)&dlsch_buffer[sdu_length_total]); (char *)&dlsch_buffer[sdu_length_total]
#ifdef Rel14
,0,
0
#endif
);
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP), T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
T_INT(harq_pid), T_INT(DCCH+1), T_INT(sdu_lengths[num_sdus])); T_INT(harq_pid), T_INT(DCCH+1), T_INT(sdu_lengths[num_sdus]));
...@@ -964,7 +982,11 @@ schedule_ue_spec( ...@@ -964,7 +982,11 @@ schedule_ue_spec(
ENB_FLAG_YES, ENB_FLAG_YES,
MBMS_FLAG_NO, MBMS_FLAG_NO,
lcid, lcid,
TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch); TBS-ta_len-header_len_dcch-sdu_length_total-header_len_dtch
#ifdef Rel14
,0, 0
#endif
);
if (rlc_status.bytes_in_buffer > 0) { if (rlc_status.bytes_in_buffer > 0) {
...@@ -979,7 +1001,12 @@ schedule_ue_spec( ...@@ -979,7 +1001,12 @@ schedule_ue_spec(
MBMS_FLAG_NO, MBMS_FLAG_NO,
lcid, lcid,
TBS, //not used TBS, //not used
(char*)&dlsch_buffer[sdu_length_total]); (char*)&dlsch_buffer[sdu_length_total]
#ifdef Rel14
,0,
0
#endif
);
T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP), T(T_ENB_MAC_UE_DL_SDU, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP),
T_INT(harq_pid), T_INT(lcid), T_INT(sdu_lengths[num_sdus])); T_INT(harq_pid), T_INT(lcid), T_INT(sdu_lengths[num_sdus]));
......
...@@ -508,7 +508,11 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra ...@@ -508,7 +508,11 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch); TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch);
rlc_status = mac_rlc_status_ind(module_idP,0,frameP,subframeP,module_idP,ENB_FLAG_YES,MBMS_FLAG_YES,MTCH, rlc_status = mac_rlc_status_ind(module_idP,0,frameP,subframeP,module_idP,ENB_FLAG_YES,MBMS_FLAG_YES,MTCH,
TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch); TBS-header_len_mcch-header_len_msi-sdu_length_total-header_len_mtch
#ifdef Rel14
,0, 0
#endif
);
LOG_D(MAC,"e-MBMS log channel %u frameP %d, subframeP %d, rlc_status.bytes_in_buffer is %d\n", LOG_D(MAC,"e-MBMS log channel %u frameP %d, subframeP %d, rlc_status.bytes_in_buffer is %d\n",
MTCH,frameP,subframeP, rlc_status.bytes_in_buffer); MTCH,frameP,subframeP, rlc_status.bytes_in_buffer);
...@@ -525,7 +529,12 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra ...@@ -525,7 +529,12 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
MBMS_FLAG_YES, MBMS_FLAG_YES,
MTCH, MTCH,
0, //not used 0, //not used
(char*)&mch_buffer[sdu_length_total]); (char*)&mch_buffer[sdu_length_total]
#ifdef Rel14
,0,
0
#endif
);
//sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, MBMS_FLAG_NO, MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)), (char*)&mch_buffer[sdu_length_total]); //sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,frameP, MBMS_FLAG_NO, MTCH+(MAX_NUM_RB*(NUMBER_OF_UE_MAX+1)), (char*)&mch_buffer[sdu_length_total]);
LOG_I(MAC,"[eNB %d][MBMS USER-PLANE] CC_id %d Got %d bytes for MTCH %d\n",module_idP,CC_id,sdu_lengths[num_sdus],MTCH); LOG_I(MAC,"[eNB %d][MBMS USER-PLANE] CC_id %d Got %d bytes for MTCH %d\n",module_idP,CC_id,sdu_lengths[num_sdus],MTCH);
cc->mtch_active=1; cc->mtch_active=1;
......
...@@ -178,7 +178,11 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, ...@@ -178,7 +178,11 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
ENB_FLAG_YES, ENB_FLAG_YES,
MBMS_FLAG_NO, MBMS_FLAG_NO,
lcid, lcid,
0); 0
#ifdef Rel14
,0, 0
#endif
);
if (rlc_status.bytes_in_buffer > 0) { if (rlc_status.bytes_in_buffer > 0) {
...@@ -198,7 +202,11 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, ...@@ -198,7 +202,11 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
ENB_FLAG_YES, ENB_FLAG_YES,
MBMS_FLAG_NO, MBMS_FLAG_NO,
lcid, lcid,
rlc_size); // transport block set size rlc_size // transport block set size
#ifdef Rel14
,0, 0
#endif
);
LOG_D(MAC, "[TEST] RLC can give %d bytes for LCID %d during second call\n", rlc_status.bytes_in_buffer, lcid); LOG_D(MAC, "[TEST] RLC can give %d bytes for LCID %d during second call\n", rlc_status.bytes_in_buffer, lcid);
...@@ -212,7 +220,12 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, ...@@ -212,7 +220,12 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id,
MBMS_FLAG_NO, MBMS_FLAG_NO,
lcid, lcid,
rlc_size, //not used rlc_size, //not used
(char *)&dlsch_buffer[sdu_length_total]); (char *)&dlsch_buffer[sdu_length_total]
#ifdef Rel14
,0,
0
#endif
);
LOG_D(MAC,"[eNB %d][LCID %d] CC_id %d Got %d bytes from RLC\n",mod_id, lcid, CC_id, sdu_lengths[j]); LOG_D(MAC,"[eNB %d][LCID %d] CC_id %d Got %d bytes from RLC\n",mod_id, lcid, CC_id, sdu_lengths[j]);
sdu_length_total += sdu_lengths[j]; sdu_length_total += sdu_lengths[j];
......
...@@ -160,7 +160,11 @@ void _store_dlsch_buffer (module_id_t Mod_id, ...@@ -160,7 +160,11 @@ void _store_dlsch_buffer (module_id_t Mod_id,
for(i=0; i< MAX_NUM_LCID; i++) { // loop over all the logical channels for(i=0; i< MAX_NUM_LCID; i++) { // loop over all the logical channels
rlc_status = mac_rlc_status_ind(Mod_id,rnti, Mod_id,frameP,subframeP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0 ); rlc_status = mac_rlc_status_ind(Mod_id,rnti, Mod_id,frameP,subframeP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0
#ifdef Rel14
,0, 0
#endif
);
UE_template->dl_buffer_info[i] = rlc_status.bytes_in_buffer; //storing the dlsch buffer for each logical channel UE_template->dl_buffer_info[i] = rlc_status.bytes_in_buffer; //storing the dlsch buffer for each logical channel
UE_template->dl_pdus_in_buffer[i] = rlc_status.pdus_in_buffer; UE_template->dl_pdus_in_buffer[i] = rlc_status.pdus_in_buffer;
UE_template->dl_buffer_head_sdu_creation_time[i] = rlc_status.head_sdu_creation_time ; UE_template->dl_buffer_head_sdu_creation_time[i] = rlc_status.head_sdu_creation_time ;
...@@ -1245,7 +1249,11 @@ flexran_schedule_ue_spec_common(mid_t mod_id, ...@@ -1245,7 +1249,11 @@ flexran_schedule_ue_spec_common(mid_t mod_id,
ENB_FLAG_YES, ENB_FLAG_YES,
MBMS_FLAG_NO, MBMS_FLAG_NO,
j, j,
(dci_tbs - ta_len - header_len - sdu_length_total)); // transport block set size (dci_tbs - ta_len - header_len - sdu_length_total) // transport block set size
#ifdef Rel14
,0, 0
#endif
);
//If data are available in channel j //If data are available in channel j
if (rlc_status.bytes_in_buffer > 0) { if (rlc_status.bytes_in_buffer > 0) {
......
...@@ -126,7 +126,11 @@ void store_dlsch_buffer (module_id_t Mod_id, ...@@ -126,7 +126,11 @@ void store_dlsch_buffer (module_id_t Mod_id,
for(i=0; i< MAX_NUM_LCID; i++) { // loop over all the logical channels for(i=0; i< MAX_NUM_LCID; i++) { // loop over all the logical channels
rlc_status = mac_rlc_status_ind(Mod_id,rnti, Mod_id,frameP,subframeP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0 ); rlc_status = mac_rlc_status_ind(Mod_id,rnti, Mod_id,frameP,subframeP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0
#ifdef Rel14
,0, 0
#endif
);
UE_template->dl_buffer_info[i] = rlc_status.bytes_in_buffer; //storing the dlsch buffer for each logical channel UE_template->dl_buffer_info[i] = rlc_status.bytes_in_buffer; //storing the dlsch buffer for each logical channel
UE_template->dl_pdus_in_buffer[i] = rlc_status.pdus_in_buffer; UE_template->dl_pdus_in_buffer[i] = rlc_status.pdus_in_buffer;
UE_template->dl_buffer_head_sdu_creation_time[i] = rlc_status.head_sdu_creation_time ; UE_template->dl_buffer_head_sdu_creation_time[i] = rlc_status.head_sdu_creation_time ;
......
...@@ -931,10 +931,9 @@ int rrc_mac_config_req_ue(module_id_t module_idP, ...@@ -931,10 +931,9 @@ int rrc_mac_config_req_ue(module_id_t module_idP,
uint16_t cba_rnti uint16_t cba_rnti
#endif #endif
#if defined(Rel14) #if defined(Rel14)
, ,config_action_t config_action
uint32_t *sourceL2Id, ,const uint32_t * const sourceL2Id
uint32_t *groupL2Id, ,const uint32_t * const destinationL2Id
uint32_t *destinationL2Id
#endif #endif
); );
......
...@@ -389,7 +389,11 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -389,7 +389,11 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
dcch_header_len = 2 + 2; /// SHORT Subheader + C-RNTI control element dcch_header_len = 2 + 2; /// SHORT Subheader + C-RNTI control element
rlc_status = mac_rlc_status_ind(module_idP,UE_mac_inst[module_idP].crnti, eNB_indexP,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO, rlc_status = mac_rlc_status_ind(module_idP,UE_mac_inst[module_idP].crnti, eNB_indexP,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
DCCH, DCCH,
6); 6
#ifdef Rel14
,0, 0
#endif
);
if (UE_mac_inst[module_idP].crnti_before_ho) if (UE_mac_inst[module_idP].crnti_before_ho)
LOG_D(MAC, LOG_D(MAC,
...@@ -403,7 +407,12 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -403,7 +407,12 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
eNB_indexP, frameP,ENB_FLAG_NO, MBMS_FLAG_NO, eNB_indexP, frameP,ENB_FLAG_NO, MBMS_FLAG_NO,
DCCH, DCCH,
6, //not used 6, //not used
(char *)&ulsch_buff[0]); (char *)&ulsch_buff[0]
#ifdef Rel14
,0,
0
#endif
);
LOG_D(MAC,"[UE %d] TX Got %d bytes for DCCH\n",module_idP,sdu_lengths[0]); LOG_D(MAC,"[UE %d] TX Got %d bytes for DCCH\n",module_idP,sdu_lengths[0]);
update_bsr(module_idP, frameP, subframeP,eNB_indexP); update_bsr(module_idP, frameP, subframeP,eNB_indexP);
......
...@@ -1572,7 +1572,12 @@ for (lcid=DCCH; (lcid < MAX_NUM_LCID) && (is_all_lcid_processed == FALSE) ; lcid ...@@ -1572,7 +1572,12 @@ for (lcid=DCCH; (lcid < MAX_NUM_LCID) && (is_all_lcid_processed == FALSE) ; lcid
MBMS_FLAG_NO, MBMS_FLAG_NO,
lcid, lcid,
buflen_remain, buflen_remain,
(char *)&ulsch_buff[sdu_length_total]); (char *)&ulsch_buff[sdu_length_total]
#ifdef Rel14
,0,
0
#endif
);
AssertFatal (buflen_remain >= sdu_lengths[num_sdus], "LCID=%d RLC has segmented %d bytes but MAC has max=%d\n", AssertFatal (buflen_remain >= sdu_lengths[num_sdus], "LCID=%d RLC has segmented %d bytes but MAC has max=%d\n",
...@@ -2416,7 +2421,11 @@ boolean_t update_bsr(module_id_t module_idP, frame_t frameP, sub_frame_t subfra ...@@ -2416,7 +2421,11 @@ boolean_t update_bsr(module_id_t module_idP, frame_t frameP, sub_frame_t subfra
rlc_status = mac_rlc_status_ind(module_idP, UE_mac_inst[module_idP].crnti,eNB_index,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO, rlc_status = mac_rlc_status_ind(module_idP, UE_mac_inst[module_idP].crnti,eNB_index,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
lcid, lcid,
0xFFFF); //TBS is not used in RLC at this step, set a special value for debug 0xFFFF //TBS is not used in RLC at this step, set a special value for debug
#ifdef Rel14
,0, 0
#endif
);
lcid_bytes_in_buffer[lcid] = rlc_status.bytes_in_buffer; lcid_bytes_in_buffer[lcid] = rlc_status.bytes_in_buffer;
...@@ -2778,34 +2787,33 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_ ...@@ -2778,34 +2787,33 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
UE_MAC_INST *ue = &UE_mac_inst[module_idP]; UE_MAC_INST *ue = &UE_mac_inst[module_idP];
int rvtab[4] = {0,2,3,1}; int rvtab[4] = {0,2,3,1};
int sdu_length; int sdu_length;
uint32_t destL2Id; //groupL2Id/destinationL2Id uint8_t sl_lcids[2] = {3, 10}; //list of lcids for SL - hardcoded
int i = 0;
// Note: this is hard-coded for now for the default SL configuration (4 SF PSCCH, 36 SF PSSCH) // Note: this is hard-coded for now for the default SL configuration (4 SF PSCCH, 36 SF PSSCH)
SLSCH_t *slsch = &UE_mac_inst[module_idP].slsch; SLSCH_t *slsch = &UE_mac_inst[module_idP].slsch;
LOG_D(MAC,"Checking SLSCH for absSF %d\n",absSF); LOG_D(MAC,"Checking SLSCH for absSF %d\n",absSF);
if ((absSF%40) == 0) { // fill PSCCH data later in first subframe of SL period if ((absSF%40) == 0) { // fill PSCCH data later in first subframe of SL period
ue->sltx_active = 0; ue->sltx_active = 0;
for (i = 0; i < 2; i++){
for (int j = 0; j < ue->numCommFlows; j++){
if ((ue->sourceL2Id > 0) && (ue->destinationList[j] >0) ){
rlc_status = mac_rlc_status_ind(module_idP, 0x1234,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO, rlc_status = mac_rlc_status_ind(module_idP, 0x1234,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
10, sl_lcids[i], 0xFFFF, ue->sourceL2Id, ue->destinationList[j]);
0xFFFF);//for signaling - hardcoded
rlc_status_data = mac_rlc_status_ind(module_idP, 0x1234,0,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
3,
0xFFFF); //for data - hardcoded
if (rlc_status.bytes_in_buffer > 2){ if (rlc_status.bytes_in_buffer > 2){
LOG_I(MAC,"SFN.SF %d.%d: Scheduling for %d bytes in Sidelink buffer\n",frameP,subframeP,rlc_status.bytes_in_buffer); LOG_I(MAC,"SFN.SF %d.%d: Scheduling for %d bytes in Sidelink buffer\n",frameP,subframeP,rlc_status.bytes_in_buffer);
// Fill in group id for off-network communications // Fill in group id for off-network communications
ue->sltx_active = 1; ue->sltx_active = 1;
ue->slsch_lcid = 10; //store LCID, destinationL2Id
ue->slsch_lcid = sl_lcids[i];
ue->destinationL2Id = ue->destinationList[j];
break;
}
} }
else if (rlc_status_data.bytes_in_buffer >2){ }
LOG_I(MAC,"SFN.SF %d.%d: Scheduling for %d bytes in Sidelink buffer\n",frameP,subframeP,rlc_status_data.bytes_in_buffer); if ( ue->sltx_active == 1) break;
// Fill in group id for off-network communications
ue->sltx_active = 1;
ue->slsch_lcid = 3;
} }
} // we're not in the SCCH period } // we're not in the SCCH period
else if (((absSF & 3) == 0 ) && else if (((absSF & 3) == 0 ) &&
...@@ -2814,15 +2822,9 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_ ...@@ -2814,15 +2822,9 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
int TBS = 4584/8; int TBS = 4584/8;
int req; int req;
if (ue->slsch_lcid == 10) {
if (TBS<=rlc_status.bytes_in_buffer) req=TBS; if (TBS <= rlc_status.bytes_in_buffer) req = TBS;
else req = rlc_status.bytes_in_buffer; else req = rlc_status.bytes_in_buffer;
destL2Id = ue->destinationL2Id;
} else if (ue->slsch_lcid == 3){
if (TBS<=rlc_status_data.bytes_in_buffer) req=TBS;
else req = rlc_status_data.bytes_in_buffer;
destL2Id = ue->groupL2Id;
}
if (req>0) { if (req>0) {
sdu_length = mac_rlc_data_req(module_idP, sdu_length = mac_rlc_data_req(module_idP,
...@@ -2833,49 +2835,50 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_ ...@@ -2833,49 +2835,50 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
MBMS_FLAG_NO, MBMS_FLAG_NO,
ue->slsch_lcid, ue->slsch_lcid,
req, req,
(char*)(ue->slsch_pdu.payload + sizeof(SLSCH_SUBHEADER_24_Bit_DST_LONG))); (char*)(ue->slsch_pdu.payload + sizeof(SLSCH_SUBHEADER_24_Bit_DST_LONG))
#ifdef Rel14
,ue->sourceL2Id,
ue->destinationL2Id
#endif
);
// Notes: 1. hard-coded to 24-bit destination format for now // Notes: 1. hard-coded to 24-bit destination format for now
// 2. LCID hard-coded to 3
// 3. SRC/DST IDs with debug values
if (sdu_length > 0) { if (sdu_length > 0) {
LOG_I(MAC,"SFN.SF %d.%d : got %d bytes from Sidelink buffer (%d requested)\n",frameP,subframeP,sdu_length,req); LOG_I(MAC,"SFN.SF %d.%d : got %d bytes from Sidelink buffer (%d requested)\n",frameP,subframeP,sdu_length,req);
LOG_I(MAC,"sourceL2Id: 0x%08x \n",ue->sourceL2Id); LOG_I(MAC,"sourceL2Id: 0x%08x \n",ue->sourceL2Id);
LOG_I(MAC,"groupL2Id/destinationL2Id: 0x%08x \n",destL2Id); LOG_I(MAC,"groupL2Id/destinationL2Id: 0x%08x \n",ue->destinationL2Id);
slsch->payload = (unsigned char*)ue->slsch_pdu.payload; slsch->payload = (unsigned char*)ue->slsch_pdu.payload;
if (sdu_length < 128) { if (sdu_length < 128) {
slsch->payload++; slsch->payload++;
SLSCH_SUBHEADER_24_Bit_DST_SHORT *shorth= (SLSCH_SUBHEADER_24_Bit_DST_SHORT *)slsch->payload; SLSCH_SUBHEADER_24_Bit_DST_SHORT *shorth= (SLSCH_SUBHEADER_24_Bit_DST_SHORT *)slsch->payload;
shorth->F=0; shorth->F = 0;
shorth->L=sdu_length; shorth->L = sdu_length;
shorth->E=0; shorth->E = 0;
shorth->LCID=ue->slsch_lcid; shorth->LCID = ue->slsch_lcid;
shorth->SRC07 = (ue->sourceL2Id>>16) & 0x000000ff; shorth->SRC07 = (ue->sourceL2Id>>16) & 0x000000ff;
shorth->SRC815 = (ue->sourceL2Id>>8) & 0x000000ff; shorth->SRC815 = (ue->sourceL2Id>>8) & 0x000000ff;
shorth->SRC1623 = ue->sourceL2Id & 0x000000ff; shorth->SRC1623 = ue->sourceL2Id & 0x000000ff;
shorth->DST07 = (destL2Id >>16) & 0x000000ff; shorth->DST07 = (ue->destinationL2Id >>16) & 0x000000ff;
shorth->DST815 = (destL2Id>>8) & 0x000000ff; shorth->DST815 = (ue->destinationL2Id >>8) & 0x000000ff;
shorth->DST1623 = destL2Id & 0x000000ff; shorth->DST1623 = ue->destinationL2Id & 0x000000ff;
shorth->V = 0x1;
shorth->V=0x1;
} }
else { else {
SLSCH_SUBHEADER_24_Bit_DST_LONG *longh= (SLSCH_SUBHEADER_24_Bit_DST_LONG *)slsch->payload; SLSCH_SUBHEADER_24_Bit_DST_LONG *longh= (SLSCH_SUBHEADER_24_Bit_DST_LONG *)slsch->payload;
longh->F=1; longh->F = 1;
longh->L_LSB=sdu_length&0xff; longh->L_LSB = sdu_length&0xff;
longh->L_MSB=(sdu_length>>8)&0x7f; longh->L_MSB = (sdu_length>>8)&0x7f;
longh->E=0; longh->E = 0;
longh->LCID=ue->slsch_lcid; longh->LCID = ue->slsch_lcid;
longh->SRC07 = (ue->sourceL2Id >>16) & 0x000000ff; longh->SRC07 = (ue->sourceL2Id >>16) & 0x000000ff;
longh->SRC815 = (ue->sourceL2Id>>8) & 0x000000ff; longh->SRC815 = (ue->sourceL2Id>>8) & 0x000000ff;
longh->SRC1623 = ue->sourceL2Id & 0x000000ff; longh->SRC1623 = ue->sourceL2Id & 0x000000ff;
longh->DST07 = (destL2Id >>16) & 0x000000ff; longh->DST07 = (ue->destinationL2Id >>16) & 0x000000ff;
longh->DST815 = (destL2Id>>8) & 0x000000ff; longh->DST815 = (ue->destinationL2Id>>8) & 0x000000ff;
longh->DST1623 = destL2Id & 0x000000ff; longh->DST1623 = ue->destinationL2Id & 0x000000ff;
longh->V = 0x1;
longh->V=0x1;
} }
slsch->rvidx = 0; slsch->rvidx = 0;
slsch->payload_length = TBS; slsch->payload_length = TBS;
...@@ -2891,6 +2894,5 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_ ...@@ -2891,6 +2894,5 @@ SLSCH_t *ue_get_slsch(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_
return(&ue->slsch); return(&ue->slsch);
} }