aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath10k/wmi.c
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2014-09-18 09:21:23 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2014-09-23 05:31:16 -0400
commitb79b9baac4f9ecec85353b76a45ae2eda4a1e41d (patch)
treea07599919105acb9eee8f48302b5829bb794e16f /drivers/net/wireless/ath/ath10k/wmi.c
parentcf9fca8f890e04a745fc9997ed75bcf0ed13b12b (diff)
ath10k: relocate wmi attach/deatch functions
Init functions should be placed at the end of files in most cases to avoid forward declarations for static functions. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/wmi.c')
-rw-r--r--drivers/net/wireless/ath/ath10k/wmi.c77
1 files changed, 38 insertions, 39 deletions
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
index e796305ad5e1..cec0c2839e5b 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -2780,45 +2780,6 @@ static void ath10k_wmi_process_rx(struct ath10k *ar, struct sk_buff *skb)
2780 } 2780 }
2781} 2781}
2782 2782
2783/* WMI Initialization functions */
2784int ath10k_wmi_attach(struct ath10k *ar)
2785{
2786 if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
2787 if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features))
2788 ar->wmi.cmd = &wmi_10_2_cmd_map;
2789 else
2790 ar->wmi.cmd = &wmi_10x_cmd_map;
2791
2792 ar->wmi.vdev_param = &wmi_10x_vdev_param_map;
2793 ar->wmi.pdev_param = &wmi_10x_pdev_param_map;
2794 } else {
2795 ar->wmi.cmd = &wmi_cmd_map;
2796 ar->wmi.vdev_param = &wmi_vdev_param_map;
2797 ar->wmi.pdev_param = &wmi_pdev_param_map;
2798 }
2799
2800 init_completion(&ar->wmi.service_ready);
2801 init_completion(&ar->wmi.unified_ready);
2802 init_waitqueue_head(&ar->wmi.tx_credits_wq);
2803
2804 return 0;
2805}
2806
2807void ath10k_wmi_detach(struct ath10k *ar)
2808{
2809 int i;
2810
2811 /* free the host memory chunks requested by firmware */
2812 for (i = 0; i < ar->wmi.num_mem_chunks; i++) {
2813 dma_free_coherent(ar->dev,
2814 ar->wmi.mem_chunks[i].len,
2815 ar->wmi.mem_chunks[i].vaddr,
2816 ar->wmi.mem_chunks[i].paddr);
2817 }
2818
2819 ar->wmi.num_mem_chunks = 0;
2820}
2821
2822int ath10k_wmi_connect(struct ath10k *ar) 2783int ath10k_wmi_connect(struct ath10k *ar)
2823{ 2784{
2824 int status; 2785 int status;
@@ -4187,3 +4148,41 @@ int ath10k_wmi_dbglog_cfg(struct ath10k *ar, u32 module_enable)
4187 4148
4188 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->dbglog_cfg_cmdid); 4149 return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->dbglog_cfg_cmdid);
4189} 4150}
4151
4152int ath10k_wmi_attach(struct ath10k *ar)
4153{
4154 if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
4155 if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features))
4156 ar->wmi.cmd = &wmi_10_2_cmd_map;
4157 else
4158 ar->wmi.cmd = &wmi_10x_cmd_map;
4159
4160 ar->wmi.vdev_param = &wmi_10x_vdev_param_map;
4161 ar->wmi.pdev_param = &wmi_10x_pdev_param_map;
4162 } else {
4163 ar->wmi.cmd = &wmi_cmd_map;
4164 ar->wmi.vdev_param = &wmi_vdev_param_map;
4165 ar->wmi.pdev_param = &wmi_pdev_param_map;
4166 }
4167
4168 init_completion(&ar->wmi.service_ready);
4169 init_completion(&ar->wmi.unified_ready);
4170 init_waitqueue_head(&ar->wmi.tx_credits_wq);
4171
4172 return 0;
4173}
4174
4175void ath10k_wmi_detach(struct ath10k *ar)
4176{
4177 int i;
4178
4179 /* free the host memory chunks requested by firmware */
4180 for (i = 0; i < ar->wmi.num_mem_chunks; i++) {
4181 dma_free_coherent(ar->dev,
4182 ar->wmi.mem_chunks[i].len,
4183 ar->wmi.mem_chunks[i].vaddr,
4184 ar->wmi.mem_chunks[i].paddr);
4185 }
4186
4187 ar->wmi.num_mem_chunks = 0;
4188}