View | Details | Raw Unified | Return to bug 2995
Collapse All | Expand All

(-)a/src/lte/model/lte-ccm-mac-sap.h (-6 / +6 lines)
 Lines 134-141   public: Link Here 
134
  virtual void UlReceiveMacCe (MacCeListElement_s bsr, uint8_t componentCarrierId);
134
  virtual void UlReceiveMacCe (MacCeListElement_s bsr, uint8_t componentCarrierId);
135
  virtual void NotifyPrbOccupancy (double prbOccupancy, uint8_t componentCarrierId);
135
  virtual void NotifyPrbOccupancy (double prbOccupancy, uint8_t componentCarrierId);
136
  // inherited from LteMacSapUser
136
  // inherited from LteMacSapUser
137
  virtual void NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
137
  virtual void NotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
138
  virtual void ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
138
  virtual void ReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
139
  virtual void NotifyHarqDeliveryFailure ();
139
  virtual void NotifyHarqDeliveryFailure ();
140
140
141
141
 Lines 162-176   void MemberLteCcmMacSapUser<C>::NotifyPrbOccupancy (double prbOccupancy, uint8_t Link Here 
162
}
162
}
163
163
164
template <class C>
164
template <class C>
165
void MemberLteCcmMacSapUser<C>::NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
165
void MemberLteCcmMacSapUser<C>::NotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
166
{
166
{
167
  m_owner->DoNotifyTxOpportunity (bytes, layer, harqId, componentCarrierId, rnti, lcid);
167
  m_owner->DoNotifyTxOpportunity (txOpParams);
168
}
168
}
169
169
170
template <class C>
170
template <class C>
171
void MemberLteCcmMacSapUser<C>::ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
171
void MemberLteCcmMacSapUser<C>::ReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
172
{
172
{
173
  m_owner->DoReceivePdu (p, rnti, lcid);
173
  m_owner->DoReceivePdu (rxPduParams);
174
}
174
}
175
175
176
template <class C>
176
template <class C>
(-)a/src/lte/model/lte-enb-mac.cc (-2 / +14 lines)
 Lines 765-774   LteEnbMac::DoReceivePhyPdu (Ptr<Packet> p) Link Here 
765
  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
765
  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
766
  //NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID" << lcid);
766
  //NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID" << lcid);
767
767
768
  LteMacSapUser::ReceivePduParameters rxPduParams;
769
  rxPduParams.p = p;
770
  rxPduParams.rnti = rnti;
771
  rxPduParams.lcid = lcid;
772
768
  //Receive PDU only if LCID is found
773
  //Receive PDU only if LCID is found
769
  if (lcidIt != rntiIt->second.end ())
774
  if (lcidIt != rntiIt->second.end ())
770
    {
775
    {
771
      (*lcidIt).second->ReceivePdu (p, rnti, lcid);
776
      (*lcidIt).second->ReceivePdu (rxPduParams);
772
    }
777
    }
773
}
778
}
774
779
 Lines 1023-1028   LteEnbMac::DoSchedDlConfigInd (FfMacSchedSapUser::SchedDlConfigIndParameters ind Link Here 
1023
  // Create DL PHY PDU
1028
  // Create DL PHY PDU
1024
  Ptr<PacketBurst> pb = CreateObject<PacketBurst> ();
1029
  Ptr<PacketBurst> pb = CreateObject<PacketBurst> ();
1025
  std::map <LteFlowId_t, LteMacSapUser* >::iterator it;
1030
  std::map <LteFlowId_t, LteMacSapUser* >::iterator it;
1031
  LteMacSapUser::TxOpportunityParameters txOpParams;
1026
1032
1027
  for (unsigned int i = 0; i < ind.m_buildDataList.size (); i++)
1033
  for (unsigned int i = 0; i < ind.m_buildDataList.size (); i++)
1028
    {
1034
    {
 Lines 1054-1060   LteEnbMac::DoSchedDlConfigInd (FfMacSchedSapUser::SchedDlConfigIndParameters ind Link Here 
1054
                  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
1060
                  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
1055
                  NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID" << (uint32_t)lcid<<" carrier id:"<<(uint16_t)m_componentCarrierId);
1061
                  NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID" << (uint32_t)lcid<<" carrier id:"<<(uint16_t)m_componentCarrierId);
1056
                  NS_LOG_DEBUG (this << " rnti= " << rnti << " lcid= " << (uint32_t) lcid << " layer= " << k);
1062
                  NS_LOG_DEBUG (this << " rnti= " << rnti << " lcid= " << (uint32_t) lcid << " layer= " << k);
1057
                  (*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);
1063
                  txOpParams.bytes = ind.m_buildDataList.at (i).m_rlcPduList.at (j).at (k).m_size;
1064
                  txOpParams.layer = k;
1065
                  txOpParams.harqId = ind.m_buildDataList.at (i).m_dci.m_harqProcess;
1066
                  txOpParams.componentCarrierId = m_componentCarrierId;
1067
                  txOpParams.rnti = rnti;
1068
                  txOpParams.lcid = lcid;
1069
                  (*lcidIt).second->NotifyTxOpportunity (txOpParams);
1058
                }
1070
                }
1059
              else
1071
              else
1060
                {
1072
                {
(-)a/src/lte/model/lte-mac-sap.h (-12 / +27 lines)
 Lines 97-113   class LteMacSapUser Link Here 
97
public:
97
public:
98
  virtual ~LteMacSapUser ();
98
  virtual ~LteMacSapUser ();
99
  /**
99
  /**
100
   * Parameters for LteMacSapUser::NotifyTxOpportunity
101
   *
102
   */
103
  struct TxOpportunityParameters
104
  {
105
    uint32_t bytes;  /**< the number of bytes to transmit */
106
    uint8_t layer; /**<  the layer of transmission (MIMO) */
107
    uint8_t harqId; /**< the HARQ ID */
108
    uint8_t componentCarrierId; /**< the component carrier id */
109
    uint16_t rnti; /**< the C-RNTI identifying the UE */
110
    uint8_t lcid; /**< the logical channel id */
111
  };
112
  /**
100
   * Called by the MAC to notify the RLC that the scheduler granted a
113
   * Called by the MAC to notify the RLC that the scheduler granted a
101
   * transmission opportunity to this RLC instance.
114
   * transmission opportunity to this RLC instance.
102
   *
115
   *
103
   * \param bytes the number of bytes to transmit
116
   * \param params the TxOpportunityParameters
104
   * \param layer the layer of transmission (MIMO)
105
   * \param harqId the HARQ ID
106
   * \param componentCarrierId component carrier ID
107
   * \param rnti the RNTI
108
   * \param lcid the LCID
109
   */
117
   */
110
  virtual void NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid) = 0;
118
  virtual void NotifyTxOpportunity (TxOpportunityParameters params) = 0;
111
119
112
  /**
120
  /**
113
   * Called by the MAC to notify the RLC that an HARQ process related
121
   * Called by the MAC to notify the RLC that an HARQ process related
 Lines 117-131   public: Link Here 
117
   */
125
   */
118
  virtual void NotifyHarqDeliveryFailure () = 0;
126
  virtual void NotifyHarqDeliveryFailure () = 0;
119
127
120
128
  /**
129
   * Parameters for LteMacSapUser::ReceivePdu
130
   *
131
   */
132
  struct ReceivePduParameters
133
  {
134
    Ptr<Packet> p;  /**< the RLC PDU to be received */
135
    uint16_t rnti; /**< the C-RNTI identifying the UE */
136
    uint8_t lcid; /**< the logical channel id */
137
  };
121
  /**
138
  /**
122
   * Called by the MAC to notify the RLC of the reception of a new PDU
139
   * Called by the MAC to notify the RLC of the reception of a new PDU
123
   *
140
   *
124
   * \param p the packet
141
   * \param params the ReceivePduParameters
125
   * \param rnti the RNTI
126
   * \param lcid the LCID
127
   */
142
   */
128
  virtual void ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid) = 0;
143
  virtual void ReceivePdu (ReceivePduParameters params) = 0;
129
144
130
};
145
};
131
146
(-)a/src/lte/model/lte-rlc-am.cc (-31 / +31 lines)
 Lines 186-212   LteRlcAm::DoTransmitPdcpPdu (Ptr<Packet> p) Link Here 
186
 */
186
 */
187
187
188
void
188
void
189
LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
189
LteRlcAm::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
190
{
190
{
191
  NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << bytes);
191
  NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << txOpParams.bytes);
192
192
193
  if (bytes < 4)
193
  if (txOpParams.bytes < 4)
