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

(-)a/src/wifi/model/wifi-phy.cc (+17 lines)
 Lines 358-363   WifiPhy::GetTypeId (void) Link Here 
358
                     "in monitor mode to sniff all frames being transmitted",
358
                     "in monitor mode to sniff all frames being transmitted",
359
                     MakeTraceSourceAccessor (&WifiPhy::m_phyMonitorSniffTxTrace),
359
                     MakeTraceSourceAccessor (&WifiPhy::m_phyMonitorSniffTxTrace),
360
                     "ns3::WifiPhy::MonitorSnifferTxTracedCallback")
360
                     "ns3::WifiPhy::MonitorSnifferTxTracedCallback")
361
    .AddTraceSource ("EndOfHeSig",
362
                     "Trace source indicating the end of the 802.11ax HE-SIG",
363
                     MakeTraceSourceAccessor (&WifiPhy::m_phyEndOfHeSigTrace),
364
                     "ns3::WifiPhy::EndOfHeSigTracedCallback")
361
  ;
365
  ;
362
  return tid;
366
  return tid;
363
}
367
}
 Lines 2357-2362   WifiPhy::NotifyMonitorSniffTx (Ptr<const Packet> packet, uint16_t channelFreqMhz Link Here 
2357
}
2361
}
2358
2362
2359
void
2363
void
2364
WifiPhy::NotifyEndOfHeSig (HeSigParameters params)
2365
{
2366
  m_phyEndOfHeSigTrace (params);
2367
}
2368
2369
void
2360
WifiPhy::SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, MpduType mpdutype)
2370
WifiPhy::SendPacket (Ptr<const Packet> packet, WifiTxVector txVector, MpduType mpdutype)
2361
{
2371
{
2362
  NS_LOG_FUNCTION (this << packet << txVector.GetMode ()
2372
  NS_LOG_FUNCTION (this << packet << txVector.GetMode ()
 Lines 2627-2632   WifiPhy::StartReceivePacket (Ptr<Packet> packet, Link Here 
2627
        {
2637
        {
2628
          NS_LOG_DEBUG ("receiving plcp payload"); //endReceive is already scheduled
2638
          NS_LOG_DEBUG ("receiving plcp payload"); //endReceive is already scheduled
2629
          m_plcpSuccess = true;
2639
          m_plcpSuccess = true;
2640
          if (txVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HE)
2641
            {
2642
              HeSigParameters params;
2643
              params.rssiW = event->GetRxPowerW ();
2644
              params.bssColor = txVector.GetBssColor ();
2645
              NotifyEndOfHeSig (params);
2646
            }
2630
        }
2647
        }
2631
      else //mode is not allowed
2648
      else //mode is not allowed
2632
        {
2649
        {
(-)a/src/wifi/model/wifi-phy.h (+29 lines)
 Lines 58-63   struct MpduInfo Link Here 
58
  uint32_t mpduRefNumber; ///< MPDU ref number
58
  uint32_t mpduRefNumber; ///< MPDU ref number
59
};
59
};
60
60
61
// Parameters for receive HE-SIG
62
struct HeSigParameters
63
{
64
  double rssiW; ///< RSSI in W
65
  uint8_t bssColor; ///< BSS color
66
}; //replace by passing PHY headers?
67
61
/**
68
/**
62
 * \brief 802.11 PHY layer model
69
 * \brief 802.11 PHY layer model
63
 * \ingroup wifi
70
 * \ingroup wifi
 Lines 1196-1201   public: Link Here 
1196
                                            MpduInfo aMpdu);
1203
                                            MpduInfo aMpdu);
1197
1204
1198
  /**
1205
  /**
1206
   * Public method used to fire a EndOfHeSig trace once a HE-SIG header is being received.
1207
   *
1208
   * \param params the HE-SIG parameters
1209
   */
1210
  void NotifyEndOfHeSig (HeSigParameters params);
1211
1212
  /**
1213
   * TracedCallback signature for end of HE-SIG-A events.
1214
   *
1215
   *
1216
   * \param params the HE-SIG parameters
1217
   */
1218
  typedef void (* EndOfHePreambleCallback)(HeSigParameters params);
1219
1220
  /**
1199
   * Assign a fixed random variable stream number to the random variables
1221
   * Assign a fixed random variable stream number to the random variables
1200
   * used by this model. Return the number of streams (possibly zero) that
1222
   * used by this model. Return the number of streams (possibly zero) that
1201
   * have been assigned.
1223
   * have been assigned.
 Lines 1736-1741   private: Link Here 
1736
  TracedCallback<Ptr<const Packet>, uint16_t, WifiTxVector, MpduInfo> m_phyMonitorSniffTxTrace;
1758
  TracedCallback<Ptr<const Packet>, uint16_t, WifiTxVector, MpduInfo> m_phyMonitorSniffTxTrace;
1737
1759
1738
  /**
1760
  /**
1761
   * A trace source that indiates end of HE-SIG-A for received 802.11ax packets
1762
   *
1763
   * \see class CallBackTraceSource
1764
   */
1765
  TracedCallback<HeSigParameters> m_phyEndOfHeSigTrace;
1766
1767
  /**
1739
   * This vector holds the set of transmission modes that this
1768
   * This vector holds the set of transmission modes that this
1740
   * WifiPhy(-derived class) can support. In conversation we call this
1769
   * WifiPhy(-derived class) can support. In conversation we call this
1741
   * the DeviceRateSet (not a term you'll find in the standard), and
1770
   * the DeviceRateSet (not a term you'll find in the standard), and
(-)a/src/wifi/model/wifi-remote-station-manager.cc (+8 lines)
 Lines 588-593   WifiRemoteStationManager::GetDataTxVector (Mac48Address address, const WifiMacHe Link Here 
588
      txVector.SetChannelWidth (GetChannelWidthForTransmission (mgtMode, m_wifiPhy->GetChannelWidth ()));
588
      txVector.SetChannelWidth (GetChannelWidthForTransmission (mgtMode, m_wifiPhy->GetChannelWidth ()));
589
      txVector.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mgtMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
589
      txVector.SetGuardInterval (ConvertGuardIntervalToNanoSeconds (mgtMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ())));
590
    }
590
    }
591
  Ptr<WifiNetDevice> device = DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ());
592
  Ptr<HeConfiguration> heConfiguration = device->GetHeConfiguration ();
593
  if (heConfiguration)
594
    {
595
      UintegerValue bssColor;
596
      heConfiguration->GetAttribute ("BssColor", bssColor);
597
      txVector.SetBssColor (bssColor.Get ());
598
    }
591
  return txVector;
599
  return txVector;
592
}
600
}
593
601
(-)a/src/wifi/model/wifi-tx-vector.cc (-1 / +16 lines)
 Lines 32-37   WifiTxVector::WifiTxVector () Link Here 
32
    m_ness (0),
32
    m_ness (0),
33
    m_aggregation (false),
33
    m_aggregation (false),
34
    m_stbc (false),
34
    m_stbc (false),
35
    m_bssColor (0),
35
    m_modeInitialized (false),
36
    m_modeInitialized (false),
36
    m_txPowerLevelInitialized (false)
37
    m_txPowerLevelInitialized (false)
37
{
38
{
 Lines 46-52   WifiTxVector::WifiTxVector (WifiMode mode, Link Here 
46
                            uint8_t ness,
47
                            uint8_t ness,
47
                            uint16_t channelWidth,
48
                            uint16_t channelWidth,
48
                            bool aggregation,
49
                            bool aggregation,
49
                            bool stbc)
50
                            bool stbc,
51
                            uint8_t bssColor)
50
  : m_mode (mode),
52
  : m_mode (mode),
51
    m_txPowerLevel (powerLevel),
53
    m_txPowerLevel (powerLevel),
52
    m_preamble (preamble),
54
    m_preamble (preamble),
 Lines 57-62   WifiTxVector::WifiTxVector (WifiMode mode, Link Here 
57
    m_ness (ness),
59
    m_ness (ness),
58
    m_aggregation (aggregation),
60
    m_aggregation (aggregation),
59
    m_stbc (stbc),
61
    m_stbc (stbc),
62
    m_bssColor (bssColor),
60
    m_modeInitialized (true),
63
    m_modeInitialized (true),
61
    m_txPowerLevelInitialized (true)
64
    m_txPowerLevelInitialized (true)
62
{
65
{
 Lines 192-197   WifiTxVector::SetStbc (bool stbc) Link Here 
192
  m_stbc = stbc;
195
  m_stbc = stbc;
193
}
196
}
194
197
198
void
199
WifiTxVector::SetBssColor (uint8_t color)
200
{
201
  m_bssColor = color;
202
}
203
204
uint8_t
205
WifiTxVector::GetBssColor (void) const
206
{
207
  return m_bssColor;
208
}
209
195
bool
210
bool
196
WifiTxVector::IsValid (void) const
211
WifiTxVector::IsValid (void) const
197
{
212
{
(-)a/src/wifi/model/wifi-tx-vector.h (-1 / +14 lines)
 Lines 75-80   public: Link Here 
75
   * \param channelWidth the channel width in MHz
75
   * \param channelWidth the channel width in MHz
76
   * \param aggregation enable or disable MPDU aggregation
76
   * \param aggregation enable or disable MPDU aggregation
77
   * \param stbc enable or disable STBC
77
   * \param stbc enable or disable STBC
78
   * \param bssColor the BSS color
78
   */
79
   */
79
  WifiTxVector (WifiMode mode,
80
  WifiTxVector (WifiMode mode,
80
                uint8_t powerLevel,
81
                uint8_t powerLevel,
 Lines 85-91   public: Link Here 
85
                uint8_t ness,
86
                uint8_t ness,
86
                uint16_t channelWidth,
87
                uint16_t channelWidth,
87
                bool aggregation,
88
                bool aggregation,
88
                bool stbc);
89
                bool stbc,
90
                uint8_t bssColor = 0);
89
  /**
91
  /**
90
   * \returns the selected payload transmission mode
92
   * \returns the selected payload transmission mode
91
   */
93
   */
 Lines 192-197   public: Link Here 
192
   */
194
   */
193
  void SetStbc (bool stbc);
195
  void SetStbc (bool stbc);
194
  /**
196
  /**
197
   * Set the BSS color
198
   * \param color the BSS color
199
   */
200
  void SetBssColor (uint8_t color);
201
  /**
202
   * Get the BSS color
203
   * \return the BSS color
204
   */
205
  uint8_t GetBssColor (void) const;
206
  /**
195
   * The standard disallows certain combinations of WifiMode, number of
207
   * The standard disallows certain combinations of WifiMode, number of
196
   * spatial streams, and channel widths.  This method can be used to
208
   * spatial streams, and channel widths.  This method can be used to
197
   * check whether this WifiTxVector contains an invalid combination.
209
   * check whether this WifiTxVector contains an invalid combination.
 Lines 216-221   private: Link Here 
216
  uint8_t  m_ness;               /**< number of spatial streams in beamforming */
228
  uint8_t  m_ness;               /**< number of spatial streams in beamforming */
217
  bool     m_aggregation;        /**< Flag whether the PSDU contains A-MPDU. */
229
  bool     m_aggregation;        /**< Flag whether the PSDU contains A-MPDU. */
218
  bool     m_stbc;               /**< STBC used or not */
230
  bool     m_stbc;               /**< STBC used or not */
231
  uint8_t  m_bssColor;           /**< BSS color */
219
232
220
  bool     m_modeInitialized;         /**< Internal initialization flag */
233
  bool     m_modeInitialized;         /**< Internal initialization flag */
221
  bool     m_txPowerLevelInitialized; /**< Internal initialization flag */
234
  bool     m_txPowerLevelInitialized; /**< Internal initialization flag */

Return to bug 3021