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

(-)a/src/wifi/examples/wifi-phy-test.cc (-4 / +4 lines)
 Lines 59-65    Link Here 
59
59
60
private:
60
private:
61
  void Send (void);
61
  void Send (void);
62
  void Receive (Ptr<Packet> p, double snr, WifiMode mode, enum WifiPreamble preamble);
62
  void Receive (Ptr<Packet> p, double snr, WifiTxVector txVector, enum WifiPreamble preamble);
63
  Ptr<WifiPhy> m_tx;
63
  Ptr<WifiPhy> m_tx;
64
  struct Input m_input;
64
  struct Input m_input;
65
  struct Output m_output;
65
  struct Output m_output;
 Lines 77-83    Link Here 
77
}
77
}
78
78
79
void
79
void
80
PsrExperiment::Receive (Ptr<Packet> p, double snr, WifiMode mode, enum WifiPreamble preamble)
80
PsrExperiment::Receive (Ptr<Packet> p, double snr, WifiTxVector txVector, enum WifiPreamble preamble)
81
{
81
{
82
  m_output.received++;
82
  m_output.received++;
83
}
83
}
 Lines 161-167    Link Here 
161
private:
161
private:
162
  void SendA (void) const;
162
  void SendA (void) const;
163
  void SendB (void) const;
163
  void SendB (void) const;
164
  void Receive (Ptr<Packet> p, double snr, WifiMode mode, enum WifiPreamble preamble);
164
  void Receive (Ptr<Packet> p, double snr, WifiTxVector txVector, enum WifiPreamble preamble);
165
  Ptr<WifiPhy> m_txA;
165
  Ptr<WifiPhy> m_txA;
166
  Ptr<WifiPhy> m_txB;
166
  Ptr<WifiPhy> m_txB;
167
  uint32_t m_flowIdA;
167
  uint32_t m_flowIdA;
 Lines 193-199    Link Here 
193
}
193
}
194
194
195
void
195
void
196
CollisionExperiment::Receive (Ptr<Packet> p, double snr, WifiMode mode, enum WifiPreamble preamble)
196
CollisionExperiment::Receive (Ptr<Packet> p, double snr, WifiTxVector txVector, enum WifiPreamble preamble)
197
{
197
{
198
  FlowIdTag tag;
198
  FlowIdTag tag;
199
  if (p->FindFirstMatchingByteTag (tag))
199
  if (p->FindFirstMatchingByteTag (tag))
(-)a/src/wifi/model/ap-wifi-mac.cc (+4 lines)
 Lines 314-319    Link Here 
314
    {
314
    {
315
      WifiMode mode = m_phy->GetMode (i);
315
      WifiMode mode = m_phy->GetMode (i);
316
      rates.AddSupportedRate (mode.GetDataRate ());
316
      rates.AddSupportedRate (mode.GetDataRate ());
317
      if(mode.IsBssBasic())
318
      {
319
        m_stationManager->AddBasicMode (mode);
320
      }
317
    }
321
    }
318
  // set the basic rates
322
  // set the basic rates
319
  for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
323
  for (uint32_t j = 0; j < m_stationManager->GetNBasicModes (); j++)
(-)a/src/wifi/model/constant-rate-wifi-manager.cc (-1 / +1 lines)
 Lines 43-49    Link Here 
43
                   StringValue ("OfdmRate6Mbps"),
43
                   StringValue ("OfdmRate6Mbps"),
44
                   MakeWifiModeAccessor (&ConstantRateWifiManager::m_dataMode),
44
                   MakeWifiModeAccessor (&ConstantRateWifiManager::m_dataMode),
45
                   MakeWifiModeChecker ())
45
                   MakeWifiModeChecker ())
46
    .AddAttribute ("ControlMode", "The transmission mode to use for every control packet transmission.",
46
    .AddAttribute ("ControlMode", "The transmission mode to use for every RTS packet transmission.",
47
                   StringValue ("OfdmRate6Mbps"),
47
                   StringValue ("OfdmRate6Mbps"),
48
                   MakeWifiModeAccessor (&ConstantRateWifiManager::m_ctlMode),
48
                   MakeWifiModeAccessor (&ConstantRateWifiManager::m_ctlMode),
49
                   MakeWifiModeChecker ())
49
                   MakeWifiModeChecker ())
(-)a/src/wifi/model/constant-rate-wifi-manager.h (-2 / +2 lines)
 Lines 28-34    Link Here 
28
28
29
/**
29
/**
30
 * \ingroup wifi
30
 * \ingroup wifi
31
 * \brief use constant rates for data and control transmissions
31
 * \brief use constant rates for data and RTS transmissions
32
 *
32
 *
33
 * This class uses always the same transmission rate for every
33
 * This class uses always the same transmission rate for every
34
 * packet sent.
34
 * packet sent.
 Lines 58-64    Link Here 
58
  virtual bool IsLowLatency (void) const;
58
  virtual bool IsLowLatency (void) const;
59
59
60
  WifiMode m_dataMode; //!< Wifi mode for unicast DATA frames
60
  WifiMode m_dataMode; //!< Wifi mode for unicast DATA frames
61
  WifiMode m_ctlMode; //!< Wifi mode for request control frames
61
  WifiMode m_ctlMode; //!< Wifi mode for RTS frames
62
};
62
};
63
63
64
} // namespace ns3
64
} // namespace ns3
(-)a/src/wifi/model/interference-helper.cc (-17 / +14 lines)
 Lines 32-47    Link Here 
32
 *       Phy event class
32
 *       Phy event class
33
 ****************************************************************/
33
 ****************************************************************/
34
34
35
InterferenceHelper::Event::Event (uint32_t size, WifiMode payloadMode,
35
InterferenceHelper::Event::Event (uint32_t size, WifiTxVector txVector,
36
                                  enum WifiPreamble preamble,
36
                                  enum WifiPreamble preamble,
37
                                  Time duration, double rxPower, WifiTxVector txVector)
37
                                  Time duration, double rxPower)
38
  : m_size (size),
38
  : m_size (size),
39
    m_payloadMode (payloadMode),
39
    m_txVector (txVector),
40
    m_preamble (preamble),
40
    m_preamble (preamble),
41
    m_startTime (Simulator::Now ()),
41
    m_startTime (Simulator::Now ()),
42
    m_endTime (m_startTime + duration),
42
    m_endTime (m_startTime + duration),
43
    m_rxPowerW (rxPower),
43
    m_rxPowerW (rxPower)
44
    m_txVector (txVector)
45
{
44
{
46
}
45
}
47
InterferenceHelper::Event::~Event ()
46
InterferenceHelper::Event::~Event ()
 Lines 73-82    Link Here 
73
{
72
{
74
  return m_size;
73
  return m_size;
75
}
74
}
75
WifiTxVector
76
InterferenceHelper::Event::GetTxVector (void) const
77
{
78
  return m_txVector;
79
}
76
WifiMode
80
WifiMode
77
InterferenceHelper::Event::GetPayloadMode (void) const
81
InterferenceHelper::Event::GetPayloadMode (void) const
78
{
82
{
79
  return m_payloadMode;
83
  return m_txVector.GetMode();
80
}
84
}
81
enum WifiPreamble
85
enum WifiPreamble
82
InterferenceHelper::Event::GetPreambleType (void) const
86
InterferenceHelper::Event::GetPreambleType (void) const
 Lines 84-95    Link Here 
84
  return m_preamble;
88
  return m_preamble;
85
}
89
}
86
90
87
WifiTxVector
88
InterferenceHelper::Event::GetTxVector (void) const
89
{
90
  return m_txVector;
91
}
92
93
91
94
/****************************************************************
92
/****************************************************************
95
 *       Class which records SNIR change events for a
93
 *       Class which records SNIR change events for a
 Lines 134-151    Link Here 
134
}
132
}
135
133
136
Ptr<InterferenceHelper::Event>
134
Ptr<InterferenceHelper::Event>
137
InterferenceHelper::Add (uint32_t size, WifiMode payloadMode,
135
InterferenceHelper::Add (uint32_t size, WifiTxVector txVector,
138
                         enum WifiPreamble preamble,
136
                         enum WifiPreamble preamble,
139
                         Time duration, double rxPowerW, WifiTxVector txVector)
137
                         Time duration, double rxPowerW)
140
{
138
{
141
  Ptr<InterferenceHelper::Event> event;
139
  Ptr<InterferenceHelper::Event> event;
142
140
143
  event = Create<InterferenceHelper::Event> (size,
141
  event = Create<InterferenceHelper::Event> (size,
144
                                             payloadMode,
142
                                             txVector,
145
                                             preamble,
143
                                             preamble,
146
                                             duration,
144
                                             duration,
147
                                             rxPowerW,
145
                                             rxPowerW);
148
                                             txVector);
149
  AppendEvent (event);
146
  AppendEvent (event);
150
  return event;
147
  return event;
151
}
148
}
(-)a/src/wifi/model/interference-helper.h (-16 / +14 lines)
 Lines 51-65    Link Here 
51
     * Create an Event with the given parameters.
51
     * Create an Event with the given parameters.
52
     *
52
     *
53
     * \param size packet size
53
     * \param size packet size
54
     * \param payloadMode Wi-Fi mode used for the payload
54
     * \param txvector TXVECTOR of the packet
55
     * \param preamble preamble type
55
     * \param preamble preamble type
56
     * \param duration duration of the signal
56
     * \param duration duration of the signal
57
     * \param rxPower the receive power (w)
57
     * \param rxPower the receive power (w)
58
     * \param txvector TXVECTOR of the packet
59
     */
58
     */
60
    Event (uint32_t size, WifiMode payloadMode,
59
    Event (uint32_t size, WifiTxVector txvector,
61
           enum WifiPreamble preamble,
60
           enum WifiPreamble preamble,
62
           Time duration, double rxPower, WifiTxVector txvector);
61
           Time duration, double rxPower);
63
    ~Event ();
62
    ~Event ();
64
63
65
    /**
64
    /**
 Lines 93-98    Link Here 
93
     */
92
     */
94
    uint32_t GetSize (void) const;
93
    uint32_t GetSize (void) const;
95
    /**
94
    /**
95
     * Return the TXVECTOR of the packet.
96
     *
97
     * \return the TXVECTOR of the packet
98
     */
99
    WifiTxVector GetTxVector (void) const;
100
    /**
96
     * Return the Wi-Fi mode used for the payload.
101
     * Return the Wi-Fi mode used for the payload.
97
     *
102
     *
98
     * \return the Wi-Fi mode used for the payload
103
     * \return the Wi-Fi mode used for the payload
 Lines 104-123    Link Here 
104
     * \return the preamble type of the packet
109
     * \return the preamble type of the packet
105
     */
110
     */
106
    enum WifiPreamble GetPreambleType (void) const;
111
    enum WifiPreamble GetPreambleType (void) const;
107
    /**
112
108
     * Return the TXVECTOR of the packet.
109
     *
110
     * \return the TXVECTOR of the packet
111
     */
112
    WifiTxVector GetTxVector (void) const;
113
private:
113
private:
114
    uint32_t m_size;
114
    uint32_t m_size;
115
    WifiMode m_payloadMode;
115
    WifiTxVector m_txVector;
116
    enum WifiPreamble m_preamble;
116
    enum WifiPreamble m_preamble;
117
    Time m_startTime;
117
    Time m_startTime;
118
    Time m_endTime;
118
    Time m_endTime;
119
    double m_rxPowerW;
119
    double m_rxPowerW;
120
    WifiTxVector m_txVector;
121
  };
120
  };
122
  /**
121
  /**
123
   * A struct for both SNR and PER
122
   * A struct for both SNR and PER
 Lines 170-185    Link Here 
170
   * Add the packet-related signal to interference helper.
169
   * Add the packet-related signal to interference helper.
171
   *
170
   *
172
   * \param size packet size
171
   * \param size packet size
173
   * \param payloadMode Wi-Fi mode for the payload
172
   * \param txvector TXVECTOR of the packet
174
   * \param preamble Wi-Fi preamble for the packet
173
   * \param preamble Wi-Fi preamble for the packet
175
   * \param duration the duration of the signal
174
   * \param duration the duration of the signal
176
   * \param rxPower receive power (w)
175
   * \param rxPower receive power (w)
177
   * \param txvector TXVECTOR of the packet
178
   * \return InterferenceHelper::Event
176
   * \return InterferenceHelper::Event
179
   */
177
   */
180
  Ptr<InterferenceHelper::Event> Add (uint32_t size, WifiMode payloadMode,
178
  Ptr<InterferenceHelper::Event> Add (uint32_t size, WifiTxVector txvector,
181
                                      enum WifiPreamble preamble,
179
                                      enum WifiPreamble preamble,
182
                                      Time duration, double rxPower, WifiTxVector txvector);
180
                                      Time duration, double rxPower);