194
    {
194
    {
195
      // Stingy MAC: In general, we need more bytes.
195
      // Stingy MAC: In general, we need more bytes.
196
      // There are a more restrictive test for each particular case
196
      // There are a more restrictive test for each particular case
197
      NS_LOG_LOGIC ("TxOpportunity (size = " << bytes << ") too small");
197
      NS_LOG_LOGIC ("TxOpportunity (size = " << txOpParams.bytes << ") too small");
198
      NS_ASSERT_MSG (false, "TxOpportunity (size = " << bytes << ") too small.\n"
198
      NS_ASSERT_MSG (false, "TxOpportunity (size = " << txOpParams.bytes << ") too small.\n"
199
                         << "Your MAC scheduler is assigned too few resource blocks.");
199
                         << "Your MAC scheduler is assigned too few resource blocks.");
200
      return;
200
      return;
201
    }
201
    }
202
202
203
  if ( m_statusPduRequested && ! m_statusProhibitTimer.IsRunning () )
203
  if ( m_statusPduRequested && ! m_statusProhibitTimer.IsRunning () )
204
    {
204
    {
205
      if (bytes < m_statusPduBufferSize)
205
      if (txOpParams.bytes < m_statusPduBufferSize)
206
        {
206
        {
207
          // Stingy MAC: We need more bytes for the STATUS PDU
207
          // Stingy MAC: We need more bytes for the STATUS PDU
208
          NS_LOG_LOGIC ("TxOpportunity (size = " << bytes << ") too small for the STATUS PDU (size = " << m_statusPduBufferSize << ")");
208
          NS_LOG_LOGIC ("TxOpportunity (size = " << txOpParams.bytes << ") too small for the STATUS PDU (size = " << m_statusPduBufferSize << ")");
209
          NS_ASSERT_MSG (false, "TxOpportunity (size = " << bytes << ") too small for the STATUS PDU (size = " << m_statusPduBufferSize << ")\n"
209
          NS_ASSERT_MSG (false, "TxOpportunity (size = " << txOpParams.bytes << ") too small for the STATUS PDU (size = " << m_statusPduBufferSize << ")\n"
210
                             << "Your MAC scheduler is assigned too few resource blocks.");
210
                             << "Your MAC scheduler is assigned too few resource blocks.");
211
          return;
211
          return;
212
        }
212
        }
 Lines 224-230   LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, Link Here 
224
      for (sn = m_vrR; sn < m_vrMs; sn++) 
224
      for (sn = m_vrR; sn < m_vrMs; sn++) 
225
        {
225
        {
226
          NS_LOG_LOGIC ("SN = " << sn);          
226
          NS_LOG_LOGIC ("SN = " << sn);          
227
          if (!rlcAmHeader.OneMoreNackWouldFitIn (bytes))
227
          if (!rlcAmHeader.OneMoreNackWouldFitIn (txOpParams.bytes))
228
            {
228
            {
229
              NS_LOG_LOGIC ("Can't fit more NACKs in STATUS PDU");
229
              NS_LOG_LOGIC ("Can't fit more NACKs in STATUS PDU");
230
              break;
230
              break;
 Lines 267-275   LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, Link Here 
267
      params.pdu = packet;
267
      params.pdu = packet;
268
      params.rnti = m_rnti;
268
      params.rnti = m_rnti;
269
      params.lcid = m_lcid;
269
      params.lcid = m_lcid;
270
      params.layer = layer;
270
      params.layer = txOpParams.layer;
271
      params.harqProcessId = harqId;
271
      params.harqProcessId = txOpParams.harqId;
272
      params.componentCarrierId = componentCarrierId;
272
      params.componentCarrierId = txOpParams.componentCarrierId;
273
273
274
      m_macSapProvider->TransmitPdu (params);
274
      m_macSapProvider->TransmitPdu (params);
275
275
 Lines 296-302   LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, Link Here 
296
296
297
              Ptr<Packet> packet = m_retxBuffer.at (seqNumberValue).m_pdu->Copy ();
297
              Ptr<Packet> packet = m_retxBuffer.at (seqNumberValue).m_pdu->Copy ();
298
              
298
              
299
              if (( packet->GetSize () <= bytes )
299
              if (( packet->GetSize () <= txOpParams.bytes )
300
                  || m_txOpportunityForRetxAlwaysBigEnough)
300
                  || m_txOpportunityForRetxAlwaysBigEnough)
301
                {
301
                {
302
                  // According to 5.2.1, the data field is left as is, but we rebuild the header
302
                  // According to 5.2.1, the data field is left as is, but we rebuild the header
 Lines 353-361   LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, Link Here 
353
                  params.pdu = packet;
353
                  params.pdu = packet;
354
                  params.rnti = m_rnti;
354
                  params.rnti = m_rnti;
355
                  params.lcid = m_lcid;
355
                  params.lcid = m_lcid;
356
                  params.layer = layer;
356
                  params.layer = txOpParams.layer;
357
                  params.harqProcessId = harqId;
357
                  params.harqProcessId = txOpParams.harqId;
358
                  params.componentCarrierId = componentCarrierId;
358
                  params.componentCarrierId = txOpParams.componentCarrierId;
359
                  
359
                  
360
                  m_macSapProvider->TransmitPdu (params);
360
                  m_macSapProvider->TransmitPdu (params);
361
361
 Lines 381-387   LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, Link Here 
381
                }
381
                }
382
              else
382
              else
383
                {
383
                {
384
                  NS_LOG_LOGIC ("TxOpportunity (size = " << bytes << ") too small for retransmission of the packet (size = " << packet->GetSize () << ")");
384
                  NS_LOG_LOGIC ("TxOpportunity (size = " << txOpParams.bytes << ") too small for retransmission of the packet (size = " << packet->GetSize () << ")");
385
                  NS_LOG_LOGIC ("Waiting for bigger TxOpportunity");
385
                  NS_LOG_LOGIC ("Waiting for bigger TxOpportunity");
386
                  return;
386
                  return;
387
                }
387
                }
 Lines 391-401   LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, Link Here 
391
    }
391
    }
392
  else if ( m_txonBufferSize > 0 )
392
  else if ( m_txonBufferSize > 0 )
393
    {
393
    {
394
      if (bytes < 7)
394
      if (txOpParams.bytes < 7)
395
      {
395
      {
396
        // Stingy MAC: We need more bytes for new DATA PDUs.
396
        // Stingy MAC: We need more bytes for new DATA PDUs.
397
        NS_LOG_LOGIC ("TxOpportunity (size = " << bytes << ") too small for DATA PDU");
397
        NS_LOG_LOGIC ("TxOpportunity (size = " << txOpParams.bytes << ") too small for DATA PDU");
398
        NS_ASSERT_MSG (false, "TxOpportunity (size = " << bytes << ") too small for DATA PDU\n"
398
        NS_ASSERT_MSG (false, "TxOpportunity (size = " << txOpParams.bytes << ") too small for DATA PDU\n"
399
                           << "Your MAC scheduler is assigned too few resource blocks.");
399
                           << "Your MAC scheduler is assigned too few resource blocks.");
400
        return;
400
        return;
401
      }
401
      }
 Lines 426-432   LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, Link Here 
426
  rlcAmHeader.SetDataPdu ();
426
  rlcAmHeader.SetDataPdu ();
427
427
428
  // Build Data field
428
  // Build Data field
429
  uint32_t nextSegmentSize = bytes - 4;
429
  uint32_t nextSegmentSize = txOpParams.bytes - 4;
430
  uint32_t nextSegmentId = 1;
430
  uint32_t nextSegmentId = 1;
431
  uint32_t dataFieldTotalSize = 0;
431
  uint32_t dataFieldTotalSize = 0;
432
  uint32_t dataFieldAddedSize = 0;
432
  uint32_t dataFieldAddedSize = 0;
 Lines 734-742   LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, Link Here 
734
  params.pdu = packet;
734
  params.pdu = packet;
735
  params.rnti = m_rnti;
735
  params.rnti = m_rnti;
736
  params.lcid = m_lcid;
736
  params.lcid = m_lcid;
737
  params.layer = layer;
737
  params.layer = txOpParams.layer;
738
  params.harqProcessId = harqId;
738
  params.harqProcessId = txOpParams.harqId;
739
  params.componentCarrierId = componentCarrierId;
739
  params.componentCarrierId = txOpParams.componentCarrierId;
740
740
741
  m_macSapProvider->TransmitPdu (params);
741
  m_macSapProvider->TransmitPdu (params);
742
}
742
}
 Lines 749-769   LteRlcAm::DoNotifyHarqDeliveryFailure () Link Here 
749
749
750
750
751
void
751
void
752
LteRlcAm::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
752
LteRlcAm::DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
753
{
753
{
754
  NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << p->GetSize ());
754
  NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << rxPduParams.p->GetSize ());
755
755
756
  // Receiver timestamp
756
  // Receiver timestamp
757
  RlcTag rlcTag;
757
  RlcTag rlcTag;
758
  Time delay;
758
  Time delay;
759
  NS_ASSERT_MSG (p->PeekPacketTag (rlcTag), "RlcTag is missing");
759
  NS_ASSERT_MSG (rxPduParams.p->PeekPacketTag (rlcTag), "RlcTag is missing");
760
  p->RemovePacketTag (rlcTag);
760
  rxPduParams.p->RemovePacketTag (rlcTag);
761
  delay = Simulator::Now() - rlcTag.GetSenderTimestamp ();
761
  delay = Simulator::Now() - rlcTag.GetSenderTimestamp ();
762
  m_rxPdu (m_rnti, m_lcid, p->GetSize (), delay.GetNanoSeconds ());
762
  m_rxPdu (m_rnti, m_lcid, rxPduParams.p->GetSize (), delay.GetNanoSeconds ());
763
763
764
  // Get RLC header parameters
764
  // Get RLC header parameters
765
  LteRlcAmHeader rlcAmHeader;
765
  LteRlcAmHeader rlcAmHeader;
766
  p->PeekHeader (rlcAmHeader);
766
  rxPduParams.p->PeekHeader (rlcAmHeader);
767
  NS_LOG_LOGIC ("RLC header: " << rlcAmHeader);
767
  NS_LOG_LOGIC ("RLC header: " << rlcAmHeader);
768
768
769
  if ( rlcAmHeader.IsDataPdu () )
769
  if ( rlcAmHeader.IsDataPdu () )
 Lines 889-895   LteRlcAm::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid) Link Here 
889
          else
889
          else
890
            {
890
            {
891
              NS_LOG_LOGIC ("Place PDU in the reception buffer ( SN = " << seqNumber << " )");
891
              NS_LOG_LOGIC ("Place PDU in the reception buffer ( SN = " << seqNumber << " )");
892
              m_rxonBuffer[ seqNumber.GetValue () ].m_byteSegments.push_back (p);
892
              m_rxonBuffer[ seqNumber.GetValue () ].m_byteSegments.push_back (rxPduParams.p);
893
              m_rxonBuffer[ seqNumber.GetValue () ].m_pduComplete = true;
893
              m_rxonBuffer[ seqNumber.GetValue () ].m_pduComplete = true;
894
            }
894
            }
895
895
(-)a/src/lte/model/lte-rlc-am.h (-8 / +3 lines)
 Lines 55-73   public: Link Here 
55
  /**
55
  /**
56
   * MAC SAP
56
   * MAC SAP
57
   *
57
   *
58
   * \param bytes number of bytes
58
   * \param txOpParams the LteMacSapUser::TxOpportunityParameters
59
   * \param layer 
60
   * \param harqId HARQ ID
61
   * \param componentCarrierId component carrier ID
62
   * \param rnti the RNTI
63
   * \param lcid the LCID
64
   */
59
   */
65
  virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
60
  virtual void DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
66
    /**
61
    /**
67
   * Notify HARQ delivery failure
62
   * Notify HARQ delivery failure
68
   */
63
   */
69
  virtual void DoNotifyHarqDeliveryFailure ();
64
  virtual void DoNotifyHarqDeliveryFailure ();
70
  virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
65
  virtual void DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
71
66
72
private:
67
private:
73
  /**
68
  /**
(-)a/src/lte/model/lte-rlc-tm.cc (-13 / +13 lines)
 Lines 111-119   LteRlcTm::DoTransmitPdcpPdu (Ptr<Packet> p) Link Here 
111
 */
111
 */
112
112
113
void
113
void
114
LteRlcTm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
114
LteRlcTm::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
115
{
115
{
116
  NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << bytes  << (uint32_t) layer << (uint32_t) harqId);
116
  NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << txOpParams.bytes  << (uint32_t) txOpParams.layer << (uint32_t) txOpParams.harqId);
117
117
118
  // 5.1.1.1 Transmit operations 
118
  // 5.1.1.1 Transmit operations 
119
  // 5.1.1.1.1 General
119
  // 5.1.1.1.1 General
 Lines 129-137   LteRlcTm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, Link Here 
129
129
130
  Ptr<Packet> packet = (*(m_txBuffer.begin ()))->Copy ();
130
  Ptr<Packet> packet = (*(m_txBuffer.begin ()))->Copy ();
131
131
132
  if (bytes < packet->GetSize ())
132
  if (txOpParams.bytes < packet->GetSize ())
133
    {
133
    {
134
      NS_LOG_WARN ("TX opportunity too small = " << bytes << " (PDU size: " << packet->GetSize () << ")");
134
      NS_LOG_WARN ("TX opportunity too small = " << txOpParams.bytes << " (PDU size: " << packet->GetSize () << ")");
135
      return;
135
      return;
136
    }
136
    }
137
137
 Lines 148-156   LteRlcTm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, Link Here 
148
  params.pdu = packet;
148
  params.pdu = packet;
149
  params.rnti = m_rnti;
149
  params.rnti = m_rnti;
150
  params.lcid = m_lcid;
150
  params.lcid = m_lcid;
151
  params.layer = layer;
151
  params.layer = txOpParams.layer;
152
  params.harqProcessId = harqId;
152
  params.harqProcessId = txOpParams.harqId;
153
  params.componentCarrierId = componentCarrierId;
153
  params.componentCarrierId = txOpParams.componentCarrierId;
154
154
155
  m_macSapProvider->TransmitPdu (params);
155
  m_macSapProvider->TransmitPdu (params);
156
156
 Lines 168-191   LteRlcTm::DoNotifyHarqDeliveryFailure () Link Here 
168
}
168
}
169
169
170
void
170
void
171
LteRlcTm::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
171
LteRlcTm::DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
172
{
172
{
173
  NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << p->GetSize ());
173
  NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << rxPduParams.p->GetSize ());
174
174
175
  // Receiver timestamp
175
  // Receiver timestamp
176
  RlcTag rlcTag;
176
  RlcTag rlcTag;
177
  Time delay;
177
  Time delay;
178
  NS_ASSERT_MSG (p->PeekPacketTag (rlcTag), "RlcTag is missing");
178
  NS_ASSERT_MSG (rxPduParams.p->PeekPacketTag (rlcTag), "RlcTag is missing");
179
  p->RemovePacketTag (rlcTag);
179
  rxPduParams.p->RemovePacketTag (rlcTag);
180
  delay = Simulator::Now() - rlcTag.GetSenderTimestamp ();
180
  delay = Simulator::Now() - rlcTag.GetSenderTimestamp ();
181
  m_rxPdu (m_rnti, m_lcid, p->GetSize (), delay.GetNanoSeconds ());
181
  m_rxPdu (m_rnti, m_lcid, rxPduParams.p->GetSize (), delay.GetNanoSeconds ());
182
182
183
  // 5.1.1.2 Receive operations 
183
  // 5.1.1.2 Receive operations 
184
  // 5.1.1.2.1  General
184
  // 5.1.1.2.1  General
185
  // When receiving a new TMD PDU from lower layer, the receiving TM RLC entity shall:
185
  // When receiving a new TMD PDU from lower layer, the receiving TM RLC entity shall:
186
  // - deliver the TMD PDU without any modification to upper layer.
186
  // - deliver the TMD PDU without any modification to upper layer.
187
187
188
   m_rlcSapUser->ReceivePdcpPdu (p);
188
   m_rlcSapUser->ReceivePdcpPdu (rxPduParams.p);
189
}
189
}
190
190
191
191
(-)a/src/lte/model/lte-rlc-tm.h (-8 / +3 lines)
 Lines 54-72   public: Link Here 
