summaryrefslogtreecommitdiff
path: root/drivers/net/benet/be_ethtool.c
diff options
context:
space:
mode:
authorAjit Khaparde <ajitk@serverengines.com>2009-09-04 07:12:16 +0400
committerDavid S. Miller <davem@davemloft.net>2009-09-07 12:56:38 +0400
commit84517482e19bc775de7b3b4e998dee2f506bc34e (patch)
treeae3491a5cf8891feef8c2896ef50758d763646f2 /drivers/net/benet/be_ethtool.c
parent384824281caa9ac4b76664033416f1eac4a652fe (diff)
downloadlinux-84517482e19bc775de7b3b4e998dee2f506bc34e.tar.xz
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)
return status;
}
+static int
+be_do_flash(struct net_device *netdev, struct ethtool_flash *efl)
+{
+ struct be_adapter *adapter = netdev_priv(netdev);
+ char file_name[ETHTOOL_FLASH_MAX_FILENAME];
+ u32 region;
+
+ file_name[ETHTOOL_FLASH_MAX_FILENAME - 1] = 0;
+ strcpy(file_name, efl->data);
+ region = efl->region;
+
+ return be_load_fw(adapter, file_name);
+}
+
const struct ethtool_ops be_ethtool_ops = {
.get_settings = be_get_settings,
.get_drvinfo = be_get_drvinfo,
@@ -352,4 +366,5 @@ const struct ethtool_ops be_ethtool_ops = {
.get_strings = be_get_stat_strings,
.get_stats_count = be_get_stats_count,
.get_ethtool_stats = be_get_ethtool_stats,
+ .flash_device = be_do_flash,
};