183
181
184
  /**
182
  /**
185
   * Calculate the SNIR at the start of the packet and accumulate
183
   * Calculate the SNIR at the start of the packet and accumulate
(-)a/src/wifi/model/mac-low.cc (-106 / +75 lines)
 Lines 503-509    Link Here 
503
void
503
void
504
MacLow::ResetPhy (void)
504
MacLow::ResetPhy (void)
505
{
505
{
506
  m_phy->SetReceiveOkCallback (MakeNullCallback<void,Ptr<Packet>, double, WifiMode, enum WifiPreamble>  ());
506
  m_phy->SetReceiveOkCallback (MakeNullCallback<void,Ptr<Packet>, double, WifiTxVector, enum WifiPreamble>  ());
507
  m_phy->SetReceiveErrorCallback (MakeNullCallback<void,Ptr<const Packet>, double> ());
507
  m_phy->SetReceiveErrorCallback (MakeNullCallback<void,Ptr<const Packet>, double> ());
508
  RemovePhyMacLowListener (m_phy);
508
  RemovePhyMacLowListener (m_phy);
509
  m_phy = 0;
509
  m_phy = 0;
 Lines 759-765    Link Here 
759
                                                hdr.GetQosTid(),
759
                                                hdr.GetQosTid(),
760
                                                hdr.GetAddr2 (),
760
                                                hdr.GetAddr2 (),
761
                                                hdr.GetDuration (),
761
                                                hdr.GetDuration (),
762
                                                m_currentMode);
762
                                                m_currentTxVector);
763
        }
763
        }
764
      else if (hdr.IsBlockAckReq())
764
      else if (hdr.IsBlockAckReq())
765
        {
765
        {
 Lines 808-816    Link Here 
808
}
808
}
809
809
810
void
810
void
811
MacLow::ReceiveOk (Ptr<Packet> packet, double rxSnr, WifiMode txMode, WifiPreamble preamble, bool ampduSubframe)
811
MacLow::ReceiveOk (Ptr<Packet> packet, double rxSnr, WifiTxVector txVector, WifiPreamble preamble, bool ampduSubframe)
812
{
812
{
813
  NS_LOG_FUNCTION (this << packet << rxSnr << txMode << preamble);
813
  NS_LOG_FUNCTION (this << packet << rxSnr << txVector.GetMode  () << preamble);
814
  /* A packet is received from the PHY.
814
  /* A packet is received from the PHY.
815
   * When we have handled this packet,
815
   * When we have handled this packet,
816
   * we handle any packet present in the
816
   * we handle any packet present in the
 Lines 821-827    Link Here 
821
821
822
  bool isPrevNavZero = IsNavZero ();
822
  bool isPrevNavZero = IsNavZero ();
823
  NS_LOG_DEBUG ("duration/id=" << hdr.GetDuration ());
823
  NS_LOG_DEBUG ("duration/id=" << hdr.GetDuration ());
824
  NotifyNav (packet,hdr, txMode, preamble);
824
  NotifyNav (packet, hdr, preamble);
825
  if (hdr.IsRts ())
825
  if (hdr.IsRts ())
826
    {
826
    {
827
      /* see section 9.2.5.7 802.11-1999
827
      /* see section 9.2.5.7 802.11-1999
 Lines 842-853    Link Here 
842
              NS_LOG_DEBUG ("rx RTS from=" << hdr.GetAddr2 () << ", schedule CTS");
842
              NS_LOG_DEBUG ("rx RTS from=" << hdr.GetAddr2 () << ", schedule CTS");
843
              NS_ASSERT (m_sendCtsEvent.IsExpired ());
843
              NS_ASSERT (m_sendCtsEvent.IsExpired ());
844
              m_stationManager->ReportRxOk (hdr.GetAddr2 (), &hdr,
844
              m_stationManager->ReportRxOk (hdr.GetAddr2 (), &hdr,
845
                                            rxSnr, txMode);
845
                                            rxSnr, txVector.GetMode  ());
846
              m_sendCtsEvent = Simulator::Schedule (GetSifs (),
846
              m_sendCtsEvent = Simulator::Schedule (GetSifs (),
847
                                                    &MacLow::SendCtsAfterRts, this,
847
                                                    &MacLow::SendCtsAfterRts, this,
848
                                                    hdr.GetAddr2 (),
848
                                                    hdr.GetAddr2 (),
849
                                                    hdr.GetDuration (),
849
                                                    hdr.GetDuration (),
850
                                                    txMode,
850
                                                    txVector,
851
                                                    rxSnr);
851
                                                    rxSnr);
852
            }
852
            }
853
          else
853
          else
 Lines 869-887    Link Here 
869
      SnrTag tag;
869
      SnrTag tag;
870
      packet->RemovePacketTag (tag);
870
      packet->RemovePacketTag (tag);
871
      m_stationManager->ReportRxOk (m_currentHdr.GetAddr1 (), &m_currentHdr,
871
      m_stationManager->ReportRxOk (m_currentHdr.GetAddr1 (), &m_currentHdr,
872
                                    rxSnr, txMode);
872
                                    rxSnr, txVector.GetMode  ());
873
      m_stationManager->ReportRtsOk (m_currentHdr.GetAddr1 (), &m_currentHdr,
873
      m_stationManager->ReportRtsOk (m_currentHdr.GetAddr1 (), &m_currentHdr,
874
                                     rxSnr, txMode, tag.Get ());
874
                                     rxSnr, txVector.GetMode  (), tag.Get ());
875
875
876
      m_ctsTimeoutEvent.Cancel ();
876
      m_ctsTimeoutEvent.Cancel ();
877
      NotifyCtsTimeoutResetNow ();
877
      NotifyCtsTimeoutResetNow ();
878
      m_listener->GotCts (rxSnr, txMode);
878
      m_listener->GotCts (rxSnr, txVector.GetMode  ());
879
      NS_ASSERT (m_sendDataEvent.IsExpired ());
879
      NS_ASSERT (m_sendDataEvent.IsExpired ());
880
      m_sendDataEvent = Simulator::Schedule (GetSifs (),
880
      m_sendDataEvent = Simulator::Schedule (GetSifs (),
881
                                             &MacLow::SendDataAfterCts, this,
881
                                             &MacLow::SendDataAfterCts, this,
882
                                             hdr.GetAddr1 (),
882
                                             hdr.GetAddr1 (),
883
                                             hdr.GetDuration (),
883
                                             hdr.GetDuration ());
884
                                             txMode);
885
    }
884
    }
886
  else if (hdr.IsAck ()
885
  else if (hdr.IsAck ()
887
           && hdr.GetAddr1 () == m_self
886
           && hdr.GetAddr1 () == m_self
 Lines 894-902    Link Here 
894
      SnrTag tag;
893
      SnrTag tag;
895
      packet->RemovePacketTag (tag);
894
      packet->RemovePacketTag (tag);
896
      m_stationManager->ReportRxOk (m_currentHdr.GetAddr1 (), &m_currentHdr,
895
      m_stationManager->ReportRxOk (m_currentHdr.GetAddr1 (), &m_currentHdr,
897
                                    rxSnr, txMode);
896
                                    rxSnr, txVector.GetMode  ());
898
      m_stationManager->ReportDataOk (m_currentHdr.GetAddr1 (), &m_currentHdr,
897
      m_stationManager->ReportDataOk (m_currentHdr.GetAddr1 (), &m_currentHdr,
899
                                      rxSnr, txMode, tag.Get ());
898
                                      rxSnr, txVector.GetMode  (), tag.Get ());
900
        
899
        
901
      bool gotAck = false;
900
      bool gotAck = false;
902
      if (m_txParams.MustWaitNormalAck ()
901
      if (m_txParams.MustWaitNormalAck ()
 Lines 915-921    Link Here 
915
        }
914
        }
916
      if (gotAck)
915
      if (gotAck)
917
        {
916
        {
918
          m_listener->GotAck (rxSnr, txMode);
917
          m_listener->GotAck (rxSnr, txVector.GetMode  ());
919
        }
918
        }
920
      if (m_txParams.HasNextPacket ())
919
      if (m_txParams.HasNextPacket ())
921
        {
920
        {
 Lines 932-938    Link Here 
932
      packet->RemoveHeader (blockAck);
931
      packet->RemoveHeader (blockAck);
933
      m_blockAckTimeoutEvent.Cancel ();
932
      m_blockAckTimeoutEvent.Cancel ();
934
      NotifyAckTimeoutResetNow ();
933
      NotifyAckTimeoutResetNow ();
935
      m_listener->GotBlockAck (&blockAck, hdr.GetAddr2 (),txMode);
934
      m_listener->GotBlockAck (&blockAck, hdr.GetAddr2 (),txVector.GetMode  ());
936
      m_sentMpdus = 0;
935
      m_sentMpdus = 0;
937
      m_ampdu = false;
936
      m_ampdu = false;
938
    }
937
    }
 Lines 962-968    Link Here 
962
                                                        blockAckReq,
961
                                                        blockAckReq,
963
                                                        hdr.GetAddr2 (),
962
                                                        hdr.GetAddr2 (),
964
                                                        hdr.GetDuration (),
963
                                                        hdr.GetDuration (),
965
                                                        txMode);
964
                                                        txVector.GetMode ());
966
                }
965
                }
967
              else
966
              else
968
                {
967
                {
 Lines 988-994    Link Here 
988
  else if (hdr.GetAddr1 () == m_self)
987
  else if (hdr.GetAddr1 () == m_self)
989
    {
988
    {
990
      m_stationManager->ReportRxOk (hdr.GetAddr2 (), &hdr,
989
      m_stationManager->ReportRxOk (hdr.GetAddr2 (), &hdr,
991
                                    rxSnr, txMode);
990
                                    rxSnr, txVector.GetMode  ());
992
      if (hdr.IsQosData () && ReceiveMpdu (packet, hdr))
991
      if (hdr.IsQosData () && ReceiveMpdu (packet, hdr))
993
        {
992
        {
994
          /* From section 9.10.4 in IEEE 802.11:
993
          /* From section 9.10.4 in IEEE 802.11:
 Lines 1009-1015    Link Here 
1009
                                                    &MacLow::SendAckAfterData, this,
1008
                                                    &MacLow::SendAckAfterData, this,
1010
                                                    hdr.GetAddr2 (),
1009
                                                    hdr.GetAddr2 (),
1011
                                                    hdr.GetDuration (),
1010
                                                    hdr.GetDuration (),
1012
                                                    txMode,
1011
                                                    txVector.GetMode  (),
1013
                                                    rxSnr);
1012
                                                    rxSnr);
1014
              m_receivedAtLeastOneMpdu = false;
1013
              m_receivedAtLeastOneMpdu = false;
1015
            }
1014
            }
 Lines 1060-1066    Link Here 
1060
                                                    &MacLow::SendAckAfterData, this,
1059
                                                    &MacLow::SendAckAfterData, this,
1061
                                                    hdr.GetAddr2 (),
1060
                                                    hdr.GetAddr2 (),
1062
                                                    hdr.GetDuration (),
1061
                                                    hdr.GetDuration (),
1063
                                                    txMode,
1062
                                                    txVector.GetMode (),
1064
                                                    rxSnr);
1063
                                                    rxSnr);
1065
            }
1064
            }
1066
        }
1065
        }
 Lines 1165-1196    Link Here 
1165
Time
1164
Time
1166
MacLow::GetAckDuration (Mac48Address to, WifiTxVector dataTxVector) const
1165
MacLow::GetAckDuration (Mac48Address to, WifiTxVector dataTxVector) const
1167
{
1166
{
1168
  WifiTxVector ackTxVector = GetAckTxVectorForData (to, dataTxVector.GetMode());
1167
  WifiTxVector ackTxVector = GetAckTxVectorForData (to, dataTxVector.GetMode ());
1169
  return GetAckDuration (ackTxVector);
1168
  return GetAckDuration (ackTxVector);
1170
}
1169
}
1171
Time
1170
Time
1172
MacLow::GetAckDuration (WifiTxVector ackTxVector) const
1171
MacLow::GetAckDuration (WifiTxVector ackTxVector) const
1173
{
1172
{
1174
  WifiPreamble preamble;
1173
  NS_ASSERT (ackTxVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_HT); // ACK should always use non-HT PPDU (HT PPDU cases not supported yet)
1175
  if (ackTxVector.GetMode().GetModulationClass () == WIFI_MOD_CLASS_HT)
1174
  return m_phy->CalculateTxDuration (GetAckSize (), ackTxVector, WIFI_PREAMBLE_LONG, m_phy->GetFrequency(), 0, 0);
1176
    preamble= WIFI_PREAMBLE_HT_MF;
1177
  else
1178
    preamble=WIFI_PREAMBLE_LONG;
1179
  return m_phy->CalculateTxDuration (GetAckSize (), ackTxVector, preamble, m_phy->GetFrequency(), 0, 0);
1180
}
1175
}
1181
Time
1176
Time
1182
MacLow::GetBlockAckDuration (Mac48Address to, WifiTxVector blockAckReqTxVector, enum BlockAckType type) const
1177
MacLow::GetBlockAckDuration (Mac48Address to, WifiTxVector blockAckReqTxVector, enum BlockAckType type) const
1183
{
1178
{
1184
  /*
1179
  /*
1185
   * For immediate BlockAck we should transmit the frame with the same WifiMode
1180
   * For immediate Basic BlockAck we should transmit the frame with the same WifiMode
1186
   * as the BlockAckReq.
1181
   * as the BlockAckReq.
1187
   *
1188
   * from section 9.6 in IEEE 802.11e:
1189
   * The BlockAck control frame shall be sent at the same rate and modulation class as
1190
   * the BlockAckReq frame if it is sent in response to a BlockAckReq frame.
1191
   */
1182
   */
1192
  WifiPreamble preamble;
1183
  WifiPreamble preamble;
1193
  if (blockAckReqTxVector.GetMode().GetModulationClass () == WIFI_MOD_CLASS_HT)
1184
  if (blockAckReqTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT && type == BASIC_BLOCK_ACK)
1194
    preamble= WIFI_PREAMBLE_HT_MF;
1185
    preamble= WIFI_PREAMBLE_HT_MF;
1195
  else
1186
  else
1196
    preamble=WIFI_PREAMBLE_LONG;
1187
    preamble=WIFI_PREAMBLE_LONG;
 Lines 1199-1217    Link Here 
1199
Time
1190
Time
1200
MacLow::GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const
1191
MacLow::GetCtsDuration (Mac48Address to, WifiTxVector rtsTxVector) const
1201
{
1192
{
1202
  WifiTxVector ctsTxVector = GetCtsTxVectorForRts (to, rtsTxVector.GetMode());
1193
  WifiTxVector ctsTxVector = GetCtsTxVectorForRts (to, rtsTxVector.GetMode ());
1203
  return GetCtsDuration (ctsTxVector);
1194
  return GetCtsDuration (ctsTxVector);
1204
}
1195
}
1205
1196
1206
Time
1197
Time
1207
MacLow::GetCtsDuration (WifiTxVector ctsTxVector) const
1198
MacLow::GetCtsDuration (WifiTxVector ctsTxVector) const
1208
{
1199
{
1209
  WifiPreamble preamble;
1200
  NS_ASSERT (ctsTxVector.GetMode ().GetModulationClass () != WIFI_MOD_CLASS_HT); // CTS should always use non-HT PPDU (HT PPDU cases not supported yet)
1210
  if (ctsTxVector.GetMode().GetModulationClass () == WIFI_MOD_CLASS_HT)
1201
  return m_phy->CalculateTxDuration (GetCtsSize (), ctsTxVector, WIFI_PREAMBLE_LONG, m_phy->GetFrequency(), 0, 0);
1211
    preamble= WIFI_PREAMBLE_HT_MF;
1212
  else
1213
    preamble=WIFI_PREAMBLE_LONG;
1214
  return m_phy->CalculateTxDuration (GetCtsSize (), ctsTxVector, preamble, m_phy->GetFrequency(), 0, 0);
1215
}
1202
}
1216
uint32_t
1203
uint32_t
1217
MacLow::GetCtsSize (void) const
1204
MacLow::GetCtsSize (void) const
 Lines 1296-1307    Link Here 
1296
        {
1283
        {
1297
          preamble = WIFI_PREAMBLE_HT_GF;
1284
          preamble = WIFI_PREAMBLE_HT_GF;
1298
        }
1285
        }
1299
      else if (rtsTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT)
1300
        {
1301
          preamble = WIFI_PREAMBLE_HT_MF;
1302
        }
1303
      else
1286
      else
1304
        {
1287
        {
1288
          //Otherwise, RTS should always use non-HT PPDU (HT PPDU cases not supported yet)
1305
          preamble = WIFI_PREAMBLE_LONG;
1289
          preamble = WIFI_PREAMBLE_LONG;
1306
        }
1290
        }
1307
      txTime += m_phy->CalculateTxDuration (GetRtsSize (), rtsTxVector, preamble, m_phy->GetFrequency(), 0, 0);
1291
      txTime += m_phy->CalculateTxDuration (GetRtsSize (), rtsTxVector, preamble, m_phy->GetFrequency(), 0, 0);
 Lines 1309-1318    Link Here 
1309
      txTime += Time (GetSifs () * 2);
1293
      txTime += Time (GetSifs () * 2);
1310
    }
1294
    }
1311
  WifiTxVector dataTxVector = GetDataTxVector (packet, hdr);
1295
  WifiTxVector dataTxVector = GetDataTxVector (packet, hdr);
1312
  //standard says RTS packets can have GF format sec 9.6.0e.1 page 110 bullet b 2
1313
  if ( m_phy->GetGreenfield()&& m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ()))
1296
  if ( m_phy->GetGreenfield()&& m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ()))
1314
    preamble= WIFI_PREAMBLE_HT_GF;
1297
    preamble= WIFI_PREAMBLE_HT_GF;
1315
  else if (dataTxVector.GetMode().GetModulationClass () == WIFI_MOD_CLASS_HT)
1298
  else if (dataTxVector.GetMode ().GetModulationClass () == WIFI_MOD_CLASS_HT)
1316
    preamble= WIFI_PREAMBLE_HT_MF;
1299
    preamble= WIFI_PREAMBLE_HT_MF;
1317
  else
1300
  else
1318
    preamble=WIFI_PREAMBLE_LONG;
1301
    preamble=WIFI_PREAMBLE_LONG;
 Lines 1336-1348    Link Here 
1336
    {
1319
    {
1337
      WifiTxVector dataTxVector = GetDataTxVector (packet, hdr);
1320
      WifiTxVector dataTxVector = GetDataTxVector (packet, hdr);
1338
      WifiPreamble preamble;
1321
      WifiPreamble preamble;
1339
        //standard says RTS packets can have GF format sec 9.6.0e.1 page 110 bullet b 2
1322
      //standard says RTS packets can have GF format sec 9.6.0e.1 page 110 bullet b 2
1340
      if ( m_phy->GetGreenfield()&& m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ()))
1323
      if ( m_phy->GetGreenfield()&& m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ()))
