diff options
author | Reinette Chatre <reinette.chatre@intel.com> | 2008-12-02 12:14:06 -0800 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-12-05 09:35:56 -0500 |
commit | a0987a8d68c86562f267efa97be01314c490c496 (patch) | |
tree | bd2fe7c65c61fbbb9a94c5264b0690fddbcbe6d2 /drivers/net/wireless/iwlwifi/iwl-4965.c | |
parent | c02b3acd29766c6f79c2411cb5b85e1ee72c4c8f (diff) | |
download | talos-obmc-linux-a0987a8d68c86562f267efa97be01314c490c496.tar.gz talos-obmc-linux-a0987a8d68c86562f267efa97be01314c490c496.zip |
iwlwifi: rely on API version read from firmware
This adds the infrastructure to support older firmware APIs.
The API version number is stored as part of the filename, we first try to
load the most recent firmware and progressively try lower versions.
The API version is also read from the firmware self and stored as part
of the iwl_priv structure. Only firmware that is supported by driver will
be loaded. The version number read from firmware is compared
to supported versions in the driver not the API version used as part of
filename.
An example using this new infrastrucure:
if (IWL_UCODE_API(priv->ucode_ver) >= 2) {
Driver interacts with Firmware API version >= 2.
} else {
Driver interacts with Firmware API version 1.
}
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 93d3df87fdaa..87c7bb0d5044 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c @@ -48,12 +48,15 @@ static int iwl4965_send_tx_power(struct iwl_priv *priv); static int iwl4965_hw_get_temperature(const struct iwl_priv *priv); -/* Change firmware file name, using "-" and incrementing number, - * *only* when uCode interface or architecture changes so that it - * is not compatible with earlier drivers. - * This number will also appear in << 8 position of 1st dword of uCode file */ -#define IWL4965_UCODE_API "-2" -#define IWL4965_MODULE_FIRMWARE "iwlwifi-4965" IWL4965_UCODE_API ".ucode" +/* Highest firmware API version supported */ +#define IWL4965_UCODE_API_MAX 2 + +/* Lowest firmware API version supported */ +#define IWL4965_UCODE_API_MIN 2 + +#define IWL4965_FW_PRE "iwlwifi-4965-" +#define _IWL4965_MODULE_FIRMWARE(api) IWL4965_FW_PRE #api ".ucode" +#define IWL4965_MODULE_FIRMWARE(api) _IWL4965_MODULE_FIRMWARE(api) /* module parameters */ @@ -2336,7 +2339,9 @@ static struct iwl_ops iwl4965_ops = { struct iwl_cfg iwl4965_agn_cfg = { .name = "4965AGN", - .fw_name = IWL4965_MODULE_FIRMWARE, + .fw_name_pre = IWL4965_FW_PRE, + .ucode_api_max = IWL4965_UCODE_API_MAX, + .ucode_api_min = IWL4965_UCODE_API_MIN, .sku = IWL_SKU_A|IWL_SKU_G|IWL_SKU_N, .eeprom_size = IWL4965_EEPROM_IMG_SIZE, .eeprom_ver = EEPROM_4965_EEPROM_VERSION, @@ -2346,7 +2351,7 @@ struct iwl_cfg iwl4965_agn_cfg = { }; /* Module firmware */ -MODULE_FIRMWARE(IWL4965_MODULE_FIRMWARE); +MODULE_FIRMWARE(IWL4965_MODULE_FIRMWARE(IWL4965_UCODE_API_MAX)); module_param_named(antenna, iwl4965_mod_params.antenna, int, 0444); MODULE_PARM_DESC(antenna, "select antenna (1=Main, 2=Aux, default 0 [both])"); |