• Michael-CY Lee's avatar
    wifi: mac80211: refactor STA CSA parsing flows · 21c3f8f9
    Michael-CY Lee authored
    The new Wi-Fi Standard (IEEE Std 802.11-2020 9.4.2.160) specifies that
    the Wide Bandwidth Channel Switch (WBCS) Element subfields have the same
    definitions as VHT operation information if the operating band is not
    S1G.
    
    The problem comes when the BSS is in 6 GHz band, the STA parses the WBCS
    Element by ieee80211_chandef_vht_oper(), which checks the capabilities for
    HT/VHT mode, not HE/EHT mode.
    
    This patch refactors STA CSA parsing flow so that the corresponding
    capabilities can be checked. Also, it adds the way to use op_class in ECSA
    Element to build a new chandef.
    
    In summary, the new steps for STA to handle CSA event are:
    1. build the new chandef from one of the CSA-related (Sub)Elements in
       following order,
       - Bandwidth Indication (Sub)Element
       - Wide Bandwidth Channel Switch (Sub)Element
       - Operating class in Extended Channel Switch Announcement Element
       - Channel Switch Announcement Element
    2. convert the new chandef into operation information according to the
       operating band in order to check if the new chandef fits STA's
       capabilities.
    3. downgrade the bandwidth until current bandwidth is not disabled.
    Co-developed-by: default avatarMoney Wang <money.wang@mediatek.com>
    Signed-off-by: default avatarMichael-CY Lee <michael-cy.lee@mediatek.com>
    Link: https://msgid.link/20231222010914.6521-3-michael-cy.lee@mediatek.com
    [rebase on top of the changes with struct ieee80211_conn_settings,
     prefer leXY_encode_bits()]
    Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    21c3f8f9
spectmgmt.c 13.8 KB