1341
         preamble= WIFI_PREAMBLE_HT_GF;
1324
         preamble= WIFI_PREAMBLE_HT_GF;
1342
      else if (dataTxVector.GetMode().GetModulationClass () == WIFI_MOD_CLASS_HT)
1325
      else //Otherwise, RTS should always use non-HT PPDU (HT PPDU cases not supported yet)
1343
        preamble= WIFI_PREAMBLE_HT_MF;
1326
         preamble = WIFI_PREAMBLE_LONG;
1344
      else
1345
        preamble=WIFI_PREAMBLE_LONG;
1346
      txTime += GetSifs ();
1327
      txTime += GetSifs ();
1347
      txTime += m_phy->CalculateTxDuration (params.GetNextPacketSize (), dataTxVector, preamble, m_phy->GetFrequency(), 0, 0);
1328
      txTime += m_phy->CalculateTxDuration (params.GetNextPacketSize (), dataTxVector, preamble, m_phy->GetFrequency(), 0, 0);
1348
    }
1329
    }
 Lines 1350-1356    Link Here 
1350
}
1331
}
1351
1332
1352
void
1333
void
1353
MacLow::NotifyNav (Ptr<const Packet> packet,const WifiMacHeader &hdr, WifiMode txMode, WifiPreamble preamble)
1334
MacLow::NotifyNav (Ptr<const Packet> packet,const WifiMacHeader &hdr, WifiPreamble preamble)
1354
{
1335
{
1355
  NS_ASSERT (m_lastNavStart <= Simulator::Now ());
1336
  NS_ASSERT (m_lastNavStart <= Simulator::Now ());
1356
  Time duration = hdr.GetDuration ();
1337
  Time duration = hdr.GetDuration ();
 Lines 1468-1474    Link Here 
1468
  NS_LOG_DEBUG ("send " << hdr->GetTypeString () <<
1449
  NS_LOG_DEBUG ("send " << hdr->GetTypeString () <<
1469
                ", to=" << hdr->GetAddr1 () <<
1450
                ", to=" << hdr->GetAddr1 () <<
1470
                ", size=" << packet->GetSize () <<
1451
                ", size=" << packet->GetSize () <<
1471
                ", mode=" << txVector.GetMode() <<
1452
                ", mode=" << txVector.GetMode  () <<
1472
                ", duration=" << hdr->GetDuration () <<
1453
                ", duration=" << hdr->GetDuration () <<
1473
                ", seq=0x" << std::hex << m_currentHdr.GetSequenceControl () << std::dec);
1454
                ", seq=0x" << std::hex << m_currentHdr.GetSequenceControl () << std::dec);
1474
  if (!m_ampdu || hdr->IsRts ())
1455
  if (!m_ampdu || hdr->IsRts ())
 Lines 1629-1640    Link Here 
1629
1610
1630
  WifiPreamble preamble;
1611
  WifiPreamble preamble;
1631
  //standard says RTS packets can have GF format sec 9.6.0e.1 page 110 bullet b 2
1612
  //standard says RTS packets can have GF format sec 9.6.0e.1 page 110 bullet b 2
1632
  if ( m_phy->GetGreenfield()&& m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ()))
1613
  if (m_phy->GetGreenfield()&& m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ()))
1633
    preamble= WIFI_PREAMBLE_HT_GF;
1614
    preamble= WIFI_PREAMBLE_HT_GF;
1634
  else if (rtsTxVector.GetMode().GetModulationClass () == WIFI_MOD_CLASS_HT)
1615
  else //Otherwise, RTS should always use non-HT PPDU (HT PPDU cases not supported yet)
1635
    preamble= WIFI_PREAMBLE_HT_MF;
1616
    preamble = WIFI_PREAMBLE_LONG;
1636
  else
1637
    preamble=WIFI_PREAMBLE_LONG;
1638
1617
1639
  if (m_txParams.HasDurationId ())
1618
  if (m_txParams.HasDurationId ())
1640
    {
1619
    {
 Lines 1651-1662    Link Here 
1651
      duration += GetSifs ();
1630
      duration += GetSifs ();
1652
      if (m_txParams.MustWaitBasicBlockAck ())
1631
      if (m_txParams.MustWaitBasicBlockAck ())
1653
        {
1632
        {
1654
          WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2(), dataTxVector.GetMode());
1633
          WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2(), dataTxVector.GetMode  ());
1655
          duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK);
1634
          duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK);
1656
        }
1635
        }
1657
      else if (m_txParams.MustWaitCompressedBlockAck ())
1636
      else if (m_txParams.MustWaitCompressedBlockAck ())
1658
        {
1637
        {
1659
          WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2(), dataTxVector.GetMode());
1638
          WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2(), dataTxVector.GetMode  ());
1660
          duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK);
1639
          duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK);
1661
        }
1640
        }
1662
      else if (m_txParams.MustWaitAck ())
1641
      else if (m_txParams.MustWaitAck ())
 Lines 1699-1705    Link Here 
1699
  //Since it is data then it can have format = GF
1678
  //Since it is data then it can have format = GF
1700
  if (m_phy->GetGreenfield() && m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ()))
1679
  if (m_phy->GetGreenfield() && m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ()))
1701
    preamble= WIFI_PREAMBLE_HT_GF;
1680
    preamble= WIFI_PREAMBLE_HT_GF;
1702
  else if (dataTxVector.GetMode().GetModulationClass () == WIFI_MOD_CLASS_HT)
1681
  else if (dataTxVector.GetMode  ().GetModulationClass () == WIFI_MOD_CLASS_HT)
1703
    preamble= WIFI_PREAMBLE_HT_MF;
1682
    preamble= WIFI_PREAMBLE_HT_MF;
1704
  else
1683
  else
1705
    preamble=WIFI_PREAMBLE_LONG;
1684
    preamble=WIFI_PREAMBLE_LONG;
 Lines 1774-1780    Link Here 
1774
  if (m_phy->GetGreenfield() && m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ()))
1753
  if (m_phy->GetGreenfield() && m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ()))
1775
     //In the future has to make sure that receiver has greenfield enabled
1754
     //In the future has to make sure that receiver has greenfield enabled
1776
     preamble= WIFI_PREAMBLE_HT_GF;
1755
     preamble= WIFI_PREAMBLE_HT_GF;
1777
  else if (dataTxVector.GetMode().GetModulationClass () == WIFI_MOD_CLASS_HT)
1756
  else if (dataTxVector.GetMode  ().GetModulationClass () == WIFI_MOD_CLASS_HT)
1778
    preamble= WIFI_PREAMBLE_HT_MF;
1757
    preamble= WIFI_PREAMBLE_HT_MF;
1779
  else
1758
  else
1780
     preamble=WIFI_PREAMBLE_LONG;
1759
     preamble=WIFI_PREAMBLE_LONG;
 Lines 1791-1803    Link Here 
1791
      if (m_txParams.MustWaitBasicBlockAck ())
1770
      if (m_txParams.MustWaitBasicBlockAck ())
1792
        {
1771
        {
1793
          duration += GetSifs ();
1772
          duration += GetSifs ();
1794
          WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode());
1773
          WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode  ());
1795
          duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK);
1774
          duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK);
1796
        }
1775
        }
1797
      else if (m_txParams.MustWaitCompressedBlockAck ())
1776
      else if (m_txParams.MustWaitCompressedBlockAck ())
1798
        {
1777
        {
1799
          duration += GetSifs ();
1778
          duration += GetSifs ();
1800
          WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode());
1779
          WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode  ());
1801
          duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK);
1780
          duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK);
1802
        }
1781
        }
1803
      else if (m_txParams.MustWaitAck ())
1782
      else if (m_txParams.MustWaitAck ())
 Lines 1826-1832    Link Here 
1826
      m_currentPacket->AddTrailer (fcs);
1805
      m_currentPacket->AddTrailer (fcs);
1827
    }
1806
    }
1828
1807
1829
  ForwardDown (m_currentPacket, &m_currentHdr, dataTxVector,preamble);
1808
  ForwardDown (m_currentPacket, &m_currentHdr, dataTxVector, preamble);
1830
  m_currentPacket = 0;
1809
  m_currentPacket = 0;
1831
}
1810
}
1832
1811
 Lines 1856-1862    Link Here 
1856
  WifiTxVector ctsTxVector = GetCtsToSelfTxVector (m_currentPacket, &m_currentHdr);
1835
  WifiTxVector ctsTxVector = GetCtsToSelfTxVector (m_currentPacket, &m_currentHdr);
1857
1836
1858
  WifiPreamble preamble;
1837
  WifiPreamble preamble;
1859
  if (ctsTxVector.GetMode().GetModulationClass () == WIFI_MOD_CLASS_HT)
1838
  if (ctsTxVector.GetMode  ().GetModulationClass () == WIFI_MOD_CLASS_HT)
1860
    preamble= WIFI_PREAMBLE_HT_MF;
1839
    preamble= WIFI_PREAMBLE_HT_MF;
1861
  else
1840
  else
1862
    preamble=WIFI_PREAMBLE_LONG;
1841
    preamble=WIFI_PREAMBLE_LONG;
 Lines 1877-1889    Link Here 
1877
        {
1856
        {
1878
          
1857
          
1879
          duration += GetSifs ();
1858
          duration += GetSifs ();
1880
          WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode());
1859
          WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode  ());
1881
          duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK);
1860
          duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK);
1882
        }
1861
        }
1883
      else if (m_txParams.MustWaitCompressedBlockAck ())
1862
      else if (m_txParams.MustWaitCompressedBlockAck ())
1884
        {
1863
        {
1885
          duration += GetSifs ();
1864
          duration += GetSifs ();
1886
          WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode());
1865
          WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode  ());
1887
          duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK);
1866
          duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK);
1888
        }
1867
        }
1889
      else if (m_txParams.MustWaitAck ())
1868
      else if (m_txParams.MustWaitAck ())
 Lines 1899-1905    Link Here 
1899
          if (m_txParams.MustWaitCompressedBlockAck ())
1878
          if (m_txParams.MustWaitCompressedBlockAck ())
1900
            {
1879
            {
1901
              duration += GetSifs ();
1880
              duration += GetSifs ();
1902
              WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode());
1881
              WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode  ());
1903
              duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK);
1882
              duration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK);
1904
            }
1883
            }
1905
          else if (m_txParams.MustWaitAck ())
1884
          else if (m_txParams.MustWaitAck ())
 Lines 1926-1942    Link Here 
1926
  m_sendDataEvent = Simulator::Schedule (txDuration,
1905
  m_sendDataEvent = Simulator::Schedule (txDuration,
1927
                                         &MacLow::SendDataAfterCts, this,
1906
                                         &MacLow::SendDataAfterCts, this,
1928
                                         cts.GetAddr1 (),
1907
                                         cts.GetAddr1 (),
1929
                                         duration,
1908
                                         duration);
1930
                                         ctsTxVector.GetMode());
