wifi: rtw89: use struct to parse firmware header
Ping-Ke Shih
maintainerPATCH 1/1 wifi: rtw89: use struct to parse firmware header
A firmware contains basic header, sections and optional dynamic header. Define them by a struct, so it will be easier to understand the layout, and also simply access these elements.
Signed-off-by Ping-Ke Shih <[email protected]>
--- drivers/net/wireless/realtek/rtw89/core.h | 8 +- drivers/net/wireless/realtek/rtw89/fw.c | 58 +++++++------ drivers/net/wireless/realtek/rtw89/fw.h | 101 ++++++++++++---------- 3 files changed, 87 insertions(+), 80 deletions(-)
drivers/net/wireless/realtek/rtw89/core.h +4 -4
@@ -3387,10 +3387,10 @@ struct rtw89_fw_suit { (mfw_hdr)->ver.idx)#define RTW89_FW_HDR_VER_CODE (fw_hdr) \ - RTW89_FW_VER_CODE(GET_FW_HDR_MAJOR_VERSION(fw_hdr), \ - GET_FW_HDR_MINOR_VERSION(fw_hdr), \ - GET_FW_HDR_SUBVERSION(fw_hdr), \ - GET_FW_HDR_SUBINDEX(fw_hdr)) + RTW89_FW_VER_CODE(le32_get_bits((fw_hdr)->w1, FW_HDR_W1_MAJOR_VERSION), \ + le32_get_bits((fw_hdr)->w1, FW_HDR_W1_MINOR_VERSION), \ + le32_get_bits((fw_hdr)->w1, FW_HDR_W1_SUBVERSION), \ + le32_get_bits((fw_hdr)->w1, FW_HDR_W1_SUBINDEX))struct rtw89_fw_req_info {const struct firmware *firmware;
drivers/net/wireless/realtek/rtw89/fw.c +30 -28
99 lines not on this page · raw message
drivers/net/wireless/realtek/rtw89/fw.h +53 -48
119 lines not on this page · raw message
Signature · 1 line
2.25.1
Quoted 5 lines · Ping-Ke Shih
A firmware contains basic header, sections and optional dynamic header. Define them by a struct, so it will be easier to understand the layout, and also simply access these elements.
Signed-off-by Ping-Ke Shih <[email protected]>
Patch applied to wireless-next.git, thanks.
f072eb39e4f2 wifi: rtw89: use struct to parse firmware header
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches