From 1cd0010e10255a960e4de3c122ee395d63649e4a Mon Sep 17 00:00:00 2001 From: Biljana Bojovic Date: Tue, 7 Mar 2017 14:33:39 +0100 Subject: [PATCH] lte: fix static code analysys warnings (thanks to Natale Patriciello) --- src/lte/model/lte-enb-mac.cc | 6 ------ src/lte/model/lte-enb-rrc.cc | 13 ++++++++++++- src/lte/model/lte-mi-error-model.cc | 5 ++--- src/lte/model/lte-rlc-am.cc | 4 +--- src/lte/model/lte-spectrum-value-helper.cc | 3 ++- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/lte/model/lte-enb-mac.cc b/src/lte/model/lte-enb-mac.cc index 70f319810..8da6d0abc 100644 --- a/src/lte/model/lte-enb-mac.cc +++ b/src/lte/model/lte-enb-mac.cc @@ -488,12 +488,6 @@ LteEnbMac::DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo) { FfMacSchedSapProvider::SchedDlCqiInfoReqParameters dlcqiInfoReq; dlcqiInfoReq.m_sfnSf = ((0x3FF & frameNo) << 4) | (0xF & subframeNo); - - int cqiNum = m_dlCqiReceived.size (); - if (cqiNum > MAX_CQI_LIST) - { - cqiNum = MAX_CQI_LIST; - } dlcqiInfoReq.m_cqiList.insert (dlcqiInfoReq.m_cqiList.begin (), m_dlCqiReceived.begin (), m_dlCqiReceived.end ()); m_dlCqiReceived.erase (m_dlCqiReceived.begin (), m_dlCqiReceived.end ()); m_schedSapProvider->SchedDlCqiInfoReq (dlcqiInfoReq); diff --git a/src/lte/model/lte-enb-rrc.cc b/src/lte/model/lte-enb-rrc.cc index a27200bef..102dd1685 100644 --- a/src/lte/model/lte-enb-rrc.cc +++ b/src/lte/model/lte-enb-rrc.cc @@ -190,7 +190,16 @@ UeManager::DoInitialize () LteEnbCmacSapProvider::LcInfo lcinfo; lcinfo.rnti = m_rnti; lcinfo.lcId = lcid; - // leave the rest of lcinfo empty as CCCH (LCID 0) is pre-configured + // Initialise the rest of lcinfo structure even if CCCH (LCID 0) is pre-configured, and only m_rnti and lcid will be used from passed lcinfo structure. + // See FF LTE MAC Scheduler Iinterface Specification v1.11, 4.3.4 logicalChannelConfigListElement + lcinfo.lcGroup = 0; + lcinfo.qci = 0; + lcinfo.isGbr = false; + lcinfo.mbrUl = 0; + lcinfo.mbrDl = 0; + lcinfo.gbrUl = 0; + lcinfo.gbrDl = 0; + // MacSapUserForRlc in the ComponentCarrierManager MacSapUser LteMacSapUser* lteMacSapUser = m_rrc->m_ccmRrcSapProvider->ConfigureSignalBearer(lcinfo, rlc->GetLteMacSapUser ()); // Signal Channel are only on Primary Carrier @@ -767,6 +776,7 @@ UeManager::SendUeContextRelease () ueCtxReleaseParams.oldEnbUeX2apId = m_sourceX2apId; ueCtxReleaseParams.newEnbUeX2apId = m_rnti; ueCtxReleaseParams.sourceCellId = m_sourceCellId; + ueCtxReleaseParams.targetCellId = m_targetCellId; m_rrc->m_x2SapProvider->SendUeContextRelease (ueCtxReleaseParams); SwitchToState (CONNECTED_NORMALLY); m_rrc->m_handoverEndOkTrace (m_imsi, m_rrc->m_cellId, m_rnti); @@ -2040,6 +2050,7 @@ LteEnbRrc::ConfigureCell (uint16_t cellId) // Enabling MIB transmission LteRrcSap::MasterInformationBlock mib; mib.dlBandwidth = m_dlBandwidth; + mib.systemFrameNumber = 0; // Enabling SIB1 transmission with default values m_sib1.cellAccessRelatedInfo.cellIdentity = cellId; m_sib1.cellAccessRelatedInfo.csgIndication = false; diff --git a/src/lte/model/lte-mi-error-model.cc b/src/lte/model/lte-mi-error-model.cc index 5896203cf..d59c12150 100644 --- a/src/lte/model/lte-mi-error-model.cc +++ b/src/lte/model/lte-mi-error-model.cc @@ -579,7 +579,6 @@ LteMiErrorModel::GetTbDecodificationStats (const SpectrumValue& sinr, const std: uint16_t Z = 6144; // max size of a codeblock (including CRC) uint32_t B = size * 8; // B = 1234; - uint32_t L = 0; uint32_t C = 0; // no. of codeblocks uint32_t Cplus = 0; // no. of codeblocks with size K+ uint32_t Kplus = 0; // no. of codeblocks with size K+ @@ -590,13 +589,13 @@ LteMiErrorModel::GetTbDecodificationStats (const SpectrumValue& sinr, const std: if (B <= Z) { // only one codeblock - L = 0; + //L = 0; C = 1; B1 = B; } else { - L = 24; + uint32_t L = 24; C = ceil ((double)B / ((double)(Z-L))); B1 = B + C * L; } diff --git a/src/lte/model/lte-rlc-am.cc b/src/lte/model/lte-rlc-am.cc index 4ff7c3030..f0cffcc30 100644 --- a/src/lte/model/lte-rlc-am.cc +++ b/src/lte/model/lte-rlc-am.cc @@ -286,7 +286,6 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, NS_ASSERT (m_vtA < m_vtS); SequenceNumber10 sn; sn.SetModulusBase (m_vtA); - bool found = false; for (sn = m_vtA; sn < m_vtS; sn++) { uint16_t seqNumberValue = sn.GetValue (); @@ -300,7 +299,6 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, if (( packet->GetSize () <= bytes ) || m_txOpportunityForRetxAlwaysBigEnough) { - found = true; // According to 5.2.1, the data field is left as is, but we rebuild the header LteRlcAmHeader rlcAmHeader; packet->RemoveHeader (rlcAmHeader); @@ -389,7 +387,7 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, } } } - NS_ASSERT_MSG (found, "m_retxBufferSize > 0, but no PDU considered for retx found"); + NS_ASSERT_MSG (false, "m_retxBufferSize > 0, but no PDU considered for retx found"); } else if ( m_txonBufferSize > 0 ) { diff --git a/src/lte/model/lte-spectrum-value-helper.cc b/src/lte/model/lte-spectrum-value-helper.cc index 3de181fa4..471816d9c 100644 --- a/src/lte/model/lte-spectrum-value-helper.cc +++ b/src/lte/model/lte-spectrum-value-helper.cc @@ -267,7 +267,6 @@ LteSpectrumValueHelper::CreateTxPowerSpectralDensity (uint32_t earfcn, uint8_t t double powerTxW = std::pow (10., (powerTx - 30) / 10); double basicPowerTxW = std::pow (10., (powerTx - 30) / 10); - double txPowerDensity = (powerTxW / (txBandwidthConfiguration * 180000)); for (std::vector ::iterator it = activeRbs.begin (); it != activeRbs.end (); it++) { @@ -275,6 +274,8 @@ LteSpectrumValueHelper::CreateTxPowerSpectralDensity (uint32_t earfcn, uint8_t t std::map::iterator powerIt = powerTxMap.find (rbId); + double txPowerDensity; + if (powerIt != powerTxMap.end ()) { powerTxW = std::pow (10., (powerIt->second - 30) / 10);