summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/emulex/benet/be_ethtool.c
diff options
context:
space:
mode:
authorKalesh AP <kalesh.purayil@emulex.com>2014-08-01 17:47:32 +0530
committerDavid S. Miller <davem@davemloft.net>2014-08-02 15:59:18 -0700
commitf0613380152a9290b68390ce60ba400ed25c780d (patch)
treea044460f3c86fa21bb1628935897538b90dc7fff /drivers/net/ethernet/emulex/benet/be_ethtool.c
parent3c31aaf340387a209b6f7036adaa8522a1cd7f18 (diff)
be2net: support deleting FW dump via ethtool (only for Lancer)
This patch adds support to delete an existing FW-dump in Lancer via ethtool. Initiating a new dump is not allowed if a FW dump is already present in the adapter. The existing dump has to be first explicitly deleted. Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex/benet/be_ethtool.c')
-rw-r--r--drivers/net/ethernet/emulex/benet/be_ethtool.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
index 25f516d6eb9e..0cd3311409a8 100644
--- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
+++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
@@ -681,22 +681,21 @@ static int be_set_dump(struct net_device *netdev, struct ethtool_dump *dump)
struct device *dev = &adapter->pdev->dev;
int status;
- if (!lancer_chip(adapter)) {
- dev_err(dev, "FW dump not supported\n");
+ if (!lancer_chip(adapter) ||
+ !check_privilege(adapter, MAX_PRIVILEGES))
return -EOPNOTSUPP;
- }
-
- if (dump_present(adapter)) {
- dev_err(dev, "Previous dump not cleared, not forcing dump\n");
- return 0;
- }
switch (dump->flag) {
case LANCER_INITIATE_FW_DUMP:
status = lancer_initiate_dump(adapter);
if (!status)
- dev_info(dev, "F/w dump initiated successfully\n");
+ dev_info(dev, "FW dump initiated successfully\n");
break;
+ case LANCER_DELETE_FW_DUMP:
+ status = lancer_delete_dump(adapter);
+ if (!status)
+ dev_info(dev, "FW dump deleted successfully\n");
+ break;
default:
dev_err(dev, "Invalid dump level: 0x%x\n", dump->flag);
return -EINVAL;