[PATCH v3 2/7] ath10k: add ATH10K_FW_IE_WMI_OP_VERSION
Michal Kazior
michal.kazior at tieto.com
Tue Dec 2 03:51:58 PST 2014
On 1 December 2014 at 15:45, Kalle Valo <kvalo at qca.qualcomm.com> wrote:
[...]
> @@ -562,6 +562,17 @@ static int ath10k_core_fetch_firmware_api_n(struct ath10k *ar, const char *name)
> ar->otp_len = ie_len;
>
> break;
> + case ATH10K_FW_IE_WMI_OP_VERSION:
> + if (ie_len != sizeof(u32))
> + break;
> +
> + version = (__le32 *)data;
> +
> + ar->wmi.op_version = le32_to_cpup(version);
> +
> + ath10k_dbg(ar, ATH10K_DBG_BOOT, "found fw ie wmi op version %d\n",
> + ar->wmi.op_version);
Hmm.. wouldn't it make sense to have a ATH10K_FW_WMI_OP_VERSION_MAX
(or _LAST) and verify if the IE value doesn't exceed the last known
value? This way switch()es won't need default handler by design and
thus we'll get the benefit of compiler telling us about unhandled
cases when we add new enums.
Michał
More information about the ath10k
mailing list