aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSharon Dvir <sharon.dvir@intel.com>2016-08-03 03:55:45 -0400
committerLuca Coelho <luciano.coelho@intel.com>2016-09-16 02:10:32 -0400
commit612da1efc07f28ea9e64402820dd25287ff5233b (patch)
tree65e0fdb2052615f5188de5638298f7336e7949cc
parent9fb064df6d57bf09ed3f8f964c8b0789b55206e7 (diff)
iwlwifi: unify iwl_get_ucode_image() implementations
Avoid multiple implementations. Signed-off-by: Sharon Dvir <sharon.dvir@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r--drivers/net/wireless/intel/iwlwifi/dvm/ucode.c11
-rw-r--r--drivers/net/wireless/intel/iwlwifi/iwl-fw.h9
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/fw.c13
3 files changed, 12 insertions, 21 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/dvm/ucode.c b/drivers/net/wireless/intel/iwlwifi/dvm/ucode.c
index b662cf35b033..c7509c51e9d9 100644
--- a/drivers/net/wireless/intel/iwlwifi/dvm/ucode.c
+++ b/drivers/net/wireless/intel/iwlwifi/dvm/ucode.c
@@ -46,15 +46,6 @@
46 * 46 *
47 ******************************************************************************/ 47 ******************************************************************************/
48 48
49static inline const struct fw_img *
50iwl_get_ucode_image(struct iwl_priv *priv, enum iwl_ucode_type ucode_type)
51{
52 if (ucode_type >= IWL_UCODE_TYPE_MAX)
53 return NULL;
54
55 return &priv->fw->img[ucode_type];
56}
57
58/* 49/*
59 * Calibration 50 * Calibration
60 */ 51 */
@@ -330,7 +321,7 @@ int iwl_load_ucode_wait_alive(struct iwl_priv *priv,
330 enum iwl_ucode_type old_type; 321 enum iwl_ucode_type old_type;
331 static const u16 alive_cmd[] = { REPLY_ALIVE }; 322 static const u16 alive_cmd[] = { REPLY_ALIVE };
332 323
333 fw = iwl_get_ucode_image(priv, ucode_type); 324 fw = iwl_get_ucode_image(priv->fw, ucode_type);
334 if (WARN_ON(!fw)) 325 if (WARN_ON(!fw))
335 return -EINVAL; 326 return -EINVAL;
336 327
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-fw.h b/drivers/net/wireless/intel/iwlwifi/iwl-fw.h
index 74ea68d1063c..5f229556339a 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-fw.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-fw.h
@@ -329,4 +329,13 @@ iwl_fw_dbg_conf_usniffer(const struct iwl_fw *fw, u8 id)
329 return conf_tlv->usniffer; 329 return conf_tlv->usniffer;
330} 330}
331 331
332static inline const struct fw_img *
333iwl_get_ucode_image(const struct iwl_fw *fw, enum iwl_ucode_type ucode_type)
334{
335 if (ucode_type >= IWL_UCODE_TYPE_MAX)
336 return NULL;
337
338 return &fw->img[ucode_type];
339}
340
332#endif /* __iwl_fw_h__ */ 341#endif /* __iwl_fw_h__ */
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index b951a7f06060..7322c4394a9a 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -90,15 +90,6 @@ struct iwl_mvm_alive_data {
90 u32 scd_base_addr; 90 u32 scd_base_addr;
91}; 91};
92 92
93static inline const struct fw_img *
94iwl_get_ucode_image(struct iwl_mvm *mvm, enum iwl_ucode_type ucode_type)
95{
96 if (ucode_type >= IWL_UCODE_TYPE_MAX)
97 return NULL;
98
99 return &mvm->fw->img[ucode_type];
100}
101
102static int iwl_send_tx_ant_cfg(struct iwl_mvm *mvm, u8 valid_tx_ant) 93static int iwl_send_tx_ant_cfg(struct iwl_mvm *mvm, u8 valid_tx_ant)
103{ 94{
104 struct iwl_tx_ant_cfg_cmd tx_ant_cmd = { 95 struct iwl_tx_ant_cfg_cmd tx_ant_cmd = {
@@ -592,9 +583,9 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,
592 iwl_fw_dbg_conf_usniffer(mvm->fw, FW_DBG_START_FROM_ALIVE) && 583 iwl_fw_dbg_conf_usniffer(mvm->fw, FW_DBG_START_FROM_ALIVE) &&
593 !(fw_has_capa(&mvm->fw->ucode_capa, 584 !(fw_has_capa(&mvm->fw->ucode_capa,
594 IWL_UCODE_TLV_CAPA_USNIFFER_UNIFIED))) 585 IWL_UCODE_TLV_CAPA_USNIFFER_UNIFIED)))
595 fw = iwl_get_ucode_image(mvm, IWL_UCODE_REGULAR_USNIFFER); 586 fw = iwl_get_ucode_image(mvm->fw, IWL_UCODE_REGULAR_USNIFFER);
596 else 587 else
597 fw = iwl_get_ucode_image(mvm, ucode_type); 588 fw = iwl_get_ucode_image(mvm->fw, ucode_type);
598 if (WARN_ON(!fw)) 589 if (WARN_ON(!fw))
599 return -EINVAL; 590 return -EINVAL;
600 mvm->cur_ucode = ucode_type; 591 mvm->cur_ucode = ucode_type;