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

(-)a/src/devices/wifi/dca-txop.cc (-3 / +14 lines)
 Lines 89-94    Link Here 
89
  virtual void Cancel (void) {
89
  virtual void Cancel (void) {
90
    m_txop->Cancel ();
90
    m_txop->Cancel ();
91
  }
91
  }
92
  virtual void EndTxNoAck (void) {
93
    m_txop->EndTxNoAck ();
94
  }
92
95
93
private:
96
private:
94
  DcaTxop *m_txop;
97
  DcaTxop *m_txop;
 Lines 387-395    Link Here 
387
                                 params,
390
                                 params,
388
                                 m_transmissionListener);
391
                                 m_transmissionListener);
389
      m_currentPacket = 0;
392
      m_currentPacket = 0;
390
      m_dcf->ResetCw ();
391
      m_dcf->StartBackoffNow (m_rng->GetNext (0, m_dcf->GetCw ()));
392
      StartAccessIfNeeded ();
393
      NS_LOG_DEBUG ("tx broadcast");
393
      NS_LOG_DEBUG ("tx broadcast");
394
    } 
394
    } 
395
  else 
395
  else 
 Lines 600-603    Link Here 
600
   */
600
   */
601
}
601
}
602
602
603
void
604
DcaTxop::EndTxNoAck (void)
605
{
606
  NS_LOG_FUNCTION (this);
607
  NS_LOG_DEBUG ("a transmission that did not require an ACK just finished");
608
  NS_ASSERT (m_currentPacket == 0);
609
  m_dcf->ResetCw ();
610
  m_dcf->StartBackoffNow (m_rng->GetNext (0, m_dcf->GetCw ()));
611
  StartAccessIfNeeded ();
612
}
613
603
} // namespace ns3
614
} // namespace ns3
(-)a/src/devices/wifi/dca-txop.h (+1 lines)
 Lines 137-142    Link Here 
137
  void MissedAck (void);
137
  void MissedAck (void);
138
  void StartNext (void);
138
  void StartNext (void);
139
  void Cancel (void);
139
  void Cancel (void);
140
  void EndTxNoAck (void);
140
141
141
  void RestartAccessIfNeeded (void);
142
  void RestartAccessIfNeeded (void);
142
  void StartAccessIfNeeded (void);
143
  void StartAccessIfNeeded (void);
(-)a/src/devices/wifi/edca-txop-n.cc (-3 / +16 lines)
 Lines 96-101    Link Here 
96
  virtual void Cancel (void) {
96
  virtual void Cancel (void) {
97
    m_txop->Cancel ();
97
    m_txop->Cancel ();
98
  }
98
  }
99
  virtual void EndTxNoAck (void) {
100
    m_txop->EndTxNoAck ();
101
  }
99
102
100
private:
103
private:
101
  EdcaTxopN *m_txop;
104
  EdcaTxopN *m_txop;
 Lines 371-379    Link Here 
371
                                m_transmissionListener);
374
                                m_transmissionListener);
372
      
375
      
373
      m_currentPacket = 0;
376
      m_currentPacket = 0;
374
      m_dcf->ResetCw ();
375
      m_dcf->StartBackoffNow (m_rng->GetNext (0, m_dcf->GetCw ()));
376
      StartAccessIfNeeded ();
377
      NS_LOG_DEBUG ("tx broadcast");
377
      NS_LOG_DEBUG ("tx broadcast");
378
    }
378
    }
379
  else if (m_currentHdr.GetType() == WIFI_MAC_CTL_BACKREQ)
379
  else if (m_currentHdr.GetType() == WIFI_MAC_CTL_BACKREQ)
 Lines 716-721    Link Here 
716
  NS_LOG_DEBUG ("transmission cancelled");
716
  NS_LOG_DEBUG ("transmission cancelled");
