• Zong-Zhe Yang's avatar
    wifi: rtw89: early recognize FW feature to decide if chanctx · deebea35
    Zong-Zhe Yang authored
    In current flow, FW is asynchronously loaded after alloc_hw(). It defers
    the decision on FW feature map. It makes things difficult for us to decide
    whether to hook chanctx ops, which should be decided while alloc_hw() is
    calling. Still, asynchronous gets its advantages. So, we want to resolve
    this without dropping them.
    
    Based on multi-FW flag, RTW89_MFW_SIG, we can determine runtime FW is
    multi-FW (MFW) or single FW (SFW). Both of them have a quite small chunk
    for header at the head. The difference is that MFW doesn't describe version
    code in its header while SFW does. So, we plan to extend MFW header for
    version code. After that, in both cases, we can determine FW feature map by
    just FW header. And, according to the map, we can decide chanctx.
    
    So, we call request_partial_firmware_into_buf() to request a quite small
    chunk before alloc_hw() to get a early FW feature map without affecting
    things much and only use early map to decide whether to hook chanctx ops.
    
    It means that if non-extended MFW is used at runtime, driver just acts
    without chanctx as before. If extended MFW or SFW, which supports required
    FW features, is used at runtime, driver can hook chanctx ops to mac80211 if
    chip has configured support_chanctx_num > 0.
    
    Besides, key point for now to support single one chanctx is whether HW scan
    is supported at runtime. So, we configure all chip's support_chanctx_num to
    1, and check if HW scan is supported at runtime via early FW feature map.
    Signed-off-by: default avatarZong-Zhe Yang <kevin_yang@realtek.com>
    Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
    Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
    Link: https://lore.kernel.org/r/20220809104952.61355-14-pkshih@realtek.com
    deebea35
core.c 94.6 KB