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

(-)a/src/wifi/model/dcf-manager.cc (-21 / +7 lines)
 Lines 808-834    Link Here 
808
  NS_LOG_FUNCTION (this << duration);
808
  NS_LOG_FUNCTION (this << duration);
809
  if (m_rxing)
809
  if (m_rxing)
810
    {
810
    {
811
      if (Simulator::Now () - m_lastRxStart <= m_sifs)
811
      //this may be caused only if PHY has started to receive a packet
812
        {
812
      //inside SIFS, so, we check that lastRxStart was maximum a SIFS ago
813
          //this may be caused if PHY has started to receive a packet
813
      NS_ASSERT (Simulator::Now () - m_lastRxStart <= m_sifs);
814
          //inside SIFS, so, we check that lastRxStart was within a SIFS ago
814
      m_lastRxEnd = Simulator::Now ();
815
          m_lastRxEnd = Simulator::Now ();
815
      m_lastRxDuration = m_lastRxEnd - m_lastRxStart;
816
          m_lastRxDuration = m_lastRxEnd - m_lastRxStart;
816
      m_lastRxReceivedOk = true;
817
          m_lastRxReceivedOk = true;
817
      m_rxing = false;
818
          m_rxing = false;
819
        }
820
      else
821
        {
822
          // Bug 2477:  It is possible for the DCF to fall out of 
823
          //            sync with the PHY state if there are problems
824
          //            receiving A-MPDUs.  PHY will cancel the reception
825
          //            and start to transmit
826
          NS_LOG_DEBUG ("Phy is transmitting despite DCF being in receive state");
827
          m_lastRxEnd = Simulator::Now ();
828
          m_lastRxDuration = m_lastRxEnd - m_lastRxStart;
829
          m_lastRxReceivedOk = false;
830
          m_rxing = false;
831
        }
832
    }
818
    }
833
  MY_DEBUG ("tx start for " << duration);
819
  MY_DEBUG ("tx start for " << duration);
834
  UpdateBackoff ();
820
  UpdateBackoff ();
(-)a/src/wifi/model/mac-low.cc (-17 / +24 lines)
 Lines 845-851    Link Here 
845
MacLow::ReceiveError (Ptr<Packet> packet, double rxSnr)
845
MacLow::ReceiveError (Ptr<Packet> packet, double rxSnr)
846
{
846
{
847
  NS_LOG_FUNCTION (this << packet << rxSnr);
847
  NS_LOG_FUNCTION (this << packet << rxSnr);
848
  NS_LOG_DEBUG ("rx failed ");
848
  NS_LOG_DEBUG ("rx failed");
849
  if (m_txParams.MustWaitFastAck ())
849
  if (m_txParams.MustWaitFastAck ())
850
    {
850
    {
851
      NS_ASSERT (m_fastAckFailedTimeoutEvent.IsExpired ());
851
      NS_ASSERT (m_fastAckFailedTimeoutEvent.IsExpired ());
 Lines 1687-1695    Link Here 
1687
          
1687
          
1688
          if (delay == Seconds (0))
1688
          if (delay == Seconds (0))
1689
            {
1689
            {
1690
              NS_LOG_DEBUG ("Sending MPDU as part of A-MPDU");
1690
              if (!vhtSingleMpdu)
1691
              if (!vhtSingleMpdu)
1691
                {
1692
                {
1692
                  NS_LOG_DEBUG ("Sending MPDU as part of A-MPDU");
1693
                  mpdutype = MPDU_IN_AGGREGATE;
1693
                  mpdutype = MPDU_IN_AGGREGATE;
1694
                }
1694
                }
1695
              else
1695
              else
 Lines 2710-2732    Link Here 
2710
void
2710
void
2711
MacLow::SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator, Time duration, WifiTxVector blockAckReqTxVector, double rxSnr)
2711
MacLow::SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator, Time duration, WifiTxVector blockAckReqTxVector, double rxSnr)
2712
{
2712
{
2713
  NS_LOG_FUNCTION (this << (uint16_t) tid << originator << duration.As (Time::S) << blockAckReqTxVector << rxSnr);
2713
  if (!m_phy->IsStateTx () && !m_phy->IsStateRx ())
2714
  CtrlBAckResponseHeader blockAck;
2714
    {
2715
  uint16_t seqNumber = 0;
2715
      NS_LOG_FUNCTION (this << (uint16_t) tid << originator << duration.As (Time::S) << blockAckReqTxVector << rxSnr);
2716
  BlockAckCachesI i = m_bAckCaches.find (std::make_pair (originator, tid));
2716
      CtrlBAckResponseHeader blockAck;
2717
  NS_ASSERT (i != m_bAckCaches.end ());
2717
      uint16_t seqNumber = 0;
2718
  seqNumber = (*i).second.GetWinStart ();
2718
      BlockAckCachesI i = m_bAckCaches.find (std::make_pair (originator, tid));
2719
      NS_ASSERT (i != m_bAckCaches.end ());
2720
      seqNumber = (*i).second.GetWinStart ();
2719
2721
2720
  bool immediate = true;
2722
      bool immediate = true;
2721
  AgreementsI it = m_bAckAgreements.find (std::make_pair (originator, tid));
2723
      AgreementsI it = m_bAckAgreements.find (std::make_pair (originator, tid));
2722
  blockAck.SetStartingSequence (seqNumber);
2724
      blockAck.SetStartingSequence (seqNumber);
2723
  blockAck.SetTidInfo (tid);
2725
      blockAck.SetTidInfo (tid);
2724
  immediate = (*it).second.first.IsImmediateBlockAck ();
2726
      immediate = (*it).second.first.IsImmediateBlockAck ();
2725
  blockAck.SetType (COMPRESSED_BLOCK_ACK);
2727
      blockAck.SetType (COMPRESSED_BLOCK_ACK);
2726
  NS_LOG_DEBUG ("Got Implicit block Ack Req with seq " << seqNumber);
2728
      NS_LOG_DEBUG ("Got Implicit block Ack Req with seq " << seqNumber);
2727
  (*i).second.FillBlockAckBitmap (&blockAck);
2729
      (*i).second.FillBlockAckBitmap (&blockAck);
2728
2730
2729
  SendBlockAckResponse (&blockAck, originator, immediate, duration, blockAckReqTxVector.GetMode (), rxSnr);
2731
      SendBlockAckResponse (&blockAck, originator, immediate, duration, blockAckReqTxVector.GetMode (), rxSnr);
2732
    }
2733
  else
2734
    {
2735
      NS_LOG_DEBUG ("Skip block ack response!");
2736
    }
2730
}
2737
}
2731
2738
2732
void
2739
void

Return to bug 2477