Commit 0bd27406 authored by Russell King's avatar Russell King Committed by David S. Miller

net: phylink: change phylink_mii_c22_pcs_set_advertisement() prototype

Change phylink_mii_c22_pcs_set_advertisement() to take only the PHY
interface and advertisement mask, rather than the full phylink state.
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b8447abc
...@@ -2184,7 +2184,8 @@ EXPORT_SYMBOL_GPL(phylink_mii_c22_pcs_get_state); ...@@ -2184,7 +2184,8 @@ EXPORT_SYMBOL_GPL(phylink_mii_c22_pcs_get_state);
* phylink_mii_c22_pcs_set_advertisement() - configure the clause 37 PCS * phylink_mii_c22_pcs_set_advertisement() - configure the clause 37 PCS
* advertisement * advertisement
* @pcs: a pointer to a &struct mdio_device. * @pcs: a pointer to a &struct mdio_device.
* @state: a pointer to the state being configured. * @interface: the PHY interface mode being configured
* @advertising: the ethtool advertisement mask
* *
* Helper for MAC PCS supporting the 802.3 clause 22 register set for * Helper for MAC PCS supporting the 802.3 clause 22 register set for
* clause 37 negotiation and/or SGMII control. * clause 37 negotiation and/or SGMII control.
...@@ -2197,22 +2198,23 @@ EXPORT_SYMBOL_GPL(phylink_mii_c22_pcs_get_state); ...@@ -2197,22 +2198,23 @@ EXPORT_SYMBOL_GPL(phylink_mii_c22_pcs_get_state);
* zero if no change has been made, or one if the advertisement has changed. * zero if no change has been made, or one if the advertisement has changed.
*/ */
int phylink_mii_c22_pcs_set_advertisement(struct mdio_device *pcs, int phylink_mii_c22_pcs_set_advertisement(struct mdio_device *pcs,
const struct phylink_link_state *state) phy_interface_t interface,
const unsigned long *advertising)
{ {
struct mii_bus *bus = pcs->bus; struct mii_bus *bus = pcs->bus;
int addr = pcs->addr; int addr = pcs->addr;
int val, ret; int val, ret;
u16 adv; u16 adv;
switch (state->interface) { switch (interface) {
case PHY_INTERFACE_MODE_1000BASEX: case PHY_INTERFACE_MODE_1000BASEX:
case PHY_INTERFACE_MODE_2500BASEX: case PHY_INTERFACE_MODE_2500BASEX:
adv = ADVERTISE_1000XFULL; adv = ADVERTISE_1000XFULL;
if (linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT, if (linkmode_test_bit(ETHTOOL_LINK_MODE_Pause_BIT,
state->advertising)) advertising))
adv |= ADVERTISE_1000XPAUSE; adv |= ADVERTISE_1000XPAUSE;
if (linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, if (linkmode_test_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT,
state->advertising)) advertising))
adv |= ADVERTISE_1000XPSE_ASYM; adv |= ADVERTISE_1000XPSE_ASYM;
val = mdiobus_read(bus, addr, MII_ADVERTISE); val = mdiobus_read(bus, addr, MII_ADVERTISE);
......
...@@ -320,7 +320,8 @@ void phylink_helper_basex_speed(struct phylink_link_state *state); ...@@ -320,7 +320,8 @@ void phylink_helper_basex_speed(struct phylink_link_state *state);
void phylink_mii_c22_pcs_get_state(struct mdio_device *pcs, void phylink_mii_c22_pcs_get_state(struct mdio_device *pcs,
struct phylink_link_state *state); struct phylink_link_state *state);
int phylink_mii_c22_pcs_set_advertisement(struct mdio_device *pcs, int phylink_mii_c22_pcs_set_advertisement(struct mdio_device *pcs,
const struct phylink_link_state *state); phy_interface_t interface,
const unsigned long *advertising);
void phylink_mii_c22_pcs_an_restart(struct mdio_device *pcs); void phylink_mii_c22_pcs_an_restart(struct mdio_device *pcs);
void phylink_mii_c45_pcs_get_state(struct mdio_device *pcs, void phylink_mii_c45_pcs_get_state(struct mdio_device *pcs,
......
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