diff --git a/src/lte/model/lte-ue-mac.cc b/src/lte/model/lte-ue-mac.cc index 086ba2596..72a312d6f 100644 --- a/src/lte/model/lte-ue-mac.cc +++ b/src/lte/model/lte-ue-mac.cc @@ -292,16 +292,22 @@ LteUeMac::SendReportBufferStatus (void) MacCeListElement_s bsr; bsr.m_rnti = m_rnti; bsr.m_macCeType = MacCeListElement_s::BSR; - // BSR - std::map ::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 ::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 msg = Create (); diff --git a/src/lte/model/pf-ff-mac-scheduler.cc b/src/lte/model/pf-ff-mac-scheduler.cc index b574d8214..84cbad53b 100644 --- a/src/lte/model/pf-ff-mac-scheduler.cc +++ b/src/lte/model/pf-ff-mac-scheduler.cc @@ -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 (rnti, buffer)); // only 1 buffer status is working now + m_ceBsrRxed.insert ( std::pair (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)); } } diff --git a/src/lte/model/rr-ff-mac-scheduler.cc b/src/lte/model/rr-ff-mac-scheduler.cc index 53a6a7476..ce5f3d6b8 100644 --- a/src/lte/model/rr-ff-mac-scheduler.cc +++ b/src/lte/model/rr-ff-mac-scheduler.cc @@ -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 (rnti, buffer)); // only 1 buffer status is working now + m_ceBsrRxed.insert ( std::pair (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 ()); } } }