diff options
author | Suresh Reddy <suresh.reddy@broadcom.com> | 2016-02-02 23:19:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-07 13:55:22 -0500 |
commit | a5a773a54e59538d03fd1a20facd7214c030b1d3 (patch) | |
tree | bafb62bacabfbe890134f70fe1dad14e097c2eff | |
parent | 19f76f63507fa87f56eb3d864318c5c65268bb46 (diff) |
be2net: return error status from be_set_phys_id()
be_set_phys_id() returns 0 to ethtool when the command fails in the FW.
This patch fixes the set_phys_id() to return -EIO in case the FW cmd fails.
Signed-off-by: Suresh Reddy <suresh.reddy@broadcom.com>
Signed-off-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_ethtool.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c index a19ac441336f..2ff691636dac 100644 --- a/drivers/net/ethernet/emulex/benet/be_ethtool.c +++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c | |||
@@ -720,29 +720,32 @@ static int be_set_phys_id(struct net_device *netdev, | |||
720 | enum ethtool_phys_id_state state) | 720 | enum ethtool_phys_id_state state) |
721 | { | 721 | { |
722 | struct be_adapter *adapter = netdev_priv(netdev); | 722 | struct be_adapter *adapter = netdev_priv(netdev); |
723 | int status = 0; | ||
723 | 724 | ||
724 | switch (state) { | 725 | switch (state) { |
725 | case ETHTOOL_ID_ACTIVE: | 726 | case ETHTOOL_ID_ACTIVE: |
726 | be_cmd_get_beacon_state(adapter, adapter->hba_port_num, | 727 | status = be_cmd_get_beacon_state(adapter, adapter->hba_port_num, |
727 | &adapter->beacon_state); | 728 | &adapter->beacon_state); |
728 | return 1; /* cycle on/off once per second */ | 729 | if (status) |
730 | return be_cmd_status(status); | ||
731 | return 1; /* cycle on/off once per second */ | ||
729 | 732 | ||
730 | case ETHTOOL_ID_ON: | 733 | case ETHTOOL_ID_ON: |
731 | be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0, | 734 | status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num, |
732 | BEACON_STATE_ENABLED); | 735 | 0, 0, BEACON_STATE_ENABLED); |
733 | break; | 736 | break; |
734 | 737 | ||
735 | case ETHTOOL_ID_OFF: | 738 | case ETHTOOL_ID_OFF: |
736 | be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0, | 739 | status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num, |
737 | BEACON_STATE_DISABLED); | 740 | 0, 0, BEACON_STATE_DISABLED); |
738 | break; | 741 | break; |
739 | 742 | ||
740 | case ETHTOOL_ID_INACTIVE: | 743 | case ETHTOOL_ID_INACTIVE: |
741 | be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0, | 744 | status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num, |
742 | adapter->beacon_state); | 745 | 0, 0, adapter->beacon_state); |
743 | } | 746 | } |
744 | 747 | ||
745 | return 0; | 748 | return be_cmd_status(status); |
746 | } | 749 | } |
747 | 750 | ||
748 | static int be_set_dump(struct net_device *netdev, struct ethtool_dump *dump) | 751 | static int be_set_dump(struct net_device *netdev, struct ethtool_dump *dump) |