diff options
author | Suresh Reddy <suresh.reddy@broadcom.com> | 2016-02-03 09:49:16 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-07 13:55:22 -0500 |
commit | a5a773a54e59538d03fd1a20facd7214c030b1d3 (patch) | |
tree | bafb62bacabfbe890134f70fe1dad14e097c2eff /drivers/net/ethernet/emulex | |
parent | 19f76f63507fa87f56eb3d864318c5c65268bb46 (diff) | |
download | linux-stable-a5a773a54e59538d03fd1a20facd7214c030b1d3.tar.gz linux-stable-a5a773a54e59538d03fd1a20facd7214c030b1d3.tar.bz2 linux-stable-a5a773a54e59538d03fd1a20facd7214c030b1d3.zip |
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>
Diffstat (limited to 'drivers/net/ethernet/emulex')
-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, enum ethtool_phys_id_state state) { struct be_adapter *adapter = netdev_priv(netdev); + int status = 0; switch (state) { case ETHTOOL_ID_ACTIVE: - be_cmd_get_beacon_state(adapter, adapter->hba_port_num, - &adapter->beacon_state); - return 1; /* cycle on/off once per second */ + status = be_cmd_get_beacon_state(adapter, adapter->hba_port_num, + &adapter->beacon_state); + if (status) + return be_cmd_status(status); + return 1; /* cycle on/off once per second */ case ETHTOOL_ID_ON: - be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0, - BEACON_STATE_ENABLED); + status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num, + 0, 0, BEACON_STATE_ENABLED); break; case ETHTOOL_ID_OFF: - be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0, - BEACON_STATE_DISABLED); + status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num, + 0, 0, BEACON_STATE_DISABLED); break; case ETHTOOL_ID_INACTIVE: - be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0, - adapter->beacon_state); + status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num, + 0, 0, adapter->beacon_state); } - return 0; + return be_cmd_status(status); } static int be_set_dump(struct net_device *netdev, struct ethtool_dump *dump) |