Commit db15dfa9 authored by Padmanabh Ratnakar's avatar Padmanabh Ratnakar Committed by David S. Miller

be2net: Fix ethtool get_settings output for VF

Return default values for fields for which VFs dont have privilege to get the
required information from FW.
Signed-off-by: default avatarPadmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f25b119c
...@@ -528,6 +528,10 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -528,6 +528,10 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
u8 link_status; u8 link_status;
u16 link_speed = 0; u16 link_speed = 0;
int status; int status;
u32 auto_speeds;
u32 fixed_speeds;
u32 dac_cable_len;
u16 interface_type;
if (adapter->phy.link_speed < 0) { if (adapter->phy.link_speed < 0) {
status = be_cmd_link_status_query(adapter, &link_speed, status = be_cmd_link_status_query(adapter, &link_speed,
...@@ -537,19 +541,22 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -537,19 +541,22 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
ethtool_cmd_speed_set(ecmd, link_speed); ethtool_cmd_speed_set(ecmd, link_speed);
status = be_cmd_get_phy_info(adapter); status = be_cmd_get_phy_info(adapter);
if (status) if (!status) {
return status; interface_type = adapter->phy.interface_type;
auto_speeds = adapter->phy.auto_speeds_supported;
fixed_speeds = adapter->phy.fixed_speeds_supported;
dac_cable_len = adapter->phy.dac_cable_len;
ecmd->supported = ecmd->supported =
convert_to_et_setting(adapter->phy.interface_type, convert_to_et_setting(interface_type,
adapter->phy.auto_speeds_supported | auto_speeds |
adapter->phy.fixed_speeds_supported); fixed_speeds);
ecmd->advertising = ecmd->advertising =
convert_to_et_setting(adapter->phy.interface_type, convert_to_et_setting(interface_type,
adapter->phy.auto_speeds_supported); auto_speeds);
ecmd->port = be_get_port_type(adapter->phy.interface_type, ecmd->port = be_get_port_type(interface_type,
adapter->phy.dac_cable_len); dac_cable_len);
if (adapter->phy.auto_speeds_supported) { if (adapter->phy.auto_speeds_supported) {
ecmd->supported |= SUPPORTED_Autoneg; ecmd->supported |= SUPPORTED_Autoneg;
...@@ -557,10 +564,9 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -557,10 +564,9 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
ecmd->advertising |= ADVERTISED_Autoneg; ecmd->advertising |= ADVERTISED_Autoneg;
} }
if (be_pause_supported(adapter)) {
ecmd->supported |= SUPPORTED_Pause; ecmd->supported |= SUPPORTED_Pause;
if (be_pause_supported(adapter))
ecmd->advertising |= ADVERTISED_Pause; ecmd->advertising |= ADVERTISED_Pause;
}
switch (adapter->phy.interface_type) { switch (adapter->phy.interface_type) {
case PHY_TYPE_KR_10GB: case PHY_TYPE_KR_10GB:
...@@ -571,6 +577,11 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -571,6 +577,11 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
ecmd->transceiver = XCVR_EXTERNAL; ecmd->transceiver = XCVR_EXTERNAL;
break; break;
} }
} else {
ecmd->port = PORT_OTHER;
ecmd->autoneg = AUTONEG_DISABLE;
ecmd->transceiver = XCVR_DUMMY1;
}
/* Save for future use */ /* Save for future use */
adapter->phy.link_speed = ethtool_cmd_speed(ecmd); adapter->phy.link_speed = ethtool_cmd_speed(ecmd);
......
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