Commit 5e7d52d2 authored by adk's avatar adk Committed by Thomas Schlichter

fix indentation

parent 36bf56d4
...@@ -38,18 +38,18 @@ ...@@ -38,18 +38,18 @@
/***********************************************************************/ /***********************************************************************/
//#define max(a,b) (((a) > (b)) ? (a) : (b)) //#define max(a,b) (((a) > (b)) ? (a) : (b))
// TS 38.211 Table 6.4.1.2.2.1-1: The parameter kRE_ref. // TS 38.211 Table 6.4.1.2.2.1-1: The parameter kRE_ref.
// The first 4 colomns are DM-RS Configuration type 1 and the last 4 colomns are DM-RS Configuration type 2. // The first 4 colomns are DM-RS Configuration type 1 and the last 4 colomns are DM-RS Configuration type 2.
int16_t table_6_4_1_2_2_1_1_pusch_ptrs_kRE_ref [6][8] = { int16_t table_6_4_1_2_2_1_1_pusch_ptrs_kRE_ref [6][8] = {
{ 0, 2, 6, 8, 0, 1, 6, 7}, { 0, 2, 6, 8, 0, 1, 6, 7},
{ 2, 4, 8, 10, 1, 6, 7, 0}, { 2, 4, 8, 10, 1, 6, 7, 0},
{ 1, 3, 7, 9, 2, 3, 8, 9}, { 1, 3, 7, 9, 2, 3, 8, 9},
{ 3, 5, 9, 11, 3, 8, 9, 2}, { 3, 5, 9, 11, 3, 8, 9, 2},
{-1, -1, -1, -1, 4, 5, 10, 11}, {-1, -1, -1, -1, 4, 5, 10, 11},
{-1, -1, -1, -1, 5, 10, 11, 4}, {-1, -1, -1, -1, 5, 10, 11, 4},
}; };
...@@ -68,19 +68,15 @@ int16_t table_6_4_1_2_2_1_1_pusch_ptrs_kRE_ref [6][8] = { ...@@ -68,19 +68,15 @@ int16_t table_6_4_1_2_2_1_1_pusch_ptrs_kRE_ref [6][8] = {
*********************************************************************/ *********************************************************************/
int16_t get_kRE_ref(uint8_t dmrs_antenna_port, uint8_t pusch_dmrs_type, uint8_t resourceElementOffset) { int16_t get_kRE_ref(uint8_t dmrs_antenna_port, uint8_t pusch_dmrs_type, uint8_t resourceElementOffset) {
uint8_t colomn; uint8_t colomn;
int16_t k_RE_ref; int16_t k_RE_ref;
colomn = resourceElementOffset; colomn = resourceElementOffset;
if (pusch_dmrs_type == 2) if (pusch_dmrs_type == 2)
colomn += 4; colomn += 4;
k_RE_ref = table_6_4_1_2_2_1_1_pusch_ptrs_kRE_ref[dmrs_antenna_port][colomn]; k_RE_ref = table_6_4_1_2_2_1_1_pusch_ptrs_kRE_ref[dmrs_antenna_port][colomn];
AssertFatal(k_RE_ref>=0,"invalid k_RE_ref < 0. Check PTRS Configuration\n"); AssertFatal(k_RE_ref>=0,"invalid k_RE_ref < 0. Check PTRS Configuration\n");
return k_RE_ref; return k_RE_ref;
} }
...@@ -98,21 +94,18 @@ int16_t get_kRE_ref(uint8_t dmrs_antenna_port, uint8_t pusch_dmrs_type, uint8_t ...@@ -98,21 +94,18 @@ int16_t get_kRE_ref(uint8_t dmrs_antenna_port, uint8_t pusch_dmrs_type, uint8_t
* *
*********************************************************************/ *********************************************************************/
uint8_t get_K_ptrs(ptrs_UplinkConfig_t *ptrs_UplinkConfig, uint16_t N_RB){ uint8_t get_K_ptrs(ptrs_UplinkConfig_t *ptrs_UplinkConfig, uint16_t N_RB) {
uint16_t nrb0, nrb1; uint16_t nrb0, nrb1;
nrb0 = ptrs_UplinkConfig->frequencyDensity.n_rb0; nrb0 = ptrs_UplinkConfig->frequencyDensity.n_rb0;
nrb1 = ptrs_UplinkConfig->frequencyDensity.n_rb1; nrb1 = ptrs_UplinkConfig->frequencyDensity.n_rb1;
if (nrb0 == 0 || nrb0 == 0) if (nrb0 == 0 || nrb0 == 0)
return 2; return 2;
if (N_RB < nrb0){ if (N_RB < nrb0) {
LOG_I(PHY,"PUSH PT-RS is not present.\n"); LOG_I(PHY,"PUSH PT-RS is not present.\n");
return 0; return 0;
} } else if (N_RB >= nrb0 && N_RB < nrb1)
else if (N_RB >= nrb0 && N_RB < nrb1)
return 2; return 2;
else else
return 4; return 4;
...@@ -141,10 +134,8 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols, ...@@ -141,10 +134,8 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
uint8_t L_ptrs, uint8_t L_ptrs,
uint8_t pusch_maxLength, uint8_t pusch_maxLength,
uint16_t ofdm_symbol_size) { uint16_t ofdm_symbol_size) {
uint8_t i, last_symbol, is_dmrs_symbol1, is_dmrs_symbol2; uint8_t i, last_symbol, is_dmrs_symbol1, is_dmrs_symbol2;
int16_t l_ref; int16_t l_ref;
*ptrs_symbols = 0; *ptrs_symbols = 0;
i = 0; i = 0;
is_dmrs_symbol1 = 0; is_dmrs_symbol1 = 0;
...@@ -153,7 +144,6 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols, ...@@ -153,7 +144,6 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
last_symbol = start_symbol + duration_in_symbols - 1; last_symbol = start_symbol + duration_in_symbols - 1;
while ( (l_ref + i*L_ptrs) <= last_symbol) { while ( (l_ref + i*L_ptrs) <= last_symbol) {
is_dmrs_symbol1 = is_dmrs_symbol(max((l_ref + (i-1)*L_ptrs + 1), l_ref), is_dmrs_symbol1 = is_dmrs_symbol(max((l_ref + (i-1)*L_ptrs + 1), l_ref),
0, 0,
0, 0,
...@@ -163,7 +153,6 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols, ...@@ -163,7 +153,6 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
duration_in_symbols, duration_in_symbols,
dmrs_type, dmrs_type,
ofdm_symbol_size); ofdm_symbol_size);
is_dmrs_symbol2 = is_dmrs_symbol(l_ref + i*L_ptrs, is_dmrs_symbol2 = is_dmrs_symbol(l_ref + i*L_ptrs,
0, 0,
0, 0,
...@@ -175,16 +164,13 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols, ...@@ -175,16 +164,13 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
ofdm_symbol_size); ofdm_symbol_size);
if ( is_dmrs_symbol1 + is_dmrs_symbol2 > 0 ) { if ( is_dmrs_symbol1 + is_dmrs_symbol2 > 0 ) {
if (pusch_maxLength == 2) if (pusch_maxLength == 2)
l_ref = l_ref + i*L_ptrs + 1; l_ref = l_ref + i*L_ptrs + 1;
else else
l_ref = l_ref + i*L_ptrs; l_ref = l_ref + i*L_ptrs;
i = 1; i = 1;
continue; continue;
} }
*ptrs_symbols = *ptrs_symbols | (1<<(l_ref + i*L_ptrs)); *ptrs_symbols = *ptrs_symbols | (1<<(l_ref + i*L_ptrs));
...@@ -206,9 +192,7 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols, ...@@ -206,9 +192,7 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols,
*********************************************************************/ *********************************************************************/
uint8_t get_L_ptrs(ptrs_UplinkConfig_t *ptrs_UplinkConfig, uint8_t I_mcs) { uint8_t get_L_ptrs(ptrs_UplinkConfig_t *ptrs_UplinkConfig, uint8_t I_mcs) {
uint8_t mcs1, mcs2, mcs3; uint8_t mcs1, mcs2, mcs3;
mcs1 = ptrs_UplinkConfig->timeDensity.ptrs_mcs1; mcs1 = ptrs_UplinkConfig->timeDensity.ptrs_mcs1;
mcs2 = ptrs_UplinkConfig->timeDensity.ptrs_mcs2; mcs2 = ptrs_UplinkConfig->timeDensity.ptrs_mcs2;
mcs3 = ptrs_UplinkConfig->timeDensity.ptrs_mcs3; mcs3 = ptrs_UplinkConfig->timeDensity.ptrs_mcs3;
...@@ -216,11 +200,10 @@ uint8_t get_L_ptrs(ptrs_UplinkConfig_t *ptrs_UplinkConfig, uint8_t I_mcs) { ...@@ -216,11 +200,10 @@ uint8_t get_L_ptrs(ptrs_UplinkConfig_t *ptrs_UplinkConfig, uint8_t I_mcs) {
if (mcs1 == 0 || mcs2 == 0 || mcs3 == 0) if (mcs1 == 0 || mcs2 == 0 || mcs3 == 0)
return 1; return 1;
if (I_mcs < mcs1){ if (I_mcs < mcs1) {
LOG_I(PHY,"PUSH PT-RS is not present.\n"); LOG_I(PHY,"PUSH PT-RS is not present.\n");
return 0; return 0;
} } else if (I_mcs >= mcs1 && I_mcs < mcs2)
else if (I_mcs >= mcs1 && I_mcs < mcs2)
return 4; return 4;
else if (I_mcs >= mcs2 && I_mcs < mcs3) else if (I_mcs >= mcs2 && I_mcs < mcs3)
return 2; return 2;
...@@ -247,9 +230,7 @@ uint8_t get_L_ptrs(ptrs_UplinkConfig_t *ptrs_UplinkConfig, uint8_t I_mcs) { ...@@ -247,9 +230,7 @@ uint8_t get_L_ptrs(ptrs_UplinkConfig_t *ptrs_UplinkConfig, uint8_t I_mcs) {
*********************************************************************/ *********************************************************************/
uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t N_RB, int16_t k_RE_ref, uint16_t start_sc, uint16_t ofdm_symbol_size) { uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t N_RB, int16_t k_RE_ref, uint16_t start_sc, uint16_t ofdm_symbol_size) {
uint16_t k_RB_ref, i, sc; uint16_t k_RB_ref, i, sc;
i = 0; i = 0;
sc = 0; sc = 0;
k_RB_ref = 0; k_RB_ref = 0;
...@@ -259,18 +240,15 @@ uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t ...@@ -259,18 +240,15 @@ uint8_t is_ptrs_subcarrier(uint16_t k, uint8_t K_ptrs, uint16_t n_rnti, uint16_t
else else
k_RB_ref = n_rnti % (N_RB % K_ptrs); k_RB_ref = n_rnti % (N_RB % K_ptrs);
while (k > sc){ while (k > sc) {
sc = (start_sc + k_RE_ref + (i*K_ptrs + k_RB_ref)*NR_NB_SC_PER_RB)%ofdm_symbol_size; sc = (start_sc + k_RE_ref + (i*K_ptrs + k_RB_ref)*NR_NB_SC_PER_RB)%ofdm_symbol_size;
i++; i++;
} }
if (k == sc) if (k == sc)
return 1; return 1;
else else
return 0; return 0;
} }
/******************************************************************* /*******************************************************************
...@@ -308,15 +286,11 @@ uint8_t is_ptrs_symbol(uint8_t l, ...@@ -308,15 +286,11 @@ uint8_t is_ptrs_symbol(uint8_t l,
uint16_t ofdm_symbol_size, uint16_t ofdm_symbol_size,
pusch_dmrs_type_t pusch_dmrs_type, pusch_dmrs_type_t pusch_dmrs_type,
uint8_t resourceElementOffset) { uint8_t resourceElementOffset) {
uint8_t is_ptrs_freq, is_ptrs_time; uint8_t is_ptrs_freq, is_ptrs_time;
int16_t k_RE_ref; int16_t k_RE_ref;
is_ptrs_freq = 0; is_ptrs_freq = 0;
is_ptrs_time = 0; is_ptrs_time = 0;
k_RE_ref = get_kRE_ref(dmrs_antenna_port, pusch_dmrs_type, resourceElementOffset); k_RE_ref = get_kRE_ref(dmrs_antenna_port, pusch_dmrs_type, resourceElementOffset);
is_ptrs_freq = is_ptrs_subcarrier(k, K_ptrs, n_rnti, N_RB, k_RE_ref, start_sc, ofdm_symbol_size); is_ptrs_freq = is_ptrs_subcarrier(k, K_ptrs, n_rnti, N_RB, k_RE_ref, start_sc, ofdm_symbol_size);
if (is_ptrs_freq == 0) if (is_ptrs_freq == 0)
...@@ -329,7 +303,6 @@ uint8_t is_ptrs_symbol(uint8_t l, ...@@ -329,7 +303,6 @@ uint8_t is_ptrs_symbol(uint8_t l,
return 1; return 1;
else else
return 0; return 0;
} }
/* /*
......
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