diff options
author | Jay Sternberg <jay.e.sternberg@intel.com> | 2010-08-12 13:24:07 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-08-24 16:32:03 -0400 |
commit | 3939608591d1d0cbb79d7afd08beabcfb5eb115f (patch) | |
tree | 58e676ff3a6a7896108b1d227bf7a9e34d87c791 | |
parent | 79e88e79a29abede50bf82064ad9d9b1a625e42a (diff) |
iwlwifi: enable experimental ucode support
ucode firmware may need to be released as experimental for testing or
debugging. released ucode filenames have the API version as the last
component. experimental ucode files will have that component be "exp"
and the fw_version string reported by ethtool will also contain the
string EXP to clearly identify this ucode from released ucode.
EXP is short for EXPERIMENTAL since fw_version has a max lenght on 32.
this capability is controlled by Kconfig and defaulted to not be used.
Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/Kconfig | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 33 |
2 files changed, 31 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/Kconfig b/drivers/net/wireless/iwlwifi/Kconfig index a51e4da1bdfc..7ab5b51951ff 100644 --- a/drivers/net/wireless/iwlwifi/Kconfig +++ b/drivers/net/wireless/iwlwifi/Kconfig | |||
@@ -36,6 +36,12 @@ config IWLWIFI_DEBUGFS | |||
36 | is a low-impact option that allows getting insight into the | 36 | is a low-impact option that allows getting insight into the |
37 | driver's state at runtime. | 37 | driver's state at runtime. |
38 | 38 | ||
39 | config IWLWIFI_DEBUG_EXPERIMENTAL_UCODE | ||
40 | bool "Experimental uCode support" | ||
41 | depends on IWLWIFI && IWLWIFI_DEBUG | ||
42 | ---help--- | ||
43 | Enable use of experimental ucode for testing and debugging. | ||
44 | |||
39 | config IWLWIFI_DEVICE_TRACING | 45 | config IWLWIFI_DEVICE_TRACING |
40 | bool "iwlwifi device access tracing" | 46 | bool "iwlwifi device access tracing" |
41 | depends on IWLWIFI | 47 | depends on IWLWIFI |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index f832535c3a47..40b82d9f309e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1659,24 +1659,37 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context); | |||
1659 | static int iwl_mac_setup_register(struct iwl_priv *priv, | 1659 | static int iwl_mac_setup_register(struct iwl_priv *priv, |
1660 | struct iwlagn_ucode_capabilities *capa); | 1660 | struct iwlagn_ucode_capabilities *capa); |
1661 | 1661 | ||
1662 | #define UCODE_EXPERIMENTAL_INDEX 100 | ||
1663 | #define UCODE_EXPERIMENTAL_TAG "exp" | ||
1664 | |||
1662 | static int __must_check iwl_request_firmware(struct iwl_priv *priv, bool first) | 1665 | static int __must_check iwl_request_firmware(struct iwl_priv *priv, bool first) |
1663 | { | 1666 | { |
1664 | const char *name_pre = priv->cfg->fw_name_pre; | 1667 | const char *name_pre = priv->cfg->fw_name_pre; |
1668 | char tag[8]; | ||
1665 | 1669 | ||
1666 | if (first) | 1670 | if (first) { |
1671 | #ifdef CONFIG_IWLWIFI_DEBUG_EXPERIMENTAL_UCODE | ||
1672 | priv->fw_index = UCODE_EXPERIMENTAL_INDEX; | ||
1673 | strcpy(tag, UCODE_EXPERIMENTAL_TAG); | ||
1674 | } else if (priv->fw_index == UCODE_EXPERIMENTAL_INDEX) { | ||
1675 | #endif | ||
1667 | priv->fw_index = priv->cfg->ucode_api_max; | 1676 | priv->fw_index = priv->cfg->ucode_api_max; |
1668 | else | 1677 | sprintf(tag, "%d", priv->fw_index); |
1678 | } else { | ||
1669 | priv->fw_index--; | 1679 | priv->fw_index--; |
1680 | sprintf(tag, "%d", priv->fw_index); | ||
1681 | } | ||
1670 | 1682 | ||
1671 | if (priv->fw_index < priv->cfg->ucode_api_min) { | 1683 | if (priv->fw_index < priv->cfg->ucode_api_min) { |
1672 | IWL_ERR(priv, "no suitable firmware found!\n"); | 1684 | IWL_ERR(priv, "no suitable firmware found!\n"); |
1673 | return -ENOENT; | 1685 | return -ENOENT; |
1674 | } | 1686 | } |
1675 | 1687 | ||
1676 | sprintf(priv->firmware_name, "%s%d%s", | 1688 | sprintf(priv->firmware_name, "%s%s%s", name_pre, tag, ".ucode"); |
1677 | name_pre, priv->fw_index, ".ucode"); | ||
1678 | 1689 | ||
1679 | IWL_DEBUG_INFO(priv, "attempting to load firmware '%s'\n", | 1690 | IWL_DEBUG_INFO(priv, "attempting to load firmware %s'%s'\n", |
1691 | (priv->fw_index == UCODE_EXPERIMENTAL_INDEX) | ||
1692 | ? "EXPERIMENTAL " : "", | ||
1680 | priv->firmware_name); | 1693 | priv->firmware_name); |
1681 | 1694 | ||
1682 | return request_firmware_nowait(THIS_MODULE, 1, priv->firmware_name, | 1695 | return request_firmware_nowait(THIS_MODULE, 1, priv->firmware_name, |
@@ -1971,8 +1984,10 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
1971 | memset(&pieces, 0, sizeof(pieces)); | 1984 | memset(&pieces, 0, sizeof(pieces)); |
1972 | 1985 | ||
1973 | if (!ucode_raw) { | 1986 | if (!ucode_raw) { |
1974 | IWL_ERR(priv, "request for firmware file '%s' failed.\n", | 1987 | if (priv->fw_index <= priv->cfg->ucode_api_max) |
1975 | priv->firmware_name); | 1988 | IWL_ERR(priv, |
1989 | "request for firmware file '%s' failed.\n", | ||
1990 | priv->firmware_name); | ||
1976 | goto try_again; | 1991 | goto try_again; |
1977 | } | 1992 | } |
1978 | 1993 | ||
@@ -2019,7 +2034,9 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
2019 | api_max, api_ver); | 2034 | api_max, api_ver); |
2020 | 2035 | ||
2021 | if (build) | 2036 | if (build) |
2022 | sprintf(buildstr, " build %u", build); | 2037 | sprintf(buildstr, " build %u%s", build, |
2038 | (priv->fw_index == UCODE_EXPERIMENTAL_INDEX) | ||
2039 | ? " (EXP)" : ""); | ||
2023 | else | 2040 | else |
2024 | buildstr[0] = '\0'; | 2041 | buildstr[0] = '\0'; |
2025 | 2042 | ||