Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150071
b: refs/heads/master
c: af2a3ea
h: refs/heads/master
i:
  150069: 59c91d2
  150067: 4da25b4
  150063: f0b1807
v: v3
  • Loading branch information
Ben Hutchings authored and David S. Miller committed Apr 30, 2009
1 parent b2f55b4 commit 097b8fe
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a8c30832b5b12e5d4e9d1c20cdac3cc2880e08b8
refs/heads/master: af2a3eac2fe6a6d8e9fdf6927284b34466a7d808
30 changes: 30 additions & 0 deletions trunk/drivers/net/mdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,36 @@ void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio,
}
EXPORT_SYMBOL(mdio45_ethtool_gset_npage);

/**
* mdio45_ethtool_spauseparam_an - set auto-negotiated pause parameters
* @mdio: MDIO interface
* @ecmd: Ethtool request structure
*
* This function assumes that the PHY has an auto-negotiation MMD. It
* will enable and disable advertising of flow control as appropriate.
*/
void mdio45_ethtool_spauseparam_an(const struct mdio_if_info *mdio,
const struct ethtool_pauseparam *ecmd)
{
int adv, old_adv;

WARN_ON(!(mdio->mmds & MDIO_DEVS_AN));

old_adv = mdio->mdio_read(mdio->dev, mdio->prtad, MDIO_MMD_AN,
MDIO_AN_ADVERTISE);
adv = old_adv & ~(ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM);
if (ecmd->autoneg)
adv |= mii_advertise_flowctrl(
(ecmd->rx_pause ? FLOW_CTRL_RX : 0) |
(ecmd->tx_pause ? FLOW_CTRL_TX : 0));
if (adv != old_adv) {
mdio->mdio_write(mdio->dev, mdio->prtad, MDIO_MMD_AN,
MDIO_AN_ADVERTISE, adv);
mdio45_nway_restart(mdio);
}
}
EXPORT_SYMBOL(mdio45_ethtool_spauseparam_an);

/**
* mdio_mii_ioctl - MII ioctl interface for MDIO (clause 22 or 45) PHYs
* @mdio: MDIO interface
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/mdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ extern int mdio45_nway_restart(const struct mdio_if_info *mdio);
extern void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio,
struct ethtool_cmd *ecmd,
u32 npage_adv, u32 npage_lpa);
extern void
mdio45_ethtool_spauseparam_an(const struct mdio_if_info *mdio,
const struct ethtool_pauseparam *ecmd);

/**
* mdio45_ethtool_gset - get settings for ETHTOOL_GSET
Expand Down

0 comments on commit 097b8fe

Please sign in to comment.