Skip to content

wifi: WifiMode refactor

Muhammad Iqbal Rochman requested to merge phy-new-arch_mode into phy-new-arch_ppdu

This is a WIP on WifiMode refactor. Current tasks:

  • Fix WifiMode::IsHigherDataRate
  • Split the commit into 3 parts:
    • refactor PHY entities to prepare for WifiMode
    • refactor WifiMode: Implement callback
    • refactor WifiMode: other refactor that is not related to callback (e.g., IsHigherCodeRate and IsHigherDataRate)

IsHigherDataRate problem

I tried to change it to only compare constellation size as per @sderonne suggestion, but it does not work. So I tried to make a "truth table" to investigate the problem.

DSSS HR-DSSS ERP-OFDM OFDM HT VHT HE
DSSS const FALSE FALSE FALSE FALSE FALSE FALSE
HR-DSSS TRUE const const const const const const
ERP-OFDM TRUE !const const & code const & code const & code const & code const & code
OFDM TRUE !const const & code const & code const & code const & code const & code
HT TRUE !const const & code const & code const & code const & code const & code
VHT TRUE !const const & code const & code const & code const & code const & code
HE TRUE !const const & code const & code const & code const & code const & code
  • The first column is the modulation class of current mode, and the first row is the modulation class to be compared to.
  • "const" means it will compare constellation size (i.e., return (GetConstellationSize () > other.GetConstellationSize ());)
  • "!const" means the check is flipped (return (other.GetConstellationSize () > GetConstellationSize ());).
  • "const & code" means it will compare constellation size, and additionally the code rate if both has the same constellation size (i.e., if (GetConstellationSize () == other.GetConstellationSize ()) { return IsHigherCodeRate (other); }).

As we can see, there are some observation:

  • if the current mode is DSSS it always return FALSE, while if the other mode is DSSS it always return TRUE
    • the exception is when both uses DSSS, then compare constellation size
  • if current mode is HR/DSSS then compare constellation size
  • if current mode is > HR/DSSS while other is HR/DSSS, then compare constellation size but flipped (return other > current)
  • if either is at least using ERP-OFDM, then compare constellation size, if both is equal, compare code rate

My reimplementation of this is in commit 289a51d6

Edited by Muhammad Iqbal Rochman

Merge request reports