54
  /**
54
  /**
55
   * MAC SAP
55
   * MAC SAP
56
   * 
56
   * 
57
   * \param bytes number of bytes
57
   * \param txOpParams the LteMacSapUser::TxOpportunityParameters
58
   * \param layer the layer
59
   * \param harqId HARQ ID
60
   * \param componentCarrierId component carrier ID
61
   * \param rnti the RNTI
62
   * \param lcid the LCID
63
   */
58
   */
64
  virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
59
  virtual void DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
65
  /**
60
  /**
66
   * Notify HARQ deliver failure
61
   * Notify HARQ deliver failure
67
   */
62
   */
68
  virtual void DoNotifyHarqDeliveryFailure ();
63
  virtual void DoNotifyHarqDeliveryFailure ();
69
  virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
64
  virtual void DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
70
65
71
private:
66
private:
72
  /// Expire RBS timer function
67
  /// Expire RBS timer function
(-)a/src/lte/model/lte-rlc-um.cc (-16 / +16 lines)
 Lines 124-137   LteRlcUm::DoTransmitPdcpPdu (Ptr<Packet> p) Link Here 
124
 */
124
 */
125
125
126
void
126
void
127
LteRlcUm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
127
LteRlcUm::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
128
{
128
{
129
  NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << bytes);
129
  NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << txOpParams.bytes);