1931
}
1909
}
1932
void
1910
void
1933
MacLow::SendCtsAfterRts (Mac48Address source, Time duration, WifiMode rtsTxMode, double rtsSnr)
1911
MacLow::SendCtsAfterRts (Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr)
1934
{
1912
{
1935
  NS_LOG_FUNCTION (this << source << duration << rtsTxMode << rtsSnr);
1913
  NS_LOG_FUNCTION (this << source << duration << rtsTxVector.GetMode () << rtsSnr);
1936
  /* send a CTS when you receive a RTS
1914
  /* send a CTS when you receive a RTS
1937
   * right after SIFS.
1915
   * right after SIFS.
1938
   */
1916
   */
1939
 WifiTxVector ctsTxVector = GetCtsTxVector (source, rtsTxMode);
1917
  WifiTxVector ctsTxVector = GetCtsTxVector (source, rtsTxVector.GetMode ());
1940
  WifiMacHeader cts;
1918
  WifiMacHeader cts;
1941
  cts.SetType (WIFI_MAC_CTL_CTS);
1919
  cts.SetType (WIFI_MAC_CTL_CTS);
1942
  cts.SetDsNotFrom ();
1920
  cts.SetDsNotFrom ();
 Lines 1944-1950    Link Here 
1944
  cts.SetNoMoreFragments ();
1922
  cts.SetNoMoreFragments ();
1945
  cts.SetNoRetry ();
1923
  cts.SetNoRetry ();
1946
  cts.SetAddr1 (source);
1924
  cts.SetAddr1 (source);
1947
  duration -= GetCtsDuration (source, ctsTxVector);
1925
  duration -= GetCtsDuration (source, rtsTxVector);
1948
  duration -= GetSifs ();
1926
  duration -= GetSifs ();
1949
  NS_ASSERT (duration >= MicroSeconds (0));
1927
  NS_ASSERT (duration >= MicroSeconds (0));
1950
  cts.SetDuration (duration);
1928
  cts.SetDuration (duration);
 Lines 1958-1973    Link Here 
1958
  tag.Set (rtsSnr);
1936
  tag.Set (rtsSnr);
1959
  packet->AddPacketTag (tag);
1937
  packet->AddPacketTag (tag);
1960
1938
1961
  WifiPreamble preamble;
1939
  //CTS should always use non-HT PPDU (HT PPDU cases not supported yet)
1962
  if (ctsTxVector.GetMode().GetModulationClass () == WIFI_MOD_CLASS_HT)
1940
  ForwardDown (packet, &cts, ctsTxVector, WIFI_PREAMBLE_LONG);
1963
    preamble= WIFI_PREAMBLE_HT_MF;
1964
  else
1965
    preamble=WIFI_PREAMBLE_LONG;
1966
  ForwardDown (packet, &cts, ctsTxVector,preamble);
1967
}
1941
}
1968
1942
1969
void
1943
void
1970
MacLow::SendDataAfterCts (Mac48Address source, Time duration, WifiMode txMode)
1944
MacLow::SendDataAfterCts (Mac48Address source, Time duration)
1971
{
1945
{
1972
  NS_LOG_FUNCTION (this);
1946
  NS_LOG_FUNCTION (this);
1973
  /* send the third step in a
1947
  /* send the third step in a
 Lines 1980-1986    Link Here 
1980
  if (m_phy->GetGreenfield() && m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ()))
1954
  if (m_phy->GetGreenfield() && m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ()))
1981
     //In the future has to make sure that receiver has greenfield enabled
1955
     //In the future has to make sure that receiver has greenfield enabled
1982
     preamble= WIFI_PREAMBLE_HT_GF;
1956
     preamble= WIFI_PREAMBLE_HT_GF;
1983
  else if (dataTxVector.GetMode().GetModulationClass () == WIFI_MOD_CLASS_HT)
1957
  else if (dataTxVector.GetMode  ().GetModulationClass () == WIFI_MOD_CLASS_HT)
1984
    preamble= WIFI_PREAMBLE_HT_MF;
1958
    preamble= WIFI_PREAMBLE_HT_MF;
1985
  else
1959
  else
1986
     preamble=WIFI_PREAMBLE_LONG;
1960
     preamble=WIFI_PREAMBLE_LONG;
 Lines 1990-2002    Link Here 
1990
  if (m_txParams.MustWaitBasicBlockAck ())
1964
  if (m_txParams.MustWaitBasicBlockAck ())
1991
    {
1965
    {
1992
      newDuration += GetSifs ();
1966
      newDuration += GetSifs ();
1993
      WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode());
1967
      WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode  ());
1994
      newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK);
1968
      newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, BASIC_BLOCK_ACK);
1995
    }
1969
    }
1996
  else if (m_txParams.MustWaitCompressedBlockAck ())
1970
  else if (m_txParams.MustWaitCompressedBlockAck ())
1997
    {
1971
    {
1998
      newDuration += GetSifs ();
1972
      newDuration += GetSifs ();
1999
      WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode());
1973
      WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode  ());
2000
      newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK);
1974
      newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK);
2001
    }
1975
    }
2002
  else if (m_txParams.MustWaitAck ())
1976
  else if (m_txParams.MustWaitAck ())
 Lines 2011-2017    Link Here 
2011
      if (m_txParams.MustWaitCompressedBlockAck ())
1985
      if (m_txParams.MustWaitCompressedBlockAck ())
2012
        {
1986
        {
2013
           newDuration += GetSifs ();
1987
           newDuration += GetSifs ();
2014
           WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode());
1988
           WifiTxVector blockAckReqTxVector = GetBlockAckTxVector (m_currentHdr.GetAddr2 (), dataTxVector.GetMode  ());
2015
           newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK);
1989
           newDuration += GetBlockAckDuration (m_currentHdr.GetAddr1 (), blockAckReqTxVector, COMPRESSED_BLOCK_ACK);
2016
        }
1990
        }
2017
      else if (m_txParams.MustWaitAck ())
1991
      else if (m_txParams.MustWaitAck ())
 Lines 2093-2105    Link Here 
2093
  tag.Set (dataSnr);
2067
  tag.Set (dataSnr);
2094
  packet->AddPacketTag (tag);
2068
  packet->AddPacketTag (tag);
2095
2069
2096
   //since ACK is a control response it can't have format GF
2070
  //ACK should always use non-HT PPDU (HT PPDU cases not supported yet)
2097
  WifiPreamble preamble;
2071
  ForwardDown (packet, &ack, ackTxVector, WIFI_PREAMBLE_LONG);
2098
  if (ackTxVector.GetMode().GetModulationClass () == WIFI_MOD_CLASS_HT)
2099
    preamble= WIFI_PREAMBLE_HT_MF;
2100
  else
2101
    preamble=WIFI_PREAMBLE_LONG;
2102
  ForwardDown (packet, &ack, ackTxVector, preamble);
2103
}
2072
}
2104
2073
2105
bool
2074
bool
 Lines 2389-2395    Link Here 
2389
  WifiMacTrailer fcs;
2358
  WifiMacTrailer fcs;
2390
  packet->AddTrailer (fcs);
2359
  packet->AddTrailer (fcs);
2391
  WifiPreamble preamble;
2360
  WifiPreamble preamble;
2392
  if (blockAckReqTxVector.GetMode().GetModulationClass () == WIFI_MOD_CLASS_HT)
2361
  if (blockAckReqTxVector.GetMode  ().GetModulationClass () == WIFI_MOD_CLASS_HT)
2393
    preamble= WIFI_PREAMBLE_HT_MF;
2362
    preamble= WIFI_PREAMBLE_HT_MF;
2394
  else
2363
  else
2395
    preamble=WIFI_PREAMBLE_LONG;
2364
    preamble=WIFI_PREAMBLE_LONG;
 Lines 2397-2403    Link Here 
2397
  m_currentPacket = 0;
2366
  m_currentPacket = 0;
2398
}
2367
}
2399
void 
2368
void 
2400
MacLow::SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator, Time duration, WifiMode blockAckReqTxMode)
2369
MacLow::SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator, Time duration, WifiTxVector blockAckReqTxVector)
2401
{
2370
{
2402
  NS_LOG_FUNCTION (this);
2371
  NS_LOG_FUNCTION (this);
2403
  CtrlBAckResponseHeader blockAck;
2372
  CtrlBAckResponseHeader blockAck;
 Lines 2415-2421    Link Here 
2415
  NS_LOG_DEBUG ("Got Implicit block Ack Req with seq " << seqNumber);
2384
  NS_LOG_DEBUG ("Got Implicit block Ack Req with seq " << seqNumber);
2416
  (*i).second.FillBlockAckBitmap (&blockAck);  
2385
  (*i).second.FillBlockAckBitmap (&blockAck);  
2417
2386
2418
  SendBlockAckResponse (&blockAck, originator, immediate, duration, blockAckReqTxMode);
2387
  SendBlockAckResponse (&blockAck, originator, immediate, duration, blockAckReqTxVector.GetMode  ());
2419
}
2388
}
2420
2389
2421
void
2390
void
 Lines 2514-2522    Link Here 
2514
}
2483
}
2515
2484
2516
void
2485
void
2517
MacLow::DeaggregateAmpduAndReceive (Ptr<Packet> aggregatedPacket, double rxSnr, WifiMode txMode, WifiPreamble preamble)
2486
MacLow::DeaggregateAmpduAndReceive (Ptr<Packet> aggregatedPacket, double rxSnr, WifiTxVector txVector, WifiPreamble preamble)
2518
{
2487
{
2519
  m_currentMode = txMode;
2488
  m_currentTxVector = txVector;
2520
  AmpduTag ampdu;
2489
  AmpduTag ampdu;
2521
  bool normalAck = false;
2490
  bool normalAck = false;
2522
  bool ampduSubframe = false;
2491
  bool ampduSubframe = false;
 Lines 2529-2544    Link Here 
2529
      WifiMacHeader firsthdr;
2498
      WifiMacHeader firsthdr;
2530
      (*n).first->PeekHeader(firsthdr);
2499
      (*n).first->PeekHeader(firsthdr);
2531
      NS_LOG_DEBUG ("duration/id=" << firsthdr.GetDuration ());
2500
      NS_LOG_DEBUG ("duration/id=" << firsthdr.GetDuration ());
2532
      NotifyNav ((*n).first,firsthdr, txMode, preamble);
2501
      NotifyNav ((*n).first,firsthdr, preamble);
2533
      if (firsthdr.GetAddr1 () == m_self)
2502
      if (firsthdr.GetAddr1 () == m_self)
2534
        {
2503
        {
2535
          m_receivedAtLeastOneMpdu = true;
2504
          m_receivedAtLeastOneMpdu = true;
2536
          if (firsthdr.IsAck () || firsthdr.IsBlockAck () || firsthdr.IsBlockAckReq ())
2505
          if (firsthdr.IsAck () || firsthdr.IsBlockAck () || firsthdr.IsBlockAckReq ())
2537
              ReceiveOk ((*n).first, rxSnr, txMode, preamble, ampduSubframe);
2506
              ReceiveOk ((*n).first, rxSnr, txVector, preamble, ampduSubframe);
2538
          else if (firsthdr.IsData () || firsthdr.IsQosData ())
2507
          else if (firsthdr.IsData () || firsthdr.IsQosData ())
2539
            {
2508
            {
2540
              NS_LOG_DEBUG ("Deaagregate packet with sequence=" << firsthdr.GetSequenceNumber ());
2509
              NS_LOG_DEBUG ("Deaagregate packet with sequence=" << firsthdr.GetSequenceNumber ());
2541
              ReceiveOk ((*n).first, rxSnr, txMode, preamble, ampduSubframe);
2510
              ReceiveOk ((*n).first, rxSnr, txVector, preamble, ampduSubframe);
2542
              if (firsthdr.IsQosAck ())
2511
              if (firsthdr.IsQosAck ())
2543
                {
2512
                {
2544
                  NS_LOG_DEBUG ("Normal Ack");
2513
                  NS_LOG_DEBUG ("Normal Ack");
 Lines 2569-2575    Link Here 
2569
                                                    firsthdr.GetQosTid(),
2538
                                                    firsthdr.GetQosTid(),
2570
                                                    firsthdr.GetAddr2 (),
2539
                                                    firsthdr.GetAddr2 (),
2571
                                                    firsthdr.GetDuration (),
2540
                                                    firsthdr.GetDuration (),
2572
                                                    txMode);
2541
                                                    txVector);
2573
            } 
2542
            } 
2574
          else
2543
          else
2575
            { 
2544
            { 
 Lines 2580-2586    Link Here 
2580
    }
2549
    }
2581
  else
2550
  else
2582
    {     
2551
    {     
2583
          ReceiveOk (aggregatedPacket,rxSnr, txMode, preamble, ampduSubframe);
2552
          ReceiveOk (aggregatedPacket,rxSnr, txVector, preamble, ampduSubframe);
2584
    }
2553
    }
2585
}
2554
}
2586
2555
 Lines 2591-2604    Link Here 
2591
    WifiTxVector dataTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr);
2560
    WifiTxVector dataTxVector = GetDataTxVector (m_currentPacket, &m_currentHdr);
2592
    if (m_phy->GetGreenfield () && m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ()))
2561
    if (m_phy->GetGreenfield () && m_stationManager->GetGreenfieldSupported (m_currentHdr.GetAddr1 ()))
2593
        preamble = WIFI_PREAMBLE_HT_GF;
2562
        preamble = WIFI_PREAMBLE_HT_GF;
2594
    else
2563
    else //Block ACK following implicit BAR always use non-HT PPDU
2595
        preamble = WIFI_PREAMBLE_HT_MF;
2564
        preamble = WIFI_PREAMBLE_LONG;
2596
    
2565
    
2597
    if (peekedPacket == 0)
2566
    if (peekedPacket == 0)
2598
        return true;
2567
        return true;
2599
    
2568
    
2600
    //An HT STA shall not transmit a PPDU that has a duration that is greater than aPPDUMaxTime (10 milliseconds)
2569
    //An HT STA shall not transmit a PPDU that has a duration that is greater than aPPDUMaxTime (10 milliseconds)
2601
    if(m_phy->CalculateTxDuration (aggregatedPacket->GetSize () + peekedPacket->GetSize () + peekedHdr.GetSize () +WIFI_MAC_FCS_LENGTH,dataTxVector, preamble, m_phy->GetFrequency(), 0, 0) > MilliSeconds(10))
2570
    if(m_phy->CalculateTxDuration (aggregatedPacket->GetSize () + peekedPacket->GetSize () + peekedHdr.GetSize () + WIFI_MAC_FCS_LENGTH, dataTxVector, preamble, m_phy->GetFrequency(), 0, 0) > MilliSeconds(10))
2602
        return true;
2571
        return true;
2603
    
2572
    
2604
    if (!m_mpduAggregator->CanBeAggregated (peekedPacket->GetSize () + peekedHdr.GetSize () + WIFI_MAC_FCS_LENGTH, aggregatedPacket, size))
2573
    if (!m_mpduAggregator->CanBeAggregated (peekedPacket->GetSize () + peekedHdr.GetSize () + WIFI_MAC_FCS_LENGTH, aggregatedPacket, size))
(-)a/src/wifi/model/mac-low.h (-11 / +10 lines)
 Lines 698-711    Link Here 
698
  /**
698
  /**
699
   * \param packet packet received
699
   * \param packet packet received
700
   * \param rxSnr snr of packet received
700
   * \param rxSnr snr of packet received
701
   * \param txMode transmission mode of packet received
701
   * \param txVector TXVECTOR of packet received
702
   * \param preamble type of preamble used for the packet received
702
   * \param preamble type of preamble used for the packet received
703
   * \param ampduSubframe true if this MPDU is part of an A-MPDU
703
   * \param ampduSubframe true if this MPDU is part of an A-MPDU
704
   *
704
   *
705
   * This method is typically invoked by the lower PHY layer to notify
705
   * This method is typically invoked by the lower PHY layer to notify
706
   * the MAC layer that a packet was successfully received.
706
   * the MAC layer that a packet was successfully received.
707
   */
707
   */
708
  void ReceiveOk (Ptr<Packet> packet, double rxSnr, WifiMode txMode, WifiPreamble preamble, bool ampduSubframe);
708
  void ReceiveOk (Ptr<Packet> packet, double rxSnr, WifiTxVector txVector, WifiPreamble preamble, bool ampduSubframe);
709
  /**
709
  /**
710
   * \param packet packet received.
710
   * \param packet packet received.
711
   * \param rxSnr snr of packet received.
711
   * \param rxSnr snr of packet received.
 Lines 775-787    Link Here 
775
  /**
775
  /**
776
   * \param aggregatedPacket which is the current A-MPDU
776
   * \param aggregatedPacket which is the current A-MPDU
777
   * \param rxSnr snr of packet received
777
   * \param rxSnr snr of packet received
778
   * \param txMode transmission mode of packet received
778
   * \param txVector TXVECTOR of packet received
779
   * \param preamble type of preamble used for the packet received        
779
   * \param preamble type of preamble used for the packet received        
780
   *
780
   *
781
   * This function de-aggregates an A-MPDU and decide if each MPDU is received correctly or not
781
   * This function de-aggregates an A-MPDU and decide if each MPDU is received correctly or not
782
   * 
782
   * 
783
   */
783
   */
784
  void DeaggregateAmpduAndReceive (Ptr<Packet> aggregatedPacket, double rxSnr, WifiMode txMode, WifiPreamble preamble);
784
  void DeaggregateAmpduAndReceive (Ptr<Packet> aggregatedPacket, double rxSnr, WifiTxVector txVector, WifiPreamble preamble);
785
  /**
785
  /**
786
   * \param peekedPacket the packet to be aggregated
786
   * \param peekedPacket the packet to be aggregated
787
   * \param peekedHdr the WifiMacHeader for the packet.
787
   * \param peekedHdr the WifiMacHeader for the packet.
 Lines 998-1004    Link Here 
998
  Time CalculateOverallTxTime (Ptr<const Packet> packet,
998
  Time CalculateOverallTxTime (Ptr<const Packet> packet,
999
                               const WifiMacHeader* hdr,
999
                               const WifiMacHeader* hdr,
1000
                               const MacLowTransmissionParameters &params) const;
1000
                               const MacLowTransmissionParameters &params) const;
1001
  void NotifyNav (Ptr<const Packet> packet,const WifiMacHeader &hdr, WifiMode txMode, WifiPreamble preamble);
1001
  void NotifyNav (Ptr<const Packet> packet,const WifiMacHeader &hdr, WifiPreamble preamble);
1002
  /**
1002
  /**
1003
   * Reset NAV with the given duration.
1003
   * Reset NAV with the given duration.
1004
   *
1004
   *
 Lines 1086-1095    Link Here 
1086
   *
1086
   *
1087
   * \param source
1087
   * \param source
1088
   * \param duration
1088
   * \param duration
1089
   * \param txMode
1089
   * \param rtsTxVector
1090
   * \param rtsSnr
1090
   * \param rtsSnr
1091
   */
1091
   */
1092
  void SendCtsAfterRts (Mac48Address source, Time duration, WifiMode txMode, double rtsSnr);
1092
  void SendCtsAfterRts (Mac48Address source, Time duration, WifiTxVector rtsTxVector, double rtsSnr);
1093
  /**
1093
  /**
1094
   * Send ACK after receiving DATA.
1094
   * Send ACK after receiving DATA.
1095
   *
1095
   *
 Lines 1104-1112    Link Here 
1104
   *
1104
   *
1105
   * \param source
1105
   * \param source
1106
   * \param duration
1106
   * \param duration
1107
   * \param txMode
1108
   */
1107
   */
1109
  void SendDataAfterCts (Mac48Address source, Time duration, WifiMode txMode);
1108
  void SendDataAfterCts (Mac48Address source, Time duration);
1110
  /**
1109
  /**
1111
   * Event handler that is usually scheduled to fired at the appropriate time
1110
   * Event handler that is usually scheduled to fired at the appropriate time
1112
   * after completing transmissions.
1111
   * after completing transmissions.
 Lines 1200-1206    Link Here 
1200
   * block ack agreement and creates block ack bitmap on a received packets basis.
1199
   * block ack agreement and creates block ack bitmap on a received packets basis.
1201
   */
1200
   */
1202
  void SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator,
1201
  void SendBlockAckAfterAmpdu (uint8_t tid, Mac48Address originator,
1203
                                          Time duration, WifiMode blockAckReqTxMode);
1202
                                          Time duration, WifiTxVector blockAckReqTxVector);
1204
  /**
1203
  /**
1205
   * This method creates block ack frame with header equals to <i>blockAck</i> and start its transmission.
1204
   * This method creates block ack frame with header equals to <i>blockAck</i> and start its transmission.
1206
   *
1205
   *
 Lines 1318-1324    Link Here 
1318
  bool m_ctsToSelfSupported;          //!< Flag whether CTS-to-self is supported
1317
  bool m_ctsToSelfSupported;          //!< Flag whether CTS-to-self is supported
1319
  uint8_t m_sentMpdus;                //!< Number of transmitted MPDUs in an A-MPDU that have not been acknowledged yet
1318
  uint8_t m_sentMpdus;                //!< Number of transmitted MPDUs in an A-MPDU that have not been acknowledged yet
1320
  Ptr<WifiMacQueue> m_aggregateQueue; //!< Queue used for MPDU aggregation
1319
  Ptr<WifiMacQueue> m_aggregateQueue; //!< Queue used for MPDU aggregation
1321
  WifiMode m_currentMode;             //!< mode used for the current packet transmission
1320
  WifiTxVector m_currentTxVector;     //!< TXVECTOR used for the current packet transmission
1322
  bool m_receivedAtLeastOneMpdu;      //!< Flag whether an MPDU has already been successfully received while receiving an A-MPDU
1321
  bool m_receivedAtLeastOneMpdu;      //!< Flag whether an MPDU has already been successfully received while receiving an A-MPDU
1323
};
1322
};
1324
1323
(-)a/src/wifi/model/wifi-mode.cc (+9 lines)
 Lines 106-111    Link Here 
106
  struct WifiModeFactory::WifiModeItem *item = WifiModeFactory::GetFactory ()->Get (m_uid);
106
  struct WifiModeFactory::WifiModeItem *item = WifiModeFactory::GetFactory ()->Get (m_uid);
107
  return item->isMandatory;
107
  return item->isMandatory;
108
}
108
}
109
bool
110
WifiMode::IsBssBasic (void) const
111
{
112
  struct WifiModeFactory::WifiModeItem *item = WifiModeFactory::GetFactory ()->Get (m_uid);
113
  return item->isBssBasic;
114
}
109
uint32_t
115
uint32_t
110
WifiMode::GetUid (void) const
116
WifiMode::GetUid (void) const
111
{
117
{
 Lines 141-146    Link Here 
141
WifiModeFactory::CreateWifiMode (std::string uniqueName,
147
WifiModeFactory::CreateWifiMode (std::string uniqueName,
142
                                 enum WifiModulationClass modClass,
148
                                 enum WifiModulationClass modClass,
143
                                 bool isMandatory,
149
                                 bool isMandatory,
150
                                 bool isBssBasic,
144
                                 uint32_t bandwidth,
151
                                 uint32_t bandwidth,
145
                                 uint32_t dataRate,
152
                                 uint32_t dataRate,
146
                                 enum WifiCodeRate codingRate,
153
                                 enum WifiCodeRate codingRate,
 Lines 193-198    Link Here 
193
200
194
  item->constellationSize = constellationSize;
201
  item->constellationSize = constellationSize;
195
  item->isMandatory = isMandatory;
202
  item->isMandatory = isMandatory;
203
  item->isBssBasic = isBssBasic;
196
204
197
  return WifiMode (uid);
205
  return WifiMode (uid);
198
}
206
}
 Lines 274-279    Link Here 
274
      item->constellationSize = 0;
282
      item->constellationSize = 0;
275
      item->codingRate = WIFI_CODE_RATE_UNDEFINED;
283
      item->codingRate = WIFI_CODE_RATE_UNDEFINED;
276
      item->isMandatory = false;
284
      item->isMandatory = false;
285
      item->isBssBasic = false;
277
      isFirstTime = false;
286
      isFirstTime = false;
278
    }
287
    }
279
  return &factory;
288
  return &factory;
(-)a/src/wifi/model/wifi-mode.h (+9 lines)
 Lines 128-133    Link Here 
128
   *          otherwise.
128
   *          otherwise.
129
   */
129
   */
130
  bool IsMandatory (void) const;
130
  bool IsMandatory (void) const;
131
  
132
  /**
133
   * \returns true if this mode belongs to the BSSBasicRateSet or to the BSSBasicMCSSet (IEEE 802.11n),
134
   *          false otherwise.
135
   */
136
  bool IsBssBasic (void) const;
131
137
132
  /**
138
  /**
133
   * \returns the uid associated to this wireless mode.
139
   * \returns the uid associated to this wireless mode.
 Lines 211-216    Link Here 
211
   *        must be unique accross _all_ instances.
217
   *        must be unique accross _all_ instances.
212
   * \param modClass the class of modulation
218
   * \param modClass the class of modulation
213
   * \param isMandatory true if this WifiMode is mandatory, false otherwise.
219
   * \param isMandatory true if this WifiMode is mandatory, false otherwise.
220
   * \param isBssBasic true if this WifiMode belongs to the BSSBasicRateSet or to the BSSBasicMCSSet (IEEE 802.11n), false otherwise.
214
   * \param bandwidth the bandwidth (Hz) of the signal generated when the
221
   * \param bandwidth the bandwidth (Hz) of the signal generated when the
215
   *        associated WifiMode is used.
222
   *        associated WifiMode is used.
216
   * \param dataRate the rate (bits/second) at which the user data is transmitted
223
   * \param dataRate the rate (bits/second) at which the user data is transmitted
 Lines 227-232    Link Here 
227
  static WifiMode CreateWifiMode (std::string uniqueName,
234
  static WifiMode CreateWifiMode (std::string uniqueName,
228
                                  enum WifiModulationClass modClass,
235
                                  enum WifiModulationClass modClass,
229
                                  bool isMandatory,
236
                                  bool isMandatory,
237
                                  bool isBssBasic,
230
                                  uint32_t bandwidth,
238
                                  uint32_t bandwidth,
231
                                  uint32_t dataRate,
239
                                  uint32_t dataRate,
232
                                  enum WifiCodeRate codingRate,
240
                                  enum WifiCodeRate codingRate,
 Lines 259-264    Link Here 
259
    uint8_t constellationSize;
267
    uint8_t constellationSize;
260
    enum WifiCodeRate codingRate;
268
    enum WifiCodeRate codingRate;
261
    bool isMandatory;
269
    bool isMandatory;
270
    bool isBssBasic;
262
  };
271
  };
263
272
264
  /**
273
  /**
(-)a/src/wifi/model/wifi-phy-state-helper.cc (-3 / +3 lines)
 Lines 415-428    Link Here 
415
}
415
}
416
416
417
void
417
void
418
WifiPhyStateHelper::SwitchFromRxEndOk (Ptr<Packet> packet, double snr, WifiMode mode, enum WifiPreamble preamble)
418
WifiPhyStateHelper::SwitchFromRxEndOk (Ptr<Packet> packet, double snr, WifiTxVector txVector, enum WifiPreamble preamble)
419
{
419
{
420
  m_rxOkTrace (packet, snr, mode, preamble);
420
  m_rxOkTrace (packet, snr, txVector.GetMode(), preamble);
421
  NotifyRxEndOk ();
421
  NotifyRxEndOk ();
422
  DoSwitchFromRx ();
422
  DoSwitchFromRx ();
423
  if (!m_rxOkCallback.IsNull ())
423
  if (!m_rxOkCallback.IsNull ())
424
    {
424
    {
425
      m_rxOkCallback (packet, snr, mode, preamble);
425
      m_rxOkCallback (packet, snr, txVector, preamble);
426
    }
426
    }
427
427
428
}
428
}
(-)a/src/wifi/model/wifi-phy-state-helper.h (-2 / +2 lines)
 Lines 157-166    Link Here 
157
   *
157
   *
158
   * \param packet the successfully received packet
158
   * \param packet the successfully received packet
159
   * \param snr the SNR of the received packet
159
   * \param snr the SNR of the received packet
160
   * \param mode the transmission mode of the packet
160
   * \param txVector TXVECTOR of the packet
161
   * \param preamble the preamble of the received packet
161
   * \param preamble the preamble of the received packet
162
   */
162
   */
163
  void SwitchFromRxEndOk (Ptr<Packet> packet, double snr, WifiMode mode, enum WifiPreamble preamble);
163
  void SwitchFromRxEndOk (Ptr<Packet> packet, double snr, WifiTxVector txVector, enum WifiPreamble preamble);
164
  /**
164
  /**
165
   * Switch from RX after the reception failed.
165
   * Switch from RX after the reception failed.
166
   *
166
   *
(-)a/src/wifi/model/wifi-phy.cc (-68 / +68 lines)
 Lines 642-648    Link Here 
642
  static WifiMode mode =
642
  static WifiMode mode =
643
    WifiModeFactory::CreateWifiMode ("DsssRate1Mbps",
643
    WifiModeFactory::CreateWifiMode ("DsssRate1Mbps",
644
                                     WIFI_MOD_CLASS_DSSS,
644
                                     WIFI_MOD_CLASS_DSSS,
645
                                     true,
645
                                     true, true,
646
                                     22000000, 1000000,
646
                                     22000000, 1000000,
647
                                     WIFI_CODE_RATE_UNDEFINED,
647
                                     WIFI_CODE_RATE_UNDEFINED,
648
                                     2);
648
                                     2);
 Lines 655-661    Link Here 
655
  static WifiMode mode =
655
  static WifiMode mode =
656
    WifiModeFactory::CreateWifiMode ("DsssRate2Mbps",
656
    WifiModeFactory::CreateWifiMode ("DsssRate2Mbps",
657
                                     WIFI_MOD_CLASS_DSSS,
657
                                     WIFI_MOD_CLASS_DSSS,
658
                                     true,
658
                                     true, false,
659
                                     22000000, 2000000,
659
                                     22000000, 2000000,
660
                                     WIFI_CODE_RATE_UNDEFINED,
660
                                     WIFI_CODE_RATE_UNDEFINED,
661
                                     4);
661
                                     4);
 Lines 671-677    Link Here 
671
  static WifiMode mode =
671
  static WifiMode mode =
672
    WifiModeFactory::CreateWifiMode ("DsssRate5_5Mbps",
672
    WifiModeFactory::CreateWifiMode ("DsssRate5_5Mbps",
673
                                     WIFI_MOD_CLASS_DSSS,
673
                                     WIFI_MOD_CLASS_DSSS,
674
                                     true,
674
                                     true, false,
675
                                     22000000, 5500000,
675
                                     22000000, 5500000,
676
                                     WIFI_CODE_RATE_UNDEFINED,
676
                                     WIFI_CODE_RATE_UNDEFINED,
677
                                     4);
677
                                     4);
 Lines 684-690    Link Here 
684
  static WifiMode mode =
684
  static WifiMode mode =
685
    WifiModeFactory::CreateWifiMode ("DsssRate11Mbps",
685
    WifiModeFactory::CreateWifiMode ("DsssRate11Mbps",
686
                                     WIFI_MOD_CLASS_DSSS,
686
                                     WIFI_MOD_CLASS_DSSS,
687
                                     true,
687
                                     true, false,
688
                                     22000000, 11000000,
688
                                     22000000, 11000000,
689
                                     WIFI_CODE_RATE_UNDEFINED,
689
                                     WIFI_CODE_RATE_UNDEFINED,
690
                                     4);
690
                                     4);
 Lines 700-706    Link Here 
700
  static WifiMode mode =
700
  static WifiMode mode =
701
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate6Mbps",
701
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate6Mbps",
702
                                     WIFI_MOD_CLASS_ERP_OFDM,
702
                                     WIFI_MOD_CLASS_ERP_OFDM,
703
                                     true,
703
                                     true, true,
704
                                     20000000, 6000000,
704
                                     20000000, 6000000,
705
                                     WIFI_CODE_RATE_1_2,
705
                                     WIFI_CODE_RATE_1_2,
706
                                     2);
706
                                     2);
 Lines 713-719    Link Here 
713
  static WifiMode mode =
713
  static WifiMode mode =
714
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate9Mbps",
714
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate9Mbps",
715
                                     WIFI_MOD_CLASS_ERP_OFDM,
715
                                     WIFI_MOD_CLASS_ERP_OFDM,
716
                                     false,
716
                                     false, false,
717
                                     20000000, 9000000,
717
                                     20000000, 9000000,
718
                                     WIFI_CODE_RATE_3_4,
718
                                     WIFI_CODE_RATE_3_4,
719
                                     2);
719
                                     2);
 Lines 726-732    Link Here 
726
  static WifiMode mode =
726
  static WifiMode mode =
727
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate12Mbps",
727
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate12Mbps",
728
                                     WIFI_MOD_CLASS_ERP_OFDM,
728
                                     WIFI_MOD_CLASS_ERP_OFDM,
729
                                     true,
729
                                     true, true,
730
                                     20000000, 12000000,
730
                                     20000000, 12000000,
731
                                     WIFI_CODE_RATE_1_2,
731
                                     WIFI_CODE_RATE_1_2,
732
                                     4);
732
                                     4);
 Lines 739-745    Link Here 
739
  static WifiMode mode =
739
  static WifiMode mode =
740
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate18Mbps",
740
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate18Mbps",
741
                                     WIFI_MOD_CLASS_ERP_OFDM,
741
                                     WIFI_MOD_CLASS_ERP_OFDM,
742
                                     false,
742
                                     false, false,
743
                                     20000000, 18000000,
743
                                     20000000, 18000000,
744
                                     WIFI_CODE_RATE_3_4,
744
                                     WIFI_CODE_RATE_3_4,
745
                                     4);
745
                                     4);
 Lines 752-758    Link Here 
752
  static WifiMode mode =
752
  static WifiMode mode =
753
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate24Mbps",
753
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate24Mbps",
754
                                     WIFI_MOD_CLASS_ERP_OFDM,
754
                                     WIFI_MOD_CLASS_ERP_OFDM,
755
                                     true,
755
                                     true, true,
756
                                     20000000, 24000000,
756
                                     20000000, 24000000,
757
                                     WIFI_CODE_RATE_1_2,
757
                                     WIFI_CODE_RATE_1_2,
758
                                     16);
758
                                     16);
 Lines 765-771    Link Here 
765
  static WifiMode mode =
765
  static WifiMode mode =
766
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate36Mbps",
766
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate36Mbps",
767
                                     WIFI_MOD_CLASS_ERP_OFDM,
767
                                     WIFI_MOD_CLASS_ERP_OFDM,
768
                                     false,
768
                                     false, false,
769
                                     20000000, 36000000,
769
                                     20000000, 36000000,
770
                                     WIFI_CODE_RATE_3_4,
770
                                     WIFI_CODE_RATE_3_4,
771
                                     16);
771
                                     16);
 Lines 778-784    Link Here 
778
  static WifiMode mode =
778
  static WifiMode mode =
779
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate48Mbps",
779
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate48Mbps",
780
                                     WIFI_MOD_CLASS_ERP_OFDM,
780
                                     WIFI_MOD_CLASS_ERP_OFDM,
781
                                     false,
781
                                     false, false,
782
                                     20000000, 48000000,
782
                                     20000000, 48000000,
783
                                     WIFI_CODE_RATE_2_3,
783
                                     WIFI_CODE_RATE_2_3,
784
                                     64);
784
                                     64);
 Lines 791-797    Link Here 
791
  static WifiMode mode =
791
  static WifiMode mode =
792
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate54Mbps",
792
    WifiModeFactory::CreateWifiMode ("ErpOfdmRate54Mbps",
793
                                     WIFI_MOD_CLASS_ERP_OFDM,
793
                                     WIFI_MOD_CLASS_ERP_OFDM,
794
                                     false,
794
                                     false, false,
795
                                     20000000, 54000000,
795
                                     20000000, 54000000,
796
                                     WIFI_CODE_RATE_3_4,
796
                                     WIFI_CODE_RATE_3_4,
797
                                     64);
797
                                     64);
 Lines 807-813    Link Here 
807
  static WifiMode mode =
807
  static WifiMode mode =
808
    WifiModeFactory::CreateWifiMode ("OfdmRate6Mbps",
808
    WifiModeFactory::CreateWifiMode ("OfdmRate6Mbps",
809
                                     WIFI_MOD_CLASS_OFDM,
809
                                     WIFI_MOD_CLASS_OFDM,
810
                                     true,
810
                                     true, false,
811
                                     20000000, 6000000,
811
                                     20000000, 6000000,
812
                                     WIFI_CODE_RATE_1_2,
812
                                     WIFI_CODE_RATE_1_2,
813
                                     2);
813
                                     2);
 Lines 820-826    Link Here 
820
  static WifiMode mode =
820
  static WifiMode mode =
821
    WifiModeFactory::CreateWifiMode ("OfdmRate9Mbps",
821
    WifiModeFactory::CreateWifiMode ("OfdmRate9Mbps",
822
                                     WIFI_MOD_CLASS_OFDM,
822
                                     WIFI_MOD_CLASS_OFDM,
823
                                     false,
823
                                     false, false,
824
                                     20000000, 9000000,
824
                                     20000000, 9000000,
825
                                     WIFI_CODE_RATE_3_4,
825
                                     WIFI_CODE_RATE_3_4,
826
                                     2);
826
                                     2);
 Lines 833-839    Link Here 
833
  static WifiMode mode =
833
  static WifiMode mode =
834
    WifiModeFactory::CreateWifiMode ("OfdmRate12Mbps",
834
    WifiModeFactory::CreateWifiMode ("OfdmRate12Mbps",
835
                                     WIFI_MOD_CLASS_OFDM,
835
                                     WIFI_MOD_CLASS_OFDM,
836
                                     true,
836
                                     true, true,
837
                                     20000000, 12000000,
837
                                     20000000, 12000000,
838
                                     WIFI_CODE_RATE_1_2,
838
                                     WIFI_CODE_RATE_1_2,
839
                                     4);
839
                                     4);
 Lines 846-852    Link Here 
846
  static WifiMode mode =
846
  static WifiMode mode =
847
    WifiModeFactory::CreateWifiMode ("OfdmRate18Mbps",
847
    WifiModeFactory::CreateWifiMode ("OfdmRate18Mbps",
848
                                     WIFI_MOD_CLASS_OFDM,
848
                                     WIFI_MOD_CLASS_OFDM,
849
                                     false,
849
                                     false, false,
850
                                     20000000, 18000000,
850
                                     20000000, 18000000,
851
                                     WIFI_CODE_RATE_3_4,
851
                                     WIFI_CODE_RATE_3_4,
852
                                     4);
852
                                     4);
 Lines 859-865    Link Here 
859
  static WifiMode mode =
859
  static WifiMode mode =
860
    WifiModeFactory::CreateWifiMode ("OfdmRate24Mbps",
860
    WifiModeFactory::CreateWifiMode ("OfdmRate24Mbps",
861
                                     WIFI_MOD_CLASS_OFDM,
861
                                     WIFI_MOD_CLASS_OFDM,
862
                                     true,
862
                                     true, true,
863
                                     20000000, 24000000,
863
                                     20000000, 24000000,
864
                                     WIFI_CODE_RATE_1_2,
864
                                     WIFI_CODE_RATE_1_2,
865
                                     16);
865
                                     16);
 Lines 872-878    Link Here 
872
  static WifiMode mode =
872
  static WifiMode mode =
873
    WifiModeFactory::CreateWifiMode ("OfdmRate36Mbps",
873
    WifiModeFactory::CreateWifiMode ("OfdmRate36Mbps",
874
                                     WIFI_MOD_CLASS_OFDM,
874
                                     WIFI_MOD_CLASS_OFDM,
875
                                     false,
875
                                     false, false,
876
                                     20000000, 36000000,
876
                                     20000000, 36000000,
877
                                     WIFI_CODE_RATE_3_4,
877
                                     WIFI_CODE_RATE_3_4,
878
                                     16);
878
                                     16);
 Lines 885-891    Link Here 
885
  static WifiMode mode =
885
  static WifiMode mode =
886
    WifiModeFactory::CreateWifiMode ("OfdmRate48Mbps",
886
    WifiModeFactory::CreateWifiMode ("OfdmRate48Mbps",
887
                                     WIFI_MOD_CLASS_OFDM,
887
                                     WIFI_MOD_CLASS_OFDM,
888
                                     false,
888
                                     false, false,
889
                                     20000000, 48000000,
889
                                     20000000, 48000000,
890
                                     WIFI_CODE_RATE_2_3,
890
                                     WIFI_CODE_RATE_2_3,
891
                                     64);
891
                                     64);
 Lines 898-904    Link Here 
898
  static WifiMode mode =
898
  static WifiMode mode =
899
    WifiModeFactory::CreateWifiMode ("OfdmRate54Mbps",
899
    WifiModeFactory::CreateWifiMode ("OfdmRate54Mbps",
900
                                     WIFI_MOD_CLASS_OFDM,
900
                                     WIFI_MOD_CLASS_OFDM,
901
                                     false,
901
                                     false, false,
902
                                     20000000, 54000000,
902
                                     20000000, 54000000,
903
                                     WIFI_CODE_RATE_3_4,
903
                                     WIFI_CODE_RATE_3_4,
904
                                     64);
904
                                     64);
 Lines 913-919    Link Here 
913
  static WifiMode mode =
913
  static WifiMode mode =
914
    WifiModeFactory::CreateWifiMode ("OfdmRate3MbpsBW10MHz",
914
    WifiModeFactory::CreateWifiMode ("OfdmRate3MbpsBW10MHz",
915
                                     WIFI_MOD_CLASS_OFDM,
915
                                     WIFI_MOD_CLASS_OFDM,
916
                                     true,
916
                                     true, true,
917
                                     10000000, 3000000,
917
                                     10000000, 3000000,
918
                                     WIFI_CODE_RATE_1_2,
918
                                     WIFI_CODE_RATE_1_2,
919
                                     2);
919
                                     2);
 Lines 926-932    Link Here 
926
  static WifiMode mode =
926
  static WifiMode mode =
927
    WifiModeFactory::CreateWifiMode ("OfdmRate4_5MbpsBW10MHz",
927
    WifiModeFactory::CreateWifiMode ("OfdmRate4_5MbpsBW10MHz",
928
                                     WIFI_MOD_CLASS_OFDM,
928
                                     WIFI_MOD_CLASS_OFDM,
929
                                     false,
929
                                     false, false,
930
                                     10000000, 4500000,
930
                                     10000000, 4500000,
931
                                     WIFI_CODE_RATE_3_4,
931
                                     WIFI_CODE_RATE_3_4,
932
                                     2);
932
                                     2);
 Lines 939-945    Link Here 
939
  static WifiMode mode =
939
  static WifiMode mode =
940
    WifiModeFactory::CreateWifiMode ("OfdmRate6MbpsBW10MHz",
940
    WifiModeFactory::CreateWifiMode ("OfdmRate6MbpsBW10MHz",
941
                                     WIFI_MOD_CLASS_OFDM,
941
                                     WIFI_MOD_CLASS_OFDM,
942
                                     true,
942
                                     true, true,
943
                                     10000000, 6000000,
943
                                     10000000, 6000000,
944
                                     WIFI_CODE_RATE_1_2,
944
                                     WIFI_CODE_RATE_1_2,
945
                                     4);
945
                                     4);
 Lines 952-958    Link Here 
952
  static WifiMode mode =
952
  static WifiMode mode =
953
    WifiModeFactory::CreateWifiMode ("OfdmRate9MbpsBW10MHz",
953
    WifiModeFactory::CreateWifiMode ("OfdmRate9MbpsBW10MHz",
954
                                     WIFI_MOD_CLASS_OFDM,
954
                                     WIFI_MOD_CLASS_OFDM,
955
                                     false,
955
                                     false, false,
956
                                     10000000, 9000000,
956
                                     10000000, 9000000,
957
                                     WIFI_CODE_RATE_3_4,
957
                                     WIFI_CODE_RATE_3_4,
958
                                     4);
958
                                     4);
 Lines 965-971    Link Here 
965
  static WifiMode mode =
965
  static WifiMode mode =
966
    WifiModeFactory::CreateWifiMode ("OfdmRate12MbpsBW10MHz",
966
    WifiModeFactory::CreateWifiMode ("OfdmRate12MbpsBW10MHz",
967
                                     WIFI_MOD_CLASS_OFDM,
967
                                     WIFI_MOD_CLASS_OFDM,
968
                                     true,
968
                                     true, true,
969
                                     10000000, 12000000,
969
                                     10000000, 12000000,
970
                                     WIFI_CODE_RATE_1_2,
970
                                     WIFI_CODE_RATE_1_2,
971
                                     16);
971
                                     16);
 Lines 978-984    Link Here 
978
  static WifiMode mode =
978
  static WifiMode mode =
979
    WifiModeFactory::CreateWifiMode ("OfdmRate18MbpsBW10MHz",
979
    WifiModeFactory::CreateWifiMode ("OfdmRate18MbpsBW10MHz",
980
                                     WIFI_MOD_CLASS_OFDM,
980
                                     WIFI_MOD_CLASS_OFDM,
981
                                     false,
981
                                     false, false,
982
                                     10000000, 18000000,
982
                                     10000000, 18000000,
983
                                     WIFI_CODE_RATE_3_4,
983
                                     WIFI_CODE_RATE_3_4,
984
                                     16);
984
                                     16);
 Lines 991-997    Link Here 
991
  static WifiMode mode =
991
  static WifiMode mode =
992
    WifiModeFactory::CreateWifiMode ("OfdmRate24MbpsBW10MHz",
992
    WifiModeFactory::CreateWifiMode ("OfdmRate24MbpsBW10MHz",
993
                                     WIFI_MOD_CLASS_OFDM,
993
                                     WIFI_MOD_CLASS_OFDM,
994
                                     false,
994
                                     false, false,
995
                                     10000000, 24000000,
995
                                     10000000, 24000000,
996
                                     WIFI_CODE_RATE_2_3,
996
                                     WIFI_CODE_RATE_2_3,
997
                                     64);
997
                                     64);
 Lines 1004-1010    Link Here 
1004
  static WifiMode mode =
1004
  static WifiMode mode =
1005
    WifiModeFactory::CreateWifiMode ("OfdmRate27MbpsBW10MHz",
1005
    WifiModeFactory::CreateWifiMode ("OfdmRate27MbpsBW10MHz",
1006
                                     WIFI_MOD_CLASS_OFDM,
1006
                                     WIFI_MOD_CLASS_OFDM,
1007
                                     false,
1007
                                     false, false,
1008
                                     10000000, 27000000,
1008
                                     10000000, 27000000,
1009
                                     WIFI_CODE_RATE_3_4,
1009
                                     WIFI_CODE_RATE_3_4,
1010
                                     64);
1010
                                     64);
 Lines 1019-1025    Link Here 
1019
  static WifiMode mode =
1019
  static WifiMode mode =
1020
    WifiModeFactory::CreateWifiMode ("OfdmRate1_5MbpsBW5MHz",
1020
    WifiModeFactory::CreateWifiMode ("OfdmRate1_5MbpsBW5MHz",
1021
                                     WIFI_MOD_CLASS_OFDM,
1021
                                     WIFI_MOD_CLASS_OFDM,
1022
                                     true,
1022
                                     true, true,
1023
                                     5000000, 1500000,
1023
                                     5000000, 1500000,
1024
                                     WIFI_CODE_RATE_1_2,
1024
                                     WIFI_CODE_RATE_1_2,
1025
                                     2);
1025
                                     2);
 Lines 1032-1038    Link Here 
1032
  static WifiMode mode =
1032
  static WifiMode mode =
1033
    WifiModeFactory::CreateWifiMode ("OfdmRate2_25MbpsBW5MHz",
1033
    WifiModeFactory::CreateWifiMode ("OfdmRate2_25MbpsBW5MHz",
1034
                                     WIFI_MOD_CLASS_OFDM,
1034
                                     WIFI_MOD_CLASS_OFDM,
1035
                                     false,
1035
                                     false, false,
1036
                                     5000000, 2250000,
1036
                                     5000000, 2250000,
1037
                                     WIFI_CODE_RATE_3_4,
1037
                                     WIFI_CODE_RATE_3_4,
1038
                                     2);
1038
                                     2);
 Lines 1045-1051    Link Here 
1045
  static WifiMode mode =
1045
  static WifiMode mode =
1046
    WifiModeFactory::CreateWifiMode ("OfdmRate3MbpsBW5MHz",
1046
    WifiModeFactory::CreateWifiMode ("OfdmRate3MbpsBW5MHz",
1047
                                     WIFI_MOD_CLASS_OFDM,
1047
                                     WIFI_MOD_CLASS_OFDM,
1048
                                     true,
1048
                                     true, true,
1049
                                     5000000, 3000000,
1049
                                     5000000, 3000000,
1050
                                     WIFI_CODE_RATE_1_2,
1050
                                     WIFI_CODE_RATE_1_2,
1051
                                     4);
1051
                                     4);
 Lines 1058-1064    Link Here 
1058
  static WifiMode mode =
1058
  static WifiMode mode =
1059
    WifiModeFactory::CreateWifiMode ("OfdmRate4_5MbpsBW5MHz",
1059
    WifiModeFactory::CreateWifiMode ("OfdmRate4_5MbpsBW5MHz",
1060
                                     WIFI_MOD_CLASS_OFDM,
1060
                                     WIFI_MOD_CLASS_OFDM,
1061
                                     false,
1061
                                     false, false,
1062
                                     5000000, 4500000,
1062
                                     5000000, 4500000,
1063
                                     WIFI_CODE_RATE_3_4,
1063
                                     WIFI_CODE_RATE_3_4,
1064
                                     4);
1064
                                     4);
 Lines 1071-1077    Link Here 
1071
  static WifiMode mode =
1071
  static WifiMode mode =
1072
    WifiModeFactory::CreateWifiMode ("OfdmRate6MbpsBW5MHz",
1072
    WifiModeFactory::CreateWifiMode ("OfdmRate6MbpsBW5MHz",
1073
                                     WIFI_MOD_CLASS_OFDM,
1073
                                     WIFI_MOD_CLASS_OFDM,
1074
                                     true,
1074
                                     true, true,
1075
                                     5000000, 6000000,
1075
                                     5000000, 6000000,
1076
                                     WIFI_CODE_RATE_1_2,
1076
                                     WIFI_CODE_RATE_1_2,
1077
                                     16);
1077
                                     16);
 Lines 1084-1090    Link Here 
1084
  static WifiMode mode =
1084
  static WifiMode mode =
1085
    WifiModeFactory::CreateWifiMode ("OfdmRate9MbpsBW5MHz",
1085
    WifiModeFactory::CreateWifiMode ("OfdmRate9MbpsBW5MHz",
1086
                                     WIFI_MOD_CLASS_OFDM,
1086
                                     WIFI_MOD_CLASS_OFDM,
1087
                                     false,
1087
                                     false, false,
1088
                                     5000000, 9000000,
1088
                                     5000000, 9000000,
1089
                                     WIFI_CODE_RATE_3_4,
1089
                                     WIFI_CODE_RATE_3_4,
1090
                                     16);
1090
                                     16);
 Lines 1097-1103    Link Here 
1097
  static WifiMode mode =
1097
  static WifiMode mode =
1098
    WifiModeFactory::CreateWifiMode ("OfdmRate12MbpsBW5MHz",
1098
    WifiModeFactory::CreateWifiMode ("OfdmRate12MbpsBW5MHz",
1099
                                     WIFI_MOD_CLASS_OFDM,
1099
                                     WIFI_MOD_CLASS_OFDM,
1100
                                     false,
1100
                                     false, false,
1101
                                     5000000, 12000000,
1101
                                     5000000, 12000000,
1102
                                     WIFI_CODE_RATE_2_3,
1102
                                     WIFI_CODE_RATE_2_3,
1103
                                     64);
1103
                                     64);
 Lines 1110-1116    Link Here 
1110
  static WifiMode mode =
1110
  static WifiMode mode =
1111
    WifiModeFactory::CreateWifiMode ("OfdmRate13_5MbpsBW5MHz",
1111
    WifiModeFactory::CreateWifiMode ("OfdmRate13_5MbpsBW5MHz",
1112
                                     WIFI_MOD_CLASS_OFDM,
1112
                                     WIFI_MOD_CLASS_OFDM,
1113
                                     false,
1113
                                     false, false,
1114
                                     5000000, 13500000,
1114
                                     5000000, 13500000,
1115
                                     WIFI_CODE_RATE_3_4,
1115
                                     WIFI_CODE_RATE_3_4,
1116
                                     64);
1116
                                     64);
 Lines 1125-1131    Link Here 
1125
  static WifiMode mode =
1125
  static WifiMode mode =
1126
  WifiModeFactory::CreateWifiMode ("OfdmRate6_5MbpsBW20MHz",
1126
  WifiModeFactory::CreateWifiMode ("OfdmRate6_5MbpsBW20MHz",
1127
                                    WIFI_MOD_CLASS_HT,
1127
                                    WIFI_MOD_CLASS_HT,
1128
                                    true,
1128
                                    true, true,
1129
                                    20000000, 6500000,
1129
                                    20000000, 6500000,
1130
                                    WIFI_CODE_RATE_1_2,
1130
                                    WIFI_CODE_RATE_1_2,
1131
                                    2);
1131
                                    2);
 Lines 1137-1143    Link Here 
1137
  static WifiMode mode =
1137
  static WifiMode mode =
1138
  WifiModeFactory::CreateWifiMode ("OfdmRate7_2MbpsBW20MHz",
1138
  WifiModeFactory::CreateWifiMode ("OfdmRate7_2MbpsBW20MHz",
1139
                                    WIFI_MOD_CLASS_HT,
1139
                                    WIFI_MOD_CLASS_HT,
1140
                                    false,
1140
                                    false, false,
1141
                                    20000000, 7200000,
1141
                                    20000000, 7200000,
1142
                                    WIFI_CODE_RATE_1_2,
1142
                                    WIFI_CODE_RATE_1_2,
1143
                                    2);
1143
                                    2);
 Lines 1150-1156    Link Here 
1150
  static WifiMode mode =
1150
  static WifiMode mode =
1151
    WifiModeFactory::CreateWifiMode ("OfdmRate13MbpsBW20MHz",
1151
    WifiModeFactory::CreateWifiMode ("OfdmRate13MbpsBW20MHz",
1152
                                     WIFI_MOD_CLASS_HT,
1152
                                     WIFI_MOD_CLASS_HT,
1153
                                     true,
1153
                                     true, true,
1154
                                     20000000, 13000000,
1154
                                     20000000, 13000000,
1155
                                     WIFI_CODE_RATE_1_2,
1155
                                     WIFI_CODE_RATE_1_2,
1156
                                     4);
1156
                                     4);
 Lines 1163-1169    Link Here 
1163
  static WifiMode mode =
1163
  static WifiMode mode =
1164
    WifiModeFactory::CreateWifiMode ("OfdmRate14_4MbpsBW20MHz",
1164
    WifiModeFactory::CreateWifiMode ("OfdmRate14_4MbpsBW20MHz",
1165
                                     WIFI_MOD_CLASS_HT,
1165
                                     WIFI_MOD_CLASS_HT,
1166
                                     false,
1166
                                     false, false,
1167
                                     20000000, 14400000,
1167
                                     20000000, 14400000,
1168
                                     WIFI_CODE_RATE_1_2,
1168
                                     WIFI_CODE_RATE_1_2,
1169
                                     4);
1169
                                     4);
 Lines 1175-1181    Link Here 
1175
  static WifiMode mode =
1175
  static WifiMode mode =
1176
    WifiModeFactory::CreateWifiMode ("OfdmRate19_5MbpsBW20MHz",
1176
    WifiModeFactory::CreateWifiMode ("OfdmRate19_5MbpsBW20MHz",
1177
                                     WIFI_MOD_CLASS_HT,
1177
                                     WIFI_MOD_CLASS_HT,
1178
                                     true,
1178
                                     true, true,
1179
                                     20000000, 19500000,
1179
                                     20000000, 19500000,
1180
                                     WIFI_CODE_RATE_3_4,
1180
                                     WIFI_CODE_RATE_3_4,
1181
                                     4);
1181
                                     4);
 Lines 1188-1194    Link Here 
1188
  static WifiMode mode =
1188
  static WifiMode mode =
1189
    WifiModeFactory::CreateWifiMode ("OfdmRate21_7MbpsBW20MHz",
1189
    WifiModeFactory::CreateWifiMode ("OfdmRate21_7MbpsBW20MHz",
1190
                                     WIFI_MOD_CLASS_HT,
1190
                                     WIFI_MOD_CLASS_HT,
1191
                                     false,
1191
                                     false, false,
1192
                                     20000000, 21700000,
1192
                                     20000000, 21700000,
1193
                                     WIFI_CODE_RATE_3_4,
1193
                                     WIFI_CODE_RATE_3_4,
1194
                                     4);
1194
                                     4);
 Lines 1202-1208    Link Here 
1202
  static WifiMode mode =
1202
  static WifiMode mode =
1203
    WifiModeFactory::CreateWifiMode ("OfdmRate26MbpsBW20MHz",
1203
    WifiModeFactory::CreateWifiMode ("OfdmRate26MbpsBW20MHz",
1204
                                     WIFI_MOD_CLASS_HT,
1204
                                     WIFI_MOD_CLASS_HT,
1205
                                     true,
1205
                                     true, true,
1206
                                     20000000, 26000000,
1206
                                     20000000, 26000000,
1207
                                     WIFI_CODE_RATE_1_2,
1207
                                     WIFI_CODE_RATE_1_2,
1208
                                     16);
1208
                                     16);
 Lines 1215-1221    Link Here 
1215
  static WifiMode mode =
1215
  static WifiMode mode =
1216
    WifiModeFactory::CreateWifiMode ("OfdmRate28_9MbpsBW20MHz",
1216
    WifiModeFactory::CreateWifiMode ("OfdmRate28_9MbpsBW20MHz",
1217
                                     WIFI_MOD_CLASS_HT,
1217
                                     WIFI_MOD_CLASS_HT,
1218
                                     false,
1218
                                     false, false,
1219
                                     20000000, 28900000,
1219
                                     20000000, 28900000,
1220
                                     WIFI_CODE_RATE_1_2,
1220
                                     WIFI_CODE_RATE_1_2,
1221
                                     16);
1221
                                     16);
 Lines 1228-1234    Link Here 
1228
  static WifiMode mode =
1228
  static WifiMode mode =
1229
    WifiModeFactory::CreateWifiMode ("OfdmRate39MbpsBW20MHz",
1229
    WifiModeFactory::CreateWifiMode ("OfdmRate39MbpsBW20MHz",
1230
                                     WIFI_MOD_CLASS_HT,
1230
                                     WIFI_MOD_CLASS_HT,
1231
                                     true,
1231
                                     true, true,
1232
                                     20000000, 39000000,
1232
                                     20000000, 39000000,
1233
                                     WIFI_CODE_RATE_3_4,
1233
                                     WIFI_CODE_RATE_3_4,
1234
                                     16);
1234
                                     16);
 Lines 1241-1247    Link Here 
1241
  static WifiMode mode =
1241
  static WifiMode mode =
1242
    WifiModeFactory::CreateWifiMode ("OfdmRate43_3MbpsBW20MHz",
1242
    WifiModeFactory::CreateWifiMode ("OfdmRate43_3MbpsBW20MHz",
1243
                                     WIFI_MOD_CLASS_HT,
1243
                                     WIFI_MOD_CLASS_HT,
1244
                                     false,
1244
                                     false, false,
1245
                                     20000000, 43300000,
1245
                                     20000000, 43300000,
1246
                                     WIFI_CODE_RATE_3_4,
1246
                                     WIFI_CODE_RATE_3_4,
1247
                                     16);
1247
                                     16);
 Lines 1254-1260    Link Here 
1254
  static WifiMode mode =
1254
  static WifiMode mode =
1255
    WifiModeFactory::CreateWifiMode ("OfdmRate52MbpsBW20MHz",
1255
    WifiModeFactory::CreateWifiMode ("OfdmRate52MbpsBW20MHz",
1256
                                     WIFI_MOD_CLASS_HT,
1256
                                     WIFI_MOD_CLASS_HT,
1257
                                     true,
1257
                                     true, true,
1258
                                     20000000, 52000000,
1258
                                     20000000, 52000000,
1259
                                     WIFI_CODE_RATE_2_3,
1259
                                     WIFI_CODE_RATE_2_3,
1260
                                     64);
1260
                                     64);
 Lines 1267-1273    Link Here 
1267
  static WifiMode mode =
1267
  static WifiMode mode =
1268
    WifiModeFactory::CreateWifiMode ("OfdmRate57_8MbpsBW20MHz",
1268
    WifiModeFactory::CreateWifiMode ("OfdmRate57_8MbpsBW20MHz",
1269
                                     WIFI_MOD_CLASS_HT,
1269
                                     WIFI_MOD_CLASS_HT,
1270
                                     false,
1270
                                     false, false,
1271
                                     20000000, 57800000,
1271
                                     20000000, 57800000,
1272
                                     WIFI_CODE_RATE_2_3,
1272
                                     WIFI_CODE_RATE_2_3,
1273
                                     64);
1273
                                     64);
 Lines 1281-1287    Link Here 
1281
  static WifiMode mode =
1281
  static WifiMode mode =
1282
    WifiModeFactory::CreateWifiMode ("OfdmRate58_5MbpsBW20MHz",
1282
    WifiModeFactory::CreateWifiMode ("OfdmRate58_5MbpsBW20MHz",
1283
                                     WIFI_MOD_CLASS_HT,
1283
                                     WIFI_MOD_CLASS_HT,
1284
                                     true,
1284
                                     true, true,
1285
                                     20000000, 58500000,
1285
                                     20000000, 58500000,
1286
                                     WIFI_CODE_RATE_3_4,
1286
                                     WIFI_CODE_RATE_3_4,
1287
                                     64);
1287
                                     64);
 Lines 1294-1300    Link Here 
1294
  static WifiMode mode =
1294
  static WifiMode mode =
1295
    WifiModeFactory::CreateWifiMode ("OfdmRate65MbpsBW20MHzShGi",
1295
    WifiModeFactory::CreateWifiMode ("OfdmRate65MbpsBW20MHzShGi",
1296
                                     WIFI_MOD_CLASS_HT,
1296
                                     WIFI_MOD_CLASS_HT,
1297
                                     false,
1297
                                     false, false,
1298
                                     20000000, 65000000,
1298
                                     20000000, 65000000,
1299
                                     WIFI_CODE_RATE_3_4,
1299
                                     WIFI_CODE_RATE_3_4,
1300
                                     64);
1300
                                     64);
 Lines 1307-1313    Link Here 
1307
  static WifiMode mode =
1307
  static WifiMode mode =
1308
    WifiModeFactory::CreateWifiMode ("OfdmRate65MbpsBW20MHz",
1308
    WifiModeFactory::CreateWifiMode ("OfdmRate65MbpsBW20MHz",
1309
                                     WIFI_MOD_CLASS_HT,
1309
                                     WIFI_MOD_CLASS_HT,
1310
                                     true,
1310
                                     true, true,
1311
                                     20000000, 65000000,
1311
                                     20000000, 65000000,
1312
                                     WIFI_CODE_RATE_5_6,
1312
                                     WIFI_CODE_RATE_5_6,
1313
                                     64);
1313
                                     64);
 Lines 1320-1326    Link Here 
1320
  static WifiMode mode =
1320
  static WifiMode mode =
1321
    WifiModeFactory::CreateWifiMode ("OfdmRate72_2MbpsBW20MHz",
1321
    WifiModeFactory::CreateWifiMode ("OfdmRate72_2MbpsBW20MHz",
1322
                                     WIFI_MOD_CLASS_HT,
1322
                                     WIFI_MOD_CLASS_HT,
1323
                                     false,
1323
                                     false, false,
1324
                                     20000000, 72200000,
1324
                                     20000000, 72200000,
1325
                                     WIFI_CODE_RATE_5_6,
1325
                                     WIFI_CODE_RATE_5_6,
1326
                                     64);
1326
                                     64);
 Lines 1333-1339    Link Here 
1333
  static WifiMode mode =
1333
  static WifiMode mode =
1334
    WifiModeFactory::CreateWifiMode ("OfdmRate13_5MbpsBW40MHz",
1334
    WifiModeFactory::CreateWifiMode ("OfdmRate13_5MbpsBW40MHz",
1335
                                     WIFI_MOD_CLASS_HT,
1335
                                     WIFI_MOD_CLASS_HT,
1336
                                     false,
1336
                                     false, false,
1337
                                     40000000, 13500000,
1337
                                     40000000, 13500000,
1338
                                     WIFI_CODE_RATE_1_2,
1338
                                     WIFI_CODE_RATE_1_2,
1339
                                     2);
1339
                                     2);
 Lines 1346-1352    Link Here 
1346
  static WifiMode mode =
1346
  static WifiMode mode =
1347
    WifiModeFactory::CreateWifiMode ("OfdmRate15MbpsBW40MHz",
1347
    WifiModeFactory::CreateWifiMode ("OfdmRate15MbpsBW40MHz",
1348
                                     WIFI_MOD_CLASS_HT,
1348
                                     WIFI_MOD_CLASS_HT,
1349
                                     false,
1349
                                     false, false,
1350
                                     40000000, 15000000,
1350
                                     40000000, 15000000,
1351
                                     WIFI_CODE_RATE_1_2,
1351
                                     WIFI_CODE_RATE_1_2,
1352
                                     2);
1352
                                     2);
 Lines 1359-1365    Link Here 
1359
  static WifiMode mode =
1359
  static WifiMode mode =
1360
    WifiModeFactory::CreateWifiMode ("OfdmRate27MbpsBW40MHz",
1360
    WifiModeFactory::CreateWifiMode ("OfdmRate27MbpsBW40MHz",
1361
                                     WIFI_MOD_CLASS_HT,
1361
                                     WIFI_MOD_CLASS_HT,
1362
                                     false,
1362
                                     false, false,
1363
                                     40000000, 27000000,
1363
                                     40000000, 27000000,
1364
                                     WIFI_CODE_RATE_1_2,
1364
                                     WIFI_CODE_RATE_1_2,
1365
                                     4);
1365
                                     4);
 Lines 1371-1377    Link Here 
1371
  static WifiMode mode =
1371
  static WifiMode mode =
1372
    WifiModeFactory::CreateWifiMode ("OfdmRate30MbpsBW40MHz",
1372
    WifiModeFactory::CreateWifiMode ("OfdmRate30MbpsBW40MHz",
1373
                                     WIFI_MOD_CLASS_HT,
1373
                                     WIFI_MOD_CLASS_HT,
1374
                                     false,
1374
                                     false, false,
1375
                                     40000000, 30000000,
1375
                                     40000000, 30000000,
1376
                                     WIFI_CODE_RATE_1_2,
1376
                                     WIFI_CODE_RATE_1_2,
1377
                                     4);
1377
                                     4);
 Lines 1384-1390    Link Here 
1384
  static WifiMode mode =
1384
  static WifiMode mode =
1385
    WifiModeFactory::CreateWifiMode ("OfdmRate40_5MbpsBW40MHz",
1385
    WifiModeFactory::CreateWifiMode ("OfdmRate40_5MbpsBW40MHz",
1386
                                     WIFI_MOD_CLASS_HT,
1386
                                     WIFI_MOD_CLASS_HT,
1387
                                     false,
1387
                                     false, false,
1388
                                     40000000, 40500000,
1388
                                     40000000, 40500000,
1389
                                     WIFI_CODE_RATE_3_4,
1389
                                     WIFI_CODE_RATE_3_4,
1390
                                     4);
1390
                                     4);
 Lines 1396-1402    Link Here 
1396
  static WifiMode mode =
1396
  static WifiMode mode =
1397
    WifiModeFactory::CreateWifiMode ("OfdmRate45MbpsBW40MHz",
1397
    WifiModeFactory::CreateWifiMode ("OfdmRate45MbpsBW40MHz",
1398
                                     WIFI_MOD_CLASS_HT,
1398
                                     WIFI_MOD_CLASS_HT,
1399
                                     false,
1399
                                     false, false,
1400
                                     40000000, 45000000,
1400
                                     40000000, 45000000,
1401
                                     WIFI_CODE_RATE_3_4,
1401
                                     WIFI_CODE_RATE_3_4,
1402
                                     4);
1402
                                     4);
 Lines 1409-1415    Link Here 
1409
  static WifiMode mode =
1409
  static WifiMode mode =
1410
    WifiModeFactory::CreateWifiMode ("OfdmRate54MbpsBW40MHz",
1410
    WifiModeFactory::CreateWifiMode ("OfdmRate54MbpsBW40MHz",
1411
                                     WIFI_MOD_CLASS_HT,
1411
                                     WIFI_MOD_CLASS_HT,
1412
                                     false,
1412
                                     false, false,
1413
                                     40000000, 54000000,
1413
                                     40000000, 54000000,
1414
                                     WIFI_CODE_RATE_1_2,
1414
                                     WIFI_CODE_RATE_1_2,
1415
                                     16);
1415
                                     16);
 Lines 1422-1428    Link Here 
1422
  static WifiMode mode =
1422
  static WifiMode mode =
1423
    WifiModeFactory::CreateWifiMode ("OfdmRate60MbpsBW40MHz",
1423
    WifiModeFactory::CreateWifiMode ("OfdmRate60MbpsBW40MHz",
1424
                                     WIFI_MOD_CLASS_HT,
1424
                                     WIFI_MOD_CLASS_HT,
1425
                                     false,
1425
                                     false, false,
1426
                                     40000000, 60000000,
1426
                                     40000000, 60000000,
1427
                                     WIFI_CODE_RATE_1_2,
1427
                                     WIFI_CODE_RATE_1_2,
1428
                                     16);
1428
                                     16);
 Lines 1435-1441    Link Here 
1435
  static WifiMode mode =
1435
  static WifiMode mode =
1436
    WifiModeFactory::CreateWifiMode ("OfdmRate81MbpsBW40MHz",
1436
    WifiModeFactory::CreateWifiMode ("OfdmRate81MbpsBW40MHz",
1437
                                     WIFI_MOD_CLASS_HT,
1437
                                     WIFI_MOD_CLASS_HT,
1438
                                     false,
1438
                                     false, false,
1439
                                     40000000, 81000000,
1439
                                     40000000, 81000000,
1440
                                     WIFI_CODE_RATE_3_4,
1440
                                     WIFI_CODE_RATE_3_4,
1441
                                     16);
1441
                                     16);
 Lines 1447-1453    Link Here 
1447
  static WifiMode mode =
1447
  static WifiMode mode =
1448
    WifiModeFactory::CreateWifiMode ("OfdmRate90MbpsBW40MHz",
1448
    WifiModeFactory::CreateWifiMode ("OfdmRate90MbpsBW40MHz",
1449
                                     WIFI_MOD_CLASS_HT,
1449
                                     WIFI_MOD_CLASS_HT,
1450
                                     false,
1450
                                     false, false,
1451
                                     40000000, 90000000,
1451
                                     40000000, 90000000,
1452
                                     WIFI_CODE_RATE_3_4,
1452
                                     WIFI_CODE_RATE_3_4,
1453
                                     16);
1453
                                     16);
 Lines 1460-1466    Link Here 
1460
  static WifiMode mode =
1460
  static WifiMode mode =
1461
    WifiModeFactory::CreateWifiMode ("OfdmRate108MbpsBW40MHz",
1461
    WifiModeFactory::CreateWifiMode ("OfdmRate108MbpsBW40MHz",
1462
                                     WIFI_MOD_CLASS_HT,
1462
                                     WIFI_MOD_CLASS_HT,
1463
                                     false,
1463
                                     false, false,
1464
                                     40000000, 108000000,
1464
                                     40000000, 108000000,
1465
                                     WIFI_CODE_RATE_2_3,
1465
                                     WIFI_CODE_RATE_2_3,
1466
                                     64);
1466
                                     64);
 Lines 1472-1478    Link Here 
1472
  static WifiMode mode =
1472
  static WifiMode mode =
1473
    WifiModeFactory::CreateWifiMode ("OfdmRate120MbpsBW40MHz",
1473
    WifiModeFactory::CreateWifiMode ("OfdmRate120MbpsBW40MHz",
1474
                                     WIFI_MOD_CLASS_HT,
1474
                                     WIFI_MOD_CLASS_HT,
1475
                                     false,
1475
                                     false, false,
1476
                                     40000000, 120000000,
1476
                                     40000000, 120000000,
1477
                                     WIFI_CODE_RATE_2_3,
1477
                                     WIFI_CODE_RATE_2_3,
1478
                                     64);
1478
                                     64);
 Lines 1484-1490    Link Here 
1484
  static WifiMode mode =
1484
  static WifiMode mode =
1485
    WifiModeFactory::CreateWifiMode ("OfdmRate121_5MbpsBW40MHz",
1485
    WifiModeFactory::CreateWifiMode ("OfdmRate121_5MbpsBW40MHz",
1486
                                     WIFI_MOD_CLASS_HT,
1486
                                     WIFI_MOD_CLASS_HT,
1487
                                     false,
1487
                                     false, false,
1488
                                     40000000, 121500000,
1488
                                     40000000, 121500000,
1489
                                     WIFI_CODE_RATE_3_4,
1489
                                     WIFI_CODE_RATE_3_4,
1490
                                     64);
1490
                                     64);
 Lines 1496-1502    Link Here 
1496
  static WifiMode mode =
1496
  static WifiMode mode =
1497
    WifiModeFactory::CreateWifiMode ("OfdmRate135MbpsBW40MHzShGi",
1497
    WifiModeFactory::CreateWifiMode ("OfdmRate135MbpsBW40MHzShGi",
1498
                                     WIFI_MOD_CLASS_HT,
1498
                                     WIFI_MOD_CLASS_HT,
1499
                                     false,
1499
                                     false, false,
1500
                                     40000000, 135000000,
1500
                                     40000000, 135000000,
1501
                                     WIFI_CODE_RATE_3_4,
1501
                                     WIFI_CODE_RATE_3_4,
1502
                                     64);
1502
                                     64);
 Lines 1508-1514    Link Here 
1508
  static WifiMode mode =
1508
  static WifiMode mode =
1509
    WifiModeFactory::CreateWifiMode ("OfdmRate135MbpsBW40MHz",
1509
    WifiModeFactory::CreateWifiMode ("OfdmRate135MbpsBW40MHz",
1510
                                     WIFI_MOD_CLASS_HT,
1510
                                     WIFI_MOD_CLASS_HT,
1511
                                     false,
1511
                                     false, false,
1512
                                     40000000, 135000000,
1512
                                     40000000, 135000000,
1513
                                     WIFI_CODE_RATE_5_6,
1513
                                     WIFI_CODE_RATE_5_6,
1514
                                     64);
1514
                                     64);
 Lines 1521-1527    Link Here 
1521
  static WifiMode mode =
1521
  static WifiMode mode =
1522
    WifiModeFactory::CreateWifiMode ("OfdmRate150MbpsBW40MHz",
1522
    WifiModeFactory::CreateWifiMode ("OfdmRate150MbpsBW40MHz",
1523
                                     WIFI_MOD_CLASS_HT,
1523
                                     WIFI_MOD_CLASS_HT,
1524
                                     false,
1524
                                     false, false,
1525
                                     40000000, 150000000,
1525
                                     40000000, 150000000,
1526
                                     WIFI_CODE_RATE_5_6,
1526
                                     WIFI_CODE_RATE_5_6,
1527
                                     64);
1527
                                     64);
(-)a/src/wifi/model/wifi-phy.h (-2 / +2 lines)
 Lines 160-169    Link Here 
160
  /**
160
  /**
161
   * arg1: packet received successfully
161
   * arg1: packet received successfully
162
   * arg2: snr of packet
162
   * arg2: snr of packet
163
   * arg3: mode of packet
163
   * arg3: TXVECTOR of packet
164
   * arg4: type of preamble used for packet.
164
   * arg4: type of preamble used for packet.
165
   */
165
   */
166
  typedef Callback<void,Ptr<Packet>, double, WifiMode, enum WifiPreamble> RxOkCallback;
166
  typedef Callback<void,Ptr<Packet>, double, WifiTxVector, enum WifiPreamble> RxOkCallback;
167
  /**
167
  /**
168
   * arg1: packet received unsuccessfully
168
   * arg1: packet received unsuccessfully
169
   * arg2: snr of packet
169
   * arg2: snr of packet
(-)a/src/wifi/model/wifi-remote-station-manager.cc (-48 / +8 lines)
 Lines 935-942    Link Here 
935
       i != m_bssBasicRateSet.end (); i++)
935
       i != m_bssBasicRateSet.end (); i++)
936
    {
936
    {
937
      if ((!found || i->GetPhyRate () > mode.GetPhyRate ())
937
      if ((!found || i->GetPhyRate () > mode.GetPhyRate ())
938
          && i->GetPhyRate () <= reqMode.GetPhyRate ()
938
          && (i->GetPhyRate () <= reqMode.GetPhyRate ())
939
          && i->GetModulationClass () == reqMode.GetModulationClass ())
939
          && ((i->GetModulationClass () == reqMode.GetModulationClass ())
940
              || (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT)))
940
        {
941
        {
941
          mode = *i;
942
          mode = *i;
942
          // We've found a potentially-suitable transmit rate, but we
943
          // We've found a potentially-suitable transmit rate, but we
 Lines 945-977    Link Here 
945
          found = true;
946
          found = true;
946
        }
947
        }
947
    }
948
    }
948
  if(HasHtSupported())
949
949
      {
950
        if (!found)
951
          {
952
            uint8_t mcs = GetDefaultMcs (); 
953
            mode=  m_wifiPhy->McsToWifiMode (mcs); 
954
          }
955
        for (WifiMcsListIterator i = m_bssBasicMcsSet.begin ();
956
             i != m_bssBasicMcsSet.end (); i++)
957
          {
958
            WifiMode thismode=  m_wifiPhy->McsToWifiMode (*i); 
959
            if ((!found || thismode.GetPhyRate () > mode.GetPhyRate ())
960
                && thismode.GetPhyRate () <= reqMode.GetPhyRate ()
961
                && thismode.GetModulationClass () == reqMode.GetModulationClass ())
962
              {
963
                mode = thismode;
964
                // We've found a potentially-suitable transmit rate, but we
965
                // need to continue and consider all the basic rates before
966
                // we can be sure we've got the right one.
967
                found = true;
968
              }
969
          }
970
      }
971
  // If we found a suitable rate in the BSSBasicRateSet, then we are
950
  // If we found a suitable rate in the BSSBasicRateSet, then we are
972
  // done and can return that mode.
951
  // done and can return that mode.
973
  if (found)
952
  if (found)
974
    {
953
    {
954
      NS_LOG_DEBUG ("WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
975
      return mode;
955
      return mode;
976
    }
956
    }
977
957
 Lines 1007-1014    Link Here 
1007
       */
987
       */
1008
      if (thismode.IsMandatory ()
988
      if (thismode.IsMandatory ()
1009
          && (!found || thismode.GetPhyRate () > mode.GetPhyRate ())
989
          && (!found || thismode.GetPhyRate () > mode.GetPhyRate ())
1010
          && thismode.GetPhyRate () <= reqMode.GetPhyRate ()
990
          && (thismode.GetPhyRate () <= reqMode.GetPhyRate ())
1011
          && thismode.GetModulationClass () == reqMode.GetModulationClass ())
991
          && ((thismode.GetModulationClass () == reqMode.GetModulationClass ()) ||
992
             (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT)))
1012
        {
993
        {
1013
          mode = thismode;
994
          mode = thismode;
1014
          // As above; we've found a potentially-suitable transmit
995
          // As above; we've found a potentially-suitable transmit
 Lines 1018-1044    Link Here 
1018
          found = true;
999
          found = true;
1019
        }
1000
        }
1020
    }
