Skip to content

Commit

Permalink
Add lte changes up to commit b9b0e8c
Browse files Browse the repository at this point in the history
  • Loading branch information
tommasozugno committed Nov 2, 2018
1 parent 745ba98 commit f140954
Show file tree
Hide file tree
Showing 23 changed files with 395 additions and 397 deletions.
29 changes: 14 additions & 15 deletions src/lte/model/lte-ccm-mac-sap.h
Expand Up @@ -33,7 +33,7 @@ namespace ns3 {
/**
* \ingroup lte
*
* \brief Service Access Point (SAP) offered by the component carrier manager (CCM)
* \brief Service Access Point (SAP) offered by the component carrier manager (CCM)
* by MAC to CCM.
*
* This is the *Component Carrier Manager SAP Provider*, i.e., the part of the SAP
Expand All @@ -42,7 +42,7 @@ namespace ns3 {
*/
class LteCcmMacSapProvider
{

public:
virtual ~LteCcmMacSapProvider ();

Expand All @@ -59,20 +59,20 @@ class LteCcmMacSapProvider
/**
* \ingroup lte
*
* \brief Service Access Point (SAP) offered by MAC to the
* \brief Service Access Point (SAP) offered by MAC to the
* component carrier manager (CCM).
*
*
*
* This is the *CCM MAC SAP User*, i.e., the part of the SAP
* that contains the component carrier manager methods called
* that contains the component carrier manager methods called
* by the eNodeB MAC instance.
*/
class LteCcmMacSapUser : public LteMacSapUser
{
public:
virtual ~LteCcmMacSapUser ();
/**
* \brief When the Primary Component carrier receive a buffer status report
* \brief When the Primary Component carrier receive a buffer status report
* it is sent to the CCM.
* \param bsr Buffer Status Report received from a Ue
* \param componentCarrierId
Expand Down Expand Up @@ -111,7 +111,7 @@ MemberLteCcmMacSapProvider<C>::MemberLteCcmMacSapProvider (C* owner)
: m_owner (owner)
{
}

template <class C>
void MemberLteCcmMacSapProvider<C>::ReportMacCeToScheduler (MacCeListElement_s bsr)
{
Expand All @@ -134,8 +134,8 @@ class MemberLteCcmMacSapUser : public LteCcmMacSapUser
virtual void UlReceiveMacCe (MacCeListElement_s bsr, uint8_t componentCarrierId);
virtual void NotifyPrbOccupancy (double prbOccupancy, uint8_t componentCarrierId);
// inherited from LteMacSapUser
virtual void NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
virtual void ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
virtual void NotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
virtual void ReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
virtual void NotifyHarqDeliveryFailure ();


Expand All @@ -162,15 +162,15 @@ void MemberLteCcmMacSapUser<C>::NotifyPrbOccupancy (double prbOccupancy, uint8_t
}

template <class C>
void MemberLteCcmMacSapUser<C>::NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
void MemberLteCcmMacSapUser<C>::NotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
{
m_owner->DoNotifyTxOpportunity (bytes, layer, harqId, componentCarrierId, rnti, lcid);
m_owner->DoNotifyTxOpportunity (txOpParams);
}

template <class C>
void MemberLteCcmMacSapUser<C>::ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
void MemberLteCcmMacSapUser<C>::ReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
{
m_owner->DoReceivePdu (p, rnti, lcid);
m_owner->DoReceivePdu (rxPduParams);
}

template <class C>
Expand All @@ -179,9 +179,8 @@ void MemberLteCcmMacSapUser<C>::NotifyHarqDeliveryFailure ()
m_owner->DoNotifyHarqDeliveryFailure ();
}


} // end of namespace ns3


#endif /* LTE_CCM_MAC_SAP_H */

20 changes: 16 additions & 4 deletions src/lte/model/lte-enb-mac.cc
Expand Up @@ -547,6 +547,7 @@ LteEnbMac::DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo)
{
rnti = jt->second.rnti;
NS_LOG_INFO ("preambleId previously allocated for NC based RA, RNTI =" << (uint32_t) rnti << ", sending RAR");

}
else
{
Expand Down Expand Up @@ -593,7 +594,6 @@ LteEnbMac::DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo)

// --- UPLINK ---
// Send UL-CQI info to the scheduler

for (uint16_t i = 0; i < m_ulCqiReceived.size (); i++)
{
if (subframeNo > 1)
Expand Down Expand Up @@ -774,10 +774,15 @@ LteEnbMac::DoReceivePhyPdu (Ptr<Packet> p)
std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
//NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID" << lcid);

LteMacSapUser::ReceivePduParameters rxPduParams;
rxPduParams.p = p;
rxPduParams.rnti = rnti;
rxPduParams.lcid = lcid;

//Receive PDU only if LCID is found
if (lcidIt != rntiIt->second.end ())
{
(*lcidIt).second->ReceivePdu (p, rnti, lcid);
(*lcidIt).second->ReceivePdu (rxPduParams);
}
}

Expand Down Expand Up @@ -995,7 +1000,7 @@ LteEnbMac::DoTransmitPdu (LteMacSapProvider::TransmitPduParameters params)
// Store pkt in HARQ buffer
std::map <uint16_t, DlHarqProcessesBuffer_t>::iterator it = m_miDlHarqProcessesPackets.find (params.rnti);
NS_ASSERT (it != m_miDlHarqProcessesPackets.end ());
NS_LOG_DEBUG (this << " LteEnbMac tx pdu LAYER " << (uint16_t)tag.GetLayer () << " HARQ ID " << (uint16_t)params.harqProcessId);
NS_LOG_DEBUG (this << " LAYER " << (uint16_t)tag.GetLayer () << " HARQ ID " << (uint16_t)params.harqProcessId);

//(*it).second.at (params.layer).at (params.harqProcessId) = params.pdu;//->Copy ();
(*it).second.at (params.layer).at (params.harqProcessId)->AddPacket (params.pdu);
Expand Down Expand Up @@ -1032,6 +1037,7 @@ LteEnbMac::DoSchedDlConfigInd (FfMacSchedSapUser::SchedDlConfigIndParameters ind
// Create DL PHY PDU
Ptr<PacketBurst> pb = CreateObject<PacketBurst> ();
std::map <LteFlowId_t, LteMacSapUser* >::iterator it;
LteMacSapUser::TxOpportunityParameters txOpParams;

for (unsigned int i = 0; i < ind.m_buildDataList.size (); i++)
{
Expand Down Expand Up @@ -1063,7 +1069,13 @@ LteEnbMac::DoSchedDlConfigInd (FfMacSchedSapUser::SchedDlConfigIndParameters ind
std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID" << (uint32_t)lcid<<" carrier id:"<<(uint16_t)m_componentCarrierId);
NS_LOG_DEBUG (this << " rnti= " << rnti << " lcid= " << (uint32_t) lcid << " layer= " << k);
(*lcidIt).second->NotifyTxOpportunity (ind.m_buildDataList.at (i).m_rlcPduList.at (j).at (k).m_size, k, ind.m_buildDataList.at (i).m_dci.m_harqProcess, m_componentCarrierId, rnti, lcid);
txOpParams.bytes = ind.m_buildDataList.at (i).m_rlcPduList.at (j).at (k).m_size;
txOpParams.layer = k;
txOpParams.harqId = ind.m_buildDataList.at (i).m_dci.m_harqProcess;
txOpParams.componentCarrierId = m_componentCarrierId;
txOpParams.rnti = rnti;
txOpParams.lcid = lcid;
(*lcidIt).second->NotifyTxOpportunity (txOpParams);
}
else
{
Expand Down
38 changes: 27 additions & 11 deletions src/lte/model/lte-mac-sap.h
Expand Up @@ -103,18 +103,26 @@ class LteMacSapUser
{
public:
virtual ~LteMacSapUser ();
/**
* Parameters for LteMacSapUser::NotifyTxOpportunity
*
*/
struct TxOpportunityParameters
{
uint32_t bytes; /**< the number of bytes to transmit */
uint8_t layer; /**< the layer of transmission (MIMO) */
uint8_t harqId; /**< the HARQ ID */
uint8_t componentCarrierId; /**< the component carrier id */
uint16_t rnti; /**< the C-RNTI identifying the UE */
uint8_t lcid; /**< the logical channel id */
};
/**
* Called by the MAC to notify the RLC that the scheduler granted a
* transmission opportunity to this RLC instance.
*
* \param bytes the number of bytes to transmit
* \param layer the layer of transmission (MIMO)
* \param harqId the HARQ ID
* \param componentCarrierId component carrier ID
* \param rnti the RNTI
* \param lcid the LCID
* \param params the TxOpportunityParameters
*/
virtual void NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid) = 0;
virtual void NotifyTxOpportunity (TxOpportunityParameters params) = 0;

/**
* Called by the MAC to notify the RLC that an HARQ process related
Expand All @@ -128,14 +136,22 @@ class LteMacSapUser

virtual void NotifyUlHarqDeliveryFailure (uint8_t harqId);

/**
* Parameters for LteMacSapUser::ReceivePdu
*
*/
struct ReceivePduParameters
{
Ptr<Packet> p; /**< the RLC PDU to be received */
uint16_t rnti; /**< the C-RNTI identifying the UE */
uint8_t lcid; /**< the logical channel id */
};
/**
* Called by the MAC to notify the RLC of the reception of a new PDU
*
* \param p the packet
* \param rnti the RNTI
* \param lcid the LCID
* \param params the ReceivePduParameters
*/
virtual void ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid) = 0;
virtual void ReceivePdu (ReceivePduParameters params) = 0;

};

Expand Down

0 comments on commit f140954

Please sign in to comment.