130
130
131
  if (bytes <= 2)
131
  if (txOpParams.bytes <= 2)
132
    {
132
    {
133
      // Stingy MAC: Header fix part is 2 bytes, we need more bytes for the data
133
      // Stingy MAC: Header fix part is 2 bytes, we need more bytes for the data
134
      NS_LOG_LOGIC ("TX opportunity too small = " << bytes);
134
      NS_LOG_LOGIC ("TX opportunity too small = " << txOpParams.bytes);
135
      return;
135
      return;
136
    }
136
    }
137
137
 Lines 139-145   LteRlcUm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, Link Here 
139
  LteRlcHeader rlcHeader;
139
  LteRlcHeader rlcHeader;
140
140
141
  // Build Data field
141
  // Build Data field
142
  uint32_t nextSegmentSize = bytes - 2;
142
  uint32_t nextSegmentSize = txOpParams.bytes - 2;
143
  uint32_t nextSegmentId = 1;
143
  uint32_t nextSegmentId = 1;
144
  uint32_t dataFieldTotalSize = 0;
144
  uint32_t dataFieldTotalSize = 0;
145
  uint32_t dataFieldAddedSize = 0;
145
  uint32_t dataFieldAddedSize = 0;
 Lines 387-395   LteRlcUm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, Link Here 
387
  params.pdu = packet;
387
  params.pdu = packet;
388
  params.rnti = m_rnti;
388
  params.rnti = m_rnti;
389
  params.lcid = m_lcid;
389
  params.lcid = m_lcid;
390
  params.layer = layer;
390
  params.layer = txOpParams.layer;
391
  params.harqProcessId = harqId;
391
  params.harqProcessId = txOpParams.harqId;
392
  params.componentCarrierId = componentCarrierId;
392
  params.componentCarrierId = txOpParams.componentCarrierId;
393
393
394
  m_macSapProvider->TransmitPdu (params);
394
  m_macSapProvider->TransmitPdu (params);
395
395
 Lines 407-429   LteRlcUm::DoNotifyHarqDeliveryFailure () Link Here 
407
}
407
}
408
408
409
void
409
void
410
LteRlcUm::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
410
LteRlcUm::DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
411
{
411
{
412
  NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << p->GetSize ());
412
  NS_LOG_FUNCTION (this << m_rnti << (uint32_t) m_lcid << rxPduParams.p->GetSize ());
413
413
414
  // Receiver timestamp
414
  // Receiver timestamp
415
  RlcTag rlcTag;
415
  RlcTag rlcTag;
416
  Time delay;
416
  Time delay;
417
  NS_ASSERT_MSG (p->PeekPacketTag (rlcTag), "RlcTag is missing");
417
  NS_ASSERT_MSG (rxPduParams.p->PeekPacketTag (rlcTag), "RlcTag is missing");
418
  p->RemovePacketTag (rlcTag);
418
  rxPduParams.p->RemovePacketTag (rlcTag);
419
  delay = Simulator::Now() - rlcTag.GetSenderTimestamp ();
419
  delay = Simulator::Now() - rlcTag.GetSenderTimestamp ();
420
  m_rxPdu (m_rnti, m_lcid, p->GetSize (), delay.GetNanoSeconds ());
420
  m_rxPdu (m_rnti, m_lcid, rxPduParams.p->GetSize (), delay.GetNanoSeconds ());
421
421
422
  // 5.1.2.2 Receive operations
422
  // 5.1.2.2 Receive operations
423
423
424
  // Get RLC header parameters
424
  // Get RLC header parameters
425
  LteRlcHeader rlcHeader;
425
  LteRlcHeader rlcHeader;
426
  p->PeekHeader (rlcHeader);
426
  rxPduParams.p->PeekHeader (rlcHeader);
427
  NS_LOG_LOGIC ("RLC header: " << rlcHeader);
427
  NS_LOG_LOGIC ("RLC header: " << rlcHeader);
428
  SequenceNumber10 seqNumber = rlcHeader.GetSequenceNumber ();
428
  SequenceNumber10 seqNumber = rlcHeader.GetSequenceNumber ();
429
429
 Lines 460-472   LteRlcUm::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid) Link Here 
460
     )
460
     )
461
    {
461
    {
462
      NS_LOG_LOGIC ("PDU discarded");
462
      NS_LOG_LOGIC ("PDU discarded");
463
      p = 0;
463
      rxPduParams.p = 0;
464
      return;
464
      return;
465
    }
465
    }
466
  else
466
  else
467
    {
467
    {
468
      NS_LOG_LOGIC ("Place PDU in the reception buffer");
468
      NS_LOG_LOGIC ("Place PDU in the reception buffer");
469
      m_rxBuffer[seqNumber.GetValue ()] = p;
469
      m_rxBuffer[seqNumber.GetValue ()] = rxPduParams.p;
470
    }
470
    }
471
471
472
472
(-)a/src/lte/model/lte-rlc-um.h (-8 / +3 lines)
 Lines 54-69   public: Link Here 
54
  /**
54
  /**
55
   * MAC SAP
55
   * MAC SAP
56
   *
56
   *
57
   * \param bytes the number of bytes
57
   * \param txOpParams the LteMacSapUser::TxOpportunityParameters
58
   * \param layer the layer
59
   * \param harqId the HARQ ID
60
   * \param componentCarrierId component carrier ID
61
   * \param rnti the RNTI
62
   * \param lcid the LCID
63
   */
58
   */
64
  virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
59
  virtual void DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
65
  virtual void DoNotifyHarqDeliveryFailure ();
60
  virtual void DoNotifyHarqDeliveryFailure ();
66
  virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
61
  virtual void DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
67
62
68
private:
63
private:
69
  /// Expire reordering timer
64
  /// Expire reordering timer
(-)a/src/lte/model/lte-rlc.cc (-20 / +20 lines)
 Lines 45-53   public: Link Here 
45
  LteRlcSpecificLteMacSapUser (LteRlc* rlc);
45
  LteRlcSpecificLteMacSapUser (LteRlc* rlc);
46
46
47
  // Interface implemented from LteMacSapUser
47
  // Interface implemented from LteMacSapUser
48
  virtual void NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
48
  virtual void NotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters params);
49
  virtual void NotifyHarqDeliveryFailure ();
49
  virtual void NotifyHarqDeliveryFailure ();
50
  virtual void ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
50
  virtual void ReceivePdu (LteMacSapUser::ReceivePduParameters params);
51
51
52
private:
52
private:
53
  LteRlcSpecificLteMacSapUser ();
53
  LteRlcSpecificLteMacSapUser ();
 Lines 64-72   LteRlcSpecificLteMacSapUser::LteRlcSpecificLteMacSapUser () Link Here 
64
}
64
}
65
65
66
void
66
void
67
LteRlcSpecificLteMacSapUser::NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
67
LteRlcSpecificLteMacSapUser::NotifyTxOpportunity (TxOpportunityParameters params)
68
{
68
{
69
  m_rlc->DoNotifyTxOpportunity (bytes, layer, harqId, componentCarrierId, rnti, lcid);
69
  m_rlc->DoNotifyTxOpportunity (params);
70
}
70
}
71
71
72
void
72
void
 Lines 76-84   LteRlcSpecificLteMacSapUser::NotifyHarqDeliveryFailure () Link Here 
76
}
76
}
77
77
78
void
78
void
79
LteRlcSpecificLteMacSapUser::ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
79
LteRlcSpecificLteMacSapUser::ReceivePdu (LteMacSapUser::ReceivePduParameters params)
80
{
80
{
81
  m_rlc->DoReceivePdu (p, rnti, lcid);
81
  m_rlc->DoReceivePdu (params);
82
}
82
}
83
83
84
84
 Lines 217-257   LteRlcSm::DoTransmitPdcpPdu (Ptr<Packet> p) Link Here 
