From: Kalle Valo <kvalo@codeaurora.org>
To: Rakesh Pillai <pillair@codeaurora.org>
Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] ath10k: Fix channel info parsing for non tlv target
Date: Thu, 12 Sep 2019 16:41:58 +0300 [thread overview]
Message-ID: <87r24lk4wp.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1552044366-9186-1-git-send-email-pillair@codeaurora.org> (Rakesh Pillai's message of "Fri, 8 Mar 2019 16:56:06 +0530")
Rakesh Pillai <pillair@codeaurora.org> writes:
> The tlv targets such as WCN3990 send more data in
> the chan info event, which is not sent by the non tlv
> targets. There is a minimum size check in the wmi event for
> non-tlv targets and hence we cannot update the common
> channel info structure.
>
> If the common channel info structure is updated, the
> size check for chan info event for non-tlv targets
> will fail and return -EPROTO
This is the code in question:
static int ath10k_wmi_op_pull_ch_info_ev(struct ath10k *ar, struct sk_buff *skb,
struct wmi_ch_info_ev_arg *arg)
{
struct wmi_chan_info_event *ev = (void *)skb->data;
if (skb->len < sizeof(*ev))
return -EPROTO;
skb_pull(skb, sizeof(*ev));
arg->err_code = ev->err_code;
arg->freq = ev->freq;
arg->cmd_flags = ev->cmd_flags;
arg->noise_floor = ev->noise_floor;
arg->rx_clear_count = ev->rx_clear_count;
arg->cycle_count = ev->cycle_count;
return 0;
}
And here I see a disconnection between firmware and ath10k. The design
philosophy in firmware is that if the firmware does not provide all
fields, for example cycle_count in this event, the host driver is
supposed to replace the missing field with value zero and continue
normally. Obviously ath10k does not do that and instead it drops the
whole WMI event, which causes breakup like this.
The quick fix (having separate structs for TLV and 10.x interfaces) in
this patch is ok, but in the future if similar field additions arise we
need to remember to fix ath10k event parsing so that both new ath10k
will continue to work with older firmwares.
--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2019-09-12 13:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-08 11:26 [PATCH] ath10k: Fix channel info parsing for non tlv target Rakesh Pillai
2019-07-30 8:40 ` Kalle Valo
2019-09-12 13:41 ` Kalle Valo [this message]
2019-09-12 15:05 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r24lk4wp.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@codeaurora.org \
--cc=ath10k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=pillair@codeaurora.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).