Commit 9e631101 authored by David S. Miller's avatar David S. Miller

Merge branch 'phylink-sfp-linkmode'

Russell King says:

====================
net: Add linkmode_fill, use linkmode_*() in phylink/sfp code

This small series adds a linkmode_fill() op, and uses it in phylink.
The SFP code is also converted to use linkmode_*() ops.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 9a1f02f3 466b97b1
...@@ -805,7 +805,7 @@ static int phylink_parse_fixedlink(struct phylink *pl, ...@@ -805,7 +805,7 @@ static int phylink_parse_fixedlink(struct phylink *pl,
phylink_warn(pl, "fixed link specifies half duplex for %dMbps link?\n", phylink_warn(pl, "fixed link specifies half duplex for %dMbps link?\n",
pl->link_config.speed); pl->link_config.speed);
bitmap_fill(pl->supported, __ETHTOOL_LINK_MODE_MASK_NBITS); linkmode_fill(pl->supported);
linkmode_copy(pl->link_config.advertising, pl->supported); linkmode_copy(pl->link_config.advertising, pl->supported);
phylink_validate(pl, pl->supported, &pl->link_config); phylink_validate(pl, pl->supported, &pl->link_config);
...@@ -1640,7 +1640,7 @@ struct phylink *phylink_create(struct phylink_config *config, ...@@ -1640,7 +1640,7 @@ struct phylink *phylink_create(struct phylink_config *config,
__set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state); __set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
timer_setup(&pl->link_poll, phylink_fixed_poll, 0); timer_setup(&pl->link_poll, phylink_fixed_poll, 0);
bitmap_fill(pl->supported, __ETHTOOL_LINK_MODE_MASK_NBITS); linkmode_fill(pl->supported);
linkmode_copy(pl->link_config.advertising, pl->supported); linkmode_copy(pl->link_config.advertising, pl->supported);
phylink_validate(pl, pl->supported, &pl->link_config); phylink_validate(pl, pl->supported, &pl->link_config);
......
...@@ -328,7 +328,7 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id, ...@@ -328,7 +328,7 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
* modules use 2500Mbaud rather than 3100 or 3200Mbaud for * modules use 2500Mbaud rather than 3100 or 3200Mbaud for
* 2500BASE-X, so we allow some slack here. * 2500BASE-X, so we allow some slack here.
*/ */
if (bitmap_empty(modes, __ETHTOOL_LINK_MODE_MASK_NBITS) && br_nom) { if (linkmode_empty(modes) && br_nom) {
if (br_min <= 1300 && br_max >= 1200) { if (br_min <= 1300 && br_max >= 1200) {
phylink_set(modes, 1000baseX_Full); phylink_set(modes, 1000baseX_Full);
__set_bit(PHY_INTERFACE_MODE_1000BASEX, interfaces); __set_bit(PHY_INTERFACE_MODE_1000BASEX, interfaces);
......
...@@ -10,6 +10,11 @@ static inline void linkmode_zero(unsigned long *dst) ...@@ -10,6 +10,11 @@ static inline void linkmode_zero(unsigned long *dst)
bitmap_zero(dst, __ETHTOOL_LINK_MODE_MASK_NBITS); bitmap_zero(dst, __ETHTOOL_LINK_MODE_MASK_NBITS);
} }
static inline void linkmode_fill(unsigned long *dst)
{
bitmap_fill(dst, __ETHTOOL_LINK_MODE_MASK_NBITS);
}
static inline void linkmode_copy(unsigned long *dst, const unsigned long *src) static inline void linkmode_copy(unsigned long *dst, const unsigned long *src)
{ {
bitmap_copy(dst, src, __ETHTOOL_LINK_MODE_MASK_NBITS); bitmap_copy(dst, src, __ETHTOOL_LINK_MODE_MASK_NBITS);
......
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