1001
    }
1021
  if(HasHtSupported())
1022
    {
1023
      for (uint32_t idx = 0; idx < m_wifiPhy->GetNMcs (); idx++)
1024
        {
1025
          uint8_t thismcs = m_wifiPhy->GetMcs (idx);
1026
          WifiMode thismode=  m_wifiPhy->McsToWifiMode (thismcs);
1027
          if (thismode.IsMandatory ()
1028
              && (!found || thismode.GetPhyRate () > mode.GetPhyRate ())
1029
              && thismode.GetPhyRate () <= reqMode.GetPhyRate ()
1030
              && thismode.GetModulationClass () == reqMode.GetModulationClass ())
1031
            {
1032
              mode = thismode;
1033
              // As above; we've found a potentially-suitable transmit
1034
              // rate, but we need to continue and consider all the
1035
              // mandatory rates before we can be sure we've got the right
1036
              // one.
1037
              found = true;
1038
            }
1039
            
1040
        }
1041
    }
1042
1002
1043
  /**
1003
  /**
1044
   * If we still haven't found a suitable rate for the response then
1004
   * If we still haven't found a suitable rate for the response then
(-)a/src/wifi/model/yans-wifi-phy.cc (-4 / +3 lines)
 Lines 530-540    Link Here 
530
530
531
  Ptr<InterferenceHelper::Event> event;
531
  Ptr<InterferenceHelper::Event> event;
532
  event = m_interference.Add (packet->GetSize (),
532
  event = m_interference.Add (packet->GetSize (),
533
                              txMode,
533
                              txVector,
534
                              preamble,
534
                              preamble,
535
                              rxDuration,
535
                              rxDuration,
536
                              rxPowerW,
536
                              rxPowerW);
537
		          txVector);  // we need it to calculate duration of HT training symbols
538
537
539
  switch (m_state->GetState ())
538
  switch (m_state->GetState ())
540
    {
539
    {
 Lines 976-982    Link Here 
976
      double signalDbm = RatioToDb (event->GetRxPowerW ()) + 30;
975
      double signalDbm = RatioToDb (event->GetRxPowerW ()) + 30;
977
      double noiseDbm = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNoiseFigure () + 30;
976
      double noiseDbm = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNoiseFigure () + 30;
978
      NotifyMonitorSniffRx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble, signalDbm, noiseDbm);
977
      NotifyMonitorSniffRx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble, signalDbm, noiseDbm);
979
      m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetPayloadMode (), event->GetPreambleType ());
978
      m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetTxVector (), event->GetPreambleType ());
980
    }
979
    }
981
  else
980
  else
982
    {
981
    {

Return to bug 2097