Commit 0b9c724a authored by Florian Kaltenberger's avatar Florian Kaltenberger

fixed scheduler for 2 CCs.


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6114 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent c9095bbe
...@@ -71,27 +71,27 @@ extern inline unsigned int taus(void); ...@@ -71,27 +71,27 @@ extern inline unsigned int taus(void);
void add_ue_dlsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t subframeP, UE_DLSCH_STATUS status){ void add_ue_dlsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t subframeP, UE_DLSCH_STATUS status){
eNB_dlsch_info[module_idP][UE_id].rnti = UE_RNTI(module_idP,UE_id); eNB_dlsch_info[module_idP][CC_id][UE_id].rnti = UE_RNTI(module_idP,UE_id);
// eNB_dlsch_info[module_idP][ue_mod_idP].weight = weight; // eNB_dlsch_info[module_idP][CC_id][ue_mod_idP].weight = weight;
eNB_dlsch_info[module_idP][UE_id].subframe = subframeP; eNB_dlsch_info[module_idP][CC_id][UE_id].subframe = subframeP;
eNB_dlsch_info[module_idP][UE_id].status = status; eNB_dlsch_info[module_idP][CC_id][UE_id].status = status;
eNB_dlsch_info[module_idP][UE_id].serving_num++; eNB_dlsch_info[module_idP][CC_id][UE_id].serving_num++;
} }
int schedule_next_dlue(module_id_t module_idP, sub_frame_t subframeP){ int schedule_next_dlue(module_id_t module_idP, int CC_id, sub_frame_t subframeP){
int next_ue; int next_ue;
UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list; UE_list_t *UE_list=&eNB_mac_inst[module_idP].UE_list;
for (next_ue=UE_list->head; next_ue>=0; next_ue=UE_list->next[next_ue] ){ for (next_ue=UE_list->head; next_ue>=0; next_ue=UE_list->next[next_ue] ){
if (eNB_dlsch_info[module_idP][next_ue].status == S_DL_WAITING) if (eNB_dlsch_info[module_idP][CC_id][next_ue].status == S_DL_WAITING)
return next_ue; return next_ue;
} }
for (next_ue=UE_list->head; next_ue>=0; next_ue=UE_list->next[next_ue] ){ for (next_ue=UE_list->head; next_ue>=0; next_ue=UE_list->next[next_ue] ){
if (eNB_dlsch_info[module_idP][next_ue].status == S_DL_BUFFERED) { if (eNB_dlsch_info[module_idP][CC_id][next_ue].status == S_DL_BUFFERED) {
eNB_dlsch_info[module_idP][next_ue].status = S_DL_WAITING; eNB_dlsch_info[module_idP][CC_id][next_ue].status = S_DL_WAITING;
} }
} }
...@@ -442,6 +442,7 @@ void schedule_ue_spec(module_id_t module_idP, ...@@ -442,6 +442,7 @@ void schedule_ue_spec(module_id_t module_idP,
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
LOG_D(MAC, "doing schedule_ue_spec for CC_id %d\n",CC_id);
if (mbsfn_flag[CC_id]>0) if (mbsfn_flag[CC_id]>0)
continue; continue;
for (UE_id=UE_list->head;UE_id>=0;UE_id=UE_list->next[UE_id]) { for (UE_id=UE_list->head;UE_id>=0;UE_id=UE_list->next[UE_id]) {
...@@ -1182,6 +1183,7 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP ...@@ -1182,6 +1183,7 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP
start_meas(&eNB->fill_DLSCH_dci); start_meas(&eNB->fill_DLSCH_dci);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_FILL_DLSCH_DCI,VCD_FUNCTION_IN); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_FILL_DLSCH_DCI,VCD_FUNCTION_IN);
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
LOG_D(MAC,"Doing fill DCI for CC_id %d\n",CC_id);
if (mbsfn_flagP[CC_id]>0) if (mbsfn_flagP[CC_id]>0)
continue; continue;
...@@ -1750,11 +1752,11 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP ...@@ -1750,11 +1752,11 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP
// UE specific DCIs // UE specific DCIs
for (UE_id=UE_list->head;UE_id>=0;UE_id=UE_list->next[UE_id]) { for (UE_id=UE_list->head;UE_id>=0;UE_id=UE_list->next[UE_id]) {
// printf("UE_id: %d => status %d\n",UE_id,eNB_dlsch_info[module_idP][UE_id].status); LOG_D(MAC,"CC_id %d, UE_id: %d => status %d\n",CC_id,UE_id,eNB_dlsch_info[module_idP][CC_id][UE_id].status);
if (eNB_dlsch_info[module_idP][UE_id].status == S_DL_SCHEDULED) { if (eNB_dlsch_info[module_idP][CC_id][UE_id].status == S_DL_SCHEDULED) {
// clear scheduling flag // clear scheduling flag
eNB_dlsch_info[module_idP][UE_id].status = S_DL_WAITING; eNB_dlsch_info[module_idP][CC_id][UE_id].status = S_DL_WAITING;
rnti = UE_RNTI(module_idP,UE_id); rnti = UE_RNTI(module_idP,UE_id);
mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0); mac_xface->get_ue_active_harq_pid(module_idP,CC_id,rnti,frameP,subframeP,&harq_pid,&round,0);
nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid];
......
...@@ -69,27 +69,29 @@ ...@@ -69,27 +69,29 @@
void init_ue_sched_info(void){ void init_ue_sched_info(void){
module_id_t i,j; module_id_t i,j,k;
for (i=0;i<NUMBER_OF_eNB_MAX;i++){ for (i=0;i<NUMBER_OF_eNB_MAX;i++){
for (k=0;i<MAX_NUM_CCs;i++){
for (j=0;j<NUMBER_OF_UE_MAX;j++){ for (j=0;j<NUMBER_OF_UE_MAX;j++){
// init DL // init DL
eNB_dlsch_info[i][j].weight = 0; eNB_dlsch_info[i][k][j].weight = 0;
eNB_dlsch_info[i][j].subframe = 0; eNB_dlsch_info[i][k][j].subframe = 0;
eNB_dlsch_info[i][j].serving_num = 0; eNB_dlsch_info[i][k][j].serving_num = 0;
eNB_dlsch_info[i][j].status = S_DL_NONE; eNB_dlsch_info[i][k][j].status = S_DL_NONE;
// init UL // init UL
eNB_ulsch_info[i][j].subframe = 0; eNB_ulsch_info[i][k][j].subframe = 0;
eNB_ulsch_info[i][j].serving_num = 0; eNB_ulsch_info[i][k][j].serving_num = 0;
eNB_ulsch_info[i][j].status = S_UL_NONE; eNB_ulsch_info[i][k][j].status = S_UL_NONE;
}
} }
} }
} }
unsigned char get_ue_weight(module_id_t module_idP, int ue_idP){ unsigned char get_ue_weight(module_id_t module_idP, int CC_id, int ue_idP){
return(eNB_dlsch_info[module_idP][ue_idP].weight); return(eNB_dlsch_info[module_idP][CC_id][ue_idP].weight);
} }
...@@ -235,8 +237,8 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP) { ...@@ -235,8 +237,8 @@ int add_new_ue(module_id_t mod_idP, int cc_idP, rnti_t rntiP,int harq_pidP) {
UE_list->UE_template[cc_idP][UE_id].oldNDI[j] = (j==0)?1:0; // 1 because first transmission is with format1A (Msg4) for harq_pid 0 UE_list->UE_template[cc_idP][UE_id].oldNDI[j] = (j==0)?1:0; // 1 because first transmission is with format1A (Msg4) for harq_pid 0
UE_list->UE_template[cc_idP][UE_id].oldNDI_UL[j] = (j==harq_pidP)?0:1; // 1st transmission is with Msg3; UE_list->UE_template[cc_idP][UE_id].oldNDI_UL[j] = (j==harq_pidP)?0:1; // 1st transmission is with Msg3;
} }
eNB_ulsch_info[mod_idP][UE_id].status = S_UL_WAITING; eNB_ulsch_info[mod_idP][cc_idP][UE_id].status = S_UL_WAITING;
eNB_dlsch_info[mod_idP][UE_id].status = S_UL_WAITING; eNB_dlsch_info[mod_idP][cc_idP][UE_id].status = S_UL_WAITING;
LOG_D(MAC,"[eNB %d] Add UE_id %d on Primary CC_id %d: rnti %x\n",mod_idP,UE_id,cc_idP,rntiP); LOG_D(MAC,"[eNB %d] Add UE_id %d on Primary CC_id %d: rnti %x\n",mod_idP,UE_id,cc_idP,rntiP);
dump_ue_list(UE_list,0); dump_ue_list(UE_list,0);
return(UE_id); return(UE_id);
...@@ -266,10 +268,10 @@ int mac_remove_ue(module_id_t mod_idP, int ue_idP) { ...@@ -266,10 +268,10 @@ int mac_remove_ue(module_id_t mod_idP, int ue_idP) {
UE_list->UE_template[pCC_id][ue_idP].ul_SR = 0; UE_list->UE_template[pCC_id][ue_idP].ul_SR = 0;
UE_list->UE_template[pCC_id][ue_idP].rnti = 0; UE_list->UE_template[pCC_id][ue_idP].rnti = 0;
UE_list->UE_template[pCC_id][ue_idP].ul_active = FALSE; UE_list->UE_template[pCC_id][ue_idP].ul_active = FALSE;
eNB_ulsch_info[mod_idP][ue_idP].rnti = 0; eNB_ulsch_info[mod_idP][pCC_id][ue_idP].rnti = 0;
eNB_ulsch_info[mod_idP][ue_idP].status = S_UL_NONE; eNB_ulsch_info[mod_idP][pCC_id][ue_idP].status = S_UL_NONE;
eNB_dlsch_info[mod_idP][ue_idP].rnti = 0; eNB_dlsch_info[mod_idP][pCC_id][ue_idP].rnti = 0;
eNB_dlsch_info[mod_idP][ue_idP].status = S_DL_NONE; eNB_dlsch_info[mod_idP][pCC_id][ue_idP].status = S_DL_NONE;
rrc_eNB_free_UE_index(mod_idP,ue_idP); rrc_eNB_free_UE_index(mod_idP,ue_idP);
......
...@@ -355,11 +355,11 @@ void adjust_bsr_info(int buffer_occupancy, ...@@ -355,11 +355,11 @@ void adjust_bsr_info(int buffer_occupancy,
void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t subframeP, UE_ULSCH_STATUS status){ void add_ue_ulsch_info(module_id_t module_idP, int CC_id, int UE_id, sub_frame_t subframeP, UE_ULSCH_STATUS status){
eNB_ulsch_info[module_idP][UE_id].rnti = UE_RNTI(module_idP,UE_id); eNB_ulsch_info[module_idP][CC_id][UE_id].rnti = UE_RNTI(module_idP,UE_id);
eNB_ulsch_info[module_idP][UE_id].subframe = subframeP; eNB_ulsch_info[module_idP][CC_id][UE_id].subframe = subframeP;
eNB_ulsch_info[module_idP][UE_id].status = status; eNB_ulsch_info[module_idP][CC_id][UE_id].status = status;
eNB_ulsch_info[module_idP][UE_id].serving_num++; eNB_ulsch_info[module_idP][CC_id][UE_id].serving_num++;
} }
......
...@@ -59,8 +59,8 @@ extern eNB_MAC_INST *eNB_mac_inst; ...@@ -59,8 +59,8 @@ extern eNB_MAC_INST *eNB_mac_inst;
extern MAC_RLC_XFACE *Mac_rlc_xface; extern MAC_RLC_XFACE *Mac_rlc_xface;
extern uint8_t Is_rrc_registered; extern uint8_t Is_rrc_registered;
extern eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8 extern eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
extern eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8 extern eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
......
...@@ -332,7 +332,7 @@ module_id_t schedule_next_ulue(module_id_t module_idP, int UE_id,sub_frame_t sub ...@@ -332,7 +332,7 @@ module_id_t schedule_next_ulue(module_id_t module_idP, int UE_id,sub_frame_t sub
@param subframe Subframe number on which to act @param subframe Subframe number on which to act
@returns UE index that is to be scheduled if needed/room @returns UE index that is to be scheduled if needed/room
*/ */
int schedule_next_dlue(module_id_t module_idP, sub_frame_t subframe); int schedule_next_dlue(module_id_t module_idP, int CC_id, sub_frame_t subframe);
/* \brief Allocates a set of PRBS for a particular UE. This is a simple function for the moment, later it should process frequency-domain CQI information and/or PMI information. Currently it just returns the first PRBS that are available in the subframe based on the number requested. /* \brief Allocates a set of PRBS for a particular UE. This is a simple function for the moment, later it should process frequency-domain CQI information and/or PMI information. Currently it just returns the first PRBS that are available in the subframe based on the number requested.
@param UE_id Index of UE on which to act @param UE_id Index of UE on which to act
...@@ -359,7 +359,7 @@ uint32_t req_new_ulsch(module_id_t module_idP); ...@@ -359,7 +359,7 @@ uint32_t req_new_ulsch(module_id_t module_idP);
*/ */
uint32_t ue_get_SR(module_id_t module_idP, int CC_id,frame_t frameP, uint8_t eNB_id,rnti_t rnti,sub_frame_t subframe); uint32_t ue_get_SR(module_id_t module_idP, int CC_id,frame_t frameP, uint8_t eNB_id,rnti_t rnti,sub_frame_t subframe);
uint8_t get_ue_weight(module_id_t module_idP, int UE_id); uint8_t get_ue_weight(module_id_t module_idP, int CC_id, int UE_id);
// UE functions // UE functions
void mac_out_of_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t CH_index); void mac_out_of_sync_ind(module_id_t module_idP, frame_t frameP, uint16_t CH_index);
......
...@@ -66,8 +66,8 @@ int pCC_id[NUMBER_OF_eNB_MAX]; ...@@ -66,8 +66,8 @@ int pCC_id[NUMBER_OF_eNB_MAX];
eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8 eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8 eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
/* /*
#ifndef USER_MODE #ifndef USER_MODE
......
...@@ -650,9 +650,11 @@ boolean_t pdcp_data_ind( ...@@ -650,9 +650,11 @@ boolean_t pdcp_data_ind(
pdcp_p->last_submitted_pdcp_rx_sn = sequence_number; pdcp_p->last_submitted_pdcp_rx_sn = sequence_number;
} }
#if defined(DEBUG_PDCP_PAYLOAD)
rlc_util_print_hex_octets(PDCP, rlc_util_print_hex_octets(PDCP,
(unsigned char*)&sdu_buffer_pP->data[payload_offset], (unsigned char*)&sdu_buffer_pP->data[payload_offset],
sdu_buffer_sizeP - payload_offset); sdu_buffer_sizeP - payload_offset);
#endif
src_id = (enb_flagP == ENB_FLAG_NO) ? enb_mod_idP : ue_mod_idP + NB_eNB_INST; src_id = (enb_flagP == ENB_FLAG_NO) ? enb_mod_idP : ue_mod_idP + NB_eNB_INST;
dst_id = (enb_flagP == ENB_FLAG_NO) ? ue_mod_idP + NB_eNB_INST: enb_mod_idP; dst_id = (enb_flagP == ENB_FLAG_NO) ? ue_mod_idP + NB_eNB_INST: enb_mod_idP;
......
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