All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH][v5] net/ethtool: Add support for the ethtool feature to flash firmware image from a specified file.
@ 2009-08-21 16:54 Ajit Khaparde
  2009-09-02 15:50 ` Ajit Khaparde
  2009-09-02 16:22 ` Ajit Khaparde
  0 siblings, 2 replies; 7+ messages in thread
From: Ajit Khaparde @ 2009-08-21 16:54 UTC (permalink / raw)
  To: davem, jgarzik, netdev

This patch adds support to flash a firmware image to a device using ethtool.
The driver gets the filename of the firmware image and flashes the image
using the request firmware path.

The region "on the chip" to be flashed can be specified by an option.
It is upto the device driver to enumerate the region number passed by ethtool,
to the region to be flashed.

The default behavior is to flash all the regions on the chip.

Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
---
 include/linux/ethtool.h |   14 ++++++++++++++
 net/core/ethtool.c      |   16 ++++++++++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 90c4a36..15e4eb7 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -362,6 +362,18 @@ struct ethtool_rxnfc {
 	__u32				rule_locs[0];
 };
 
+#define ETHTOOL_FLASH_MAX_FILENAME	128
+enum ethtool_flash_op_type {
+	ETHTOOL_FLASH_ALL_REGIONS	= 0,
+};
+
+/* for passing firmware flashing related parameters */
+struct ethtool_flash {
+	__u32	cmd;
+	__u32	region;
+	char	data[ETHTOOL_FLASH_MAX_FILENAME];
+};
+
 #ifdef __KERNEL__
 
 struct net_device;
@@ -489,6 +501,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 *, struct ethtool_flash *);
 };
 #endif /* __KERNEL__ */
 
@@ -545,6 +558,7 @@ 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 */
 
 /* compatibility with older code */
 #define SPARC_ETH_GSET		ETHTOOL_GSET
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 44e5711..4c12ddb 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -898,6 +898,19 @@ 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, char __user *useraddr)
+{
+	struct ethtool_flash efl;
+
+	if (copy_from_user(&efl, useraddr, sizeof(efl)))
+		return -EFAULT;
+
+	if (!dev->ethtool_ops->flash_device)
+		return -EOPNOTSUPP;
+
+	return dev->ethtool_ops->flash_device(dev, &efl);
+}
+
 /* The main entry point in this file.  Called from net/core/dev.c */
 
 int dev_ethtool(struct net *net, struct ifreq *ifr)
@@ -1111,6 +1124,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, useraddr);
+		break;
 	default:
 		rc = -EOPNOTSUPP;
 	}
-- 
1.6.0.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [RFC][PATCH][v5] net/ethtool: Add support for the ethtool feature to flash firmware image from a specified file.
  2009-08-21 16:54 [RFC][PATCH][v5] net/ethtool: Add support for the ethtool feature to flash firmware image from a specified file Ajit Khaparde
@ 2009-09-02 15:50 ` Ajit Khaparde
  2009-09-02 21:40   ` David Miller
  2009-09-02 16:22 ` Ajit Khaparde
  1 sibling, 1 reply; 7+ messages in thread
From: Ajit Khaparde @ 2009-09-02 15:50 UTC (permalink / raw)
  To: davem, jgarzik, netdev

On 21/08/09 22:24 +0530, Ajit Khaparde wrote:
> This patch adds support to flash a firmware image to a device using ethtool.
> The driver gets the filename of the firmware image and flashes the image
> using the request firmware path.
> 
> The region "on the chip" to be flashed can be specified by an option.
> It is upto the device driver to enumerate the region number passed by ethtool,
> to the region to be flashed.
> 
> The default behavior is to flash all the regions on the chip.
David,
Is this patch good enough for being accepted? Please let me know if any more
work has to be done on this. Also, I want to send the changes to the be2net
driver which would use this ethtool feature.

Any ETA for applying the patch to the git tree? I will schedule my driver patch according to that.

Thanks
-Ajit

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC][PATCH][v5] net/ethtool: Add support for the ethtool feature to flash firmware image from a specified file.
  2009-08-21 16:54 [RFC][PATCH][v5] net/ethtool: Add support for the ethtool feature to flash firmware image from a specified file Ajit Khaparde
  2009-09-02 15:50 ` Ajit Khaparde
@ 2009-09-02 16:22 ` Ajit Khaparde
  2009-09-02 16:48   ` Jeff Garzik
  1 sibling, 1 reply; 7+ messages in thread
From: Ajit Khaparde @ 2009-09-02 16:22 UTC (permalink / raw)
  To: davem, jgarzik, netdev

On 21/08/09 22:24 +0530, Ajit Khaparde wrote:
> This patch adds support to flash a firmware image to a device using ethtool.
> The driver gets the filename of the firmware image and flashes the image
> using the request firmware path.
> 
> The region "on the chip" to be flashed can be specified by an option.
> It is upto the device driver to enumerate the region number passed by ethtool,
> to the region to be flashed.
> 
> The default behavior is to flash all the regions on the chip.
David, 
Is this patch good enough for being accepted? Please let me know if any more 
work has to be done on this. 

I want to send the changes to the be2net driver which would use this 
new ethtool feature.  Any ETA for applying the patch to the git tree? 
I will schedule my driver patch according to that. 

