wifi: Add linkId parameter to GetVhtSupported()
VHT is only supported on links operating on a band other than 2.4 GHz.
This commit is contained in:
committed by
Stefano Avallone
parent
72d5720f60
commit
d239dacb9b
@@ -168,12 +168,12 @@ OcbWifiMac::Enqueue (Ptr<Packet> packet, Mac48Address to)
|
||||
{
|
||||
//In ad hoc mode, we assume that every destination supports all
|
||||
//the rates we support.
|
||||
if (GetHtSupported () || GetVhtSupported ())
|
||||
if (GetHtSupported () || GetVhtSupported (SINGLE_LINK_OP_ID))
|
||||
{
|
||||
GetWifiRemoteStationManager ()->AddAllSupportedMcs (to);
|
||||
GetWifiRemoteStationManager ()->AddStationHtCapabilities (to, GetHtCapabilities(SINGLE_LINK_OP_ID));
|
||||
}
|
||||
if (GetVhtSupported ())
|
||||
if (GetVhtSupported (SINGLE_LINK_OP_ID))
|
||||
{
|
||||
GetWifiRemoteStationManager ()->AddStationVhtCapabilities (to, GetVhtCapabilities(SINGLE_LINK_OP_ID));
|
||||
}
|
||||
@@ -216,7 +216,7 @@ OcbWifiMac::Enqueue (Ptr<Packet> packet, Mac48Address to)
|
||||
hdr.SetType (WIFI_MAC_DATA);
|
||||
}
|
||||
|
||||
if (GetHtSupported () || GetVhtSupported ())
|
||||
if (GetHtSupported () || GetVhtSupported (SINGLE_LINK_OP_ID))
|
||||
{
|
||||
hdr.SetNoOrder (); // explicitly set to 0 for the time being since HT/VHT/HE control field is not yet implemented (set it to 1 when implemented)
|
||||
}
|
||||
@@ -260,12 +260,12 @@ OcbWifiMac::Receive (Ptr<WifiMpdu> mpdu, uint8_t linkId)
|
||||
{
|
||||
//In ad hoc mode, we assume that every destination supports all
|
||||
//the rates we support.
|
||||
if (GetHtSupported () || GetVhtSupported ())
|
||||
if (GetHtSupported () || GetVhtSupported (SINGLE_LINK_OP_ID))
|
||||
{
|
||||
GetWifiRemoteStationManager ()->AddAllSupportedMcs (from);
|
||||
GetWifiRemoteStationManager ()->AddStationHtCapabilities (from, GetHtCapabilities(SINGLE_LINK_OP_ID));
|
||||
}
|
||||
if (GetVhtSupported ())
|
||||
if (GetVhtSupported (SINGLE_LINK_OP_ID))
|
||||
{
|
||||
GetWifiRemoteStationManager ()->AddStationVhtCapabilities (from, GetVhtCapabilities(SINGLE_LINK_OP_ID));
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ AdhocWifiMac::Enqueue (Ptr<Packet> packet, Mac48Address to)
|
||||
GetWifiRemoteStationManager ()->AddAllSupportedMcs (to);
|
||||
GetWifiRemoteStationManager ()->AddStationHtCapabilities (to, GetHtCapabilities (SINGLE_LINK_OP_ID));
|
||||
}
|
||||
if (GetVhtSupported ())
|
||||
if (GetVhtSupported (SINGLE_LINK_OP_ID))
|
||||
{
|
||||
GetWifiRemoteStationManager ()->AddStationVhtCapabilities (to, GetVhtCapabilities (SINGLE_LINK_OP_ID));
|
||||
}
|
||||
@@ -180,7 +180,7 @@ AdhocWifiMac::Receive (Ptr<WifiMpdu> mpdu, uint8_t linkId)
|
||||
GetWifiRemoteStationManager ()->AddAllSupportedMcs (from);
|
||||
GetWifiRemoteStationManager ()->AddStationHtCapabilities (from, GetHtCapabilities (SINGLE_LINK_OP_ID));
|
||||
}
|
||||
if (GetVhtSupported ())
|
||||
if (GetVhtSupported (SINGLE_LINK_OP_ID))
|
||||
{
|
||||
GetWifiRemoteStationManager ()->AddStationVhtCapabilities (from, GetVhtCapabilities (SINGLE_LINK_OP_ID));
|
||||
}
|
||||
|
||||
@@ -764,7 +764,7 @@ VhtOperation
|
||||
ApWifiMac::GetVhtOperation (uint8_t linkId) const
|
||||
{
|
||||
NS_LOG_FUNCTION (this << +linkId);
|
||||
NS_ASSERT (GetVhtSupported ());
|
||||
NS_ASSERT (GetVhtSupported (linkId));
|
||||
VhtOperation operation;
|
||||
auto phy = GetWifiPhy (linkId);
|
||||
auto remoteStationManager = GetWifiRemoteStationManager (linkId);
|
||||
@@ -871,7 +871,7 @@ ApWifiMac::SendProbeResp (Mac48Address to, uint8_t linkId)
|
||||
probe.SetHtCapabilities (GetHtCapabilities (linkId));
|
||||
probe.SetHtOperation (GetHtOperation (linkId));
|
||||
}
|
||||
if (GetVhtSupported ())
|
||||
if (GetVhtSupported (SINGLE_LINK_OP_ID))
|
||||
{
|
||||
probe.SetVhtCapabilities (GetVhtCapabilities (linkId));
|
||||
probe.SetVhtOperation (GetVhtOperation (linkId));
|
||||
@@ -970,7 +970,7 @@ ApWifiMac::GetAssocResp (Mac48Address to, uint8_t linkId)
|
||||
assoc.SetHtCapabilities (GetHtCapabilities (linkId));
|
||||
assoc.SetHtOperation (GetHtOperation (linkId));
|
||||
}
|
||||
if (GetVhtSupported ())
|
||||
if (GetVhtSupported (linkId))
|
||||
{
|
||||
assoc.SetVhtCapabilities (GetVhtCapabilities (linkId));
|
||||
assoc.SetVhtOperation (GetVhtOperation (linkId));
|
||||
@@ -1234,7 +1234,7 @@ ApWifiMac::SendOneBeacon (uint8_t linkId)
|
||||
beacon.SetHtCapabilities (GetHtCapabilities (linkId));
|
||||
beacon.SetHtOperation (GetHtOperation (linkId));
|
||||
}
|
||||
if (GetVhtSupported ())
|
||||
if (GetVhtSupported (linkId))
|
||||
{
|
||||
beacon.SetVhtCapabilities (GetVhtCapabilities (linkId));
|
||||
beacon.SetVhtOperation (GetVhtOperation (linkId));
|
||||
@@ -1589,7 +1589,7 @@ ApWifiMac::ReceiveAssocRequest (const AssocReqRefVariant& assoc, const Mac48Addr
|
||||
}
|
||||
}
|
||||
}
|
||||
if (GetVhtSupported ())
|
||||
if (GetVhtSupported (linkId))
|
||||
{
|
||||
//check whether the VHT STA supports all MCSs in Basic MCS Set
|
||||
const auto& vhtCapabilities = frame.GetVhtCapabilities ();
|
||||
@@ -1653,7 +1653,7 @@ ApWifiMac::ReceiveAssocRequest (const AssocReqRefVariant& assoc, const Mac48Addr
|
||||
// const ExtendedCapabilities& extendedCapabilities = frame.GetExtendedCapabilities ();
|
||||
//TODO: to be completed
|
||||
}
|
||||
if (GetVhtSupported ())
|
||||
if (GetVhtSupported (linkId))
|
||||
{
|
||||
const auto& vhtCapabilities = frame.GetVhtCapabilities ();
|
||||
//we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
|
||||
|
||||
@@ -234,7 +234,7 @@ StaWifiMac::SendProbeRequest (void)
|
||||
probe.SetExtendedCapabilities (GetExtendedCapabilities ());
|
||||
probe.SetHtCapabilities (GetHtCapabilities (SINGLE_LINK_OP_ID));
|
||||
}
|
||||
if (GetVhtSupported ())
|
||||
if (GetVhtSupported (SINGLE_LINK_OP_ID))
|
||||
{
|
||||
probe.SetVhtCapabilities (GetVhtCapabilities (SINGLE_LINK_OP_ID));
|
||||
}
|
||||
@@ -296,7 +296,7 @@ StaWifiMac::GetAssociationRequest (bool isReassoc, uint8_t linkId) const
|
||||
frame.SetExtendedCapabilities (GetExtendedCapabilities ());
|
||||
frame.SetHtCapabilities (GetHtCapabilities (linkId));
|
||||
}
|
||||
if (GetVhtSupported ())
|
||||
if (GetVhtSupported (linkId))
|
||||
{
|
||||
frame.SetVhtCapabilities (GetVhtCapabilities (linkId));
|
||||
}
|
||||
@@ -1129,7 +1129,7 @@ StaWifiMac::UpdateApInfo (const MgtFrameType& frame, const Mac48Address& apAddr,
|
||||
|
||||
// we do not return if VHT is not supported because HE STAs operating in
|
||||
// the 2.4 GHz band do not support VHT
|
||||
if (GetVhtSupported ())
|
||||
if (GetVhtSupported (linkId))
|
||||
{
|
||||
const auto& vhtCapabilities = frame.GetVhtCapabilities ();
|
||||
//we will always fill in RxHighestSupportedLgiDataRate field at TX, so this can be used to check whether it supports VHT
|
||||
|
||||
@@ -1198,43 +1198,28 @@ WifiMac::GetEhtConfiguration (void) const
|
||||
}
|
||||
|
||||
bool
|
||||
WifiMac::GetHtSupported () const
|
||||
WifiMac::GetHtSupported (void) const
|
||||
{
|
||||
if (GetHtConfiguration ())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return bool (GetDevice ()->GetHtConfiguration ());
|
||||
}
|
||||
|
||||
bool
|
||||
WifiMac::GetVhtSupported () const
|
||||
WifiMac::GetVhtSupported (uint8_t linkId) const
|
||||
{
|
||||
if (GetVhtConfiguration ())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return (GetDevice ()->GetVhtConfiguration ()
|
||||
&& GetWifiPhy (linkId)->GetPhyBand () != WIFI_PHY_BAND_2_4GHZ);
|
||||
}
|
||||
|
||||
bool
|
||||
WifiMac::GetHeSupported () const
|
||||
{
|
||||
if (GetHeConfiguration ())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return bool (GetDevice ()->GetHeConfiguration ());
|
||||
}
|
||||
|
||||
bool
|
||||
WifiMac::GetEhtSupported () const
|
||||
{
|
||||
if (GetEhtConfiguration ())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return bool (GetDevice ()->GetEhtConfiguration ());
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1323,7 +1308,7 @@ WifiMac::GetExtendedCapabilities (void) const
|
||||
NS_LOG_FUNCTION (this);
|
||||
ExtendedCapabilities capabilities;
|
||||
capabilities.SetHtSupported (GetHtSupported ());
|
||||
capabilities.SetVhtSupported (GetVhtSupported ());
|
||||
capabilities.SetVhtSupported (GetVhtSupported (SINGLE_LINK_OP_ID));
|
||||
//TODO: to be completed
|
||||
return capabilities;
|
||||
}
|
||||
@@ -1388,7 +1373,7 @@ VhtCapabilities
|
||||
WifiMac::GetVhtCapabilities (uint8_t linkId) const
|
||||
{
|
||||
NS_LOG_FUNCTION (this << +linkId);
|
||||
NS_ASSERT (GetVhtSupported ());
|
||||
NS_ASSERT (GetVhtSupported (linkId));
|
||||
VhtCapabilities capabilities;
|
||||
|
||||
auto phy = GetWifiPhy (linkId);
|
||||
|
||||
@@ -471,11 +471,12 @@ public:
|
||||
*/
|
||||
bool GetHtSupported () const;
|
||||
/**
|
||||
* Return whether the device supports VHT.
|
||||
* Return whether the device supports VHT on the given link.
|
||||
*
|
||||
* \param linkId the ID of the given link.
|
||||
* \return true if VHT is supported, false otherwise
|
||||
*/
|
||||
bool GetVhtSupported () const;
|
||||
bool GetVhtSupported (uint8_t linkId) const;
|
||||
/**
|
||||
* Return whether the device supports HE.
|
||||
*
|
||||
|
||||
@@ -593,8 +593,7 @@ WifiNetDevice::SetVhtConfiguration (Ptr<VhtConfiguration> vhtConfiguration)
|
||||
Ptr<VhtConfiguration>
|
||||
WifiNetDevice::GetVhtConfiguration (void) const
|
||||
{
|
||||
return (m_standard >= WIFI_STANDARD_80211ac && m_phys[SINGLE_LINK_OP_ID]->GetPhyBand () == WIFI_PHY_BAND_5GHZ
|
||||
? m_vhtConfiguration : nullptr);
|
||||
return (m_standard >= WIFI_STANDARD_80211ac ? m_vhtConfiguration : nullptr);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -238,7 +238,8 @@ WifiRemoteStationManager::GetHtSupported (void) const
|
||||
bool
|
||||
WifiRemoteStationManager::GetVhtSupported (void) const
|
||||
{
|
||||
return bool (m_wifiPhy->GetDevice ()->GetVhtConfiguration ());
|
||||
return (m_wifiPhy->GetDevice ()->GetVhtConfiguration ()
|
||||
&& m_wifiPhy->GetPhyBand () != WIFI_PHY_BAND_2_4GHZ);
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user