From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Bartosz Markowski <bartosz.markowski@tieto.com>
Cc: <ath10k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH v3 2/2] ath10k: implement per-VDEV FW statistics
Date: Tue, 3 Sep 2013 10:13:55 +0300 [thread overview]
Message-ID: <87a9ju1ioc.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1377778061-22331-3-git-send-email-bartosz.markowski@tieto.com> (Bartosz Markowski's message of "Thu, 29 Aug 2013 14:07:40 +0200")
Bartosz Markowski <bartosz.markowski@tieto.com> writes:
> The WMI_REQUEST_PEER_STAT command with latst (1.0.0.716) FW
> can return per-VDEV statistics. Using debugfs we can fetch this info now.
>
> This is a backward compatible change. In case of older FW the VDEV
> statistics are simply not returned.
>
> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
[...]
> if (num_peer_stats) {
> - struct wmi_peer_stats *peer_stats;
> struct ath10k_peer_stat *s;
> + struct wmi_peer_stats_1 *peer_stats_1;
> + struct wmi_peer_stats_2 *peer_stats_2;
>
> stats->peers = num_peer_stats;
>
> for (i = 0; i < num_peer_stats; i++) {
> - peer_stats = (struct wmi_peer_stats *)tmp;
> + peer_stats_1 = (struct wmi_peer_stats_1 *)tmp;
You still have this evil cast here which assumes struct wmi_peer_stats_1
starts with the same content as _2. It's better to spell that out in the
code, for example like this:
if (test_bit(ATH10K_FW_FEATURE_VDEV_STATS, ar->fw_features)) {
peer_v2 = (struct wmi_peer_stats_v2 *)tmp;
peer_stats = &peer_v2->common;
tmp += sizeof(*peer_v2);
} else {
peer_v1 = (struct wmi_peer_stats_v1 *)tmp;
peer_stats = &peer_v1->common;
tmp += sizeof(*peer_v1);
}
> +struct wmi_peer_stats_1 {
struct wmi_peer_stats_v1
> +struct wmi_peer_stats_2 {
struct wmi_peer_stats_v2
--
Kalle Valo
prev parent reply other threads:[~2013-09-03 7:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-29 12:07 [PATCH v3 0/2] add per-VDEV FW statistics Bartosz Markowski
2013-08-29 12:07 ` [PATCH v3 1/2] ath10k: update wal_dbg_tx_stats structure with missing parameter Bartosz Markowski
2013-09-03 7:05 ` Kalle Valo
2013-08-29 12:07 ` [PATCH v3 2/2] ath10k: implement per-VDEV FW statistics Bartosz Markowski
2013-09-03 7:13 ` Kalle Valo [this message]
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=87a9ju1ioc.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@qca.qualcomm.com \
--cc=ath10k@lists.infradead.org \
--cc=bartosz.markowski@tieto.com \
--cc=linux-wireless@vger.kernel.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