diff --git a/src/lte/model/lte-rlc-tm.cc b/src/lte/model/lte-rlc-tm.cc index 505958251..c8eb6ac28 100644 --- a/src/lte/model/lte-rlc-tm.cc +++ b/src/lte/model/lte-rlc-tm.cc @@ -130,7 +130,6 @@ LteRlcTm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId) if (bytes < packet->GetSize ()) { - // Stingy MAC: Header fix part is 2 bytes, we need more bytes for the data NS_LOG_WARN ("TX opportunity too small = " << bytes << " (PDU size: " << packet->GetSize () << ")"); return; } diff --git a/src/lte/model/lte-ue-mac.cc b/src/lte/model/lte-ue-mac.cc index 4abdbe53d..f2599565e 100644 --- a/src/lte/model/lte-ue-mac.cc +++ b/src/lte/model/lte-ue-mac.cc @@ -339,6 +339,10 @@ LteUeMac::SendReportBufferStatus (void) std::map ::iterator lcInfoMapIt; lcInfoMapIt = m_lcInfoMap.find (lcid); NS_ASSERT (lcInfoMapIt != m_lcInfoMap.end ()); + NS_ASSERT_MSG ((lcid != 0) || (((*it).second.txQueueSize == 0) + && ((*it).second.retxQueueSize == 0) + && ((*it).second.statusPduSize == 0)), + "BSR should not be used for LCID 0"); uint8_t lcg = lcInfoMapIt->second.lcConfig.logicalChannelGroup; queue.at (lcg) += ((*it).second.txQueueSize + (*it).second.retxQueueSize + (*it).second.statusPduSize); } @@ -411,6 +415,21 @@ LteUeMac::RecvRaResponse (BuildRarListElement_s raResponse) // preambles are sent no one is received, so there is no need // for contention resolution m_cmacSapUser->NotifyRandomAccessSuccessful (); + // trigger tx opportunity for Message 3 over LC 0 + // this is needed since Message 3's UL GRANT is in the RAR, not in UL-DCIs + const uint8_t lc0Lcid = 0; + std::map ::iterator lc0InfoIt = m_lcInfoMap.find (lc0Lcid); + NS_ASSERT (lc0InfoIt != m_lcInfoMap.end ()); + std::map ::iterator lc0BsrIt + = m_ulBsrReceived.find (lc0Lcid); + if ((lc0BsrIt != m_ulBsrReceived.end ()) + && (lc0BsrIt->second.txQueueSize > 0)) + { + NS_ASSERT_MSG (raResponse.m_grant.m_tbSize > lc0BsrIt->second.txQueueSize, + "segmentation of Message 3 is not allowed"); + lc0InfoIt->second.macSapUser->NotifyTxOpportunity (raResponse.m_grant.m_tbSize, 0, 0); + lc0BsrIt->second.txQueueSize = 0; + } } void