aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-04-28 15:09:14 -0400
committerReinette Chatre <reinette.chatre@intel.com>2010-05-10 18:08:54 -0400
commit22adba2a6995dc24663251ffb954f8856968f26e (patch)
treedbfaf7fa3926244445cbe51ec582ea2952f78bf3 /drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
parent93b1a2f919a752bb689fdb0c5817c643c2f74435 (diff)
iwlwifi: remove ucode virtual functions
AGN devices all use the same ucode operations, except for 4965, because 4965 uses only v1 file headers. Therefore, we can remove all the indirection we have here and just code the API distinction in place, with a small special case for 4965. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-ucode.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-ucode.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
index c3e3283426a9..637286c396fe 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c
@@ -182,55 +182,6 @@ int iwlagn_load_ucode(struct iwl_priv *priv)
182 return ret; 182 return ret;
183} 183}
184 184
185#define IWL_UCODE_GET(item) \
186static u32 iwlagn_ucode_get_##item(const struct iwl_ucode_header *ucode,\
187 u32 api_ver) \
188{ \
189 if (api_ver <= 2) \
190 return le32_to_cpu(ucode->u.v1.item); \
191 return le32_to_cpu(ucode->u.v2.item); \
192}
193
194static u32 iwlagn_ucode_get_header_size(u32 api_ver)
195{
196 if (api_ver <= 2)
197 return UCODE_HEADER_SIZE(1);
198 return UCODE_HEADER_SIZE(2);
199}
200
201static u32 iwlagn_ucode_get_build(const struct iwl_ucode_header *ucode,
202 u32 api_ver)
203{
204 if (api_ver <= 2)
205 return 0;
206 return le32_to_cpu(ucode->u.v2.build);
207}
208
209static u8 *iwlagn_ucode_get_data(const struct iwl_ucode_header *ucode,
210 u32 api_ver)
211{
212 if (api_ver <= 2)
213 return (u8 *) ucode->u.v1.data;
214 return (u8 *) ucode->u.v2.data;
215}
216
217IWL_UCODE_GET(inst_size);
218IWL_UCODE_GET(data_size);
219IWL_UCODE_GET(init_size);
220IWL_UCODE_GET(init_data_size);
221IWL_UCODE_GET(boot_size);
222
223struct iwl_ucode_ops iwlagn_ucode = {
224 .get_header_size = iwlagn_ucode_get_header_size,
225 .get_build = iwlagn_ucode_get_build,
226 .get_inst_size = iwlagn_ucode_get_inst_size,
227 .get_data_size = iwlagn_ucode_get_data_size,
228 .get_init_size = iwlagn_ucode_get_init_size,
229 .get_init_data_size = iwlagn_ucode_get_init_data_size,
230 .get_boot_size = iwlagn_ucode_get_boot_size,
231 .get_data = iwlagn_ucode_get_data,
232};
233
234/* 185/*
235 * Calibration 186 * Calibration
236 */ 187 */