Skip to content

Commit 9e63110

Browse files
committed
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 <[email protected]>
2 parents 9a1f02f + 466b97b commit 9e63110

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

drivers/net/phy/phylink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ static int phylink_parse_fixedlink(struct phylink *pl,
805805
phylink_warn(pl, "fixed link specifies half duplex for %dMbps link?\n",
806806
pl->link_config.speed);
807807

808-
bitmap_fill(pl->supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
808+
linkmode_fill(pl->supported);
809809
linkmode_copy(pl->link_config.advertising, pl->supported);
810810
phylink_validate(pl, pl->supported, &pl->link_config);
811811

@@ -1640,7 +1640,7 @@ struct phylink *phylink_create(struct phylink_config *config,
16401640
__set_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
16411641
timer_setup(&pl->link_poll, phylink_fixed_poll, 0);
16421642

1643-
bitmap_fill(pl->supported, __ETHTOOL_LINK_MODE_MASK_NBITS);
1643+
linkmode_fill(pl->supported);
16441644
linkmode_copy(pl->link_config.advertising, pl->supported);
16451645
phylink_validate(pl, pl->supported, &pl->link_config);
16461646

drivers/net/phy/sfp-bus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
328328
* modules use 2500Mbaud rather than 3100 or 3200Mbaud for
329329
* 2500BASE-X, so we allow some slack here.
330330
*/
331-
if (bitmap_empty(modes, __ETHTOOL_LINK_MODE_MASK_NBITS) && br_nom) {
331+
if (linkmode_empty(modes) && br_nom) {
332332
if (br_min <= 1300 && br_max >= 1200) {
333333
phylink_set(modes, 1000baseX_Full);
334334
__set_bit(PHY_INTERFACE_MODE_1000BASEX, interfaces);

include/linux/linkmode.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ static inline void linkmode_zero(unsigned long *dst)
1010
bitmap_zero(dst, __ETHTOOL_LINK_MODE_MASK_NBITS);
1111
}
1212

13+
static inline void linkmode_fill(unsigned long *dst)
14+
{
15+
bitmap_fill(dst, __ETHTOOL_LINK_MODE_MASK_NBITS);
16+
}
17+
1318
static inline void linkmode_copy(unsigned long *dst, const unsigned long *src)
1419
{
1520
bitmap_copy(dst, src, __ETHTOOL_LINK_MODE_MASK_NBITS);

0 commit comments

Comments
 (0)