Thanks 
-Ajit

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC][PATCH][v5] net/ethtool: Add support for the ethtool feature to flash firmware image from a specified file.
  2009-09-02 16:22 ` Ajit Khaparde
@ 2009-09-02 16:48   ` Jeff Garzik
  2009-09-02 17:00     ` Ben Hutchings
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Garzik @ 2009-09-02 16:48 UTC (permalink / raw)
  To: Ajit Khaparde; +Cc: davem, netdev

On 09/02/2009 12:22 PM, Ajit Khaparde wrote:
> On 21/08/09 22:24 +0530, Ajit Khaparde wrote:
>> This patch adds support to flash a firmware image to a device using ethtool.
>> The driver gets the filename of the firmware image and flashes the image
>> using the request firmware path.
>>
>> The region "on the chip" to be flashed can be specified by an option.
>> It is upto the device driver to enumerate the region number passed by ethtool,
>> to the region to be flashed.
>>
>> The default behavior is to flash all the regions on the chip.
> David,
> Is this patch good enough for being accepted? Please let me know if any more
> work has to be done on this.
>
> I want to send the changes to the be2net driver which would use this
> new ethtool feature.  Any ETA for applying the patch to the git tree?
> I will schedule my driver patch according to that.

BTW, don't forget to update the ethtool userland utility as well,
git://git.kernel.org/pub/scm/network/ethtool/ethtool.git

	Jeff




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC][PATCH][v5] net/ethtool: Add support for the ethtool feature to flash firmware image from a specified file.
  2009-09-02 16:48   ` Jeff Garzik
@ 2009-09-02 17:00     ` Ben Hutchings
  0 siblings, 0 replies; 7+ messages in thread
From: Ben Hutchings @ 2009-09-02 17:00 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Ajit Khaparde, davem, netdev

On Wed, 2009-09-02 at 12:48 -0400, Jeff Garzik wrote:
> On 09/02/2009 12:22 PM, Ajit Khaparde wrote:
> > On 21/08/09 22:24 +0530, Ajit Khaparde wrote:
> >> This patch adds support to flash a firmware image to a device using ethtool.
> >> The driver gets the filename of the firmware image and flashes the image
> >> using the request firmware path.
> >>
> >> The region "on the chip" to be flashed can be specified by an option.
> >> It is upto the device driver to enumerate the region number passed by ethtool,
> >> to the region to be flashed.
> >>
> >> The default behavior is to flash all the regions on the chip.
> > David,
> > Is this patch good enough for being accepted? Please let me know if any more
> > work has to be done on this.
> >
> > I want to send the changes to the be2net driver which would use this
> > new ethtool feature.  Any ETA for applying the patch to the git tree?
> > I will schedule my driver patch according to that.
> 
> BTW, don't forget to update the ethtool userland utility as well,
> git://git.kernel.org/pub/scm/network/ethtool/ethtool.git

Ajit also posted a patch for ethtool on 21 August:
<http://article.gmane.org/gmane.linux.network/135785>.

Also, I sent you a series of patches back in April that you have
apparently ignored, although the corresponding kernel patches are in
2.6.31: <http://thread.gmane.org/gmane.linux.network/127025>.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC][PATCH][v5] net/ethtool: Add support for the ethtool feature to flash firmware image from a specified file.
  2009-09-02 15:50 ` Ajit Khaparde
@ 2009-09-02 21:40   ` David Miller
  2009-09-03  3:02     ` Ajit Khaparde
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2009-09-02 21:40 UTC (permalink / raw)
  To: ajitk; +Cc: jgarzik, netdev

From: Ajit Khaparde <ajitk@serverengines.com>
Date: Wed, 2 Sep 2009 21:20:09 +0530

> Is this patch good enough for being accepted? Please let me know if
> any more work has to be done on this. Also, I want to send the
> changes to the be2net driver which would use this ethtool feature.

My impression was that the patch was still under review and
people were still making change requests.

I guess not :-)

Please resubmit the kernel side patch, it'll get into patchwork
and I'll apply it.

Thanks.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC][PATCH][v5] net/ethtool: Add support for the ethtool feature to flash firmware image from a specified file.
  2009-09-02 21:40   ` David Miller
@ 2009-09-03  3:02     ` Ajit Khaparde
  0 siblings, 0 replies; 7+ messages in thread
From: Ajit Khaparde @ 2009-09-03  3:02 UTC (permalink / raw)
  To: David Miller, jgarzik; +Cc: netdev

On 02/09/09 14:40 -0700, David Miller wrote:
> From: Ajit Khaparde <ajitk@serverengines.com>
> Date: Wed, 2 Sep 2009 21:20:09 +0530
> 
> > Is this patch good enough for being accepted? Please let me know if
> > any more work has to be done on this. Also, I want to send the
> > changes to the be2net driver which would use this ethtool feature.
> 
> My impression was that the patch was still under review and
> people were still making change requests.
> 
> I guess not :-)
> 
> Please resubmit the kernel side patch, it'll get into patchwork
> and I'll apply it.
> 
> Thanks.
Thanks David. 
I am resending both the user space and the kernel side patches.

-Ajit

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-03  3:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-21 16:54 [RFC][PATCH][v5] net/ethtool: Add support for the ethtool feature to flash firmware image from a specified file Ajit Khaparde
2009-09-02 15:50 ` Ajit Khaparde
2009-09-02 21:40   ` David Miller
2009-09-03  3:02     ` Ajit Khaparde
2009-09-02 16:22 ` Ajit Khaparde
2009-09-02 16:48   ` Jeff Garzik
2009-09-02 17:00     ` Ben Hutchings

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.