fixed bug with multiple LCs in UL BSR

This commit is contained in:
Nicola Baldo
2012-07-02 11:34:21 +02:00
parent e5050bb99d
commit 27f0dc0f96
3 changed files with 21 additions and 12 deletions

View File

@@ -292,16 +292,22 @@ LteUeMac::SendReportBufferStatus (void)
MacCeListElement_s bsr;
bsr.m_rnti = m_rnti;
bsr.m_macCeType = MacCeListElement_s::BSR;
// BSR
std::map <uint8_t, uint64_t>::iterator it;
NS_ASSERT_MSG (m_ulBsrReceived.size () <=4, " Too many LCs (max is 4)");
// BSR is reported for each LCG. As a simplification, we consider that all LCs belong to the first LCG.
std::map <uint8_t, uint64_t>::iterator it;
int queue = 0;
for (it = m_ulBsrReceived.begin (); it != m_ulBsrReceived.end (); it++)
{
int queue = (*it).second;
int index = BufferSizeLevelBsr::BufferSize2BsrId (queue);
bsr.m_macCeValue.m_bufferStatus.push_back (index);
queue += (*it).second;
}
int index = BufferSizeLevelBsr::BufferSize2BsrId (queue);
bsr.m_macCeValue.m_bufferStatus.push_back (index);
// FF API says that all 4 LCGs are always present
// we do so but reporting a 0 size for all other LCGs
bsr.m_macCeValue.m_bufferStatus.push_back (BufferSizeLevelBsr::BufferSize2BsrId (0));
bsr.m_macCeValue.m_bufferStatus.push_back (BufferSizeLevelBsr::BufferSize2BsrId (0));
bsr.m_macCeValue.m_bufferStatus.push_back (BufferSizeLevelBsr::BufferSize2BsrId (0));
// create the feedback to eNB
Ptr<BsrIdealControlMessage> msg = Create<BsrIdealControlMessage> ();

View File

@@ -1025,6 +1025,8 @@ PfFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider::S
if ( params.m_macCeList.at (i).m_macCeType == MacCeListElement_s::BSR )
{
// buffer status report
// note that we only consider LCG 0, the other three LCGs are neglected
// this is consistent with the assumption in LteUeMac that the first LCG gathers all LCs
uint16_t rnti = params.m_macCeList.at (i).m_rnti;
it = m_ceBsrRxed.find (rnti);
if (it == m_ceBsrRxed.end ())
@@ -1032,11 +1034,11 @@ PfFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider::S
// create the new entry
uint8_t bsrId = params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0);
int buffer = BufferSizeLevelBsr::BsrId2BufferSize (bsrId);
m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer)); // only 1 buffer status is working now
m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer));
}
else
{
// update the CQI value
// update the buffer size value
(*it).second = BufferSizeLevelBsr::BsrId2BufferSize (params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0));
}
}

View File

@@ -827,6 +827,8 @@ RrFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider::S
if ( params.m_macCeList.at (i).m_macCeType == MacCeListElement_s::BSR )
{
// buffer status report
// note that we only consider LCG 0, the other three LCGs are neglected
// this is consistent with the assumption in LteUeMac that the first LCG gathers all LCs
uint16_t rnti = params.m_macCeList.at (i).m_rnti;
it = m_ceBsrRxed.find (rnti);
if (it == m_ceBsrRxed.end ())
@@ -834,13 +836,12 @@ RrFfMacScheduler::DoSchedUlMacCtrlInfoReq (const struct FfMacSchedSapProvider::S
// create the new entry
uint8_t bsrId = params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0);
int buffer = BufferSizeLevelBsr::BsrId2BufferSize (bsrId);
m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer)); // only 1 buffer status is working now
m_ceBsrRxed.insert ( std::pair<uint16_t, uint32_t > (rnti, buffer));
}
else
{
// update the CQI value
// update the buffer size value
(*it).second = BufferSizeLevelBsr::BsrId2BufferSize (params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0));
// NS_LOG_DEBUG (this << " Update BSR with " << BufferSizeLevelBsr::BsrId2BufferSize (params.m_macCeList.at (i).m_macCeValue.m_bufferStatus.at (0)) << " at " << Simulator::Now ());
}
}
}