Commit a5a773a5 authored by Suresh Reddy's avatar Suresh Reddy Committed by David S. Miller

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: default avatarSuresh Reddy <suresh.reddy@broadcom.com>
Signed-off-by: default avatarSriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 19f76f63
...@@ -720,29 +720,32 @@ static int be_set_phys_id(struct net_device *netdev, ...@@ -720,29 +720,32 @@ static int be_set_phys_id(struct net_device *netdev,
enum ethtool_phys_id_state state) enum ethtool_phys_id_state state)
{ {
struct be_adapter *adapter = netdev_priv(netdev); struct be_adapter *adapter = netdev_priv(netdev);
int status = 0;
switch (state) { switch (state) {
case ETHTOOL_ID_ACTIVE: case ETHTOOL_ID_ACTIVE:
be_cmd_get_beacon_state(adapter, adapter->hba_port_num, status = be_cmd_get_beacon_state(adapter, adapter->hba_port_num,
&adapter->beacon_state); &adapter->beacon_state);
return 1; /* cycle on/off once per second */ if (status)
return be_cmd_status(status);
return 1; /* cycle on/off once per second */
case ETHTOOL_ID_ON: case ETHTOOL_ID_ON:
be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0, status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num,
BEACON_STATE_ENABLED); 0, 0, BEACON_STATE_ENABLED);
break; break;
case ETHTOOL_ID_OFF: case ETHTOOL_ID_OFF:
be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0, status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num,
BEACON_STATE_DISABLED); 0, 0, BEACON_STATE_DISABLED);
break; break;
case ETHTOOL_ID_INACTIVE: case ETHTOOL_ID_INACTIVE:
be_cmd_set_beacon_state(adapter, adapter->hba_port_num, 0, 0, status = be_cmd_set_beacon_state(adapter, adapter->hba_port_num,
adapter->beacon_state); 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) static int be_set_dump(struct net_device *netdev, struct ethtool_dump *dump)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment