From: Antonio Quartulli <a@unstable.cc>
To: The list for a Better Approach To Mobile Ad-hoc Networking
<b.a.t.m.a.n@lists.open-mesh.org>
Subject: Re: [B.A.T.M.A.N.] [RFC next v2] batman-adv: ELP - use new ethtool_link_get_ksettings API
Date: Sun, 28 Feb 2016 17:08:38 +0800 [thread overview]
Message-ID: <20160228090838.GK28478@prodigo> (raw)
In-Reply-To: <1456644694-8497-1-git-send-email-sven@narfation.org>
[-- Attachment #1: Type: text/plain, Size: 1219 bytes --]
On Sun, Feb 28, 2016 at 08:31:34AM +0100, Sven Eckelmann wrote:
> +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
> +
> +#define ethtool_link_ksettings batadv_ethtool_link_ksettings
> +
> +struct batadv_ethtool_link_ksettings {
> + struct {
> + __u32 speed;
> + __u8 duplex;
> + } base;
> +};
> +
> +#define __ethtool_get_link_ksettings(__dev, __link_settings) \
> + batadv_ethtool_get_link_ksettings(__dev, __link_settings)
> +
> +static inline int
> +batadv_ethtool_get_link_ksettings(struct net_device *dev,
> + struct ethtool_link_ksettings *link_ksettings)
> +{
> + struct ethtool_cmd cmd;
> + int ret;
> +
> + memset(&cmd, 0, sizeof(cmd));
> + ret = __ethtool_get_settings(dev, &cmd);
> +
> + if (ret != 0)
> + return ret;
> +
> + link_ksettings->base.duplex = cmd.duplex;
> + link_ksettings->base.speed = ethtool_cmd_speed(&cmd);
> +
> + return 0;
> +}
> +
> +#endif /* < KERNEL_VERSION(4, 6, 0) */
Hi Sven,
I really like this approach! thanks a lot!
By the way, you should have added your name to the list of contributor of this
file though :)
How about re-sending this RFC as PATCH (with your sign-off as well) ?
Cheers,
--
Antonio Quartulli
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-02-28 9:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-27 21:04 [B.A.T.M.A.N.] [RFC next] batman-adv: ELP - use new ethtool_link_get_ksettings API Antonio Quartulli
2016-02-28 7:31 ` [B.A.T.M.A.N.] [RFC next v2] " Sven Eckelmann
2016-02-28 9:08 ` Antonio Quartulli [this message]
2016-02-28 9:41 ` Sven Eckelmann
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=20160228090838.GK28478@prodigo \
--to=a@unstable.cc \
--cc=b.a.t.m.a.n@lists.open-mesh.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