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

(-)a/src/wifi/model/dca-txop.cc (-1 / +4 lines)
 Lines 116-122    Link Here 
116
  {
116
  {
117
    m_txop->StartNextFragment ();
117
    m_txop->StartNextFragment ();
118
  }
118
  }
119
  virtual void StartNext (void)
119
  virtual void StartNextPacketInBA (void)
120
  {
121
  }
122
  virtual void StartNextPacketInTxop (void)
120
  {
123
  {
121
  }
124
  }
122
  virtual void Cancel (void)
125
  virtual void Cancel (void)
(-)a/src/wifi/model/edca-txop-n.cc (-3 / +51 lines)
 Lines 123-131    Link Here 
123
  {
123
  {
124
    m_txop->StartNextFragment ();
124
    m_txop->StartNextFragment ();
125
  }
125
  }
126
  virtual void StartNext (void)
126
  virtual void StartNextPacketInBA (void)
127
  {
127
  {
128
    m_txop->StartNext ();
128
    m_txop->StartNextPacketInBA ();
129
  }
130
  virtual void StartNextPacketInTxop (void)
131
  {
132
    m_txop->StartNextPacketInTxop ();
129
  }
133
  }
130
  virtual void Cancel (void)
134
  virtual void Cancel (void)
131
  {
135
  {
 Lines 1201-1207    Link Here 
1201
}
1205
}
1202
1206
1203
void
1207
void
1204
EdcaTxopN::StartNext (void)
1208
EdcaTxopN::StartNextPacketInBA (void)
1209
{
1210
  NS_LOG_FUNCTION (this);
1211
  Ptr<const Packet> peekedPacket = m_baManager->GetNextPacket (m_currentHdr);
1212
  Time tstamp;
1213
  if (peekedPacket == 0)
1214
    {
1215
      peekedPacket = m_queue->PeekByTidAndAddress (&m_currentHdr,
1216
                                                   m_currentHdr.GetQosTid (),
1217
                                                   WifiMacHeader::ADDR1,
1218
                                                   m_currentHdr.GetAddr1 (),
1219
                                                   &tstamp);
1220
    }
1221
  if (peekedPacket == 0 || m_baManager->HasBar (m_currentBar))
1222
    {
1223
      SendBlockAckRequest (m_currentBar);
1224
      return;
1225
    }
1226
1227
  MacLowTransmissionParameters params;
1228
  params.DisableOverrideDurationId ();
1229
  params.DisableAck ();
1230
  params.DisableNextData ();
1231
1232
  NS_LOG_DEBUG ("start next packet belonging to the same BA");
1233
  m_currentPacket = m_queue->DequeueByTidAndAddress (&m_currentHdr,
1234
                                                     m_currentHdr.GetQosTid (),
1235
                                                     WifiMacHeader::ADDR1,
1236
                                                     m_currentHdr.GetAddr1 ());
1237
  NS_ASSERT (m_currentPacket != 0);
1238
  uint16_t sequence = m_txMiddle->GetNextSequenceNumberfor (&m_currentHdr);
1239
  m_currentHdr.SetSequenceNumber (sequence);
1240
  m_stationManager->UpdateFragmentationThreshold ();
1241
  m_currentHdr.SetFragmentNumber (0);
1242
  m_currentHdr.SetNoMoreFragments ();
1243
  m_currentHdr.SetNoRetry ();
1244
  m_fragmentNumber = 0;
1245
1246
  VerifyBlockAck ();
1247
  GetLow ()->StartTransmission (m_currentPacket, &m_currentHdr, params, m_transmissionListener);
1248
  CompleteTx ();
1249
}
1250
1251
void
1252
EdcaTxopN::StartNextPacketInTxop (void)
1205
{
1253
{
1206
  NS_LOG_FUNCTION (this);
1254
  NS_LOG_FUNCTION (this);
1207
  Time txopLimit = GetTxopLimit ();
1255
  Time txopLimit = GetTxopLimit ();
(-)a/src/wifi/model/edca-txop-n.h (-1 / +5 lines)
 Lines 275-283    Link Here 
275
   */
275
   */
276
  void StartNextFragment (void);
276
  void StartNextFragment (void);
277
  /**
277
  /**
278
   * Start transmission for the next packet belonging to the same Block Ack.
279
   */
280
  void StartNextPacketInBA (void);
281
  /**
278
   * Start transmission for the next packet if allowed by the TxopLimit.
282
   * Start transmission for the next packet if allowed by the TxopLimit.
279
   */
283
   */
280
  void StartNext (void);
284
  void StartNextPacketInTxop (void);
281
  /**
285
  /**
282
   * Cancel the transmission.
286
   * Cancel the transmission.
283
   */
287
   */
(-)a/src/wifi/model/mac-low.cc (-3 / +14 lines)
 Lines 1016-1022    Link Here 
1016
      else if (m_currentHdr.IsQosData () && !m_ampdu && m_listener->HasTxop ())
1016
      else if (m_currentHdr.IsQosData () && !m_ampdu && m_listener->HasTxop ())
1017
        {
1017
        {
1018
          m_waitSifsEvent = Simulator::Schedule (GetSifs (),
1018
          m_waitSifsEvent = Simulator::Schedule (GetSifs (),
1019
                                                 &MacLow::WaitSifsAfterEndTx, this);
1019
                                                 &MacLow::WaitSifsAfterEndTxPacketInTxop, this);
1020
        }
1020
        }
1021
      m_ampdu = false;
1021
      m_ampdu = false;
1022
      if (m_currentHdr.IsQosData ())
1022
      if (m_currentHdr.IsQosData ())
 Lines 1843-1848    Link Here 
1843
          m_waitSifsEvent = Simulator::Schedule (delay, &MacLow::WaitSifsAfterEndTxFragment, this);
1843
          m_waitSifsEvent = Simulator::Schedule (delay, &MacLow::WaitSifsAfterEndTxFragment, this);
1844
        }
1844
        }