717
}
717
}
718
718
719
720
void
721
EdcaTxopN::EndTxNoAck (void)
722
{
723
  NS_LOG_FUNCTION (this);
724
  NS_LOG_DEBUG ("a transmission that did not require an ACK just finished");
725
  NS_ASSERT (m_currentPacket == 0);
726
  m_dcf->ResetCw ();
727
  m_dcf->StartBackoffNow (m_rng->GetNext (0, m_dcf->GetCw ()));
728
  StartAccessIfNeeded ();
729
}
730
731
719
bool
732
bool
720
EdcaTxopN::NeedFragmentation (void) const
733
EdcaTxopN::NeedFragmentation (void) const
721
{
734
{
(-)a/src/devices/wifi/edca-txop-n.h (+1 lines)
 Lines 124-129    Link Here 
124
  void MissedAck (void);
124
  void MissedAck (void);
125
  void StartNext (void);
125
  void StartNext (void);
126
  void Cancel (void);
126
  void Cancel (void);
127
  void EndTxNoAck (void);
127
128
128
  void RestartAccessIfNeeded (void);
129
  void RestartAccessIfNeeded (void);
129
  void StartAccessIfNeeded (void);
130
  void StartAccessIfNeeded (void);
(-)a/src/devices/wifi/mac-low.cc (-4 / +18 lines)
 Lines 344-349    Link Here 
344
    m_sendAckEvent (),
344
    m_sendAckEvent (),
345
    m_sendDataEvent (),
345
    m_sendDataEvent (),
346
    m_waitSifsEvent (),
346
    m_waitSifsEvent (),
347
    m_endTxNoAckEvent (),
347
    m_currentPacket (0),
348
    m_currentPacket (0),
348
    m_listener (0)
349
    m_listener (0)
349
{
350
{
 Lines 379-384    Link Here 
379
  m_sendAckEvent.Cancel ();
380
  m_sendAckEvent.Cancel ();
380
  m_sendDataEvent.Cancel ();
381
  m_sendDataEvent.Cancel ();
381
  m_waitSifsEvent.Cancel ();
382
  m_waitSifsEvent.Cancel ();
383
  m_endTxNoAckEvent.Cancel ();
382
  m_phy = 0;
384
  m_phy = 0;
383
  m_stationManager = 0;
385
  m_stationManager = 0;
384
  delete m_phyMacLowListener;
386
  delete m_phyMacLowListener;
 Lines 440-445    Link Here 
440
      m_waitSifsEvent.Cancel ();
442
      m_waitSifsEvent.Cancel ();
441
      oneRunning = true;
443
      oneRunning = true;
442
    }
444
    }
445
  if (m_endTxNoAckEvent.IsRunning ()) 
446
    {
447
      m_endTxNoAckEvent.Cancel ();
448
      oneRunning = true;
449
    }
443
  if (oneRunning && m_listener != 0) 
450
  if (oneRunning && m_listener != 0) 
444
    {
451
    {
445
      m_listener->Cancel ();
452
      m_listener->Cancel ();
 Lines 1320-1329    Link Here 
1320
      m_waitSifsEvent = Simulator::Schedule (delay, &MacLow::WaitSifsAfterEndTx, this);
1327
      m_waitSifsEvent = Simulator::Schedule (delay, &MacLow::WaitSifsAfterEndTx, this);
1321
    } 
1328
    } 
1322
  else 
1329
  else 
1323
    {
1330
    {      
1324
      // since we do not expect any timer to be triggered.
1331
      Simulator::Schedule(txDuration, &MacLow::EndTxNoAck, this);
1325
      m_listener = 0;
1332
    } 
1326
    }
1327
}
1333
}
1328
1334
1329
void
1335
void
 Lines 1460-1465    Link Here 
1460
  m_listener->StartNext ();
1466
  m_listener->StartNext ();
1461
}
1467
}
1462
1468
1469
void 
1470
MacLow::EndTxNoAck (void)
1471
{
1472
  MacLowTransmissionListener *listener = m_listener;
1473
  m_listener = 0;
1474
  listener->EndTxNoAck ();
1475
}
1476
1463
void
1477
void
1464
MacLow::FastAckFailedTimeout (void)
1478
MacLow::FastAckFailedTimeout (void)
1465
{
1479
{
(-)a/src/devices/wifi/mac-low.h (+10 lines)
 Lines 122-127    Link Here 
122
   * down the stack to the PHY.
122
   * down the stack to the PHY.
123
   */
123
   */
124
  virtual void Cancel (void) = 0;
124
  virtual void Cancel (void) = 0;
125
126
  /** 
127
   * Invoked upon the end of the transmission of a frame that does not
128
   * require an ACK (e.g., broadcast and multicast frames).
129
   * 
130
   */
131
  virtual void EndTxNoAck (void) = 0;
132
125
};
133
};
126
134
127
135
 Lines 523-528    Link Here 
523
  void SendAckAfterData (Mac48Address source, Time duration, WifiMode txMode, double rtsSnr);
531
  void SendAckAfterData (Mac48Address source, Time duration, WifiMode txMode, double rtsSnr);
524
  void SendDataAfterCts (Mac48Address source, Time duration, WifiMode txMode);
532
  void SendDataAfterCts (Mac48Address source, Time duration, WifiMode txMode);
525
  void WaitSifsAfterEndTx (void);
533
  void WaitSifsAfterEndTx (void);
534
  void EndTxNoAck (void);
526
535
527
  void SendRtsForPacket (void);
536
  void SendRtsForPacket (void);
528
  void SendDataPacket (void);
537
  void SendDataPacket (void);
 Lines 596-601    Link Here 
596
  EventId m_sendAckEvent;
605
  EventId m_sendAckEvent;
597
  EventId m_sendDataEvent;
606
  EventId m_sendDataEvent;
598
  EventId m_waitSifsEvent;
607
  EventId m_waitSifsEvent;
608
  EventId m_endTxNoAckEvent;
599
  EventId m_navCounterResetCtsMissed;
609
  EventId m_navCounterResetCtsMissed;
600
610
601
  Ptr<Packet> m_currentPacket;
611
  Ptr<Packet> m_currentPacket;

Return to bug 555