be2net: Bug fix to return correct values in ethtool get_settings.
Changes to return correct values for transceiver and supported in ethtool get_settings function. Signed-off-by: Sarveshwar Bandi <sarveshwarb@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
fced9999ed
commit
16c0214590
@ -275,6 +275,7 @@ struct be_adapter {
|
|||||||
u32 tx_fc; /* Tx flow control */
|
u32 tx_fc; /* Tx flow control */
|
||||||
int link_speed;
|
int link_speed;
|
||||||
u8 port_type;
|
u8 port_type;
|
||||||
|
u8 transceiver;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern const struct ethtool_ops be_ethtool_ops;
|
extern const struct ethtool_ops be_ethtool_ops;
|
||||||
|
@ -340,28 +340,50 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
|||||||
|
|
||||||
status = be_cmd_read_port_type(adapter, adapter->port_num,
|
status = be_cmd_read_port_type(adapter, adapter->port_num,
|
||||||
&connector);
|
&connector);
|
||||||
switch (connector) {
|
if (!status) {
|
||||||
case 7:
|
switch (connector) {
|
||||||
ecmd->port = PORT_FIBRE;
|
case 7:
|
||||||
break;
|
ecmd->port = PORT_FIBRE;
|
||||||
default:
|
ecmd->transceiver = XCVR_EXTERNAL;
|
||||||
ecmd->port = PORT_TP;
|
break;
|
||||||
break;
|
case 0:
|
||||||
|
ecmd->port = PORT_TP;
|
||||||
|
ecmd->transceiver = XCVR_EXTERNAL;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
ecmd->port = PORT_TP;
|
||||||
|
ecmd->transceiver = XCVR_INTERNAL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ecmd->port = PORT_AUI;
|
||||||
|
ecmd->transceiver = XCVR_INTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save for future use */
|
/* Save for future use */
|
||||||
adapter->link_speed = ecmd->speed;
|
adapter->link_speed = ecmd->speed;
|
||||||
adapter->port_type = ecmd->port;
|
adapter->port_type = ecmd->port;
|
||||||
|
adapter->transceiver = ecmd->transceiver;
|
||||||
} else {
|
} else {
|
||||||
ecmd->speed = adapter->link_speed;
|
ecmd->speed = adapter->link_speed;
|
||||||
ecmd->port = adapter->port_type;
|
ecmd->port = adapter->port_type;
|
||||||
|
ecmd->transceiver = adapter->transceiver;
|
||||||
}
|
}
|
||||||
|
|
||||||
ecmd->duplex = DUPLEX_FULL;
|
ecmd->duplex = DUPLEX_FULL;
|
||||||
ecmd->autoneg = AUTONEG_DISABLE;
|
ecmd->autoneg = AUTONEG_DISABLE;
|
||||||
ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_TP);
|
|
||||||
ecmd->phy_address = adapter->port_num;
|
ecmd->phy_address = adapter->port_num;
|
||||||
ecmd->transceiver = XCVR_INTERNAL;
|
switch (ecmd->port) {
|
||||||
|
case PORT_FIBRE:
|
||||||
|
ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
|
||||||
|
break;
|
||||||
|
case PORT_TP:
|
||||||
|
ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_TP);
|
||||||
|
break;
|
||||||
|
case PORT_AUI:
|
||||||
|
ecmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_AUI);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user