Commit 17500573 authored by Stefan's avatar Stefan

SSR 2019-01-14

parent 7db6ac93
...@@ -305,7 +305,6 @@ subframe2harqpid(COMMON_channels_t *cc, ...@@ -305,7 +305,6 @@ subframe2harqpid(COMMON_channels_t *cc,
} else { } else {
switch (cc->tdd_Config->subframeAssignment) { switch (cc->tdd_Config->subframeAssignment) {
case 1: case 1:
if ((subframe == 2) || (subframe == 3) || (subframe == 7) || (subframe == 8))
switch (subframe) { switch (subframe) {
case 2: case 2:
case 3: case 3:
...@@ -322,7 +321,6 @@ subframe2harqpid(COMMON_channels_t *cc, ...@@ -322,7 +321,6 @@ subframe2harqpid(COMMON_channels_t *cc,
subframe, (int) cc->tdd_Config->subframeAssignment); subframe, (int) cc->tdd_Config->subframeAssignment);
break; break;
} }
break; break;
case 2: case 2:
...@@ -2622,11 +2620,19 @@ int get_nb_subband(int N_RB_DL) { ...@@ -2622,11 +2620,19 @@ int get_nb_subband(int N_RB_DL) {
return nb_sb; return nb_sb;
} }
/*
void init_CCE_table(int module_idP, int CC_idP) { void
init_CCE_table(int module_idP,
int CC_idP)
{
memset(RC.mac[module_idP]->CCE_table[CC_idP], 0, 800 * sizeof(int)); memset(RC.mac[module_idP]->CCE_table[CC_idP], 0, 800 * sizeof(int));
} }
*/
void
init_CCE_table(int *CCE_table)
{
memset(CCE_table, 0, 800 * sizeof(int));
}
int int
get_nCCE_offset(int *CCE_table, get_nCCE_offset(int *CCE_table,
...@@ -2895,19 +2901,21 @@ allocate_CCEs(int module_idP, ...@@ -2895,19 +2901,21 @@ allocate_CCEs(int module_idP,
sub_frame_t subframeP, sub_frame_t subframeP,
int test_onlyP) int test_onlyP)
{ {
int *CCE_table = RC.mac[module_idP]->CCE_table[CC_idP]; eNB_MAC_INST *eNB = RC.mac[module_idP];
nfapi_dl_config_request_body_t *DL_req = &RC.mac[module_idP]->DL_req[CC_idP].dl_config_request_body; int *CCE_table = eNB->CCE_table[CC_idP];
nfapi_hi_dci0_request_body_t *HI_DCI0_req = &RC.mac[module_idP]->HI_DCI0_req[CC_idP][subframeP].hi_dci0_request_body; nfapi_dl_config_request_body_t *DL_req = &eNB->DL_req[CC_idP].dl_config_request_body;
nfapi_hi_dci0_request_body_t *HI_DCI0_req = &eNB->HI_DCI0_req[CC_idP][subframeP].hi_dci0_request_body;
nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req->dl_config_pdu_list[0]; nfapi_dl_config_request_pdu_t *dl_config_pdu = &DL_req->dl_config_pdu_list[0];
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[0]; nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[0];
int nCCE_max = get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP], 1, subframeP); COMMON_channels_t *cc = &eNB->common_channels[CC_idP];
int nCCE_max = get_nCCE_max(cc, 1, subframeP);
int fCCE; int fCCE;
int i, j, idci; int i, j, idci;
int nCCE = 0; int nCCE = 0;
int max_symbol; int max_symbol;
eNB_MAC_INST *eNB = RC.mac[module_idP];
COMMON_channels_t *cc = &eNB->common_channels[CC_idP];
int ackNAK_absSF = get_pucch1_absSF(cc, (frameP*10+subframeP)); int ackNAK_absSF = get_pucch1_absSF(cc, (frameP*10+subframeP));
nfapi_dl_config_request_pdu_t *dl_config_pduLoop;
nfapi_hi_dci0_request_pdu_t *hi_dci0_pduLoop;
if (cc->tdd_Config!=NULL && is_S_sf(cc,subframeP) > 0) if (cc->tdd_Config!=NULL && is_S_sf(cc,subframeP) > 0)
max_symbol = 2; max_symbol = 2;
...@@ -2916,83 +2924,94 @@ allocate_CCEs(int module_idP, ...@@ -2916,83 +2924,94 @@ allocate_CCEs(int module_idP,
nfapi_ul_config_request_body_t *ul_req = &eNB->UL_req_tmp[CC_idP][ackNAK_absSF % 10].ul_config_request_body; nfapi_ul_config_request_body_t *ul_req = &eNB->UL_req_tmp[CC_idP][ackNAK_absSF % 10].ul_config_request_body;
LOG_D(MAC, "Allocate CCEs subframe %d, test %d : (DL PDU %d, DL DCI %d, UL %d)\n", LOG_D(MAC, "Allocate CCEs subframe %d, test %d : (DL PDU %d, DL DCI %d, UL %d)\n",
subframeP, test_onlyP, DL_req->number_pdu, DL_req->number_dci, subframeP,
test_onlyP,
DL_req->number_pdu,
DL_req->number_dci,
HI_DCI0_req->number_of_dci); HI_DCI0_req->number_of_dci);
DL_req->number_pdcch_ofdm_symbols = 1; DL_req->number_pdcch_ofdm_symbols = 1;
try_again: try_again:
init_CCE_table(module_idP, CC_idP); init_CCE_table(CCE_table);
nCCE = 0; nCCE = 0;
for (i = 0, idci = 0; i < DL_req->number_pdu; i++) { for (i = 0, idci = 0; i < DL_req->number_pdu; i++) {
dl_config_pduLoop = &dl_config_pdu[i];
// allocate DL common DCIs first // allocate DL common DCIs first
if ((dl_config_pdu[i].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE) && if (dl_config_pduLoop->pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE &&
(dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type == 2)) { dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type == 2) {
LOG_D(MAC, "Trying to allocate COMMON DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", LOG_D(MAC, "Trying to allocate COMMON DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n",
idci, DL_req->number_dci + HI_DCI0_req->number_of_dci, idci,
DL_req->number_dci, HI_DCI0_req->number_of_dci, DL_req->number_dci + HI_DCI0_req->number_of_dci,
dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti, DL_req->number_dci,
dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, HI_DCI0_req->number_of_dci,
nCCE, nCCE_max, DL_req->number_pdcch_ofdm_symbols); dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.rnti,
dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,
nCCE,
nCCE_max,
DL_req->number_pdcch_ofdm_symbols);
if (nCCE + (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level) > nCCE_max) { if (nCCE + (dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level) > nCCE_max) {
if (DL_req->number_pdcch_ofdm_symbols == max_symbol) if (DL_req->number_pdcch_ofdm_symbols == max_symbol)
return -1; return -1;
LOG_D(MAC, "Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n", LOG_D(MAC, "Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n",
DL_req->number_pdcch_ofdm_symbols); DL_req->number_pdcch_ofdm_symbols);
DL_req->number_pdcch_ofdm_symbols++; DL_req->number_pdcch_ofdm_symbols++;
nCCE_max = nCCE_max = get_nCCE_max(cc, DL_req->number_pdcch_ofdm_symbols, subframeP);
get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP], DL_req->number_pdcch_ofdm_symbols, subframeP);
goto try_again; goto try_again;
} }
// number of CCEs left can potentially hold this allocation // number of CCEs left can potentially hold this allocation
fCCE = get_nCCE_offset(CCE_table, fCCE = get_nCCE_offset(CCE_table,
dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8. dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,
aggregation_level, nCCE_max, 1, nCCE_max,
dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti, 1,
dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.rnti,
subframeP); subframeP);
if (fCCE == -1) { if (fCCE == -1) {
if (DL_req->number_pdcch_ofdm_symbols == max_symbol) { if (DL_req->number_pdcch_ofdm_symbols == max_symbol) {
LOG_D(MAC, "subframe %d: Dropping Allocation for RNTI %x\n", LOG_D(MAC, "subframe %d: Dropping Allocation for RNTI %x\n",
subframeP, dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti); subframeP,
dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.rnti);
for (j = 0; j <= i; j++) { for (j = 0; j <= i; j++) {
if (dl_config_pdu[j].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE) dl_config_pduLoop = &dl_config_pdu[j];
if (dl_config_pduLoop->pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE)
LOG_D(MAC, "DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", LOG_D(MAC, "DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n",
j, j,
DL_req->number_dci + HI_DCI0_req->number_of_dci, DL_req->number_dci + HI_DCI0_req->number_of_dci,
DL_req->number_dci, DL_req->number_dci,
HI_DCI0_req->number_of_dci, HI_DCI0_req->number_of_dci,
dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.rnti, dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.rnti,
dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.dci_format, dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.dci_format,
dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,
nCCE, nCCE_max, DL_req->number_pdcch_ofdm_symbols); nCCE, nCCE_max, DL_req->number_pdcch_ofdm_symbols);
} }
//dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L); //dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L);
return -1; return -1;
} }
LOG_D(MAC, LOG_D(MAC, "Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n",
"Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n",
DL_req->number_pdcch_ofdm_symbols); DL_req->number_pdcch_ofdm_symbols);
DL_req->number_pdcch_ofdm_symbols++; DL_req->number_pdcch_ofdm_symbols++;
nCCE_max = nCCE_max = get_nCCE_max(cc, DL_req->number_pdcch_ofdm_symbols, subframeP);
get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP], DL_req->number_pdcch_ofdm_symbols, subframeP);
goto try_again; goto try_again;
} // fCCE==-1 } // fCCE==-1
// the allocation is feasible, rnti rule passes // the allocation is feasible, rnti rule passes
nCCE += dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level; nCCE += dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level;
LOG_D(MAC, "Allocating at nCCE %d\n", fCCE); LOG_D(MAC, "Allocating at nCCE %d\n", fCCE);
if ((test_onlyP%2) == 0) { if ((test_onlyP%2) == 0) {
dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.cce_idx = fCCE; dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx = fCCE;
LOG_D(MAC, "Allocate COMMON DCI CCEs subframe %d, test %d => L %d fCCE %d\n", LOG_D(MAC, "Allocate COMMON DCI CCEs subframe %d, test %d => L %d fCCE %d\n",
subframeP, test_onlyP, dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, fCCE); subframeP,
test_onlyP,
dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,
fCCE);
} }
idci++; idci++;
...@@ -3001,50 +3020,55 @@ try_again: ...@@ -3001,50 +3020,55 @@ try_again:
// no try to allocate UL DCIs // no try to allocate UL DCIs
for (i = 0; i < HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi; i++) { for (i = 0; i < HI_DCI0_req->number_of_dci + HI_DCI0_req->number_of_hi; i++) {
hi_dci0_pduLoop = &hi_dci0_pdu[i];
// allocate UL DCIs // allocate UL DCIs
if (hi_dci0_pdu[i].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) { if (hi_dci0_pdu[i].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) {
LOG_D(MAC, "Trying to allocate format 0 DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", LOG_D(MAC, "Trying to allocate format 0 DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n",
idci, DL_req->number_dci + HI_DCI0_req->number_of_dci, idci,
DL_req->number_dci, HI_DCI0_req->number_of_dci, DL_req->number_dci + HI_DCI0_req->number_of_dci,
hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti, DL_req->number_dci,
hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level, HI_DCI0_req->number_of_dci,
nCCE, nCCE_max, DL_req->number_pdcch_ofdm_symbols); hi_dci0_pduLoop->dci_pdu.dci_pdu_rel8.rnti,
hi_dci0_pduLoop->dci_pdu.dci_pdu_rel8.aggregation_level,
nCCE, nCCE_max,
DL_req->number_pdcch_ofdm_symbols);
if (nCCE + (hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level) > nCCE_max) { if (nCCE + hi_dci0_pduLoop->dci_pdu.dci_pdu_rel8.aggregation_level > nCCE_max) {
if (DL_req->number_pdcch_ofdm_symbols == max_symbol) if (DL_req->number_pdcch_ofdm_symbols == max_symbol)
return -1; return -1;
LOG_D(MAC, "Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n", LOG_D(MAC, "Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n",
DL_req->number_pdcch_ofdm_symbols); DL_req->number_pdcch_ofdm_symbols);
DL_req->number_pdcch_ofdm_symbols++; DL_req->number_pdcch_ofdm_symbols++;
nCCE_max = nCCE_max = get_nCCE_max(cc, DL_req->number_pdcch_ofdm_symbols, subframeP);
get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP], DL_req->number_pdcch_ofdm_symbols, subframeP);
goto try_again; goto try_again;
} }
// number of CCEs left can potentially hold this allocation // number of CCEs left can potentially hold this allocation
fCCE = get_nCCE_offset(CCE_table, fCCE = get_nCCE_offset(CCE_table,
hi_dci0_pdu[i].dci_pdu. hi_dci0_pduLoop->dci_pdu.dci_pdu_rel8.aggregation_level,
dci_pdu_rel8.aggregation_level, nCCE_max,
nCCE_max, 0, 0,
hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8. hi_dci0_pduLoop->dci_pdu.dci_pdu_rel8.rnti,
rnti, subframeP); subframeP);
if (fCCE == -1) { if (fCCE == -1) {
if (DL_req->number_pdcch_ofdm_symbols == max_symbol) { if (DL_req->number_pdcch_ofdm_symbols == max_symbol) {
LOG_D(MAC, "subframe %d: Dropping Allocation for RNTI %x\n", LOG_D(MAC, "subframe %d: Dropping Allocation for RNTI %x\n",
subframeP, hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.rnti); subframeP,
hi_dci0_pduLoop->dci_pdu.dci_pdu_rel8.rnti);
for (j = 0; j <= i; j++) { for (j = 0; j <= i; j++) {
hi_dci0_pduLoop = &hi_dci0_pdu[j];
if (hi_dci0_pdu[j].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE) if (hi_dci0_pdu[j].pdu_type == NFAPI_HI_DCI0_DCI_PDU_TYPE)
LOG_D(MAC, "DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", LOG_D(MAC, "DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n",
j, j,
DL_req->number_dci + HI_DCI0_req->number_of_dci, DL_req->number_dci + HI_DCI0_req->number_of_dci,
DL_req->number_dci, DL_req->number_dci,
HI_DCI0_req->number_of_dci, HI_DCI0_req->number_of_dci,
hi_dci0_pdu[j].dci_pdu.dci_pdu_rel8.rnti, hi_dci0_pduLoop->dci_pdu.dci_pdu_rel8.rnti,
hi_dci0_pdu[j].dci_pdu.dci_pdu_rel8.dci_format, hi_dci0_pduLoop->dci_pdu.dci_pdu_rel8.dci_format,
hi_dci0_pdu[j].dci_pdu.dci_pdu_rel8.aggregation_level, hi_dci0_pduLoop->dci_pdu.dci_pdu_rel8.aggregation_level,
nCCE, nCCE_max, DL_req->number_pdcch_ofdm_symbols); nCCE, nCCE_max, DL_req->number_pdcch_ofdm_symbols);
} }
//dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L); //dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<<dci_alloc->L);
...@@ -3054,18 +3078,20 @@ try_again: ...@@ -3054,18 +3078,20 @@ try_again:
LOG_D(MAC, "Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n", LOG_D(MAC, "Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n",
DL_req->number_pdcch_ofdm_symbols); DL_req->number_pdcch_ofdm_symbols);
DL_req->number_pdcch_ofdm_symbols++; DL_req->number_pdcch_ofdm_symbols++;
nCCE_max = nCCE_max = get_nCCE_max(cc, DL_req->number_pdcch_ofdm_symbols, subframeP);
get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP], DL_req->number_pdcch_ofdm_symbols, subframeP);
goto try_again; goto try_again;
} // fCCE==-1 } // fCCE==-1
// the allocation is feasible, rnti rule passes // the allocation is feasible, rnti rule passes
nCCE += hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.aggregation_level; nCCE += hi_dci0_pduLoop->dci_pdu.dci_pdu_rel8.aggregation_level;
LOG_D(MAC, "Allocating at nCCE %d\n", fCCE); LOG_D(MAC, "Allocating at nCCE %d\n",
fCCE);
if ((test_onlyP%2) == 0) { if ((test_onlyP%2) == 0) {
hi_dci0_pdu[i].dci_pdu.dci_pdu_rel8.cce_index = fCCE; hi_dci0_pduLoop->dci_pdu.dci_pdu_rel8.cce_index = fCCE;
LOG_D(MAC, "Allocate CCEs subframe %d, test %d\n", subframeP, test_onlyP); LOG_D(MAC, "Allocate CCEs subframe %d, test %d\n",
subframeP,
test_onlyP);
} }
idci++; idci++;
...@@ -3073,51 +3099,56 @@ try_again: ...@@ -3073,51 +3099,56 @@ try_again:
} // for i = 0 ... num_UL_DCIs } // for i = 0 ... num_UL_DCIs
for (i = 0; i < DL_req->number_pdu; i++) { for (i = 0; i < DL_req->number_pdu; i++) {
dl_config_pduLoop = &dl_config_pdu[i];
// allocate DL UE specific DCIs // allocate DL UE specific DCIs
if ((dl_config_pdu[i].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE) if ((dl_config_pdu[i].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE)
&& (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type == && (dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type == 1)) {
1)) {
LOG_D(MAC, "Trying to allocate DL UE-SPECIFIC DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", LOG_D(MAC, "Trying to allocate DL UE-SPECIFIC DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n",
idci, DL_req->number_dci + HI_DCI0_req->number_of_dci, idci,
DL_req->number_dci + HI_DCI0_req->number_of_dci,
DL_req->number_dci, HI_DCI0_req->number_of_dci, DL_req->number_dci, HI_DCI0_req->number_of_dci,
dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti, dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.rnti,
dl_config_pdu[i].dci_dl_pdu. dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,
dci_dl_pdu_rel8.aggregation_level, nCCE, nCCE_max, nCCE,
nCCE_max,
DL_req->number_pdcch_ofdm_symbols); DL_req->number_pdcch_ofdm_symbols);
if (nCCE + (dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level) > nCCE_max) { if (nCCE + (dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level) > nCCE_max) {
if (DL_req->number_pdcch_ofdm_symbols == max_symbol) if (DL_req->number_pdcch_ofdm_symbols == max_symbol)
return -1; return -1;
LOG_D(MAC, "Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n", DL_req->number_pdcch_ofdm_symbols); LOG_D(MAC, "Can't fit DCI allocations with %d PDCCH symbols, increasing by 1\n",
DL_req->number_pdcch_ofdm_symbols);
DL_req->number_pdcch_ofdm_symbols++; DL_req->number_pdcch_ofdm_symbols++;
nCCE_max = nCCE_max = get_nCCE_max(cc, DL_req->number_pdcch_ofdm_symbols, subframeP);
get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP], DL_req->number_pdcch_ofdm_symbols, subframeP);
goto try_again; goto try_again;
} }
// number of CCEs left can potentially hold this allocation // number of CCEs left can potentially hold this allocation
fCCE = get_nCCE_offset(CCE_table, fCCE = get_nCCE_offset(CCE_table,
dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level, nCCE_max, 0, dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,
dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti, nCCE_max,
0,
dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.rnti,
subframeP); subframeP);
if (fCCE == -1) { if (fCCE == -1) {
if (DL_req->number_pdcch_ofdm_symbols == max_symbol) { if (DL_req->number_pdcch_ofdm_symbols == max_symbol) {
LOG_I(MAC, "subframe %d: Dropping Allocation for RNTI %x\n", LOG_I(MAC, "subframe %d: Dropping Allocation for RNTI %x\n",
subframeP, dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti); subframeP,
dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.rnti);
for (j = 0; j <= i; j++) { for (j = 0; j <= i; j++) {
if (dl_config_pdu[j].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE) dl_config_pduLoop = &dl_config_pdu[j];
if (dl_config_pduLoop->pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE)
LOG_D(MAC, "DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", LOG_D(MAC, "DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n",
j, j,
DL_req->number_dci + HI_DCI0_req->number_of_dci, DL_req->number_dci + HI_DCI0_req->number_of_dci,
DL_req->number_dci, DL_req->number_dci,
HI_DCI0_req->number_of_dci, HI_DCI0_req->number_of_dci,
dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.rnti, dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.rnti,
dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8.dci_format, dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.dci_format,
dl_config_pdu[j].dci_dl_pdu.dci_dl_pdu_rel8. dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level,
aggregation_level,
nCCE, nCCE,
nCCE_max, nCCE_max,
DL_req->number_pdcch_ofdm_symbols); DL_req->number_pdcch_ofdm_symbols);
...@@ -3129,18 +3160,20 @@ try_again: ...@@ -3129,18 +3160,20 @@ try_again:
LOG_D(MAC, "Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n", LOG_D(MAC, "Can't fit DCI allocations with %d PDCCH symbols (rnti condition), increasing by 1\n",
DL_req->number_pdcch_ofdm_symbols); DL_req->number_pdcch_ofdm_symbols);
DL_req->number_pdcch_ofdm_symbols++; DL_req->number_pdcch_ofdm_symbols++;
nCCE_max = nCCE_max = get_nCCE_max(cc, DL_req->number_pdcch_ofdm_symbols, subframeP);
get_nCCE_max(&RC.mac[module_idP]->common_channels[CC_idP], DL_req->number_pdcch_ofdm_symbols, subframeP);
goto try_again; goto try_again;
} // fCCE==-1 } // fCCE==-1
// the allocation is feasible, rnti rule passes // the allocation is feasible, rnti rule passes
nCCE += dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level; nCCE += dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.aggregation_level;
LOG_D(MAC, "Allocating at nCCE %d\n", fCCE); LOG_D(MAC, "Allocating at nCCE %d\n",
fCCE);
if ((test_onlyP%2) == 0) { if ((test_onlyP%2) == 0) {
dl_config_pdu[i].dci_dl_pdu.dci_dl_pdu_rel8.cce_idx = fCCE; dl_config_pduLoop->dci_dl_pdu.dci_dl_pdu_rel8.cce_idx = fCCE;
LOG_D(MAC, "Allocate CCEs subframe %d, test %d\n", subframeP, test_onlyP); LOG_D(MAC, "Allocate CCEs subframe %d, test %d\n",
subframeP,
test_onlyP);
} }
if ((test_onlyP/2) == 1) { if ((test_onlyP/2) == 1) {
......
...@@ -444,7 +444,7 @@ uint8_t get_aggregation(uint8_t bw_index, uint8_t cqi, uint8_t dci_fmt); ...@@ -444,7 +444,7 @@ uint8_t get_aggregation(uint8_t bw_index, uint8_t cqi, uint8_t dci_fmt);
int8_t find_active_UEs_with_traffic(module_id_t module_idP); int8_t find_active_UEs_with_traffic(module_id_t module_idP);
void init_CCE_table(int module_idP, int CC_idP); void init_CCE_table(int *CCE_table);
int get_nCCE_offset(int *CCE_table, int get_nCCE_offset(int *CCE_table,
const unsigned char L, const unsigned char L,
......
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