aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945.c
diff options
context:
space:
mode:
authorJay Sternberg <jay.e.sternberg@intel.com>2009-07-17 12:30:16 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-24 15:05:24 -0400
commitcc0f555d511a5fe9d4519334c8f674a1dbab9e3a (patch)
tree33308c826deaf26796112df7ffb983b67146bb7f /drivers/net/wireless/iwlwifi/iwl-3945.c
parent244294e83f7637e31bbf64060301904860a32051 (diff)
iwlwifi: Handle new firmware file with ucode build number in header
Adding new API version to account for change to ucode file format. New header includes the build number of the ucode. This build number is the SVN revision thus allowing for exact correlation to the code that generated it. The header adds the build number so that older ucode images can also be enhanced to include the build in the future. some cleanup in iwl_read_ucode needed to ensure old header not used and reduce unnecessary references through pointer with the data is already in heap variable. Signed-off-by: Jay Sternberg <jay.e.sternberg@intel.com> 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-3945.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 1227ed2960fb..14a47c0a1583 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -2786,11 +2786,50 @@ static int iwl3945_load_bsm(struct iwl_priv *priv)
2786 return 0; 2786 return 0;
2787} 2787}
2788 2788
2789#define IWL3945_UCODE_GET(item) \
2790static u32 iwl3945_ucode_get_##item(const struct iwl_ucode_header *ucode,\
2791 u32 api_ver) \
2792{ \
2793 return le32_to_cpu(ucode->u.v1.item); \
2794}
2795
2796static u32 iwl3945_ucode_get_header_size(u32 api_ver)
2797{
2798 return UCODE_HEADER_SIZE(1);
2799}
2800static u32 iwl3945_ucode_get_build(const struct iwl_ucode_header *ucode,
2801 u32 api_ver)
2802{
2803 return 0;
2804}
2805static u8 *iwl3945_ucode_get_data(const struct iwl_ucode_header *ucode,
2806 u32 api_ver)
2807{
2808 return (u8 *) ucode->u.v1.data;
2809}
2810
2811IWL3945_UCODE_GET(inst_size);
2812IWL3945_UCODE_GET(data_size);
2813IWL3945_UCODE_GET(init_size);
2814IWL3945_UCODE_GET(init_data_size);
2815IWL3945_UCODE_GET(boot_size);
2816
2789static struct iwl_hcmd_ops iwl3945_hcmd = { 2817static struct iwl_hcmd_ops iwl3945_hcmd = {
2790 .rxon_assoc = iwl3945_send_rxon_assoc, 2818 .rxon_assoc = iwl3945_send_rxon_assoc,
2791 .commit_rxon = iwl3945_commit_rxon, 2819 .commit_rxon = iwl3945_commit_rxon,
2792}; 2820};
2793 2821
2822static struct iwl_ucode_ops iwl3945_ucode = {
2823 .get_header_size = iwl3945_ucode_get_header_size,
2824 .get_build = iwl3945_ucode_get_build,
2825 .get_inst_size = iwl3945_ucode_get_inst_size,
2826 .get_data_size = iwl3945_ucode_get_data_size,
2827 .get_init_size = iwl3945_ucode_get_init_size,
2828 .get_init_data_size = iwl3945_ucode_get_init_data_size,
2829 .get_boot_size = iwl3945_ucode_get_boot_size,
2830 .get_data = iwl3945_ucode_get_data,
2831};
2832
2794static struct iwl_lib_ops iwl3945_lib = { 2833static struct iwl_lib_ops iwl3945_lib = {
2795 .txq_attach_buf_to_tfd = iwl3945_hw_txq_attach_buf_to_tfd, 2834 .txq_attach_buf_to_tfd = iwl3945_hw_txq_attach_buf_to_tfd,
2796 .txq_free_tfd = iwl3945_hw_txq_free_tfd, 2835 .txq_free_tfd = iwl3945_hw_txq_free_tfd,
@@ -2831,6 +2870,7 @@ static struct iwl_hcmd_utils_ops iwl3945_hcmd_utils = {
2831}; 2870};
2832 2871
2833static struct iwl_ops iwl3945_ops = { 2872static struct iwl_ops iwl3945_ops = {
2873 .ucode = &iwl3945_ucode,
2834 .lib = &iwl3945_lib, 2874 .lib = &iwl3945_lib,
2835 .hcmd = &iwl3945_hcmd, 2875 .hcmd = &iwl3945_hcmd,
2836 .utils = &iwl3945_hcmd_utils, 2876 .utils = &iwl3945_hcmd_utils,