wifi: No need to indicate whether HT and/or VHT is supported in Extended Capabilities IEs

This commit is contained in:
Sébastien Deronne
2024-01-22 21:26:33 +01:00
committed by Stefano Avallone
parent 25a3714759
commit 6a2b47cf95
3 changed files with 24 additions and 75 deletions

View File

@@ -79,9 +79,7 @@ ExtendedCapabilities::ExtendedCapabilities()
m_protectedQloadReport(0),
m_tdlsWiderBandwidth(0),
m_operatingModeNotification(0),
m_maxNumberOfMsdusInAmsdu(0),
m_htSupported(0),
m_vhtSupported(0)
m_maxNumberOfMsdusInAmsdu(0)
{
}
@@ -97,27 +95,9 @@ ExtendedCapabilities::Print(std::ostream& os) const
os << "Extended Capabilities=" << +GetExtendedCapabilitiesByte1();
}
void
ExtendedCapabilities::SetHtSupported(uint8_t htSupported)
{
m_htSupported = htSupported;
}
void
ExtendedCapabilities::SetVhtSupported(uint8_t vhtSupported)
{
m_vhtSupported = vhtSupported;
}
uint16_t
ExtendedCapabilities::GetInformationFieldSize() const
{
// we should not be here if it is not supported
NS_ASSERT(m_htSupported > 0 || m_vhtSupported > 0);
if (!m_vhtSupported)
{
return 1;
}
return 8;
}
@@ -334,23 +314,15 @@ ExtendedCapabilities::GetExtendedCapabilitiesByte8() const
void
ExtendedCapabilities::SerializeInformationField(Buffer::Iterator start) const
{
if (m_htSupported > 0 && m_vhtSupported == 0)
{
// write the corresponding value for each bit
start.WriteU8(GetExtendedCapabilitiesByte1() & 0x7f);
}
else if (m_vhtSupported > 0)
{
// write the corresponding value for each bit
start.WriteU8(GetExtendedCapabilitiesByte1());
start.WriteU8(GetExtendedCapabilitiesByte2());
start.WriteU8(GetExtendedCapabilitiesByte3());
start.WriteU8(GetExtendedCapabilitiesByte4());
start.WriteU8(GetExtendedCapabilitiesByte5());
start.WriteU8(GetExtendedCapabilitiesByte6());
start.WriteU8(GetExtendedCapabilitiesByte7());
start.WriteU8(GetExtendedCapabilitiesByte8());
}
// write the corresponding value for each bit
start.WriteU8(GetExtendedCapabilitiesByte1());
start.WriteU8(GetExtendedCapabilitiesByte2());
start.WriteU8(GetExtendedCapabilitiesByte3());
start.WriteU8(GetExtendedCapabilitiesByte4());
start.WriteU8(GetExtendedCapabilitiesByte5());
start.WriteU8(GetExtendedCapabilitiesByte6());
start.WriteU8(GetExtendedCapabilitiesByte7());
start.WriteU8(GetExtendedCapabilitiesByte8());
}
uint16_t
@@ -358,24 +330,21 @@ ExtendedCapabilities::DeserializeInformationField(Buffer::Iterator start, uint16
{
Buffer::Iterator i = start;
uint8_t byte1 = i.ReadU8();
uint8_t byte2 = i.ReadU8();
uint8_t byte3 = i.ReadU8();
uint8_t byte4 = i.ReadU8();
uint8_t byte5 = i.ReadU8();
uint8_t byte6 = i.ReadU8();
uint8_t byte7 = i.ReadU8();
uint8_t byte8 = i.ReadU8();
SetExtendedCapabilitiesByte1(byte1);
if (m_vhtSupported > 0)
{
uint8_t byte2 = i.ReadU8();
uint8_t byte3 = i.ReadU8();
uint8_t byte4 = i.ReadU8();
uint8_t byte5 = i.ReadU8();
uint8_t byte6 = i.ReadU8();
uint8_t byte7 = i.ReadU8();
uint8_t byte8 = i.ReadU8();
SetExtendedCapabilitiesByte2(byte2);
SetExtendedCapabilitiesByte3(byte3);
SetExtendedCapabilitiesByte4(byte4);
SetExtendedCapabilitiesByte5(byte5);
SetExtendedCapabilitiesByte6(byte6);
SetExtendedCapabilitiesByte7(byte7);
SetExtendedCapabilitiesByte8(byte8);
}
SetExtendedCapabilitiesByte2(byte2);
SetExtendedCapabilitiesByte3(byte3);
SetExtendedCapabilitiesByte4(byte4);
SetExtendedCapabilitiesByte5(byte5);
SetExtendedCapabilitiesByte6(byte6);
SetExtendedCapabilitiesByte7(byte7);
SetExtendedCapabilitiesByte8(byte8);
return length;
}

View File

@@ -42,18 +42,6 @@ class ExtendedCapabilities : public WifiInformationElement
void SerializeInformationField(Buffer::Iterator start) const override;
uint16_t DeserializeInformationField(Buffer::Iterator start, uint16_t length) override;
void Print(std::ostream& os) const override;
/**
* Set the HT Supported flag.
*
* \param htSupported flag whether HT is supported
*/
void SetHtSupported(uint8_t htSupported);
/**
* Set the VHT Supported flag.
*
* \param vhtSupported flag whether VHT is supported
*/
void SetVhtSupported(uint8_t vhtSupported);
/**
* Set the first byte in the Extended Capabilities information element.
@@ -160,7 +148,6 @@ class ExtendedCapabilities : public WifiInformationElement
uint8_t m_psmpCapability; ///< PSMP Capability
uint8_t m_spsmpSupport; ///< S-PSMP Support
// fields if VHT supported
uint8_t m_event; ///< Event
uint8_t m_diagnostics; ///< Diagnostics
uint8_t m_multicastDiagnostics; ///< Multicast Diagnostics
@@ -220,11 +207,6 @@ class ExtendedCapabilities : public WifiInformationElement
uint8_t m_tdlsWiderBandwidth; ///< TDLS Wider Bandwidth
uint8_t m_operatingModeNotification; ///< Operating Mode Notification
uint8_t m_maxNumberOfMsdusInAmsdu; ///< Max Number Of MSDUs In A-MSDU
uint8_t m_htSupported; ///< Flag to indicate HT is supported in order to decide whether this
///< element should be added to the frame or not
uint8_t m_vhtSupported; ///< Flag to indicate VHT is supported in order to decide whether this
///< element should be added to the frame or not
};
} // namespace ns3

View File

@@ -2093,8 +2093,6 @@ WifiMac::GetExtendedCapabilities() const
{
NS_LOG_FUNCTION(this);
ExtendedCapabilities capabilities;
capabilities.SetHtSupported(GetHtSupported(SINGLE_LINK_OP_ID));
capabilities.SetVhtSupported(GetVhtSupported(SINGLE_LINK_OP_ID));
// TODO: to be completed
return capabilities;
}