diff options
author | chunfan chen <jeffc@marvell.com> | 2016-01-07 10:40:47 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2016-01-29 12:11:31 +0300 |
commit | 2fd5c6ed0b4fbf3c2d9314a24c82862ce5254d42 (patch) | |
tree | 63b9591b8551453fea757bec2c1d9fe5d6485dcc /drivers/net/wireless/marvell/mwifiex/init.c | |
parent | 04654c386145239c8bcb35878b0b0537ce916766 (diff) | |
download | linux-2fd5c6ed0b4fbf3c2d9314a24c82862ce5254d42.tar.xz |
mwifiex: firmware download enhancements
Same chip is being used by WLAN as well as bluetooth
drivers. Each driver needs to check during initialisation
if firmware is already active or it needs to be freshly
downloaded. If one driver has started downloading the
firmware, other finds the winner flag as false.
mwifiex_check_fw_status() checks firmware status and also
check if WLAN is the winner for firmware downloading.
Once we detect that other interface is downloading
the firmware, we call this routine again with max
poll count to wait until firmware is ready.
This patch splits the routine to avoid checking
winner status unnecessarily multiple times and ensures
that correct messages are displayed to user.
Firmware status poll count is also increased to 150.
Signed-off-by: Chunfan Chen <jeffc@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/marvell/mwifiex/init.c')
-rw-r--r-- | drivers/net/wireless/marvell/mwifiex/init.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/wireless/marvell/mwifiex/init.c b/drivers/net/wireless/marvell/mwifiex/init.c index 6f7876ec31b7..517653b3adab 100644 --- a/drivers/net/wireless/marvell/mwifiex/init.c +++ b/drivers/net/wireless/marvell/mwifiex/init.c @@ -741,8 +741,6 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter, u32 poll_num = 1; if (adapter->if_ops.check_fw_status) { - adapter->winner = 0; - /* check if firmware is already running */ ret = adapter->if_ops.check_fw_status(adapter, poll_num); if (!ret) { @@ -750,13 +748,23 @@ int mwifiex_dnld_fw(struct mwifiex_adapter *adapter, "WLAN FW already running! Skip FW dnld\n"); return 0; } + } + + /* check if we are the winner for downloading FW */ + if (adapter->if_ops.check_winner_status) { + adapter->winner = 0; + ret = adapter->if_ops.check_winner_status(adapter); poll_num = MAX_FIRMWARE_POLL_TRIES; + if (ret) { + mwifiex_dbg(adapter, MSG, + "WLAN read winner status failed!\n"); + return ret; + } - /* check if we are the winner for downloading FW */ if (!adapter->winner) { mwifiex_dbg(adapter, MSG, - "FW already running! Skip FW dnld\n"); + "WLAN is not the winner! Skip FW dnld\n"); goto poll_fw; } } |