1845
    }
1845
    }
1846
  else if (m_currentHdr.IsQosData () && m_currentHdr.IsQosBlockAck ())
1847
    {
1848
      Time delay = txDuration + GetSifs ();
1849
      m_waitSifsEvent = Simulator::Schedule (delay, &MacLow::WaitSifsAfterEndTxPacketInBA, this);
1850
    }
1846
  else
1851
  else
1847
    {
1852
    {
1848
      // since we do not expect any timer to be triggered.
1853
      // since we do not expect any timer to be triggered.
 Lines 2119-2127    Link Here 
2119
}
2124
}
2120
2125
2121
void
2126
void
2122
MacLow::WaitSifsAfterEndTx (void)
2127
MacLow::WaitSifsAfterEndTxPacketInBA (void)
2123
{
2128
{
2124
  m_listener->StartNext ();
2129
  m_listener->StartNextPacketInBA ();
2130
}
2131
2132
void
2133
MacLow::WaitSifsAfterEndTxPacketInTxop (void)
2134
{
2135
  m_listener->StartNextPacketInTxop ();
2125
}
2136
}
2126
2137
2127
void
2138
void
(-)a/src/wifi/model/mac-low.h (-4 / +9 lines)
 Lines 112-122    Link Here 
112
   */
112
   */
113
  virtual void StartNextFragment (void) = 0;
113
  virtual void StartNextFragment (void) = 0;
114
  /**
114
  /**
115
   * Invoked when ns3::MacLow wants to continue the transmission under Block Ack policy.
116
   * The listener is expected to call again MacLow::StartTransmission with the "next" packet to send.
117
   */
118
  virtual void StartNextPacketInBA (void) = 0;
119
  /**
115
   * Invoked when ns3::MacLow wants to continue the TXOP.
120
   * Invoked when ns3::MacLow wants to continue the TXOP.
116
   * The listener is expected to call again MacLow::StartTransmission
121
   * The listener is expected to call again MacLow::StartTransmission with the "next" packet to send.
117
   * with the "next" packet to send.
118
   */
122
   */
119
  virtual void StartNext (void) = 0;
123
  virtual void StartNextPacketInTxop (void) = 0;
120
  /**
124
  /**
121
   * Invoked if this transmission was canceled
125
   * Invoked if this transmission was canceled
122
   * one way or another. When this method is invoked,
126
   * one way or another. When this method is invoked,
 Lines 1137-1143    Link Here 
1137
   * after completing transmissions.
1141
   * after completing transmissions.
1138
   */
1142
   */
1139
  void WaitSifsAfterEndTxFragment (void);
1143
  void WaitSifsAfterEndTxFragment (void);
1140
  void WaitSifsAfterEndTx (void);
1144
  void WaitSifsAfterEndTxPacketInBA (void);
1145
  void WaitSifsAfterEndTxPacketInTxop (void);
1141
1146
1142
  /**
1147
  /**
1143
   * A transmission that does not require an ACK has completed.
1148
   * A transmission that does not require an ACK has completed.

Return to bug 2604