MikePeters - 2014-06-26

It seems as if the newest commit has broken part of the LTE_fdd_dl_scan tool. Specifically, when the scan finds an LTE cell, it crashes when trying to decode it. It looks like this was due to dropping a reference to N_bits in pulling out the pcfich_channel_demap function in liblte_phy.cc. Here is a patch that fixes that functionality.

Thanks,
Mike Peters

http://pastebin.com/6KunYhRV

diff --git a/liblte/src/liblte_phy.cc b/liblte/src/liblte_phy.cc
index 3a9820b..29c938c 100644
--- a/liblte/src/liblte_phy.cc
+++ b/liblte/src/liblte_phy.cc
@@ -1044,7 +1044,8 @@ void pcfich_channel_demap(LIBLTE_PHY_STRUCT phy_struct,
LIBLTE_PHY_SUBFRAME_STRUCT
subframe,
uint32 N_id_cell,
uint8 N_ant,
- LIBLTE_PHY_PCFICH_STRUCT pcfich);
+ LIBLTE_PHY_PCFICH_STRUCT
pcfich,
+ uint32 *N_bits);

/**********
Name: pdcch_permute_pre_calc
@@ -4257,7 +4258,7 @@ LIBLTE_ERROR_ENUM liblte_phy_pdcch_channel_decode(LIBLTE_PHY_STRUCT
pdcch != NULL)
{
// PCFICH
- pcfich_channel_demap(phy_struct, subframe, N_id_cell, N_ant, pcfich);
+ pcfich_channel_demap(phy_struct, subframe, N_id_cell, N_ant, pcfich, &N_bits);
if(LIBLTE_SUCCESS != cfi_channel_decode(phy_struct,
phy_struct->pdcch_descramb_bits,
N_bits,
@@ -7390,11 +7391,12 @@ void pcfich_channel_demap(LIBLTE_PHY_STRUCT
phy_struct,
LIBLTE_PHY_SUBFRAME_STRUCT subframe,
uint32 N_id_cell,
uint8 N_ant,
- LIBLTE_PHY_PCFICH_STRUCT
pcfich)
+ LIBLTE_PHY_PCFICH_STRUCT pcfich,
+ uint32
N_bits)
{
uint32 M_layer_symb;
uint32 M_symb;
- uint32 N_bits;
+ //uint32 N_bits;
uint32 c_init;
uint32 k_hat;
uint32 i;
@@ -7455,8 +7457,8 @@ void pcfich_channel_demap(LIBLTE_PHY_STRUCT phy_struct,
M_symb,
LIBLTE_PHY_MODULATION_TYPE_QPSK,
phy_struct->pdcch_soft_bits,
- &N_bits);
- for(i=0; i<N_bits; i++)="" +="" N_bits);="" +="" for(i="0;" i<*N_bits;="" i++)="" {="" phy_struct-="">pdcch_descramb_bits[i] = (float)phy_struct->pdcch_soft_bits[i]
(1-2*(float)phy_struct->pdcch_c[i]);
}