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

(-)a/src/wifi/model/ht-capabilities.cc (-2 / +8 lines)
 Lines 179-185   HtCapabilities::SetTxRxMcsSetUnequal (uint8_t txrxmcssetunequal) Link Here 
179
void
179
void
180
HtCapabilities::SetTxMaxNSpatialStreams (uint8_t maxtxspatialstreams)
180
HtCapabilities::SetTxMaxNSpatialStreams (uint8_t maxtxspatialstreams)
181
{
181
{
182
  m_txMaxNSpatialStreams = maxtxspatialstreams;
182
  m_txMaxNSpatialStreams = maxtxspatialstreams - 1; //0 for 1 SS, 1 for 2 SSs, etc
183
}
183
}
184
184
185
void
185
void
 Lines 236-241   HtCapabilities::GetMaxAmpduLength (void) const Link Here 
236
  return m_maxAmpduLength;
236
  return m_maxAmpduLength;
237
}
237
}
238
238
239
uint8_t
240
HtCapabilities::GetMinMpduStartSpace (void) const
241
{
242
  return m_minMpduStartSpace;
243
}
244
239
uint8_t*
245
uint8_t*
240
HtCapabilities::GetRxMcsBitmask ()
246
HtCapabilities::GetRxMcsBitmask ()
241
{
247
{
 Lines 292-298   HtCapabilities::GetTxRxMcsSetUnequal (void) const Link Here 
292
uint8_t
298
uint8_t
293
HtCapabilities::GetTxMaxNSpatialStreams (void) const
299
HtCapabilities::GetTxMaxNSpatialStreams (void) const
294
{
300
{
295
  return m_txMaxNSpatialStreams;
301
  return m_txMaxNSpatialStreams; //0 for 1 SS, 1 for 2 SSs, etc
296
}
302
}
297
303
298
uint8_t
304
uint8_t
(-)a/src/wifi/model/ht-capabilities.h (+6 lines)
 Lines 268-273   public: Link Here 
268
   * \return the maximum AMPDU length
268
   * \return the maximum AMPDU length
269
   */
269
   */
270
  uint8_t GetMaxAmpduLength (void) const;
270
  uint8_t GetMaxAmpduLength (void) const;
271
  /**
272
   * Return the minimum MPDU start space.
273
   *
274
   * \return the minimum MPDU start space
275
   */
276
  uint8_t GetMinMpduStartSpace (void) const;
271
277
272
  /**
278
  /**
273
   * Return the receive MCS bitmask.
279
   * Return the receive MCS bitmask.
(-)a/src/wifi/model/regular-wifi-mac.cc (-5 / +19 lines)
 Lines 154-162   RegularWifiMac::GetHtCapabilities (void) const Link Here 
154
      capabilities.SetShortGuardInterval20 (m_phy->GetShortGuardInterval ());
154
      capabilities.SetShortGuardInterval20 (m_phy->GetShortGuardInterval ());
155
      capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () >= 40 && m_phy->GetShortGuardInterval ());
155
      capabilities.SetShortGuardInterval40 (m_phy->GetChannelWidth () >= 40 && m_phy->GetShortGuardInterval ());
156
      capabilities.SetGreenfield (m_phy->GetGreenfield ());
156
      capabilities.SetGreenfield (m_phy->GetGreenfield ());
157
      capabilities.SetMaxAmsduLength (1); //hardcoded for now (TBD)
157
      uint32_t maxAmsduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize));
158
      capabilities.SetMaxAmsduLength (maxAmsduLength > 3839); //0 if 3839 and 1 if 7935
158
      capabilities.SetLSigProtectionSupport (!m_phy->GetGreenfield ());
159
      capabilities.SetLSigProtectionSupport (!m_phy->GetGreenfield ());
159
      capabilities.SetMaxAmpduLength (3); //hardcoded for now (TBD)
160
      double maxAmpduLengthExponent = std::ceil (std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize))
161
                                                           + 1.0)
162
                                                 - 13.0);
163
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
164
      capabilities.SetMaxAmpduLength (std::max<uint8_t> (3, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 3 for HT
160
      uint64_t maxSupportedRate = 0; //in bit/s
165
      uint64_t maxSupportedRate = 0; //in bit/s
161
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
166
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
162
        {
167
        {
 Lines 198-208   RegularWifiMac::GetVhtCapabilities (void) const Link Here 
198
        {
203
        {
199
          capabilities.SetSupportedChannelWidthSet (0);
204
          capabilities.SetSupportedChannelWidthSet (0);
200
        }
205
        }
201
      capabilities.SetMaxMpduLength (2); //hardcoded for now (TBD)
206
      uint32_t maxMpduLength = std::max (std::max (m_beMaxAmsduSize, m_bkMaxAmsduSize), std::max (m_voMaxAmsduSize, m_viMaxAmsduSize)) + 56; //see section 9.11 of 11ac standard
207
      capabilities.SetMaxMpduLength (uint8_t (maxMpduLength > 3895) + uint8_t (maxMpduLength > 7991)); //0 if 3895, 1 if 7991, 2 for 11454
202
      capabilities.SetRxLdpc (m_phy->GetLdpc ());
208
      capabilities.SetRxLdpc (m_phy->GetLdpc ());
203
      capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && m_phy->GetShortGuardInterval ());
209
      capabilities.SetShortGuardIntervalFor80Mhz ((m_phy->GetChannelWidth () == 80) && m_phy->GetShortGuardInterval ());
204
      capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && m_phy->GetShortGuardInterval ());
210
      capabilities.SetShortGuardIntervalFor160Mhz ((m_phy->GetChannelWidth () == 160) && m_phy->GetShortGuardInterval ());
205
      capabilities.SetMaxAmpduLengthExponent (7); //hardcoded for now (TBD)
211
      double maxAmpduLengthExponent = std::ceil (std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize))
212
                                                           + 1.0)
213
                                                 - 13.0);
214
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
215
      capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //0 to 7 for VHT
206
      uint8_t maxMcs = 0;
216
      uint8_t maxMcs = 0;
207
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
217
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
208
        {
218
        {
 Lines 274-280   RegularWifiMac::GetHeCapabilities (void) const Link Here 
274
          gi |= 0x02;
284
          gi |= 0x02;
275
        }
285
        }
276
      capabilities.SetHeLtfAndGiForHePpdus (gi);
286
      capabilities.SetHeLtfAndGiForHePpdus (gi);
277
      capabilities.SetMaxAmpduLengthExponent (7); //hardcoded for now (TBD)
287
      double maxAmpduLengthExponent = std::ceil (std::log (std::max (std::max (m_beMaxAmpduSize, m_bkMaxAmpduSize), std::max (m_voMaxAmpduSize, m_viMaxAmpduSize))
288
                                                           + 1.0)
289
                                                 - 13.0);
290
      NS_ASSERT (maxAmpduLengthExponent >= 0 && maxAmpduLengthExponent <= 255);
291
      capabilities.SetMaxAmpduLengthExponent (std::max<uint8_t> (7, static_cast<uint8_t> (maxAmpduLengthExponent))); //assume 0 to 7 for HE
278
      uint8_t maxMcs = 0;
292
      uint8_t maxMcs = 0;
279
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
293
      for (uint8_t i = 0; i < m_phy->GetNMcs (); i++)
280
        {
294
        {
(-)a/src/wifi/model/vht-capabilities.cc (+5 lines)
 Lines 49-54   VhtCapabilities::VhtCapabilities () Link Here 
49
{
49
{
50
  m_rxMcsMap.resize (8,0);
50
  m_rxMcsMap.resize (8,0);
51
  m_txMcsMap.resize (8,0);
51
  m_txMcsMap.resize (8,0);
52
  for (uint8_t i = 0; i < 8; i++) //set to 3 by default, i.e. #spatial streams not supported. 0 means supported up to MCS 7, not what we want to imply at this stage.
53
    {
54
      m_rxMcsMap[i] = 3;
55
      m_txMcsMap[i] = 3;
56
    }
52
}
57
}
53
58
54
WifiInformationElementId
59
WifiInformationElementId

Return to bug 2739