Add "-f" option to flash a firmware image from the specified file to a device.
Subsystems (2)
PATCH 1/1 Add "-f" option to flash a firmware image from the specified file to a device.
This patch adds a new "-f" option to the ethtool utility
to flash a firmware image to a network device. The filename is passed as a
command line argument. This filename is passed to the network driver which will flash the image on the chip using the request_firmware path.
Usage:
ethtool -f <interface name> <filename of firmware image>
Signed-off-by Ajit Khaparde <[email protected]>
--- ethtool-copy.h | 7 +++++++ ethtool.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletions(-)
ethtool-copy.h +7 -0
@@ -272,6 +272,12 @@ struct ethtool_perm_addr {__u8 data[0 ]; }; +/* for passing firmware flashing related parameters */ +struct ethtool_flash { +__u32 cmd; +__u8 *data; +}; +/* boolean flags controlling per-interface behavior characteristics. * When reading, the flag indicates whether or not a certain behavior * is enabled/present. When writing, the flag indicates whether
@@ -338,6 +344,7 @@ struct ethtool_rxnfc {#define ETHTOOL_SRXFH 0x0000002a/* Set RX flow hash configuration */ #define ETHTOOL_GGRO 0x0000002b/* Get GRO enable (ethtool_value) */ #define ETHTOOL_SGRO 0x0000002c/* Set GRO enable (ethtool_value) */ +#define ETHTOOL_FLASHDEV 0x00000033/* Flash firmware to device */ /* compatibility with older code */ #define SPARC_ETH_GSET ETHTOOL_GSET
ethtool.c +44 -1
93 lines not on this page · raw message
Signature · 1 line
1.6.0.4