aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_ethtool.c
diff options
context:
space:
mode:
authorAjit Khaparde <ajitk@serverengines.com>2009-09-03 23:12:16 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-07 04:56:38 -0400
commit84517482e19bc775de7b3b4e998dee2f506bc34e (patch)
treeae3491a5cf8891feef8c2896ef50758d763646f2 /drivers/net/benet/be_ethtool.c
parent384824281caa9ac4b76664033416f1eac4a652fe (diff)
be2net: Changes to support flashing of the be2 network adapter
Changes to support flashing of the be2 network adapter using the request_firmware() & ethtool infrastructure. The trigger to flash the device will come from ethtool utility. The driver will invoke request_firmware() to start the flash process. The file containing the flash image is expected to be available in /lib/firmware/ Signed-off-by: Ajit Khaparde <ajitk@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_ethtool.c')
-rw-r--r--drivers/net/benet/be_ethtool.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/benet/be_ethtool.c b/drivers/net/benet/be_ethtool.c
index 4ff3cc465406..11445df3dbc0 100644
--- a/drivers/net/benet/be_ethtool.c
+++ b/drivers/net/benet/be_ethtool.c
@@ -332,6 +332,20 @@ be_set_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *ecmd)
332 return status; 332 return status;
333} 333}
334 334
335static int
336be_do_flash(struct net_device *netdev, struct ethtool_flash *efl)
337{
338 struct be_adapter *adapter = netdev_priv(netdev);
339 char file_name[ETHTOOL_FLASH_MAX_FILENAME];
340 u32 region;
341
342 file_name[ETHTOOL_FLASH_MAX_FILENAME - 1] = 0;
343 strcpy(file_name, efl->data);
344 region = efl->region;
345
346 return be_load_fw(adapter, file_name);
347}
348
335const struct ethtool_ops be_ethtool_ops = { 349const struct ethtool_ops be_ethtool_ops = {
336 .get_settings = be_get_settings, 350 .get_settings = be_get_settings,
337 .get_drvinfo = be_get_drvinfo, 351 .get_drvinfo = be_get_drvinfo,
@@ -352,4 +366,5 @@ const struct ethtool_ops be_ethtool_ops = {
352 .get_strings = be_get_stat_strings, 366 .get_strings = be_get_stat_strings,
353 .get_stats_count = be_get_stats_count, 367 .get_stats_count = be_get_stats_count,
354 .get_ethtool_stats = be_get_ethtool_stats, 368 .get_ethtool_stats = be_get_ethtool_stats,
369 .flash_device = be_do_flash,
355}; 370};