Commit d7a2a022 authored by tct-labo4's avatar tct-labo4

fix bad subframe indication from PHY to MAC

parent 737ed3fc
......@@ -1149,7 +1149,7 @@ void rx_phich(PHY_VARS_UE *ue,
phich_d_ptr = phich_d;
// x1 is set in lte_gold_generic
x2 = (((pusch_tti+1)*((frame_parms->Nid_cell<<1)+1))<<9) + frame_parms->Nid_cell;
x2 = (((nr_tti_rx+1)*((frame_parms->Nid_cell<<1)+1))<<9) + frame_parms->Nid_cell;
s = lte_gold_generic(&x1, &x2, reset);
......
......@@ -1810,7 +1810,8 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
mac_xface->ue_get_sdu(Mod_id,
CC_id,
frame_tx,
nr_tti_tx,
proc->subframe_tx,
nr_tti_tx%(ue->frame_parms.ttis_per_subframe),
eNB_id,
ulsch_input_buffer,
input_buffer_length,
......@@ -2475,7 +2476,8 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
mac_xface->ue_get_sdu(Mod_id,
CC_id,
frame_tx,
nr_tti_tx,
proc->subframe_tx,
nr_tti_tx%(ue->frame_parms.ttis_per_subframe),
eNB_id,
ulsch_input_buffer,
input_buffer_length,
......@@ -5657,12 +5659,12 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u
//#ifdef UE_NR_PHY_DEMO
ret = mac_xface->ue_scheduler(ue->Mod_id,
frame_rx,
nr_tti_rx,
nr_tti_rx,
proc->subframe_rx,
nr_tti_rx%(ue->frame_parms.ttis_per_subframe),
frame_tx,
nr_tti_tx,
nr_tti_tx,
subframe_select(&ue->frame_parms,nr_tti_tx),
proc->subframe_tx,
nr_tti_tx%(ue->frame_parms.ttis_per_subframe),
subframe_select(&ue->frame_parms,nr_tti_tx),
eNB_id,
0/*FIXME CC_id*/);
//#else
......
......@@ -1050,8 +1050,6 @@ typedef struct {
uint8_t numerology_index;
/// NR number of ttis per subframe deduced from numerology (cf 38.211): 1, 2, 4, 8(not supported),16(not supported),32(not supported)
uint8_t ttis_per_subframe;
/// NR number of slots per tti . Assumption only 2 Slot per TTI is supported (Slot Config 1 in 38.211)
uint8_t slots_per_tti;
/// NR TTI index within subframe_tx [0 .. ttis_per_subframe - 1] to act upon for transmission
nr_tti_t txNRTti;
/// NR TTI index within subframe_rx [0 .. ttis_per_subframe - 1] to act upon for reception
......
......@@ -435,7 +435,7 @@ int ue_query_mch(uint8_t Mod_id,uint8_t CC_id, uint32_t frame,sub_frame_t subfra
@param subframe subframe number
@returns 0 for no SR, 1 for SR
*/
void ue_get_sdu(module_id_t module_idP, int CC_id,frame_t frameP, sub_frame_t subframe, uint8_t eNB_index,uint8_t *ulsch_buffer,uint16_t buflen,uint8_t *access_mode);
void ue_get_sdu(module_id_t module_idP, int CC_id,frame_t frameP, sub_frame_t subframe, nr_tti_t nrTti, uint8_t eNB_index,uint8_t *ulsch_buffer,uint16_t buflen,uint8_t *access_mode);
/* \brief Function called by PHY to retrieve information to be transmitted using the RA procedure. If the UE is not in PUSCH mode for a particular eNB index, this is assumed to be an Msg3 and MAC attempts to retrieves the CCCH message from RRC. If the UE is in PUSCH mode for a particular eNB index and PUCCH format 0 (Scheduling Request) is not activated, the MAC may use this resource for random-access to transmit a BSR along with the C-RNTI control element (see 5.1.4 from 36.321)
@param Mod_id Index of UE instance
......
......@@ -93,6 +93,9 @@ void ue_init_mac(module_id_t module_idP)
// default values as deined in 36.331 sec 9.2.2
LOG_I(MAC,"[UE%d] Applying default macMainConfig\n",module_idP);
//UE_mac_inst[module_idP].scheduling_info.macConfig=NULL;
UE_mac_inst[module_idP].numerology_index = 0;
UE_mac_inst[module_idP].ttis_per_subframe = 1;
UE_mac_inst[module_idP].txLastAbsSubframe = 0xFFFFFFFF;
UE_mac_inst[module_idP].scheduling_info.retxBSR_Timer= RetxBSR_Timer_r12_sf10240;
UE_mac_inst[module_idP].scheduling_info.periodicBSR_Timer=PeriodicBSR_Timer_r12_infinity;
UE_mac_inst[module_idP].scheduling_info.periodicPHR_Timer = MAC_MainConfig__phr_Config__setup__periodicPHR_Timer_sf20;
......@@ -1276,7 +1279,7 @@ unsigned char generate_ulsch_header(uint8_t *mac_header,
}
void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index,uint8_t *ulsch_buffer,uint16_t buflen, uint8_t *access_mode)
void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframe, nr_tti_t nrTti, uint8_t eNB_index,uint8_t *ulsch_buffer,uint16_t buflen, uint8_t *access_mode)
{
uint8_t total_rlc_pdu_header_len=0, rlc_pdu_header_len_last=0 ;
......@@ -1307,9 +1310,8 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
int num_lcg_id_with_data = 0;
rlc_buffer_occupancy_t lcid_buffer_occupancy_old=0, lcid_buffer_occupancy_new=0;
LOG_D(MAC,"[UE %d] MAC PROCESS UL TRANSPORT BLOCK at frame%d subframe %d TBS=%d\n",
module_idP, frameP, subframe, buflen);
LOG_D(MAC,"[UE %d] MAC PROCESS UL TRANSPORT BLOCK at frame%d subframe %d nrtti%d TBS=%d\n",
module_idP, frameP, subframe, nrTti, buflen);
if (CC_id>0) {
LOG_E(MAC,"Transmission on secondary CCs is not supported yet\n");
......
......@@ -164,7 +164,7 @@ typedef struct {
#endif
/// Retrieve ULSCH sdu from MAC
void (*ue_get_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,sub_frame_t subframe, uint8_t CH_index,uint8_t *ulsch_buffer,uint16_t buflen,uint8_t *access_mode);
void (*ue_get_sdu)(module_id_t Mod_id,int CC_id,frame_t frameP,sub_frame_t subframe, nr_tti_t nrTti, uint8_t CH_index,uint8_t *ulsch_buffer,uint16_t buflen,uint8_t *access_mode);
/// Retrieve RRCConnectionReq from MAC
PRACH_RESOURCES_t* (*ue_get_rach)(module_id_t Mod_id,int CC_id,frame_t frameP,uint8_t Msg3_flag,sub_frame_t subframe);
......
......@@ -566,10 +566,10 @@ static void *UE_thread_rxn_txnp4(void *arg) {
ret = mac_xface->ue_scheduler(UE->Mod_id,
proc->frame_rx,
proc->subframe_rx,
proc->nr_tti_rx,
proc->nr_tti_rx,
proc->frame_tx,
proc->subframe_tx,
proc->nr_tti_tx,
proc->nr_tti_tx%(UE->frame_parms.ttis_per_subframe),
subframe_select(&UE->frame_parms,proc->subframe_tx),
0,
0/*FIXME CC_id*/);
......@@ -858,6 +858,7 @@ void *UE_thread(void *arg) {
proc->nr_tti_tx=(tti_nr+4)%(10*UE->frame_parms.ttis_per_subframe);
proc->subframe_rx=tti_nr>>((uint8_t)(log2 (UE->frame_parms.ttis_per_subframe)));
proc->frame_tx = proc->frame_rx + (proc->subframe_rx>5?1:0);
proc->subframe_tx=(proc->nr_tti_tx)>>((uint8_t)(log2 (UE->frame_parms.ttis_per_subframe)));
proc->timestamp_tx = timestamp+
(4*UE->frame_parms.samples_per_tti)-
UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0;
......
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