217
}
217
}
218
218
219
void
219
void
220
LteRlcSm::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
220
LteRlcSm::DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
221
{
221
{
222
  NS_LOG_FUNCTION (this << p);
222
  NS_LOG_FUNCTION (this << rxPduParams.p);
223
  // RLC Performance evaluation
223
  // RLC Performance evaluation
224
  RlcTag rlcTag;
224
  RlcTag rlcTag;
225
  Time delay;
225
  Time delay;
226
  NS_ASSERT_MSG (p->PeekPacketTag (rlcTag), "RlcTag is missing");
226
  NS_ASSERT_MSG (rxPduParams.p->PeekPacketTag (rlcTag), "RlcTag is missing");
227
  p->RemovePacketTag (rlcTag);
227
  rxPduParams.p->RemovePacketTag (rlcTag);
228
  delay = Simulator::Now() - rlcTag.GetSenderTimestamp ();
228
  delay = Simulator::Now() - rlcTag.GetSenderTimestamp ();
229
  NS_LOG_LOGIC (" RNTI=" << m_rnti 
229
  NS_LOG_LOGIC (" RNTI=" << m_rnti 
230
                << " LCID=" << (uint32_t) m_lcid 
230
                << " LCID=" << (uint32_t) m_lcid 
231
                << " size=" << p->GetSize () 
231
                << " size=" << rxPduParams.p->GetSize ()
232
                << " delay=" << delay.GetNanoSeconds ());
232
                << " delay=" << delay.GetNanoSeconds ());
233
  m_rxPdu(m_rnti, m_lcid, p->GetSize (), delay.GetNanoSeconds () );
233
  m_rxPdu(m_rnti, m_lcid, rxPduParams.p->GetSize (), delay.GetNanoSeconds () );
234
}
234
}
235
235
236
void
236
void
237
LteRlcSm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
237
LteRlcSm::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
238
{
238
{
239
  NS_LOG_FUNCTION (this << bytes);
239
  NS_LOG_FUNCTION (this << txOpParams.bytes);
240
  LteMacSapProvider::TransmitPduParameters params;
240
  LteMacSapProvider::TransmitPduParameters params;
241
  params.pdu = Create<Packet> (bytes);
241
  params.pdu = Create<Packet> (txOpParams.bytes);
242
  params.rnti = m_rnti;
242
  params.rnti = m_rnti;
243
  params.lcid = m_lcid;
243
  params.lcid = m_lcid;
244
  params.layer = layer;
244
  params.layer = txOpParams.layer;
245
  params.harqProcessId = harqId;
245
  params.harqProcessId = txOpParams.harqId;
246
  params.componentCarrierId = componentCarrierId;
246
  params.componentCarrierId = txOpParams.componentCarrierId;
247
247
248
  // RLC Performance evaluation
248
  // RLC Performance evaluation
249
  RlcTag tag (Simulator::Now());
249
  RlcTag tag (Simulator::Now());
250
  params.pdu->AddPacketTag (tag);
250
  params.pdu->AddPacketTag (tag);
251
  NS_LOG_LOGIC (" RNTI=" << m_rnti 
251
  NS_LOG_LOGIC (" RNTI=" << m_rnti 
252
                << " LCID=" << (uint32_t) m_lcid 
252
                << " LCID=" << (uint32_t) m_lcid 
253
                << " size=" << bytes);
253
                << " size=" << txOpParams.bytes);
254
  m_txPdu(m_rnti, m_lcid, bytes);
254
  m_txPdu(m_rnti, m_lcid, txOpParams.bytes);
255
255
256
  m_macSapProvider->TransmitPdu (params);
256
  m_macSapProvider->TransmitPdu (params);
257
  ReportBufferStatus ();
257
  ReportBufferStatus ();
(-)a/src/lte/model/lte-rlc.h (-13 / +6 lines)
 Lines 148-161   protected: Link Here 
148
  /**
148
  /**
149
   * Notify transmit opportunity
149
   * Notify transmit opportunity
150
   *
150
   *
151
   * \param bytes number of bytes
151
   * \param params LteMacSapUser::TxOpportunityParameters
152
   * \param layer the layer
153
   * \param harqId the HARQ ID
154
   * \param componentCarrierId component carrier ID
155
   * \param rnti the RNTI
156
   * \param lcid the LCID
157
   */ 
152
   */ 
158
  virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid) = 0;
153
  virtual void DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters params) = 0;
159
  /**
154
  /**
160
   * Notify HARQ delivery failure
155
   * Notify HARQ delivery failure
161
   */ 
156
   */ 
 Lines 163-173   protected: Link Here 
163
  /**
158
  /**
164
   * Receive PDU function
159
   * Receive PDU function
165
   *
160
   *
166
   * \param p the packet
161
   * \param params the LteMacSapUser::ReceivePduParameters
167
   * \param rnti the RNTI
168
   * \param lcid the LCID
169
   */ 
162
   */ 
170
  virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid) = 0;
163
  virtual void DoReceivePdu (LteMacSapUser::ReceivePduParameters params) = 0;
171
164
172
  LteMacSapUser* m_macSapUser; ///< MAC SAP user
165
  LteMacSapUser* m_macSapUser; ///< MAC SAP user
173
  LteMacSapProvider* m_macSapProvider; ///< MAC SAP provider
166
  LteMacSapProvider* m_macSapProvider; ///< MAC SAP provider
 Lines 210-218   public: Link Here 
210
  virtual void DoDispose ();
203
  virtual void DoDispose ();
211
204
212
  virtual void DoTransmitPdcpPdu (Ptr<Packet> p);
205
  virtual void DoTransmitPdcpPdu (Ptr<Packet> p);
213
  virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
206
  virtual void DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
214
  virtual void DoNotifyHarqDeliveryFailure ();
207
  virtual void DoNotifyHarqDeliveryFailure ();
215
  virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
208
  virtual void DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
216
209
217
210
218
211
(-)a/src/lte/model/lte-ue-mac.cc (-7 / +45 lines)
 Lines 463-469   LteUeMac::RecvRaResponse (BuildRarListElement_s raResponse) Link Here 
463
        {
463
        {
464
          NS_FATAL_ERROR ("Function called on wrong componentCarrier");
464
          NS_FATAL_ERROR ("Function called on wrong componentCarrier");
465
        }
465
        }
466
      lc0InfoIt->second.macSapUser->NotifyTxOpportunity (raResponse.m_grant.m_tbSize, 0, 0, m_componentCarrierId, m_rnti, lc0Lcid); 
466
      LteMacSapUser::TxOpportunityParameters txOpParams;
467
      txOpParams.bytes = raResponse.m_grant.m_tbSize;
468
      txOpParams.layer = 0;
469
      txOpParams.harqId = 0;
470
      txOpParams.componentCarrierId = m_componentCarrierId;
471
      txOpParams.rnti = m_rnti;
472
      txOpParams.lcid = lc0Lcid;
473
      lc0InfoIt->second.macSapUser->NotifyTxOpportunity (txOpParams);
467
      lc0BsrIt->second.txQueueSize = 0;
474
      lc0BsrIt->second.txQueueSize = 0;
468
    }
475
    }
469
}
476
}
 Lines 589-595   LteUeMac::DoReceivePhyPdu (Ptr<Packet> p) Link Here 
589
      std::map <uint8_t, LcInfo>::const_iterator it = m_lcInfoMap.find (tag.GetLcid ());
596
      std::map <uint8_t, LcInfo>::const_iterator it = m_lcInfoMap.find (tag.GetLcid ());
590
      if (it != m_lcInfoMap.end ())
597
      if (it != m_lcInfoMap.end ())
591
        {
598
        {
592
          it->second.macSapUser->ReceivePdu (p, m_rnti, tag.GetLcid ());
599
          LteMacSapUser::ReceivePduParameters rxPduParams;
600
          rxPduParams.p = p;
601
          rxPduParams.rnti = m_rnti;
602
          rxPduParams.lcid = tag.GetLcid ();
603
          it->second.macSapUser->ReceivePdu (rxPduParams);
593
        }
604
        }
594
      else
605
      else
595
        {
606
        {
 Lines 650-655   LteUeMac::DoReceiveLteControlMessage (Ptr<LteControlMessage> msg) Link Here 
650
                }
661
                }
651
            }
662
            }
652
          NS_LOG_LOGIC (this << " UE " << m_rnti << ": UL-CQI notified TxOpportunity of " << dci.m_tbSize << " => " << bytesPerActiveLc << " bytes per active LC" << " statusPduMinSize " << statusPduMinSize);
