Ping-Ke Shih <pkshih@xxxxxxxxxxx> writes: > From: Zong-Zhe Yang <kevin_yang@xxxxxxxxxxx> > > 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: Zong-Zhe Yang <kevin_yang@xxxxxxxxxxx> > Signed-off-by: Ping-Ke Shih <pkshih@xxxxxxxxxxx> [...] > + ver_code = buf.mfw_hdr.sig != RTW89_MFW_SIG ? > + RTW89_FW_HDR_VER_CODE(&buf.fw_hdr) : > + RTW89_MFW_HDR_VER_CODE(&buf.mfw_hdr); Nitpicking, but in this case a proper if statement is preferred over a '?' operator. You only save one line with the latter. if (buf.mfw_hdr.sig != RTW89_MFW_SIG) ver_code = RTW89_FW_HDR_VER_CODE(&buf.fw_hdr); else ver_code = RTW89_MFW_HDR_VER_CODE(&buf.mfw_hdr); But no need to resend because of this. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches