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: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
9e6311010c
@ -805,7 +805,7 @@ static int phylink_parse_fixedlink(struct phylink *pl,
|
||||
phylink_warn(pl, "fixed link specifies half duplex for %dMbps link?\n",
|
||||
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);
|
||||
phylink_validate(pl, pl->supported, &pl->link_config);
|
||||
|
||||
@ -1640,7 +1640,7 @@ struct phylink *phylink_create(struct phylink_config *config,
|
||||
__set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
|
||||
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);
|
||||
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,
|
||||
* modules use 2500Mbaud rather than 3100 or 3200Mbaud for
|
||||
* 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) {
|
||||
phylink_set(modes, 1000baseX_Full);
|
||||
__set_bit(PHY_INTERFACE_MODE_1000BASEX, interfaces);
|
||||
|
@ -10,6 +10,11 @@ static inline void linkmode_zero(unsigned long *dst)
|
||||
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)
|
||||
{
|
||||
bitmap_copy(dst, src, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
|
Loading…
Reference in New Issue
Block a user