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

(-)a/src/wifi/model/edca-txop-n.cc (-12 / +24 lines)
 Lines 163-171    Link Here 
163
  {
163
  {
164
    m_txop->CompleteAmpduTransfer (recipient, tid);
164
    m_txop->CompleteAmpduTransfer (recipient, tid);
165
  }
165
  }
166
  virtual void SetAmpdu (bool ampdu)
166
  virtual void SetAmpdu (Mac48Address dest, bool enableAmpdu)
167
  {
167
  {
168
    return m_txop->SetAmpduExist (ampdu);
168
    return m_txop->SetAmpduExist (dest, enableAmpdu);
169
  }
169
  }
170
  virtual void CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp)
170
  virtual void CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp)
171
  {
171
  {
 Lines 254-261    Link Here 
254
    m_currentPacket (0),
254
    m_currentPacket (0),
255
    m_aggregator (0),
255
    m_aggregator (0),
256
    m_typeOfStation (STA),
256
    m_typeOfStation (STA),
257
    m_blockAckType (COMPRESSED_BLOCK_ACK),
257
    m_blockAckType (COMPRESSED_BLOCK_ACK)
258
    m_ampduExist (false)
259
{
258
{
260
  NS_LOG_FUNCTION (this);
259
  NS_LOG_FUNCTION (this);
261
  m_transmissionListener = new EdcaTxopN::TransmissionListener (this);
260
  m_transmissionListener = new EdcaTxopN::TransmissionListener (this);
 Lines 632-638    Link Here 
632
          params.DisableNextData ();
631
          params.DisableNextData ();
633
          m_low->StartTransmission (m_currentPacket, &m_currentHdr,
632
          m_low->StartTransmission (m_currentPacket, &m_currentHdr,
634
                                    params, m_transmissionListener);
633
                                    params, m_transmissionListener);
635
          if (!GetAmpduExist ())
634
          if (!GetAmpduExist (m_currentHdr.GetAddr1 ()))
636
            {
635
            {
637
              CompleteTx ();
636
              CompleteTx ();
638
            }
637
            }
 Lines 675-681    Link Here 
675
        {
674
        {
676
          m_txFailedCallback (m_currentHdr);
675
          m_txFailedCallback (m_currentHdr);
677
        }
676
        }
678
      if (GetAmpduExist ())
677
      if (GetAmpduExist (m_currentHdr.GetAddr1 ()))
679
        {
678
        {
680
          m_low->FlushAggregateQueue ();
679
          m_low->FlushAggregateQueue ();
681
          uint8_t tid = 0;
680
          uint8_t tid = 0;
 Lines 827-833    Link Here 
827
        {
826
        {
828
          m_txFailedCallback (m_currentHdr);
827
          m_txFailedCallback (m_currentHdr);
829
        }
828
        }
830
      if (GetAmpduExist ())
829
      if (GetAmpduExist (m_currentHdr.GetAddr1 ()))
831
        {
830
        {
832
          uint8_t tid = 0;
831
          uint8_t tid = 0;
833
          if (m_currentHdr.IsQosData ())
832
          if (m_currentHdr.IsQosData ())
 Lines 890-896    Link Here 
890
  NS_LOG_DEBUG ("missed block ack");
889
  NS_LOG_DEBUG ("missed block ack");
891
  if (NeedBarRetransmission ())
890
  if (NeedBarRetransmission ())
892
    {
891
    {
893
      if (!GetAmpduExist ())
892
      if (!GetAmpduExist (m_currentHdr.GetAddr1 ()))
894
        {
893
        {
895
          //should i report this to station addressed by ADDR1?
894
          //should i report this to station addressed by ADDR1?
896
          NS_LOG_DEBUG ("Retransmit block ack request");
895
          NS_LOG_DEBUG ("Retransmit block ack request");
 Lines 1267-1280    Link Here 
1267
    }
1266
    }
1268
}
1267
}
1269
1268
1270
bool EdcaTxopN::GetAmpduExist (void)
1269
bool EdcaTxopN::GetAmpduExist (Mac48Address dest)
1271
{
1270
{
1272
  return m_ampduExist;
1271
  NS_LOG_FUNCTION (this << dest);
1272
  if (m_aMpduEnabled.find (dest) != m_aMpduEnabled.end ())
1273
    {
1274
      return m_aMpduEnabled.find (dest)->second;
1275
    }
1276
  return false;
1273
}
1277
}
1274
1278
1275
void EdcaTxopN::SetAmpduExist (bool ampdu)
1279
void EdcaTxopN::SetAmpduExist (Mac48Address dest, bool enableAmpdu)
1276
{
1280
{
1277
  m_ampduExist = ampdu;
1281
  NS_LOG_FUNCTION (this << dest << enableAmpdu);
1282
  if (m_aMpduEnabled.find (dest) != m_aMpduEnabled.end () && m_aMpduEnabled.find (dest)->second != enableAmpdu)
1283
    {
1284
      m_aMpduEnabled.erase (m_aMpduEnabled.find (dest));
1285
    }
1286
  if (m_aMpduEnabled.find (dest) == m_aMpduEnabled.end ())
1287
    {
1288
      m_aMpduEnabled.insert (std::make_pair (dest, enableAmpdu));
1289
    }
1278
}
1290
}
1279
1291
1280
void
1292
void
(-)a/src/wifi/model/edca-txop-n.h (-3 / +5 lines)
 Lines 92-97    Link Here 
92
   * packet transmission was failed.
92
   * packet transmission was failed.
93
   */
93
   */
94
  typedef Callback <void, const WifiMacHeader&> TxFailed;
94
  typedef Callback <void, const WifiMacHeader&> TxFailed;
95
  
96
  typedef std::map<Mac48Address, bool> AmpduEnabled;
97
  AmpduEnabled m_aMpduEnabled;
95
98
96
  static TypeId GetTypeId (void);
99
  static TypeId GetTypeId (void);
97
  EdcaTxopN ();
100
  EdcaTxopN ();
 Lines 411-418    Link Here 
411
  void SetBlockAckInactivityTimeout (uint16_t timeout);
414
  void SetBlockAckInactivityTimeout (uint16_t timeout);
412
  void SendDelbaFrame (Mac48Address addr, uint8_t tid, bool byOriginator);
415
  void SendDelbaFrame (Mac48Address addr, uint8_t tid, bool byOriginator);
413
  void CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp);
416
  void CompleteMpduTx (Ptr<const Packet> packet, WifiMacHeader hdr, Time tstamp);
414
  bool GetAmpduExist (void);
417
  bool GetAmpduExist (Mac48Address dest);
415
  void SetAmpduExist (bool ampdu);
418
  void SetAmpduExist (Mac48Address dest, bool enableAmpdu);
416
419
417
  /**
420
  /**
418
   * Return the next sequence number for the given header.
421
   * Return the next sequence number for the given header.
 Lines 555-561    Link Here 
555
  Time m_currentPacketTimestamp;
558
  Time m_currentPacketTimestamp;
556
  uint16_t m_blockAckInactivityTimeout;
559
  uint16_t m_blockAckInactivityTimeout;
557
  struct Bar m_currentBar;
560
  struct Bar m_currentBar;
558
  bool m_ampduExist;
559
};
561
};
560
562
561
} //namespace ns3
563
} //namespace ns3
(-)a/src/wifi/model/mac-low.cc (-3 / +3 lines)
 Lines 73-79    Link Here 
73
MacLowAggregationCapableTransmissionListener::~MacLowAggregationCapableTransmissionListener ()
73
MacLowAggregationCapableTransmissionListener::~MacLowAggregationCapableTransmissionListener ()
74
{
74
{
75
}
75
}
76
void MacLowAggregationCapableTransmissionListener::SetAmpdu (bool ampdu)
76
void MacLowAggregationCapableTransmissionListener::SetAmpdu (Mac48Address dest, bool enableAmpdu)
77
{
77
{
78
}
78
}
79
void MacLowAggregationCapableTransmissionListener::CompleteTransfer (Mac48Address address, uint8_t tid)
79
void MacLowAggregationCapableTransmissionListener::CompleteTransfer (Mac48Address address, uint8_t tid)
 Lines 3088-3094    Link Here 
3088
                  newPacket = currentAggregatedPacket;
3088
                  newPacket = currentAggregatedPacket;
3089
                  newPacket->AddPacketTag (ampdutag);
3089
                  newPacket->AddPacketTag (ampdutag);
3090
                  NS_LOG_DEBUG ("tx unicast A-MPDU");
3090
                  NS_LOG_DEBUG ("tx unicast A-MPDU");
3091
                  listenerIt->second->SetAmpdu (true);
3091
                  listenerIt->second->SetAmpdu (hdr.GetAddr2 (), true);
3092
                }
3092
                }
3093
              else
3093
              else
3094
                {
3094
                {
 Lines 3130-3136    Link Here 
3130
              newPacket->AddPacketTag (ampdutag);
3130
              newPacket->AddPacketTag (ampdutag);
3131
3131
3132
              NS_LOG_DEBUG ("tx unicast VHT single MPDU with sequence number " << hdr.GetSequenceNumber ());
3132
              NS_LOG_DEBUG ("tx unicast VHT single MPDU with sequence number " << hdr.GetSequenceNumber ());
3133
              listenerIt->second->SetAmpdu (true);
3133
              listenerIt->second->SetAmpdu (hdr.GetAddr2 (), true);
3134
            }
3134
            }
3135
        }
3135
        }
3136
    }
3136
    }
(-)a/src/wifi/model/mac-low.h (-1 / +1 lines)
 Lines 221-227    Link Here 
221
   * of an A-MPDU with ImmediateBlockAck policy (i.e. no BAR is scheduled)
221
   * of an A-MPDU with ImmediateBlockAck policy (i.e. no BAR is scheduled)
222
   */
222
   */
223
  virtual void CompleteTransfer (Mac48Address address, uint8_t tid);
223
  virtual void CompleteTransfer (Mac48Address address, uint8_t tid);
224
  virtual void SetAmpdu (bool ampdu);
224
  virtual void SetAmpdu (Mac48Address dest, bool enableAmpdu);
225
  /**
225
  /**
226
   * This function stores an MPDU (part of an A-MPDU) in blockackagreement (i.e. the sender is waiting
226
   * This function stores an MPDU (part of an A-MPDU) in blockackagreement (i.e. the sender is waiting
227
   * for a blockack containing the sequence number of this MPDU).
227
   * for a blockack containing the sequence number of this MPDU).

Return to bug 2224