wifi: rtw89: use schedule_work to request firmware
authorPing-Ke Shih <pkshih@realtek.com>
Mon, 20 Mar 2023 13:06:05 +0000 (21:06 +0800)
committerKalle Valo <kvalo@kernel.org>
Fri, 14 Apr 2023 12:13:59 +0000 (15:13 +0300)
commitb80ad23a8f2e0b63384cadc0aa2c1135b1dc03eb
tree811ecd64b891335ce6c0477414824c292c5e8723
parent639ec6d63588b7e7c2dfae1df447daf243fb8342
wifi: rtw89: use schedule_work to request firmware

Since we are going to load more than one firmware and some are not
presented or optional, using asynchronous API request_firmware_nowait()
will become complicated. Also, we want to use firmware_request_nowarn()
to avoid warning messages when loading optional files. So, use
schedule_work to be simpler.

To abstract loading a firmware or file, define a struct rtw89_fw_req_info
containing a struct firmware and a completion to ensure this firmware is
loaded completely.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230320130606.20777-3-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.c
drivers/net/wireless/realtek/rtw89/core.h
drivers/net/wireless/realtek/rtw89/fw.c
drivers/net/wireless/realtek/rtw89/fw.h