Commit c4b7d4c1 authored by knopp's avatar knopp
Browse files

updates to UL (DFTs for 10/20 MHz), Ndi toggling, DCI structures

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4600 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 21635af2
......@@ -185,8 +185,9 @@ void sub_block_deinterleaving_turbo(uint32_t D,int16_t *d,int16_t *w) {
k++;k2++;k2++;
}
}
if (ND>0)
d[2] = LTE_NULL;//d[(3*D)+2];
// if (ND>0)
// d[2] = LTE_NULL;//d[(3*D)+2];
}
......@@ -476,19 +477,19 @@ uint32_t lte_rate_matching_turbo(uint32_t RTC,
k=0;
for (;(ind<Ncb)&&(k<E);ind++) {
e2[k]=w[ind];
// e2[k]=w[ind];
#ifdef RM_DEBUG_TX
printf("RM_TX k%d Ind: %d (%d)\n",k,ind,w[ind]);
#endif
if (w[ind] != LTE_NULL) k++;
if (w[ind] != LTE_NULL) e2[k++]=w[ind];
}
while(k<E) {
for (ind=0;(ind<Ncb)&&(k<E);ind++) {
e2[k] = w[ind];
// e2[k] = w[ind];
#ifdef RM_DEBUG_TX
printf("RM_TX k%d Ind: %d (%d)\n",k,ind,w[ind]);
#endif
if (w[ind] != LTE_NULL) k++;
if (w[ind] != LTE_NULL) e2[k++]=w[ind];
}
}
/*
......
......@@ -1963,7 +1963,7 @@ u8 get_num_pdcch_symbols(u8 num_dci,
// compute numCCE
for (i=0;i<num_dci;i++) {
// printf("dci %d => %d\n",i,dci_alloc[i].L);
// printf("dci %d => %d\n",i,dci_alloc[i].L);
numCCE += (1<<(dci_alloc[i].L));
}
......@@ -2017,11 +2017,6 @@ u8 generate_dci_top(u8 num_ue_spec_dci,
mod_sym_t *y[2];
mod_sym_t *wbar[2];
#ifdef IFFT_FPGA
u8 qpsk_table_offset = 0;
u8 qpsk_table_offset2 = 0;
#endif
int nushiftmod3 = frame_parms->nushift%3;
int Msymb2;
......@@ -2129,7 +2124,7 @@ u8 generate_dci_top(u8 num_ue_spec_dci,
e_ptr = e;
if (frame_parms->mode1_flag) { //SISO
#ifndef IFFT_FPGA
for (i=0;i<Msymb2;i++) {
//((s16*)(&(y[0][i])))[0] = (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK;
//((s16*)(&(y[1][i])))[0] = (*e_ptr == 1) ? -gain_lin_QPSK : gain_lin_QPSK;
......@@ -2144,25 +2139,10 @@ u8 generate_dci_top(u8 num_ue_spec_dci,
e_ptr++;
}
#else
for (i=0;i<Msymb2;i++) {
qpsk_table_offset = MOD_TABLE_QPSK_OFFSET;
if (*e_ptr == 1)
qpsk_table_offset+=2;
e_ptr++;
if (*e_ptr == 1)
qpsk_table_offset+=1;
e_ptr++;
y[0][i] = (mod_sym_t) qpsk_table_offset;
y[1][i] = (mod_sym_t) qpsk_table_offset;
}
#endif
}
else { //ALAMOUTI
#ifndef IFFT_FPGA
for (i=0;i<Msymb2;i+=2) {
#ifdef DEBUG_DCI_ENCODING
......@@ -2187,49 +2167,6 @@ u8 generate_dci_top(u8 num_ue_spec_dci,
((s16*)&y[1][i+1])[1] = -((s16*)&y[0][i])[1];
}
#else
for (i=0;i<Msymb2;i+=2) {
#ifdef DEBUG_DCI_ENCODING
LOG_I(PHY," PDCCH Modulation: Symbol %d : REG %d/%d\n",i,i>>2,Msymb2>>2);
#endif
qpsk_table_offset = MOD_TABLE_QPSK_OFFSET; //x0
qpsk_table_offset2 = MOD_TABLE_QPSK_OFFSET; //x0*
if (*e_ptr == 1) { //real
qpsk_table_offset+=2;
qpsk_table_offset2+=2;
}
e_ptr++;
if (*e_ptr == 1) //imag
qpsk_table_offset+=1;
else
qpsk_table_offset2+=1;
e_ptr++;
y[0][i] = (mod_sym_t) qpsk_table_offset; // x0
y[1][i+1] = (mod_sym_t) qpsk_table_offset2; // x0*
qpsk_table_offset = MOD_TABLE_QPSK_OFFSET; //-x1*
qpsk_table_offset2 = MOD_TABLE_QPSK_OFFSET; //x1
if (*e_ptr == 1) // flipping bit for real part of symbol means taking -x1*
qpsk_table_offset2+=2;
else
qpsk_table_offset+=2;
e_ptr++;
if (*e_ptr == 1) {
qpsk_table_offset+=1;
qpsk_table_offset2+=1;
}
e_ptr++;
y[1][i] = (mod_sym_t) qpsk_table_offset; // -x1*
y[0][i+1] = (mod_sym_t) qpsk_table_offset2; // x1
}
#endif
}
......@@ -2243,23 +2180,14 @@ u8 generate_dci_top(u8 num_ue_spec_dci,
mprime=0;
nsymb = (frame_parms->Ncp==0) ? 14:12;
#ifdef IFFT_FPGA
re_offset = frame_parms->N_RB_DL*12/2;
#else
re_offset = frame_parms->first_carrier_offset;
#endif
// This is the REG allocation algorithm from 36-211, second part of Section 6.8.5
// printf("DCI : txdataF %p (0 %p)\n",&txdataF[0][512*14*subframe],&txdataF[0][0]);
// printf("DCI (SF %d) : txdataF %p (0 %p)\n",subframe,&txdataF[0][512*14*subframe],&txdataF[0][0]);
for (kprime=0;kprime<frame_parms->N_RB_DL*12;kprime++) {
for (lprime=0;lprime<num_pdcch_symbols;lprime++) {
#ifdef IFFT_FPGA
symbol_offset = (u32)frame_parms->N_RB_DL*12*(lprime+(subframe*nsymb));
#else
symbol_offset = (u32)frame_parms->ofdm_symbol_size*(lprime+(subframe*nsymb));
#endif
......@@ -2353,14 +2281,8 @@ u8 generate_dci_top(u8 num_ue_spec_dci,
} //lprime loop
re_offset++;
#ifdef IFFT_FPGA
if (re_offset == (frame_parms->N_RB_DL*12))
re_offset = 0;
#else
if (re_offset == (frame_parms->ofdm_symbol_size))
re_offset = 1;
#endif
} // kprime loop
return(num_pdcch_symbols);
}
......
......@@ -100,9 +100,7 @@ typedef struct DCI0_1_5MHz_TDD_1_6 DCI0_1_5MHz_TDD_1_6_t;
/// DCI Format Type 1A (1.5 MHz, TDD, frame 1-6, 24 bits)
struct DCI1A_1_5MHz_TDD_1_6 {
/// padding
uint32_t padding:8;
/// SRS request bit
uint32_t srs_req:1;
uint32_t padding:9;
/// Downlink Assignment Index
uint32_t dai:2;
/// Power Control
......@@ -212,9 +210,7 @@ typedef struct DCI0_10MHz_TDD_1_6 DCI0_10MHz_TDD_1_6_t;
/// DCI Format Type 1A (10 MHz, TDD, frame 1-6, 30 bits)
struct DCI1A_10MHz_TDD_1_6 {
/// padding
uint32_t padding:2;
/// SRS request bit
uint32_t srs_req:1;
uint32_t padding:3;
/// Downlink Assignment Index
uint32_t dai:2;
/// Power Control
......@@ -243,7 +239,7 @@ typedef struct DCI1A_10MHz_TDD_1_6 DCI1A_10MHz_TDD_1_6_t;
struct DCI0_20MHz_TDD_1_6 {
/// Padding
uint32_t padding:2;
/// CQI Request
/// CQI request
uint32_t cqi_req:1;
/// DAI
uint32_t dai:2;
......@@ -268,8 +264,7 @@ typedef struct DCI0_20MHz_TDD_1_6 DCI0_20MHz_TDD_1_6_t;
/// DCI Format Type 1A (20 MHz, TDD, frame 1-6, 27 bits)
struct DCI1A_20MHz_TDD_1_6 {
/// SRS request bit
uint32_t srs_req:1;
uint32_t padding:1;
/// Downlink Assignment Index
uint32_t dai:2;
/// Power Control
......@@ -321,9 +316,7 @@ typedef struct DCI0_1_5MHz_FDD DCI0_1_5MHz_FDD_t;
struct DCI1A_1_5MHz_FDD {
/// padding
uint32_t padding:11;
/// Downlink Assignment Index
uint32_t srs_req:1;
uint32_t padding:12;
/// Power Control
uint32_t TPC:2;
/// Redundancy version
......@@ -374,9 +367,7 @@ typedef struct DCI0_5MHz_FDD DCI0_5MHz_FDD_t;
struct DCI1A_5MHz_FDD {
/// padding
uint32_t padding:7;
/// Downlink Assignment Index
uint32_t srs_req:1;
uint32_t padding:8;
/// Power Control
uint32_t TPC:2;
/// Redundancy version
......@@ -428,9 +419,7 @@ typedef struct DCI0_10MHz_FDD DCI0_10MHz_FDD_t;
struct DCI1A_10MHz_FDD {
/// padding
uint32_t padding:5;
/// Downlink Assignment Index
uint32_t srs_req:1;
uint32_t padding:6;
/// Power Control
uint32_t TPC:2;
/// Redundancy version
......@@ -480,9 +469,7 @@ typedef struct DCI0_20MHz_FDD DCI0_20MHz_FDD_t;
struct DCI1A_20MHz_FDD {
/// padding
uint32_t padding:3;
/// Downlink Assignment Index
uint32_t srs_req:1;
uint32_t padding:4;
/// Power Control
uint32_t TPC:2;
/// Redundancy version
......
</
......@@ -161,12 +161,12 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
if (ra_header == 0) {// Type 0 Allocation
for (i=12;i>0;i--) {
if ((rb_alloc&(1<<i)) != 0)
rb_alloc2[0] |= (3<<((2*(12-i))));
// printf("rb_alloc2 (type 0) %x\n",rb_alloc2);
if ((rb_alloc&(1<<i)) != 0)
rb_alloc2[0] |= (3<<((2*(12-i))));
// printf("rb_alloc2 (type 0) %x\n",rb_alloc2);
}
if ((rb_alloc&1) != 0)
rb_alloc2[0] |= (1<<24);
rb_alloc2[0] |= (1<<24);
}
else {
subset = rb_alloc&1;
......@@ -192,30 +192,30 @@ void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t
rb_alloc2[(3*(16-i))>>5] |= (7<<((3*(16-i))%32));
}
/*
for (i=1;i<=16;i++) {
for (i=1;i<=16;i++) {
if ((rb_alloc&(1<<(16-i))) != 0)
rb_alloc2[(3*i)>>5] |= (7<<((3*i)%32));
}
rb_alloc2[(3*i)>>5] |= (7<<((3*i)%32));
}
*/
// bit mask across
if ((rb_alloc2[0]>>31)==1)
rb_alloc2[1] |= 1;
if ((rb_alloc&1) != 0)
rb_alloc2[1] |= (3<<16);
rb_alloc2[1] |= (3<<16);
/*
for (i=0;i<16;i++) {
if (((rb_alloc>>(16-i))&1) != 0)
rb_alloc2[(3*i)>>5] |= (7<<((3*i)%32));
if ((i==10)&&((rb_alloc&(1<<6))!=0))
rb_alloc2[1] = 1;
// printf("rb_alloc2[%d] (type 0) %x ((%x>>%d)&1=%d)\n",(3*i)>>5,rb_alloc2[(3*i)>>5],rb_alloc,i,(rb_alloc>>i)&1);
for (i=0;i<16;i++) {
if (((rb_alloc>>(16-i))&1) != 0)
rb_alloc2[(3*i)>>5] |= (7<<((3*i)%32));
if ((i==10)&&((rb_alloc&(1<<6))!=0))
rb_alloc2[1] = 1;
// printf("rb_alloc2[%d] (type 0) %x ((%x>>%d)&1=%d)\n",(3*i)>>5,rb_alloc2[(3*i)>>5],rb_alloc,i,(rb_alloc>>i)&1);
}
// fill in 2 from last bit instead of 3
if ((rb_alloc&1) != 0)
rb_alloc2[1] |= (3<<i);
// printf("rb_alloc2[%d] (type 0) %x ((%x>>%d)&1=%d)\n",(3*i)>>5,rb_alloc2[(3*i)>>5],rb_alloc,i,(rb_alloc>>i)&1);
*/
}
// fill in 2 from last bit instead of 3
if ((rb_alloc&1) != 0)
rb_alloc2[1] |= (3<<i);
// printf("rb_alloc2[%d] (type 0) %x ((%x>>%d)&1=%d)\n",(3*i)>>5,rb_alloc2[(3*i)>>5],rb_alloc,i,(rb_alloc>>i)&1);
*/
// printf("rb_alloc[1]=%x,rb_alloc[0]=%x\n",rb_alloc2[1],rb_alloc2[0]);
}
else {
......@@ -292,12 +292,12 @@ uint32_t conv_nprb(uint8_t ra_header,uint32_t rb_alloc,int N_RB_DL) {
case 25:
if (ra_header == 0) {// Type 0 Allocation
for (i=12;i>0;i--) {
if ((rb_alloc&(1<<i)) != 0)
nprb += 2;
}
if ((rb_alloc&1) != 0)
nprb += 1;
for (i=12;i>0;i--) {
if ((rb_alloc&(1<<i)) != 0)
nprb += 2;
}
if ((rb_alloc&1) != 0)
nprb += 1;
}
else {
for (i=0;i<11;i++) {
......@@ -351,14 +351,14 @@ uint32_t conv_nprb(uint8_t ra_header,uint32_t rb_alloc,int N_RB_DL) {
uint16_t computeRIV(uint16_t N_RB_DL,uint16_t RBstart,uint16_t Lcrbs) {
uint16_t RIV;
uint16_t RIV;
if (Lcrbs<=(1+(N_RB_DL>>1)))
RIV = (N_RB_DL*(Lcrbs-1)) + RBstart;
else
RIV = (N_RB_DL*(N_RB_DL+1-Lcrbs)) + (N_RB_DL-1-RBstart);
if (Lcrbs<=(1+(N_RB_DL>>1)))
RIV = (N_RB_DL*(Lcrbs-1)) + RBstart;
else
RIV = (N_RB_DL*(N_RB_DL+1-Lcrbs)) + (N_RB_DL-1-RBstart);
return(RIV);
return(RIV);
}
int dist6[6]={0,2,3,5,1,4};
......@@ -399,27 +399,27 @@ void generate_RIV_tables() {
for (RBstart=0;RBstart<25;RBstart++) {
alloc0 = 0;
alloc_dist0 = 0;
for (Lcrbs=1;Lcrbs<=(25-RBstart);Lcrbs++) {
// printf("RBstart %d, len %d --> ",RBstart,Lcrbs);
alloc0 |= (1<<(RBstart+Lcrbs-1));
// This is the RB<->VRB relationship for N_RB_DL=25
distpos = ((RBstart+Lcrbs-1)*6)%23;
if (distpos == 0)
distpos = 23;
alloc_dist0 |= (1<<distpos);
alloc0 = 0;
alloc_dist0 = 0;
for (Lcrbs=1;Lcrbs<=(25-RBstart);Lcrbs++) {
// printf("RBstart %d, len %d --> ",RBstart,Lcrbs);
alloc0 |= (1<<(RBstart+Lcrbs-1));
// This is the RB<->VRB relationship for N_RB_DL=25
distpos = ((RBstart+Lcrbs-1)*6)%23;
if (distpos == 0)
distpos = 23;
alloc_dist0 |= (1<<distpos);
RIV=computeRIV(25,RBstart,Lcrbs);
if (RIV>RIV_max25)
RIV_max25 = RIV;
RIV=computeRIV(25,RBstart,Lcrbs);
if (RIV>RIV_max25)
RIV_max25 = RIV;
// printf("RIV %d (%d) : first_rb %d NBRB %d\n",RIV,localRIV2alloc_LUT25[RIV],RBstart,Lcrbs);
localRIV2alloc_LUT25[RIV] = alloc0;
distRIV2alloc_LUT25[RIV] = alloc_dist0;
RIV2nb_rb_LUT25[RIV] = Lcrbs;
RIV2first_rb_LUT25[RIV] = RBstart;
}
// printf("RIV %d (%d) : first_rb %d NBRB %d\n",RIV,localRIV2alloc_LUT25[RIV],RBstart,Lcrbs);
localRIV2alloc_LUT25[RIV] = alloc0;
distRIV2alloc_LUT25[RIV] = alloc_dist0;
RIV2nb_rb_LUT25[RIV] = Lcrbs;
RIV2first_rb_LUT25[RIV] = RBstart;
}
}
......@@ -556,7 +556,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
uint8_t mcs=0;
uint8_t I_mcs = 0;
uint8_t rv=0;
uint8_t ndi=0;
uint8_t rah=0;
uint8_t TPC=0;
// printf("Generate eNB DCI, format %d, rnti %x (pdu %p)\n",dci_format,rnti,dci_pdu);
......@@ -579,7 +578,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
mcs = ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->mcs;
rballoc = ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->rballoc;
rv = ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->rv;
ndi = ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->ndi;
TPC = ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->TPC;
harq_pid = ((DCI1A_1_5MHz_TDD_1_6_t *)dci_pdu)->harq_pid;
......@@ -590,7 +588,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
mcs = ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->mcs;
rballoc = ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->rballoc;
rv = ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->rv;
ndi = ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->ndi;
TPC = ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->TPC;
harq_pid = ((DCI1A_1_5MHz_FDD_t *)dci_pdu)->harq_pid;
......@@ -613,7 +610,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
mcs = ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->mcs;
rballoc = ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->rballoc;
rv = ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->rv;
ndi = ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->ndi;
TPC = ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->TPC;
harq_pid = ((DCI1A_5MHz_TDD_1_6_t *)dci_pdu)->harq_pid;
......@@ -624,7 +620,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
mcs = ((DCI1A_5MHz_FDD_t *)dci_pdu)->mcs;
rballoc = ((DCI1A_5MHz_FDD_t *)dci_pdu)->rballoc;
rv = ((DCI1A_5MHz_FDD_t *)dci_pdu)->rv;
ndi = ((DCI1A_5MHz_FDD_t *)dci_pdu)->ndi;
TPC = ((DCI1A_5MHz_FDD_t *)dci_pdu)->TPC;
harq_pid = ((DCI1A_5MHz_FDD_t *)dci_pdu)->harq_pid;
......@@ -645,7 +640,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
mcs = ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->mcs;
rballoc = ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->rballoc;
rv = ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->rv;
ndi = ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->ndi;
TPC = ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->TPC;
harq_pid = ((DCI1A_10MHz_TDD_1_6_t *)dci_pdu)->harq_pid;
......@@ -656,7 +650,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
mcs = ((DCI1A_10MHz_FDD_t *)dci_pdu)->mcs;
rballoc = ((DCI1A_10MHz_FDD_t *)dci_pdu)->rballoc;
rv = ((DCI1A_10MHz_FDD_t *)dci_pdu)->rv;
ndi = ((DCI1A_10MHz_FDD_t *)dci_pdu)->ndi;
TPC = ((DCI1A_10MHz_FDD_t *)dci_pdu)->TPC;
harq_pid = ((DCI1A_10MHz_FDD_t *)dci_pdu)->harq_pid;
// printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
......@@ -679,7 +672,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
mcs = ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->mcs;
rballoc = ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->rballoc;
rv = ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->rv;
ndi = ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->ndi;
TPC = ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->TPC;
harq_pid = ((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->harq_pid;
// printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
......@@ -689,7 +681,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
mcs = ((DCI1A_20MHz_FDD_t *)dci_pdu)->mcs;
rballoc = ((DCI1A_20MHz_FDD_t *)dci_pdu)->rballoc;
rv = ((DCI1A_20MHz_FDD_t *)dci_pdu)->rv;
ndi = ((DCI1A_20MHz_FDD_t *)dci_pdu)->ndi;
TPC = ((DCI1A_20MHz_FDD_t *)dci_pdu)->TPC;
harq_pid = ((DCI1A_20MHz_FDD_t *)dci_pdu)->harq_pid;
// printf("FDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
......@@ -722,7 +713,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
harq_pid=0;
// see 36-212 V8.6.0 p. 45
NPRB = (TPC&1)+2;
ndi = 1;
// 36-213 sec.7.1.7.2 p.26
I_mcs = mcs;
}
......@@ -748,13 +738,28 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
dlsch[0]->harq_processes[harq_pid]->Nl = 1;
dlsch[0]->layer_index = 0;
dlsch[0]->harq_processes[harq_pid]->mimo_mode = (frame_parms->mode1_flag == 1) ? SISO : ALAMOUTI;
dlsch[0]->harq_processes[harq_pid]->Ndi = ndi;
dlsch[0]->dl_power_off = 1;
if (dlsch[0]->harq_processes[harq_pid]->Ndi == 1) {
dlsch[0]->harq_processes[harq_pid]->status = ACTIVE;
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
}
/*
if ((rnti!=si_rnti)&&(rnti!=ra_rnti)&&(rnti!=p_rnti)) { //handle toggling for C-RNTI
if (dlsch[0]->harq_processes[harq_pid]->first_tx == 1) {
LOG_D(PHY,"First TX for TC-RNTI %x, clearing first_tx flag\n",rnti);
dlsch[0]->harq_processes[harq_pid]->first_tx=0;
dlsch[0]->harq_processes[harq_pid]->Ndi = 1;
}
else {
if (ndi == dlsch[0]->harq_processes[harq_pid]->DCINdi)
dlsch[0]->harq_processes[harq_pid]->Ndi = 0;
else
dlsch[0]->harq_processes[harq_pid]->Ndi = 1;
}
dlsch[0]->harq_processes[harq_pid]->DCINdi=ndi;
}
else {
dlsch[0]->harq_processes[harq_pid]->Ndi = 1;
}
*/
dlsch[0]->dl_power_off = 1;
......@@ -770,7 +775,7 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
dlsch[0]->rnti = rnti;
dlsch[0]->harq_ids[subframe] = harq_pid;
if (dlsch[0]->harq_processes[harq_pid]->Ndi == 1)
if (dlsch[0]->harq_processes[harq_pid]->round == 0)
dlsch[0]->harq_processes[harq_pid]->status = ACTIVE;
break;
......@@ -784,7 +789,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
rballoc = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->rballoc;
rah = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->rah;
rv = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->rv;
ndi = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->ndi;
harq_pid = ((DCI1_1_5MHz_TDD_t *)dci_pdu)->harq_pid;
}
else {
......@@ -792,7 +796,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->rah;
rballoc = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->rballoc;
rv = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->rv;
ndi = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->ndi;
harq_pid = ((DCI1_1_5MHz_FDD_t *)dci_pdu)->harq_pid;
}
break;
......@@ -803,16 +806,17 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
rballoc = ((DCI1_5MHz_TDD_t *)dci_pdu)->rballoc;
rah = ((DCI1_5MHz_TDD_t *)dci_pdu)->rah;
rv = ((DCI1_5MHz_TDD_t *)dci_pdu)->rv;
ndi = ((DCI1_5MHz_TDD_t *)dci_pdu)->ndi;
harq_pid = ((DCI1_5MHz_TDD_t *)dci_pdu)->harq_pid;
LOG_D(PHY,"eNB: subframe %d UE %x, Format1 DCI: ndi %d, harq_pid %d\n",subframe,rnti,((DCI1_5MHz_TDD_t *)dci_pdu)->ndi,harq_pid);
}
else {
mcs = ((DCI1_5MHz_FDD_t *)dci_pdu)->mcs;
rah = ((DCI1_5MHz_FDD_t *)dci_pdu)->rah;
rballoc = ((DCI1_5MHz_FDD_t *)dci_pdu)->rballoc;
rv = ((DCI1_5MHz_FDD_t *)dci_pdu)->rv;
ndi = ((DCI1_5MHz_FDD_t *)dci_pdu)->ndi;
harq_pid = ((DCI1_5MHz_FDD_t *)dci_pdu)->harq_pid;
LOG_D(PHY,"eNB: subframe %d UE %x, Format1 DCI: ndi %d, harq_pid %d\n",subframe,rnti,((DCI1_5MHz_FDD_t *)dci_pdu)->ndi,harq_pid);
}
break;
case 50:
......@@ -821,7 +825,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
rballoc = ((DCI1_10MHz_TDD_t *)dci_pdu)->rballoc;
rah = ((DCI1_10MHz_TDD_t *)dci_pdu)->rah;
rv = ((DCI1_10MHz_TDD_t *)dci_pdu)->rv;
ndi = ((DCI1_10MHz_TDD_t *)dci_pdu)->ndi;
harq_pid = ((DCI1_10MHz_TDD_t *)dci_pdu)->harq_pid;
}
else {
......@@ -829,7 +832,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI1_10MHz_FDD_t *)dci_pdu)->rah;
rballoc = ((DCI1_10MHz_FDD_t *)dci_pdu)->rballoc;
rv = ((DCI1_10MHz_FDD_t *)dci_pdu)->rv;
ndi = ((DCI1_10MHz_FDD_t *)dci_pdu)->ndi;
harq_pid = ((DCI1_10MHz_FDD_t *)dci_pdu)->harq_pid;
}
break;
......@@ -840,7 +842,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
rballoc = ((DCI1_20MHz_TDD_t *)dci_pdu)->rballoc;
rah = ((DCI1_20MHz_TDD_t *)dci_pdu)->rah;
rv = ((DCI1_20MHz_TDD_t *)dci_pdu)->rv;
ndi = ((DCI1_20MHz_TDD_t *)dci_pdu)->ndi;
harq_pid = ((DCI1_20MHz_TDD_t *)dci_pdu)->harq_pid;
}
else {
......@@ -848,7 +849,6 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
rah = ((DCI1_20MHz_FDD_t *)dci_pdu)->rah;
rballoc = ((DCI1_20MHz_FDD_t *)dci_pdu)->rballoc;
rv = ((DCI1_20MHz_FDD_t *)dci_pdu)->rv;
ndi = ((DCI1_20MHz_FDD_t *)dci_pdu)->ndi;
harq_pid = ((DCI1_20MHz_FDD_t *)dci_pdu)->harq_pid;
}
break;
......@@ -884,16 +884,32 @@ int generate_eNB_dlsch_params_from_dci(uint8_t subframe,
dlsch[0]->layer_index = 0;
dlsch[0]->harq_processes[harq_pid]->mimo_mode = (frame_parms->mode1_flag == 1) ? SISO : ALAMOUTI;
dlsch[0]->dl_power_off = 1;
dlsch[0]->harq_processes[harq_pid]->Ndi = ndi;
/*
if (dlsch[0]->harq_processes[harq_pid]->first_tx == 1) {
LOG_D(PHY,"First TX for C-RNTI %x, clearing first_tx flag, shouldn't happen!\n",rnti);
dlsch[0]->harq_processes[harq_pid]->first_tx=0;
dlsch[0]->harq_processes[harq_pid]->Ndi = 1;
}
else {
LOG_D(PHY,"Checking for Toggled Ndi for C-RNTI %x, old value %d, DCINdi %d\n",rnti,dlsch[0]->harq_processes[harq_pid]->DCINdi,ndi);