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

(-)a/src/wifi/model/edca-parameter-set.cc (+6 lines)
 Lines 46-51    Link Here 
46
  m_qosSupported = qosSupported;
46
  m_qosSupported = qosSupported;
47
}
47
}
48
48
49
uint8_t
50
EdcaParameterSet::IsQosSupported (void) const
51
{
52
  return ((m_acBE != 0) || (m_acBK != 0) || (m_acVI != 0) || (m_acVO!= 0));
53
}
54
49
void
55
void
50
EdcaParameterSet::SetQosInfo (uint8_t qosInfo)
56
EdcaParameterSet::SetQosInfo (uint8_t qosInfo)
51
{
57
{
(-)a/src/wifi/model/edca-parameter-set.h (+1 lines)
 Lines 36-41    Link Here 
36
public:
36
public:
37
  EdcaParameterSet ();
37
  EdcaParameterSet ();
38
  void SetQosSupported (uint8_t qosSupported);
38
  void SetQosSupported (uint8_t qosSupported);
39
  uint8_t IsQosSupported (void) const;
39
  
40
  
40
  /**
41
  /**
41
   * Set the QoS Info field in the EdcaParameterSet information element.
42
   * Set the QoS Info field in the EdcaParameterSet information element.
(-)a/src/wifi/model/edca-txop-n.cc (+1 lines)
 Lines 523-528    Link Here 
523
              return;
523
              return;
524
            }
524
            }
525
          if (m_currentHdr.IsQosData () && !m_currentHdr.GetAddr1 ().IsBroadcast ()
525
          if (m_currentHdr.IsQosData () && !m_currentHdr.GetAddr1 ().IsBroadcast ()
526
              && m_stationManager->GetQosSupported (m_currentHdr.GetAddr1 ())
526
              && !m_baManager->ExistsAgreement (m_currentHdr.GetAddr1 (), m_currentHdr.GetQosTid ())
527
              && !m_baManager->ExistsAgreement (m_currentHdr.GetAddr1 (), m_currentHdr.GetQosTid ())
527
              && SetupBlockAckIfNeeded ())
528
              && SetupBlockAckIfNeeded ())
528
            {
529
            {
(-)a/src/wifi/model/ht-capabilities.cc (-3 / +6 lines)
 Lines 591-601    Link Here 
591
std::ostream &
591
std::ostream &
592
operator << (std::ostream &os, const HtCapabilities &htcapabilities)
592
operator << (std::ostream &os, const HtCapabilities &htcapabilities)
593
{
593
{
594
  os <<  bool (htcapabilities.GetLdpc ())
594
  os << bool (htcapabilities.GetLdpc ())
595
     << "|" << bool (htcapabilities.GetSupportedChannelWidth ())
595
     << "|" << bool (htcapabilities.GetSupportedChannelWidth ())
596
     << "|" << bool (htcapabilities.GetGreenfield ())
596
     << "|" << bool (htcapabilities.GetGreenfield ())
597
     << "|" << bool (htcapabilities.GetShortGuardInterval20 ());
597
     << "|" << bool (htcapabilities.GetShortGuardInterval20 ()) << "|";
598
598
  for (uint32_t k = 0; k < MAX_SUPPORTED_MCS; k++)
599
    {
600
      os << htcapabilities.IsSupportedMcs (k) << " ";
601
    }
599
  return os;
602
  return os;
600
}
603
}
601
604
(-)a/src/wifi/model/regular-wifi-mac.cc (-1 / +2 lines)
 Lines 139-149    Link Here 
139
HtCapabilities
139
HtCapabilities
140
RegularWifiMac::GetHtCapabilities (void) const
140
RegularWifiMac::GetHtCapabilities (void) const
141
{
141
{
142
  NS_LOG_FUNCTION (this);
142
  NS_LOG_FUNCTION (this << m_htSupported);
143
  HtCapabilities capabilities;
143
  HtCapabilities capabilities;
144
  if (m_htSupported)
144
  if (m_htSupported)
145
    {
145
    {
146
      capabilities.SetHtSupported (1);
146
      capabilities.SetHtSupported (1);
147
      capabilities.SetHtSupported (1);
147
      capabilities.SetLdpc (m_phy->GetLdpc ());
148
      capabilities.SetLdpc (m_phy->GetLdpc ());
148
      capabilities.SetSupportedChannelWidth (m_phy->GetChannelWidth () == 40);
149
      capabilities.SetSupportedChannelWidth (m_phy->GetChannelWidth () == 40);
149
      capabilities.SetShortGuardInterval20 (m_phy->GetGuardInterval ());
150
      capabilities.SetShortGuardInterval20 (m_phy->GetGuardInterval ());
(-)a/src/wifi/model/sta-wifi-mac.cc (-13 / +39 lines)
 Lines 535-551    Link Here 
535
            }
535
            }
536
          if (m_qosSupported)
536
          if (m_qosSupported)
537
            {
537
            {
538
              bool qosSupported = false;
538
              EdcaParameterSet edcaParameters = beacon.GetEdcaParameterSet ();
539
              EdcaParameterSet edcaParameters = beacon.GetEdcaParameterSet ();
539
              //The value of the TXOP Limit field is specified as an unsigned integer, with the least significant octet transmitted first, in units of 32 μs.
540
              if (edcaParameters.IsQosSupported ())
540
              SetEdcaParameters (AC_BE, edcaParameters.GetBeCWmin(), edcaParameters.GetBeCWmax(), edcaParameters.GetBeAifsn(), 32 * MicroSeconds (edcaParameters.GetBeTXOPLimit()));
541
                {
541
              SetEdcaParameters (AC_BK, edcaParameters.GetBkCWmin(), edcaParameters.GetBkCWmax(), edcaParameters.GetBkAifsn(), 32 * MicroSeconds (edcaParameters.GetBkTXOPLimit()));
542
                  qosSupported = true;
542
              SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin(), edcaParameters.GetViCWmax(), edcaParameters.GetViAifsn(), 32 * MicroSeconds (edcaParameters.GetViTXOPLimit()));
543
                  //The value of the TXOP Limit field is specified as an unsigned integer, with the least significant octet transmitted first, in units of 32 μs.
543
              SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin(), edcaParameters.GetVoCWmax(), edcaParameters.GetVoAifsn(), 32 * MicroSeconds (edcaParameters.GetVoTXOPLimit()));
544
                  SetEdcaParameters (AC_BE, edcaParameters.GetBeCWmin(), edcaParameters.GetBeCWmax(), edcaParameters.GetBeAifsn(), 32 * MicroSeconds (edcaParameters.GetBeTXOPLimit()));
545
                  SetEdcaParameters (AC_BK, edcaParameters.GetBkCWmin(), edcaParameters.GetBkCWmax(), edcaParameters.GetBkAifsn(), 32 * MicroSeconds (edcaParameters.GetBkTXOPLimit()));
546
                  SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin(), edcaParameters.GetViCWmax(), edcaParameters.GetViAifsn(), 32 * MicroSeconds (edcaParameters.GetViTXOPLimit()));
547
                  SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin(), edcaParameters.GetVoCWmax(), edcaParameters.GetVoAifsn(), 32 * MicroSeconds (edcaParameters.GetVoTXOPLimit()));
548
                }
549
              m_stationManager->SetQosSupport (hdr->GetAddr2 (), qosSupported);
544
            }
550
            }
545
          if (m_htSupported)
551
          if (m_htSupported)
546
            {
552
            {
547
              HtCapabilities htcapabilities = beacon.GetHtCapabilities ();
553
              HtCapabilities htcapabilities = beacon.GetHtCapabilities ();
548
              m_stationManager->AddStationHtCapabilities (hdr->GetAddr2 (), htcapabilities);
554
              if (!htcapabilities.IsSupportedMcs (0))
555
                {
556
                  m_stationManager->RemoveAllSupportedMcs (hdr->GetAddr2 ());
557
                }
558
              else
559
                {
560
                  m_stationManager->AddStationHtCapabilities (hdr->GetAddr2 (), htcapabilities);
561
                }
549
            }
562
            }
550
          if (m_vhtSupported)
563
          if (m_vhtSupported)
551
            {
564
            {
 Lines 702-719    Link Here 
702
              m_stationManager->SetShortSlotTimeEnabled (capabilities.IsShortSlotTime ());
715
              m_stationManager->SetShortSlotTimeEnabled (capabilities.IsShortSlotTime ());
703
              if (m_qosSupported)
716
              if (m_qosSupported)
704
                {
717
                {
718
                  bool qosSupported = false;
705
                  EdcaParameterSet edcaParameters = assocResp.GetEdcaParameterSet ();
719
                  EdcaParameterSet edcaParameters = assocResp.GetEdcaParameterSet ();
706
                  //The value of the TXOP Limit field is specified as an unsigned integer, with the least significant octet transmitted first, in units of 32 μs.
720
                  if (edcaParameters.IsQosSupported ())
707
                  SetEdcaParameters (AC_BE, edcaParameters.GetBeCWmin(), edcaParameters.GetBeCWmax(), edcaParameters.GetBeAifsn(), 32 * MicroSeconds (edcaParameters.GetBeTXOPLimit()));
721
                    {
708
                  SetEdcaParameters (AC_BK, edcaParameters.GetBkCWmin(), edcaParameters.GetBkCWmax(), edcaParameters.GetBkAifsn(), 32 * MicroSeconds (edcaParameters.GetBkTXOPLimit()));
722
                      qosSupported = true;
709
                  SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin(), edcaParameters.GetViCWmax(), edcaParameters.GetViAifsn(), 32 * MicroSeconds (edcaParameters.GetViTXOPLimit()));
723
                      //The value of the TXOP Limit field is specified as an unsigned integer, with the least significant octet transmitted first, in units of 32 μs.
710
                  SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin(), edcaParameters.GetVoCWmax(), edcaParameters.GetVoAifsn(), 32 * MicroSeconds (edcaParameters.GetVoTXOPLimit()));
724
                      SetEdcaParameters (AC_BE, edcaParameters.GetBeCWmin(), edcaParameters.GetBeCWmax(), edcaParameters.GetBeAifsn(), 32 * MicroSeconds (edcaParameters.GetBeTXOPLimit()));
725
                      SetEdcaParameters (AC_BK, edcaParameters.GetBkCWmin(), edcaParameters.GetBkCWmax(), edcaParameters.GetBkAifsn(), 32 * MicroSeconds (edcaParameters.GetBkTXOPLimit()));
726
                      SetEdcaParameters (AC_VI, edcaParameters.GetViCWmin(), edcaParameters.GetViCWmax(), edcaParameters.GetViAifsn(), 32 * MicroSeconds (edcaParameters.GetViTXOPLimit()));
727
                      SetEdcaParameters (AC_VO, edcaParameters.GetVoCWmin(), edcaParameters.GetVoCWmax(), edcaParameters.GetVoAifsn(), 32 * MicroSeconds (edcaParameters.GetVoTXOPLimit()));
728
                    }
729
                  m_stationManager->SetQosSupport (hdr->GetAddr2 (), qosSupported);
711
                }
730
                }
712
              if (m_htSupported)
731
              if (m_htSupported)
713
                {
732
                {
714
                  HtCapabilities htcapabilities = assocResp.GetHtCapabilities ();
733
                  HtCapabilities htcapabilities = assocResp.GetHtCapabilities ();
715
                  HtOperation htOperation = assocResp.GetHtOperation ();
734
                  if (!htcapabilities.IsSupportedMcs (0))
716
                  m_stationManager->AddStationHtCapabilities (hdr->GetAddr2 (), htcapabilities);
735
                    {
736
                      m_stationManager->RemoveAllSupportedMcs (hdr->GetAddr2 ());
737
                    }
738
                  else
739
                    {
740
                      HtOperation htOperation = assocResp.GetHtOperation ();
741
                      m_stationManager->AddStationHtCapabilities (hdr->GetAddr2 (), htcapabilities);
742
                    }
717
                }
743
                }
718
              if (m_vhtSupported)
744
              if (m_vhtSupported)
719
                {
745
                {
(-)a/src/wifi/model/wifi-remote-station-manager.cc (-1 / +47 lines)
 Lines 352-358    Link Here 
352
}
352
}
353
353
354
WifiRemoteStationManager::WifiRemoteStationManager ()
354
WifiRemoteStationManager::WifiRemoteStationManager ()
355
  : m_htSupported (false),
355
  : m_qosSupported (false),
356
    m_htSupported (false),
356
    m_vhtSupported (false),
357
    m_vhtSupported (false),
357
    m_useNonErpProtection (false),
358
    m_useNonErpProtection (false),
358
    m_shortPreambleEnabled (false),
359
    m_shortPreambleEnabled (false),
 Lines 406-411    Link Here 
406
}
407
}
407
408
408
void
409
void
410
WifiRemoteStationManager::SetQosSupported (bool enable)
411
{
412
  m_qosSupported = enable;
413
}
414
415
void
409
WifiRemoteStationManager::SetHtSupported (bool enable)
416
WifiRemoteStationManager::SetHtSupported (bool enable)
410
{
417
{
411
  m_htSupported = enable;
418
  m_htSupported = enable;
 Lines 472-477    Link Here 
472
}
479
}
473
480
474
bool
481
bool
482
WifiRemoteStationManager::HasQosSupported (void) const
483
{
484
  return m_qosSupported;
485
}
486
487
bool
475
WifiRemoteStationManager::HasHtSupported (void) const
488
WifiRemoteStationManager::HasHtSupported (void) const
476
{
489
{
477
  return m_htSupported;
490
  return m_htSupported;
 Lines 591-596    Link Here 
591
}
604
}
592
605
593
void
606
void
607
WifiRemoteStationManager::RemoveAllSupportedMcs (Mac48Address address)
608
{
609
  NS_LOG_FUNCTION (this << address);
610
  NS_ASSERT (!address.IsGroup ());
611
  WifiRemoteStationState *state = LookupState (address);
612
  state->m_operationalMcsSet.clear ();
613
}
614
615
void
594
WifiRemoteStationManager::AddSupportedMcs (Mac48Address address, WifiMode mcs)
616
WifiRemoteStationManager::AddSupportedMcs (Mac48Address address, WifiMode mcs)
595
{
617
{
596
  NS_LOG_FUNCTION (this << address << mcs);
618
  NS_LOG_FUNCTION (this << address << mcs);
 Lines 620-625    Link Here 
620
}
642
}
621
643
622
bool
644
bool
645
WifiRemoteStationManager::GetQosSupported (Mac48Address address) const
646
{
647
  return LookupState (address)->m_qosSupported;
648
}
649
650
bool
623
WifiRemoteStationManager::IsBrandNew (Mac48Address address) const
651
WifiRemoteStationManager::IsBrandNew (Mac48Address address) const
624
{
652
{
625
  if (address.IsGroup ())
653
  if (address.IsGroup ())
 Lines 1490-1495    Link Here 
1490
  state->m_ness = 0;
1518
  state->m_ness = 0;
1491
  state->m_aggregation = false;
1519
  state->m_aggregation = false;
1492
  state->m_stbc = false;
1520
  state->m_stbc = false;
1521
  state->m_qosSupported = false;
1493
  state->m_htSupported = false;
1522
  state->m_htSupported = false;
1494
  state->m_vhtSupported = false;
1523
  state->m_vhtSupported = false;
1495
  const_cast<WifiRemoteStationManager *> (this)->m_states.push_back (state);
1524
  const_cast<WifiRemoteStationManager *> (this)->m_states.push_back (state);
 Lines 1536-1541    Link Here 
1536
}
1565
}
1537
1566
1538
void
1567
void
1568
WifiRemoteStationManager::SetQosSupport (Mac48Address from, bool qosSupported)
1569
{
1570
  NS_LOG_FUNCTION (this << from << qosSupported);
1571
  WifiRemoteStationState *state;
1572
  state = LookupState (from);
1573
  state->m_qosSupported = qosSupported;
1574
}
1575
1576
void
1539
WifiRemoteStationManager::AddStationHtCapabilities (Mac48Address from, HtCapabilities htCapabilities)
1577
WifiRemoteStationManager::AddStationHtCapabilities (Mac48Address from, HtCapabilities htCapabilities)
1540
{
1578
{
1541
  //Used by all stations to record HT capabilities of remote stations
1579
  //Used by all stations to record HT capabilities of remote stations
 Lines 1551-1556    Link Here 
1551
    {
1589
    {
1552
      state->m_channelWidth = 20;
1590
      state->m_channelWidth = 20;
1553
    }
1591
    }
1592
  SetQosSupport (from, true);
1554
  state->m_htSupported = true;
1593
  state->m_htSupported = true;
1555
  state->m_greenfield = htCapabilities.GetGreenfield ();
1594
  state->m_greenfield = htCapabilities.GetGreenfield ();
1556
  state->m_streams = htCapabilities.GetRxHighestSupportedAntennas ();
1595
  state->m_streams = htCapabilities.GetRxHighestSupportedAntennas ();
 Lines 1577-1582    Link Here 
1577
    {
1616
    {
1578
      state->m_channelWidth = m_wifiPhy->GetChannelWidth ();
1617
      state->m_channelWidth = m_wifiPhy->GetChannelWidth ();
1579
    }
1618
    }
1619
  SetQosSupport (from, true);
1580
  state->m_vhtSupported = true;
1620
  state->m_vhtSupported = true;
1581
}
1621
}
1582
1622
 Lines 1880-1885    Link Here 
1880
}
1920
}
1881
1921
1882
bool
1922
bool
1923
WifiRemoteStationManager::GetQosSupported (const WifiRemoteStation *station) const
1924
{
1925
  return station->m_state->m_qosSupported;
1926
}
1927
1928
bool
1883
WifiRemoteStationManager::GetHtSupported (const WifiRemoteStation *station) const
1929
WifiRemoteStationManager::GetHtSupported (const WifiRemoteStation *station) const
1884
{
1930
{
1885
  return station->m_state->m_htSupported;
1931
  return station->m_state->m_htSupported;
(-)a/src/wifi/model/wifi-remote-station-manager.h (+45 lines)
 Lines 165-170    Link Here 
165
   */
165
   */
166
  void UpdateFragmentationThreshold (void);
166
  void UpdateFragmentationThreshold (void);
167
  /**
167
  /**
168
   * Records QoS support of the remote station.
169
   *
170
   * \param from the address of the station being recorded
171
   * \param qosSupported whether the station supports QoS
172
   */
173
  void SetQosSupport (Mac48Address from, bool qosSupported);
174
  /**
168
   * Records HT capabilities of the remote station.
175
   * Records HT capabilities of the remote station.
169
   *
176
   *
170
   * \param from the address of the station being recorded
177
   * \param from the address of the station being recorded
 Lines 179-184    Link Here 
179
   */
186
   */
180
  void AddStationVhtCapabilities (Mac48Address from,VhtCapabilities vhtcapabilities);
187
  void AddStationVhtCapabilities (Mac48Address from,VhtCapabilities vhtcapabilities);
181
  /**
188
  /**
189
   * Enable or disable QoS support.
190
   *
191
   * \param enable enable or disable QoS support
192
   */
193
  virtual void SetQosSupported (bool enable);
194
  /**
195
   * Return whether the device has QoS support enabled.
196
   *
197
   * \return true if QoS support is enabled, false otherwise
198
   */
199
  bool HasQosSupported (void) const;
200
  /**
182
   * Enable or disable HT capability support.
201
   * Enable or disable HT capability support.
183
   *
202
   *
184
   * \param enable enable or disable HT capability support
203
   * \param enable enable or disable HT capability support
 Lines 329-334    Link Here 
329
   */
348
   */
330
  bool GetShortSlotTimeSupported (Mac48Address address) const;
349
  bool GetShortSlotTimeSupported (Mac48Address address) const;
331
  /**
350
  /**
351
   * Return whether the given station is QoS capable.
352
   *
353
   * \param address the address of the station
354
   *
355
   * \return true if the station has QoS capabilities,
356
   *         false otherwise
357
   */
358
  bool GetQosSupported (Mac48Address address) const;
359
  /**
332
   * Add a given Modulation and Coding Scheme (MCS) index to
360
   * Add a given Modulation and Coding Scheme (MCS) index to
333
   * the set of basic MCS.
361
   * the set of basic MCS.
334
   *
362
   *
 Lines 422-427    Link Here 
422
   */
450
   */
423
  void AddAllSupportedMcs (Mac48Address address);
451
  void AddAllSupportedMcs (Mac48Address address);
424
  /**
452
  /**
453
   * Invoked in a STA or AP to delete all of the suppported MCS by a destination.
454
   *
455
   * \param address the address of the station being recorded
456
   */
457
  void RemoveAllSupportedMcs (Mac48Address address);
458
  /**
425
   * Record whether the short PLCP preamble is supported by the station.
459
   * Record whether the short PLCP preamble is supported by the station.
426
   *
460
   *
427
   * \param address the address of the station
461
   * \param address the address of the station
 Lines 788-793    Link Here 
788
   */
822
   */
789
  uint32_t GetNSupported (const WifiRemoteStation *station) const;
823
  uint32_t GetNSupported (const WifiRemoteStation *station) const;
790
  /**
824
  /**
825
   * Return whether the given station is QoS capable.
826
   *
827
   * \param station the station being queried
828
   *
829
   * \return true if the station has QoS capabilities,
830
   *         false otherwise
831
   */
832
  bool GetQosSupported (const WifiRemoteStation *station) const;
833
  /**
791
   * Return whether the given station is HT capable.
834
   * Return whether the given station is HT capable.
792
   *
835
   *
793
   * \param station the station being queried
836
   * \param station the station being queried
 Lines 1254-1259    Link Here 
1254
  WifiMode m_defaultTxMode; //!< The default transmission mode
1297
  WifiMode m_defaultTxMode; //!< The default transmission mode
1255
  WifiMode m_defaultTxMcs;   //!< The default transmission modulation-coding scheme (MCS)
1298
  WifiMode m_defaultTxMcs;   //!< The default transmission modulation-coding scheme (MCS)
1256
1299
1300
  bool m_qosSupported;  //!< Flag if HT capability is supported
1257
  bool m_htSupported;  //!< Flag if HT capability is supported
1301
  bool m_htSupported;  //!< Flag if HT capability is supported
1258
  bool m_vhtSupported; //!< Flag if VHT capability is supported
1302
  bool m_vhtSupported; //!< Flag if VHT capability is supported
1259
  uint32_t m_maxSsrc;  //!< Maximum STA short retry count (SSRC)
1303
  uint32_t m_maxSsrc;  //!< Maximum STA short retry count (SSRC)
 Lines 1327-1332    Link Here 
1327
  bool m_greenfield;          //!< Flag if greenfield is supported by the remote station
1371
  bool m_greenfield;          //!< Flag if greenfield is supported by the remote station
1328
  bool m_shortPreamble;       //!< Flag if short PLCP preamble is supported by the remote station
1372
  bool m_shortPreamble;       //!< Flag if short PLCP preamble is supported by the remote station
1329
  bool m_shortSlotTime;       //!< Flag if short ERP slot time is supported by the remote station
1373
  bool m_shortSlotTime;       //!< Flag if short ERP slot time is supported by the remote station
1374
  bool m_qosSupported;         //!< Flag if HT is supported by the station
1330
  bool m_htSupported;         //!< Flag if HT is supported by the station
1375
  bool m_htSupported;         //!< Flag if HT is supported by the station
1331
  bool m_vhtSupported;        //!< Flag if VHT is supported by the station
1376
  bool m_vhtSupported;        //!< Flag if VHT is supported by the station
1332
};
1377
};

Return to bug 2605