From: Ajit Khaparde <ajitk@serverengines.com>
To: davem@davemloft.net, jgarzik@pobox.com, netdev@vger.kernel.org
Subject: Re: [PATCH net-next-2.6] net: Changes to support the "-f" option of ethtool.
Date: Wed, 5 Aug 2009 18:07:05 +0530 [thread overview]
Message-ID: <20090805123704.GC6592@serverengines.com> (raw)
In-Reply-To: <20090805123211.GB6592@serverengines.com>
The patch intends to use the request_firmware() interface to pick the
firmware image file.
I had missed this in the original post. Thanks.
On 05/08/09 18:02 +0530, Ajit Khaparde wrote:
> This patch adds kernel support for the new "-f" option in ethtool,
> This will allow a firmware image to be flashed to a network device.
>
> Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
> ---
> include/linux/ethtool.h | 3 +++
> net/core/ethtool.c | 13 +++++++++++++
> 2 files changed, 16 insertions(+), 0 deletions(-)
>
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index 90c4a36..9b92f44 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -489,6 +489,7 @@ struct ethtool_ops {
> int (*get_stats_count)(struct net_device *);/* use get_sset_count */
> int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *);
> int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
> + int (*flash_device)(struct net_device *);
> };
> #endif /* __KERNEL__ */
>
> @@ -545,6 +546,8 @@ struct ethtool_ops {
> #define ETHTOOL_GRXCLSRLALL 0x00000030 /* Get all RX classification rule */
> #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */
> #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */
> +#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device
> + * (ethtool_value). */
>
> /* compatibility with older code */
> #define SPARC_ETH_GSET ETHTOOL_GSET
> diff --git a/net/core/ethtool.c b/net/core/ethtool.c
> index 44e5711..0524201 100644
> --- a/net/core/ethtool.c
> +++ b/net/core/ethtool.c
> @@ -898,6 +898,16 @@ static int ethtool_set_value(struct net_device *dev, char __user *useraddr,
> return actor(dev, edata.data);
> }
>
> +static int ethtool_flash_device(struct net_device *dev)
> +{
> + int err;
> +
> + if (!dev->ethtool_ops->flash_device)
> + return -EOPNOTSUPP;
> +
> + return dev->ethtool_ops->flash_device(dev);
> +}
> +
> /* The main entry point in this file. Called from net/core/dev.c */
>
> int dev_ethtool(struct net *net, struct ifreq *ifr)
> @@ -1111,6 +1121,9 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
> case ETHTOOL_SGRO:
> rc = ethtool_set_gro(dev, useraddr);
> break;
> + case ETHTOOL_FLASHDEV:
> + rc = ethtool_flash_device(dev);
> + break;
> default:
> rc = -EOPNOTSUPP;
> }
> --
> 1.6.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-08-05 12:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-05 12:32 [PATCH net-next-2.6] net: Changes to support the "-f" option of ethtool Ajit Khaparde
2009-08-05 12:37 ` Ajit Khaparde [this message]
2009-08-05 13:06 ` Ben Hutchings
2009-08-05 20:17 ` David Miller
2009-08-10 9:04 ` Ajit Khaparde
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=20090805123704.GC6592@serverengines.com \
--to=ajitk@serverengines.com \
--cc=davem@davemloft.net \
--cc=jgarzik@pobox.com \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).