663
          NS_LOG_LOGIC (this << " UE " << m_rnti << ": UL-CQI notified TxOpportunity of " << dci.m_tbSize << " => " << bytesPerActiveLc << " bytes per active LC" << " statusPduMinSize " << statusPduMinSize);
664
665
          LteMacSapUser::TxOpportunityParameters txOpParams;
666
653
          for (it = m_lcInfoMap.begin (); it != m_lcInfoMap.end (); it++)
667
          for (it = m_lcInfoMap.begin (); it != m_lcInfoMap.end (); it++)
654
            {
668
            {
655
              itBsr = m_ulBsrReceived.find ((*it).first);
669
              itBsr = m_ulBsrReceived.find ((*it).first);
 Lines 661-667   LteUeMac::DoReceiveLteControlMessage (Ptr<LteControlMessage> msg) Link Here 
661
                {
675
                {
662
                  if ((statusPduPriority) && ((*itBsr).second.statusPduSize == statusPduMinSize))
676
                  if ((statusPduPriority) && ((*itBsr).second.statusPduSize == statusPduMinSize))
663
                    {
677
                    {
664
                      (*it).second.macSapUser->NotifyTxOpportunity ((*itBsr).second.statusPduSize, 0, 0, m_componentCarrierId, m_rnti, (*it).first);
678
                      txOpParams.bytes = (*itBsr).second.statusPduSize;
679
                      txOpParams.layer = 0;
680
                      txOpParams.harqId = 0;
681
                      txOpParams.componentCarrierId = m_componentCarrierId;
682
                      txOpParams.rnti = m_rnti;
683
                      txOpParams.lcid = (*it).first;
684
                      (*it).second.macSapUser->NotifyTxOpportunity (txOpParams);
665
                      NS_LOG_LOGIC (this << "\t" << bytesPerActiveLc << " send  " << (*itBsr).second.statusPduSize << " status bytes to LC " << (uint32_t)(*it).first << " statusQueue " << (*itBsr).second.statusPduSize << " retxQueue" << (*itBsr).second.retxQueueSize << " txQueue" <<  (*itBsr).second.txQueueSize);
685
                      NS_LOG_LOGIC (this << "\t" << bytesPerActiveLc << " send  " << (*itBsr).second.statusPduSize << " status bytes to LC " << (uint32_t)(*it).first << " statusQueue " << (*itBsr).second.statusPduSize << " retxQueue" << (*itBsr).second.retxQueueSize << " txQueue" <<  (*itBsr).second.txQueueSize);
666
                      (*itBsr).second.statusPduSize = 0;
686
                      (*itBsr).second.statusPduSize = 0;
667
                      break;
687
                      break;
 Lines 672-678   LteUeMac::DoReceiveLteControlMessage (Ptr<LteControlMessage> msg) Link Here 
672
                      NS_LOG_LOGIC (this << "\t" << bytesPerActiveLc << " bytes to LC " << (uint32_t)(*it).first << " statusQueue " << (*itBsr).second.statusPduSize << " retxQueue" << (*itBsr).second.retxQueueSize << " txQueue" <<  (*itBsr).second.txQueueSize);
692
                      NS_LOG_LOGIC (this << "\t" << bytesPerActiveLc << " bytes to LC " << (uint32_t)(*it).first << " statusQueue " << (*itBsr).second.statusPduSize << " retxQueue" << (*itBsr).second.retxQueueSize << " txQueue" <<  (*itBsr).second.txQueueSize);
673
                      if (((*itBsr).second.statusPduSize > 0) && (bytesForThisLc > (*itBsr).second.statusPduSize))
693
                      if (((*itBsr).second.statusPduSize > 0) && (bytesForThisLc > (*itBsr).second.statusPduSize))
674
                        {
694
                        {
675
                          (*it).second.macSapUser->NotifyTxOpportunity ((*itBsr).second.statusPduSize, 0, 0, m_componentCarrierId, m_rnti, (*it).first);
695
                          txOpParams.bytes = (*itBsr).second.statusPduSize;
696
                          txOpParams.layer = 0;
697
                          txOpParams.harqId = 0;
698
                          txOpParams.componentCarrierId = m_componentCarrierId;
699
                          txOpParams.rnti = m_rnti;
700
                          txOpParams.lcid = (*it).first;
701
                          (*it).second.macSapUser->NotifyTxOpportunity (txOpParams);
676
                          bytesForThisLc -= (*itBsr).second.statusPduSize;
702
                          bytesForThisLc -= (*itBsr).second.statusPduSize;
677
                          NS_LOG_DEBUG (this << " serve STATUS " << (*itBsr).second.statusPduSize);
703
                          NS_LOG_DEBUG (this << " serve STATUS " << (*itBsr).second.statusPduSize);
678
                          (*itBsr).second.statusPduSize = 0;
704
                          (*itBsr).second.statusPduSize = 0;
 Lines 692-698   LteUeMac::DoReceiveLteControlMessage (Ptr<LteControlMessage> msg) Link Here 
692
                          if ((*itBsr).second.retxQueueSize > 0)
718
                          if ((*itBsr).second.retxQueueSize > 0)
693
                            {
719
                            {
694
                              NS_LOG_DEBUG (this << " serve retx DATA, bytes " << bytesForThisLc);
720
                              NS_LOG_DEBUG (this << " serve retx DATA, bytes " << bytesForThisLc);
695
                              (*it).second.macSapUser->NotifyTxOpportunity (bytesForThisLc, 0, 0, m_componentCarrierId, m_rnti, (*it).first);
721
                              txOpParams.bytes = bytesForThisLc;
722
                              txOpParams.layer = 0;
723
                              txOpParams.harqId = 0;
724
                              txOpParams.componentCarrierId = m_componentCarrierId;
725
                              txOpParams.rnti = m_rnti;
726
                              txOpParams.lcid = (*it).first;
727
                              (*it).second.macSapUser->NotifyTxOpportunity (txOpParams);
696
                              if ((*itBsr).second.retxQueueSize >= bytesForThisLc)
728
                              if ((*itBsr).second.retxQueueSize >= bytesForThisLc)
697
                                {
729
                                {
698
                                  (*itBsr).second.retxQueueSize -= bytesForThisLc;
730
                                  (*itBsr).second.retxQueueSize -= bytesForThisLc;
 Lines 712-718   LteUeMac::DoReceiveLteControlMessage (Ptr<LteControlMessage> msg) Link Here 
712
                                  // overestimate RLC overhead rather than
744
                                  // overestimate RLC overhead rather than
713
                                  // underestimate it and risk unneeded
745
                                  // underestimate it and risk unneeded
714
                                  // segmentation which increases delay 
746
                                  // segmentation which increases delay 
715
                                  rlcOverhead = 4;                                  
747
                                  rlcOverhead = 4;
716
                                }
748
                                }
717
                              else
749
                              else
718
                                {
750
                                {
 Lines 720-726   LteUeMac::DoReceiveLteControlMessage (Ptr<LteControlMessage> msg) Link Here 
720
                                  rlcOverhead = 2;
752
                                  rlcOverhead = 2;
721
                                }
753
                                }
722
                              NS_LOG_DEBUG (this << " serve tx DATA, bytes " << bytesForThisLc << ", RLC overhead " << rlcOverhead);
754
                              NS_LOG_DEBUG (this << " serve tx DATA, bytes " << bytesForThisLc << ", RLC overhead " << rlcOverhead);
723
                              (*it).second.macSapUser->NotifyTxOpportunity (bytesForThisLc, 0, 0, m_componentCarrierId, m_rnti, (*it).first);
755
                              txOpParams.bytes = bytesForThisLc;
756
                              txOpParams.layer = 0;
757
                              txOpParams.harqId = 0;
758
                              txOpParams.componentCarrierId = m_componentCarrierId;
759
                              txOpParams.rnti = m_rnti;
760
                              txOpParams.lcid = (*it).first;
761
                              (*it).second.macSapUser->NotifyTxOpportunity (txOpParams);
724
                              if ((*itBsr).second.txQueueSize >= bytesForThisLc - rlcOverhead)
762
                              if ((*itBsr).second.txQueueSize >= bytesForThisLc - rlcOverhead)
725
                                {
763
                                {
726
                                  (*itBsr).second.txQueueSize -= bytesForThisLc - rlcOverhead;
764
                                  (*itBsr).second.txQueueSize -= bytesForThisLc - rlcOverhead;
(-)a/src/lte/model/no-op-component-carrier-manager.cc (-12 / +12 lines)
 Lines 99-126   NoOpComponentCarrierManager::DoReportBufferStatus (LteMacSapProvider::ReportBuff Link Here 
99
}
99
}
100
100
101
void
101
void
102
NoOpComponentCarrierManager::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
102
NoOpComponentCarrierManager::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
103
{
103
{
104
  NS_LOG_FUNCTION (this);
104
  NS_LOG_FUNCTION (this);
105
  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_ueAttached.find (rnti);
105
  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_ueAttached.find (txOpParams.rnti);
106
  NS_ASSERT_MSG (rntiIt != m_ueAttached.end (), "could not find RNTI" << rnti);
106
  NS_ASSERT_MSG (rntiIt != m_ueAttached.end (), "could not find RNTI" << txOpParams.rnti);
107
  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
107
  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (txOpParams.lcid);
108
  NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID " << (uint16_t) lcid);
108
  NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID " << (uint16_t) txOpParams.lcid);
109
  NS_LOG_DEBUG (this << " rnti= " << rnti << " lcid= " << (uint32_t) lcid << " layer= " << (uint32_t)layer<<" ccId="<< (uint32_t)componentCarrierId);
109
  NS_LOG_DEBUG (this << " rnti= " << txOpParams.rnti << " lcid= " << (uint32_t) txOpParams.lcid << " layer= " << (uint32_t)txOpParams.layer<<" ccId="<< (uint32_t)txOpParams.componentCarrierId);
110
  (*lcidIt).second->NotifyTxOpportunity (bytes, layer, harqId, componentCarrierId, rnti, lcid);
110
  (*lcidIt).second->NotifyTxOpportunity (txOpParams);
111
111
112
}
112
}
113
113
114
void
114
void
115
NoOpComponentCarrierManager::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
115
NoOpComponentCarrierManager::DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
116
{
116
{
117
  NS_LOG_FUNCTION (this);
117
  NS_LOG_FUNCTION (this);
118
  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_ueAttached.find (rnti);
118
  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_ueAttached.find (rxPduParams.rnti);
119
  NS_ASSERT_MSG (rntiIt != m_ueAttached.end (), "could not find RNTI" << rnti);
119
  NS_ASSERT_MSG (rntiIt != m_ueAttached.end (), "could not find RNTI" << rxPduParams.rnti);
120
  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
120
  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (rxPduParams.lcid);
121
  if (lcidIt != rntiIt->second.end ())
121
  if (lcidIt != rntiIt->second.end ())
122
    {
122
    {
123
      (*lcidIt).second->ReceivePdu (p, rnti, lcid);
123
      (*lcidIt).second->ReceivePdu (rxPduParams);
124
    }
124
    }
125
}
125
}
126
126
(-)a/src/lte/model/no-op-component-carrier-manager.h (-11 / +6 lines)
 Lines 101-121   protected: Link Here 
101
  virtual void DoReportBufferStatus (LteMacSapProvider::ReportBufferStatusParameters params);
101
  virtual void DoReportBufferStatus (LteMacSapProvider::ReportBufferStatusParameters params);
102
  /**
102
  /**
103
   * \brief Notify transmit opportunity.
103
   * \brief Notify transmit opportunity.
104
   * \param bytes the number of bytes
104
   *
105
   * \param layer the layer
105
   * \param txOpParams the LteMacSapUser::TxOpportunityParameters
106
   * \param harqId the HARQ ID
107
   * \param componentCarrierId the component carrier ID
108
   * \param rnti the RNTI
109
   * \param lcid the LCID
110
   */
106
   */
111
  virtual void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
107
  virtual void DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
112
  /**
108
  /**
113
   * \brief Receive PDU.
109
   * \brief Receive PDU.
114
   * \param p the packet
110
   *
115
   * \param rnti the RNTI
111
   * \param rxPduParams the LteMacSapUser::ReceivePduParameters
116
   * \param lcid the LCID
117
   */
112
   */
118
  virtual void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
113
  virtual void DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
119
  /// Notify HARQ delivery failure
114
  /// Notify HARQ delivery failure
120
  virtual void DoNotifyHarqDeliveryFailure ();
115
  virtual void DoNotifyHarqDeliveryFailure ();
121
  /**
116
  /**
(-)a/src/lte/model/simple-ue-component-carrier-manager.cc (-17 / +22 lines)
 Lines 90-97   public: Link Here 
90
  SimpleUeCcmMacSapUser  (SimpleUeComponentCarrierManager* mac);
90
  SimpleUeCcmMacSapUser  (SimpleUeComponentCarrierManager* mac);
91
91
92
  // inherited from LteMacSapUser
92
  // inherited from LteMacSapUser
93
  virtual void NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
93
  virtual void NotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
94
  virtual void ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
94
  virtual void ReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
95
  virtual void NotifyHarqDeliveryFailure ();
95
  virtual void NotifyHarqDeliveryFailure ();
96
96
97
97
 Lines 105-121   SimpleUeCcmMacSapUser::SimpleUeCcmMacSapUser (SimpleUeComponentCarrierManager* m Link Here 
105
}
105
}
106
106
107
void
107
void
108
SimpleUeCcmMacSapUser::NotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
108
SimpleUeCcmMacSapUser::NotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
109
{
109
{
110
  NS_LOG_INFO ("SimpleUeCcmMacSapUser::NotifyTxOpportunity for ccId:"<<(uint32_t)componentCarrierId);
110
  NS_LOG_INFO ("SimpleUeCcmMacSapUser::NotifyTxOpportunity for ccId:"<<(uint32_t)txOpParams.componentCarrierId);
111
  m_mac->DoNotifyTxOpportunity (bytes, layer, harqId, componentCarrierId, rnti, lcid);
111
  m_mac->DoNotifyTxOpportunity (txOpParams);
112
}
112
}
113
113
114
114
115
void
115
void
116
SimpleUeCcmMacSapUser::ReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
116
SimpleUeCcmMacSapUser::ReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
117
{
117
{
118
  m_mac->DoReceivePdu (p, rnti, lcid);
118
  m_mac->DoReceivePdu (rxPduParams);
119
}
119
}
120
120
121
void
121
void
 Lines 203-209   SimpleUeComponentCarrierManager::DoReportBufferStatus (LteMacSapProvider::Report Link Here 
203
  NS_LOG_FUNCTION (this);
203
  NS_LOG_FUNCTION (this);
204
  NS_LOG_DEBUG ("BSR from RLC for LCID = " << (uint16_t)params.lcid);
204
  NS_LOG_DEBUG ("BSR from RLC for LCID = " << (uint16_t)params.lcid);
205
  std::map <uint8_t, LteMacSapProvider*>::iterator it =  m_macSapProvidersMap.find (0);
205
  std::map <uint8_t, LteMacSapProvider*>::iterator it =  m_macSapProvidersMap.find (0);
206
  NS_ABORT_MSG_IF (it == m_macSapProvidersMap.end (), "could not find Sap for ComponentCarrier ");
206
  NS_ABORT_MSG_IF (it == m_macSapProvidersMap.end (), "could not find Sap for ComponentCarrier");
207
207
208
  NS_LOG_DEBUG ("Size of component carrier LC map "<< m_componentCarrierLcMap.size());
208
  NS_LOG_DEBUG ("Size of component carrier LC map "<< m_componentCarrierLcMap.size());
209
209
 Lines 227-249   SimpleUeComponentCarrierManager::DoNotifyHarqDeliveryFailure () Link Here 
227
227
228
228
229
void 
229
void 
230
SimpleUeComponentCarrierManager::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
230
SimpleUeComponentCarrierManager::DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams)
231
{
231
{
232
  NS_LOG_FUNCTION (this);
232
  NS_LOG_FUNCTION (this);
233
  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = m_lcAttached.find (lcid);
233
  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = m_lcAttached.find (txOpParams.lcid);
234
  NS_ASSERT_MSG (lcidIt != m_lcAttached.end (), "could not find LCID" << lcid);
234
  NS_ABORT_MSG_IF (lcidIt == m_lcAttached.end (), "could not find LCID" << (uint16_t) txOpParams.lcid);
235
  NS_LOG_DEBUG (this << " lcid= " << (uint32_t) lcid << " layer= " << (uint16_t) layer << " componentCarierId " << (uint16_t) componentCarrierId << " rnti " << rnti);
235
  NS_LOG_DEBUG (this << " lcid = " << (uint32_t) txOpParams.lcid << " layer= "
236
  NS_LOG_DEBUG (this << " MAC is asking component carrier id = " << (uint16_t) componentCarrierId <<" with lcid = " << (uint32_t) lcid << " to transmit "<< bytes<< " bytes");
236
                << (uint16_t) txOpParams.layer << " componentCarierId "
237
  (*lcidIt).second->NotifyTxOpportunity (bytes, layer, harqId, componentCarrierId, rnti, lcid);
237
                << (uint16_t) txOpParams.componentCarrierId << " rnti " << txOpParams.rnti);
238
239
  NS_LOG_DEBUG (this << " MAC is asking component carrier id = " << (uint16_t) txOpParams.componentCarrierId
240
                << " with lcid = " << (uint32_t) txOpParams.lcid << " to transmit "<< txOpParams.bytes<< " bytes");
241
  (*lcidIt).second->NotifyTxOpportunity (txOpParams);
238
}
242
}
239
void
243
void
240
SimpleUeComponentCarrierManager::DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid)
244
SimpleUeComponentCarrierManager::DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams)
241
{
245
{
242
  NS_LOG_FUNCTION (this);
246
  NS_LOG_FUNCTION (this);
243
  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = m_lcAttached.find (lcid);
247
  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = m_lcAttached.find (rxPduParams.lcid);
248
  NS_ABORT_MSG_IF (lcidIt == m_lcAttached.end (), "could not find LCID" << (uint16_t) rxPduParams.lcid);
244
  if (lcidIt != m_lcAttached.end ())
249
  if (lcidIt != m_lcAttached.end ())
245
    {
250
    {
246
      (*lcidIt).second->ReceivePdu (p, rnti, lcid);
251
      (*lcidIt).second->ReceivePdu (rxPduParams);
247
    }
252
    }
248
}
253
}
249
254
(-)a/src/lte/model/simple-ue-component-carrier-manager.h (-11 / +6 lines)
 Lines 93-113   protected: Link Here 
93
  // forwarded from LteMacSapUser
93
  // forwarded from LteMacSapUser
94
  /**
94
  /**
95
   * \brief Notify TX opportunity function
95
   * \brief Notify TX opportunity function
96
   * \param bytes the number of bytes
96
   *
97
   * \param layer the layer
97
   * \param txOpParams the LteMacSapUser::TxOpportunityParameters
98
   * \param harqId the HARQ ID
99
   * \param componentCarrierId the component carrier ID
100
   * \param rnti the RNTI
101
   * \param lcid the LCID
102
   */
98
   */
103
  void DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid);
99
  void DoNotifyTxOpportunity (LteMacSapUser::TxOpportunityParameters txOpParams);
104
  /**
100
  /**
105
   * \brief Receive PDU function
101
   * \brief Receive PDU function
106
   * \param p the packet
102
   *
107
   * \param rnti the RNTI
103
   * \param rxPduParams the LteMacSapUser::ReceivePduParameters
108
   * \param lcid the LCID
109
   */
104
   */
110
  void DoReceivePdu (Ptr<Packet> p, uint16_t rnti, uint8_t lcid);
105
  void DoReceivePdu (LteMacSapUser::ReceivePduParameters rxPduParams);
111
  //forwarded from LteUeCcmRrcSapProvider
106
  //forwarded from LteUeCcmRrcSapProvider
112
  /**
107
  /**
113
   * \brief Add LC function
108
   * \brief Add LC function
(-)a/src/lte/test/lte-test-entities.cc (-5 / +29 lines)
 Lines 484-496   LteTestMac::SendTxOpportunity (Time time, uint32_t bytes) Link Here 
484
          haveContext = true;
484
          haveContext = true;
485
        }
485
        }
486
    }
486
    }
487
  LteMacSapUser::TxOpportunityParameters txOpParmas;
488
  txOpParmas.bytes = bytes;
489
  txOpParmas.layer = 0;
490
  txOpParmas.componentCarrierId = 0;
491
  txOpParmas.harqId = 0;
492
  txOpParmas.rnti = 0;
493
  txOpParmas.lcid = 0;
494
487
  if (haveContext)
495
  if (haveContext)
488
    {
496
    {
489
      Simulator::ScheduleWithContext (node->GetId (), time, &LteMacSapUser::NotifyTxOpportunity, m_macSapUser, bytes, 0, 0, 0, 0, 0);
497
      Simulator::ScheduleWithContext (node->GetId (), time, &LteMacSapUser::NotifyTxOpportunity, m_macSapUser, txOpParmas);
490
    }
498
    }
491
  else
499
  else
492
    {
500
    {
493
      Simulator::Schedule (time, &LteMacSapUser::NotifyTxOpportunity, m_macSapUser, bytes, 0, 0, 0, 0, 0);
501
      Simulator::Schedule (time, &LteMacSapUser::NotifyTxOpportunity, m_macSapUser, txOpParmas);
494
    }
502
    }
495
    
503
    
496
  if (m_txOpportunityMode == RANDOM_MODE)
504
  if (m_txOpportunityMode == RANDOM_MODE)
 Lines 558-563   LteTestMac::DoTransmitPdu (LteMacSapProvider::TransmitPduParameters params) Link Here 
558
  m_txPdus++;
566
  m_txPdus++;
559
  m_txBytes += params.pdu->GetSize ();
567
  m_txBytes += params.pdu->GetSize ();
560
568
569
  LteMacSapUser::ReceivePduParameters rxPduParams;
570
  rxPduParams.p = params.pdu;
571
  rxPduParams.rnti = params.rnti;
572
  rxPduParams.lcid = params.lcid;
573
561
  if (m_device)
574
  if (m_device)
562
    {
575
    {
563
      m_device->Send (params.pdu, m_device->GetBroadcast (), 0);
576
      m_device->Send (params.pdu, m_device->GetBroadcast (), 0);
 Lines 565-571   LteTestMac::DoTransmitPdu (LteMacSapProvider::TransmitPduParameters params) Link Here 
565
  else if (m_macLoopback)
578
  else if (m_macLoopback)
566
    {
579
    {
567
      Simulator::Schedule (Seconds (0.1), &LteMacSapUser::ReceivePdu,
580
      Simulator::Schedule (Seconds (0.1), &LteMacSapUser::ReceivePdu,
568
                           m_macLoopback->m_macSapUser, params.pdu, params.rnti, params.lcid);
581
                           m_macLoopback->m_macSapUser, rxPduParams);
569
    }
582
    }
570
  else
583
  else
571
    {
584
    {
 Lines 622-632   LteTestMac::DoReportBufferStatus (LteMacSapProvider::ReportBufferStatusParameter Link Here 
622
635
623
      int32_t size = params.statusPduSize + params.txQueueSize  + params.retxQueueSize;
636
      int32_t size = params.statusPduSize + params.txQueueSize  + params.retxQueueSize;
624
      Time time = m_txOppTime;
637
      Time time = m_txOppTime;
638
      LteMacSapUser::TxOpportunityParameters txOpParmas;
639
      txOpParmas.bytes = m_txOppSize;
640
      txOpParmas.layer = 0;
641
      txOpParmas.componentCarrierId = 0;
642
      txOpParmas.harqId = 0;
643
      txOpParmas.rnti = params.rnti;
644
      txOpParmas.lcid = params.lcid;
625
      while (size > 0)
645
      while (size > 0)
626
        {
646
        {
627
          EventId e = Simulator::Schedule (time, 
647
          EventId e = Simulator::Schedule (time, 
628
                                           &LteMacSapUser::NotifyTxOpportunity,
648
                                           &LteMacSapUser::NotifyTxOpportunity,
629
                                           m_macSapUser, m_txOppSize, 0, 0, 0, params.rnti, params.lcid);
649
                                           m_macSapUser, txOpParmas);
630
          m_nextTxOppList.push_back (e);
650
          m_nextTxOppList.push_back (e);
631
          size -= m_txOppSize;
651
          size -= m_txOppSize;
632
          time += m_txOppTime;
652
          time += m_txOppTime;
 Lines 644-650   LteTestMac::Receive (Ptr<NetDevice> nd, Ptr<const Packet> p, uint16_t protocol, Link Here 
644
  m_rxBytes += p->GetSize ();
664
  m_rxBytes += p->GetSize ();
645
665
646
  Ptr<Packet> packet = p->Copy ();
666
  Ptr<Packet> packet = p->Copy ();
647
  m_macSapUser->ReceivePdu (packet, 0, 0);
667
  LteMacSapUser::ReceivePduParameters rxPduParams;
668
  rxPduParams.p = packet;
669
  rxPduParams.rnti = 0;
670
  rxPduParams.lcid = 0;
671
  m_macSapUser->ReceivePdu (rxPduParams);
648
  return true;
672
  return true;
649
}
673
}
650
674

Return to bug 2995