2016-04-25 17:34:38

by Luca Coelho

[permalink] [raw]
Subject: [PATCH] iwlwifi: fix fw version reading for DVM devices

From: Luca Coelho <[email protected]>

In commit 97f95c93c8ed ("iwlwifi: remove support for fw older than
-16.ucode") we accidentally changed the fw version reading code for
DVM devices. The code intended to remove the old fw version API,
because all MVM firmwares version 16 and above that we support don't
use it anymore. But DVM devices still use the old FW API.

Fix that by bringing the code back in.

Reported-by: Pat Erley <[email protected]>
Fixes: 97f95c93c8ed ("iwlwifi: remove support for fw older than-16.ucode")
Signed-off-by: Luca Coelho <[email protected]>
---
drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 5 ++++-
drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index 48e8737..4f495d9 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -1280,7 +1280,10 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
if (err)
goto try_again;

- api_ver = drv->fw.ucode_ver;
+ if (fw_has_api(&drv->fw.ucode_capa, IWL_UCODE_TLV_API_NEW_VERSION))
+ api_ver = drv->fw.ucode_ver;
+ else
+ api_ver = IWL_UCODE_API(drv->fw.ucode_ver);

/*
* api_ver should match the api version forming part of the
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h b/drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h
index 843232b..37dc09e 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-fw-file.h
@@ -251,6 +251,7 @@ typedef unsigned int __bitwise__ iwl_ucode_tlv_api_t;
* @IWL_UCODE_TLV_API_WIFI_MCC_UPDATE: ucode supports MCC updates with source.
* @IWL_UCODE_TLV_API_WIDE_CMD_HDR: ucode supports wide command header
* @IWL_UCODE_TLV_API_LQ_SS_PARAMS: Configure STBC/BFER via LQ CMD ss_params
+ * @IWL_UCODE_TLV_API_NEW_VERSION: new versioning format
* @IWL_UCODE_TLV_API_EXT_SCAN_PRIORITY: scan APIs use 8-level priority
* instead of 3.
* @IWL_UCODE_TLV_API_TX_POWER_CHAIN: TX power API has larger command size
@@ -263,6 +264,7 @@ enum iwl_ucode_tlv_api {
IWL_UCODE_TLV_API_WIFI_MCC_UPDATE = (__force iwl_ucode_tlv_api_t)9,
IWL_UCODE_TLV_API_WIDE_CMD_HDR = (__force iwl_ucode_tlv_api_t)14,
IWL_UCODE_TLV_API_LQ_SS_PARAMS = (__force iwl_ucode_tlv_api_t)18,
+ IWL_UCODE_TLV_API_NEW_VERSION = (__force iwl_ucode_tlv_api_t)20,
IWL_UCODE_TLV_API_EXT_SCAN_PRIORITY = (__force iwl_ucode_tlv_api_t)24,
IWL_UCODE_TLV_API_TX_POWER_CHAIN = (__force iwl_ucode_tlv_api_t)27,

--
2.8.0.rc3



2016-04-26 09:33:10

by Kalle Valo

[permalink] [raw]
Subject: Re: iwlwifi: fix fw version reading for DVM devices


> From: Luca Coelho <[email protected]>
>
> In commit 97f95c93c8ed ("iwlwifi: remove support for fw older than
> -16.ucode") we accidentally changed the fw version reading code for
> DVM devices. The code intended to remove the old fw version API,
> because all MVM firmwares version 16 and above that we support don't
> use it anymore. But DVM devices still use the old FW API.
>
> Fix that by bringing the code back in.
>
> Reported-by: Pat Erley <[email protected]>
> Tested-by: Kalle Valo <[email protected]>
> Fixes: 97f95c93c8ed ("iwlwifi: remove support for fw older than-16.ucode")
> Signed-off-by: Luca Coelho <[email protected]>

Thanks, applied to wireless-drivers-next.git.

Kalle Valo

2016-04-26 07:28:22

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH] iwlwifi: fix fw version reading for DVM devices

T24gTW9uLCAyMDE2LTA0LTI1IGF0IDIwOjAyICswMzAwLCBMdWNhIENvZW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