From: Dan Williams <dcbw@redhat.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: linville@tuxdriver.com, libertas-dev@lists.infradead.org,
linux-wireless@vger.kernel.org,
Sebastian Siewior <liber+tas@ml.breakpoint.cc>
Subject: Re: [PATCH] libertas: Fix ethtool statistics
Date: Mon, 19 May 2008 11:47:50 -0400 [thread overview]
Message-ID: <1211212070.12187.8.camel@localhost.localdomain> (raw)
In-Reply-To: <1211211122.21380.167.camel@pmac.infradead.org>
On Mon, 2008-05-19 at 16:32 +0100, David Woodhouse wrote:
> Fix various problems:
> - We converted MESH_ACCESS to a direct command but missed this caller.
> - We were trying to access mesh stats even on meshless firmware.
> - We should really zero the buffer if something goes wrong.
>
> Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Acked-by: Dan Williams <dcbw@redhat.com>
> diff --git a/drivers/net/wireless/libertas/ethtool.c b/drivers/net/wireless/libertas/ethtool.c
> index dcfdb40..688d60d 100644
> --- a/drivers/net/wireless/libertas/ethtool.c
> +++ b/drivers/net/wireless/libertas/ethtool.c
> @@ -73,8 +73,8 @@ out:
> return ret;
> }
>
> -static void lbs_ethtool_get_stats(struct net_device * dev,
> - struct ethtool_stats * stats, u64 * data)
> +static void lbs_ethtool_get_stats(struct net_device *dev,
> + struct ethtool_stats *stats, uint64_t *data)
> {
> struct lbs_private *priv = dev->priv;
> struct cmd_ds_mesh_access mesh_access;
> @@ -83,12 +83,12 @@ static void lbs_ethtool_get_stats(struct net_device * dev,
> lbs_deb_enter(LBS_DEB_ETHTOOL);
>
> /* Get Mesh Statistics */
> - ret = lbs_prepare_and_send_command(priv,
> - CMD_MESH_ACCESS, CMD_ACT_MESH_GET_STATS,
> - CMD_OPTION_WAITFORRSP, 0, &mesh_access);
> + ret = lbs_mesh_access(priv, CMD_ACT_MESH_GET_STATS, &mesh_access);
>
> - if (ret)
> + if (ret) {
> + memset(data, 0, MESH_STATS_NUM*(sizeof(uint64_t)));
> return;
> + }
>
> priv->mstats.fwd_drop_rbt = le32_to_cpu(mesh_access.data[0]);
> priv->mstats.fwd_drop_ttl = le32_to_cpu(mesh_access.data[1]);
> @@ -111,19 +111,18 @@ static void lbs_ethtool_get_stats(struct net_device * dev,
> lbs_deb_enter(LBS_DEB_ETHTOOL);
> }
>
> -static int lbs_ethtool_get_sset_count(struct net_device * dev, int sset)
> +static int lbs_ethtool_get_sset_count(struct net_device *dev, int sset)
> {
> - switch (sset) {
> - case ETH_SS_STATS:
> + struct lbs_private *priv = dev->priv;
> +
> + if (sset == ETH_SS_STATS && dev == priv->mesh_dev)
> return MESH_STATS_NUM;
> - default:
> - return -EOPNOTSUPP;
> - }
> +
> + return -EOPNOTSUPP;
> }
>
> static void lbs_ethtool_get_strings(struct net_device *dev,
> - u32 stringset,
> - u8 * s)
> + uint32_t stringset, uint8_t *s)
> {
> int i;
>
>
next prev parent reply other threads:[~2008-05-19 15:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-19 15:32 [PATCH] libertas: Fix ethtool statistics David Woodhouse
2008-05-19 15:47 ` Dan Williams [this message]
2008-05-19 17:20 ` Sebastian Siewior
2008-05-20 7:54 ` Holger Schurig
-- strict thread matches above, loose matches on Subject: below --
2008-04-17 16:13 David Woodhouse
2008-04-17 18:02 ` Dan Williams
2008-04-17 19:44 ` Sebastian Siewior
2008-04-18 11:09 ` David Woodhouse
2008-04-18 9:02 ` Holger Schurig
2008-04-18 9:11 ` David Woodhouse
2008-04-18 9:49 ` Holger Schurig
2008-04-18 11:15 ` David Woodhouse
2008-04-18 13:10 ` Holger Schurig
2008-04-20 8:41 ` Sebastian Siewior
2008-04-20 10:56 ` David Woodhouse
2008-04-20 19:10 ` Sebastian Siewior
2008-04-21 6:42 ` David Woodhouse
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=1211212070.12187.8.camel@localhost.localdomain \
--to=dcbw@redhat.com \
--cc=dwmw2@infradead.org \
--cc=liber+tas@ml.breakpoint.cc \
--cc=libertas-dev@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.