Commit c634263d authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller

sfc: 10Xpress: Initialise pause advertising flags

The mdio module now handles reconfiguration of pause advertising
through ethtool, but not initialisation.  Add the necessary
initialisation to tenxpress_phy_init().
Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 27fbc7db
...@@ -301,6 +301,7 @@ static int tenxpress_init(struct efx_nic *efx) ...@@ -301,6 +301,7 @@ static int tenxpress_init(struct efx_nic *efx)
static int tenxpress_phy_init(struct efx_nic *efx) static int tenxpress_phy_init(struct efx_nic *efx)
{ {
struct tenxpress_phy_data *phy_data; struct tenxpress_phy_data *phy_data;
u16 old_adv, adv;
int rc = 0; int rc = 0;
phy_data = kzalloc(sizeof(*phy_data), GFP_KERNEL); phy_data = kzalloc(sizeof(*phy_data), GFP_KERNEL);
...@@ -333,6 +334,15 @@ static int tenxpress_phy_init(struct efx_nic *efx) ...@@ -333,6 +334,15 @@ static int tenxpress_phy_init(struct efx_nic *efx)
if (rc < 0) if (rc < 0)
goto fail; goto fail;
/* Set pause advertising */
old_adv = efx_mdio_read(efx, MDIO_MMD_AN, MDIO_AN_ADVERTISE);
adv = ((old_adv & ~(ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM)) |
mii_advertise_flowctrl(efx->wanted_fc));
if (adv != old_adv) {
efx_mdio_write(efx, MDIO_MMD_AN, MDIO_AN_ADVERTISE, adv);
mdio45_nway_restart(&efx->mdio);
}
if (efx->phy_type == PHY_TYPE_SFT9001B) { if (efx->phy_type == PHY_TYPE_SFT9001B) {
rc = device_create_file(&efx->pci_dev->dev, rc = device_create_file(&efx->pci_dev->dev,
&dev_attr_phy_short_reach); &dev_attr_phy_short_reach);
......
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