diff options
author | Kalesh AP <kalesh.purayil@emulex.com> | 2014-08-01 08:17:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-02 18:59:18 -0400 |
commit | f0613380152a9290b68390ce60ba400ed25c780d (patch) | |
tree | a044460f3c86fa21bb1628935897538b90dc7fff /drivers/net/ethernet/emulex/benet/be_ethtool.c | |
parent | 3c31aaf340387a209b6f7036adaa8522a1cd7f18 (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.c | 17 |
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) | |||
681 | struct device *dev = &adapter->pdev->dev; | 681 | struct device *dev = &adapter->pdev->dev; |
682 | int status; | 682 | int status; |
683 | 683 | ||
684 | if (!lancer_chip(adapter)) { | 684 | if (!lancer_chip(adapter) || |
685 | dev_err(dev, "FW dump not supported\n"); | 685 | !check_privilege(adapter, MAX_PRIVILEGES)) |
686 | return -EOPNOTSUPP; | 686 | return -EOPNOTSUPP; |
687 | } | ||
688 | |||
689 | if (dump_present(adapter)) { | ||
690 | dev_err(dev, "Previous dump not cleared, not forcing dump\n"); | ||
691 | return 0; | ||
692 | } | ||
693 | 687 | ||
694 | switch (dump->flag) { | 688 | switch (dump->flag) { |
695 | case LANCER_INITIATE_FW_DUMP: | 689 | case LANCER_INITIATE_FW_DUMP: |
696 | status = lancer_initiate_dump(adapter); | 690 | status = lancer_initiate_dump(adapter); |
697 | if (!status) | 691 | if (!status) |
698 | dev_info(dev, "F/w dump initiated successfully\n"); | 692 | dev_info(dev, "FW dump initiated successfully\n"); |
699 | break; | 693 | break; |
694 | case LANCER_DELETE_FW_DUMP: | ||
695 | status = lancer_delete_dump(adapter); | ||
696 | if (!status) | ||
697 | dev_info(dev, "FW dump deleted successfully\n"); | ||
698 | break; | ||
700 | default: | 699 | default: |
701 | dev_err(dev, "Invalid dump level: 0x%x\n", dump->flag); | 700 | dev_err(dev, "Invalid dump level: 0x%x\n", dump->flag); |
702 | return -EINVAL; | 701 | return -EINVAL; |