[PATCH v4 6/8] ath10k: introduce wmi ops

Kalle Valo kvalo at qca.qualcomm.com
Sun Dec 7 23:03:30 PST 2014


Michal Kazior <michal.kazior at tieto.com> writes:

> On 3 December 2014 at 09:10, Kalle Valo <kvalo at qca.qualcomm.com> wrote:
> [...]
>>  int ath10k_wmi_attach(struct ath10k *ar)
>>  {
>> -       if (test_bit(ATH10K_FW_FEATURE_WMI_10X, ar->fw_features)) {
>> -               if (test_bit(ATH10K_FW_FEATURE_WMI_10_2, ar->fw_features))
>> -                       ar->wmi.cmd = &wmi_10_2_cmd_map;
>> -               else
>> -                       ar->wmi.cmd = &wmi_10x_cmd_map;
>> -
>> +       switch (ar->wmi.op_version) {
>> +       case ATH10K_FW_WMI_OP_VERSION_10_2:
>> +               ar->wmi.cmd = &wmi_10_2_cmd_map;
>> +               ar->wmi.ops = &wmi_10_2_ops;
>>                 ar->wmi.vdev_param = &wmi_10x_vdev_param_map;
>>                 ar->wmi.pdev_param = &wmi_10x_pdev_param_map;
>> -       } else {
>> +               break;
>> +       case ATH10K_FW_WMI_OP_VERSION_10_1:
>> +               ar->wmi.cmd = &wmi_10x_cmd_map;
>> +               ar->wmi.ops = &wmi_10_1_ops;
>> +               ar->wmi.vdev_param = &wmi_10x_vdev_param_map;
>> +               ar->wmi.pdev_param = &wmi_10x_pdev_param_map;
>> +               break;
>> +       case ATH10K_FW_WMI_OP_VERSION_MAIN:
>>                 ar->wmi.cmd = &wmi_cmd_map;
>> +               ar->wmi.ops = &wmi_ops;
>>                 ar->wmi.vdev_param = &wmi_vdev_param_map;
>>                 ar->wmi.pdev_param = &wmi_pdev_param_map;
>> +               break;
>> +       default:
>
> I think we don't need the `default` here now, do we? Instead _UNSET
> and _MAX should be handled.

Correct. I folded this change:

--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
@@ -4786,7 +4786,8 @@ int ath10k_wmi_attach(struct ath10k *ar)
                ar->wmi.vdev_param = &wmi_vdev_param_map;
                ar->wmi.pdev_param = &wmi_pdev_param_map;
                break;
-       default:
+       case ATH10K_FW_WMI_OP_VERSION_UNSET:
+       case ATH10K_FW_WMI_OP_VERSION_MAX:
                ath10k_err(ar, "unsupported WMI op version: %d\n",
                           ar->wmi.op_version);
                return -EINVAL;

-- 
Kalle Valo



More information about the ath10k mailing list