aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-07-23 13:24:44 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-08 16:04:02 -0400
commit5d7969bf2bce73fdb91bd53ad39b1f0ab43f5ce3 (patch)
treea3d254a0af08426c4ab8ba114106e5f5821b45e0
parent306584c038c2d801a2be772807a89d6a397f0938 (diff)
iwlagn: separate firmware version warning
We sometimes need to support new firmware API for a while before we can publish them since testing them fully takes a long time. We could keep all the new code private, but that causes plenty of problems and sometimes we can give a pre-release version of firmware to people who need to test. However, when we just bump the API version, the driver will warn everybody that their firmware is outdated, when in fact it isn't. (Currently our case for this doesn't really change the API but bumping the API version is necessary because the firmware isn't fully backward compatible) In order to handle this in the future, add a new "api_ok" version; only below this will the driver warn that the uCode is too old. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c24
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h3
2 files changed, 20 insertions, 7 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 5ad85b2a213a..44400f9aa7b9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -951,6 +951,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
951 int err; 951 int err;
952 struct iwlagn_firmware_pieces pieces; 952 struct iwlagn_firmware_pieces pieces;
953 const unsigned int api_max = priv->cfg->ucode_api_max; 953 const unsigned int api_max = priv->cfg->ucode_api_max;
954 unsigned int api_ok = priv->cfg->ucode_api_ok;
954 const unsigned int api_min = priv->cfg->ucode_api_min; 955 const unsigned int api_min = priv->cfg->ucode_api_min;
955 u32 api_ver; 956 u32 api_ver;
956 char buildstr[25]; 957 char buildstr[25];
@@ -961,10 +962,13 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
961 IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE, 962 IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE,
962 }; 963 };
963 964
965 if (!api_ok)
966 api_ok = api_max;
967
964 memset(&pieces, 0, sizeof(pieces)); 968 memset(&pieces, 0, sizeof(pieces));
965 969
966 if (!ucode_raw) { 970 if (!ucode_raw) {
967 if (priv->fw_index <= priv->cfg->ucode_api_max) 971 if (priv->fw_index <= api_ok)
968 IWL_ERR(priv, 972 IWL_ERR(priv,
969 "request for firmware file '%s' failed.\n", 973 "request for firmware file '%s' failed.\n",
970 priv->firmware_name); 974 priv->firmware_name);
@@ -1010,12 +1014,18 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1010 goto try_again; 1014 goto try_again;
1011 } 1015 }
1012 1016
1013 if (api_ver != api_max) 1017 if (api_ver < api_ok) {
1014 IWL_ERR(priv, 1018 if (api_ok != api_max)
1015 "Firmware has old API version. Expected v%u, " 1019 IWL_ERR(priv, "Firmware has old API version, "
1016 "got v%u. New firmware can be obtained " 1020 "expected v%u through v%u, got v%u.\n",
1017 "from http://www.intellinuxwireless.org.\n", 1021 api_ok, api_max, api_ver);
1018 api_max, api_ver); 1022 else
1023 IWL_ERR(priv, "Firmware has old API version, "
1024 "expected v%u, got v%u.\n",
1025 api_max, api_ver);
1026 IWL_ERR(priv, "New firmware can be obtained from "
1027 "http://www.intellinuxwireless.org/.\n");
1028 }
1019 } 1029 }
1020 1030
1021 if (build) 1031 if (build)
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 02817a438550..0e5be5abb005 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -194,6 +194,8 @@ struct iwl_ht_params {
194 * (.ucode) will be added to filename before loading from disk. The 194 * (.ucode) will be added to filename before loading from disk. The
195 * filename is constructed as fw_name_pre<api>.ucode. 195 * filename is constructed as fw_name_pre<api>.ucode.
196 * @ucode_api_max: Highest version of uCode API supported by driver. 196 * @ucode_api_max: Highest version of uCode API supported by driver.
197 * @ucode_api_ok: oldest version of the uCode API that is OK to load
198 * without a warning, for use in transitions
197 * @ucode_api_min: Lowest version of uCode API supported by driver. 199 * @ucode_api_min: Lowest version of uCode API supported by driver.
198 * @valid_tx_ant: valid transmit antenna 200 * @valid_tx_ant: valid transmit antenna
199 * @valid_rx_ant: valid receive antenna 201 * @valid_rx_ant: valid receive antenna
@@ -237,6 +239,7 @@ struct iwl_cfg {
237 const char *name; 239 const char *name;
238 const char *fw_name_pre; 240 const char *fw_name_pre;
239 const unsigned int ucode_api_max; 241 const unsigned int ucode_api_max;
242 const unsigned int ucode_api_ok;
240 const unsigned int ucode_api_min; 243 const unsigned int ucode_api_min;
241 u8 valid_tx_ant; 244 u8 valid_tx_ant;
242 u8 valid_rx_ant; 245 u8 valid_rx_ant;