Skip to content

Commit 84a6879

Browse files
ahduyckNipaLocal
authored andcommitted
fbnic: Add support for setting/getting pause configuration
Phylink already handles most of the pieces necessary for configuring autonegotation. With that being the case we can add support for getting/setting pause now by just passing through the ethtool call to the phylink code. Signed-off-by: Alexander Duyck <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent cee57e7 commit 84a6879

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

drivers/net/ethernet/meta/fbnic/fbnic_ethtool.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,8 @@ static const struct ethtool_ops fbnic_ethtool_ops = {
16881688
.set_coalesce = fbnic_set_coalesce,
16891689
.get_ringparam = fbnic_get_ringparam,
16901690
.set_ringparam = fbnic_set_ringparam,
1691+
.get_pauseparam = fbnic_phylink_get_pauseparam,
1692+
.set_pauseparam = fbnic_phylink_set_pauseparam,
16911693
.get_strings = fbnic_get_strings,
16921694
.get_ethtool_stats = fbnic_get_ethtool_stats,
16931695
.get_sset_count = fbnic_get_sset_count,

drivers/net/ethernet/meta/fbnic/fbnic_netdev.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ void fbnic_time_stop(struct fbnic_net *fbn);
9292
void __fbnic_set_rx_mode(struct net_device *netdev);
9393
void fbnic_clear_rx_mode(struct net_device *netdev);
9494

95+
void fbnic_phylink_get_pauseparam(struct net_device *netdev,
96+
struct ethtool_pauseparam *pause);
97+
int fbnic_phylink_set_pauseparam(struct net_device *netdev,
98+
struct ethtool_pauseparam *pause);
9599
int fbnic_phylink_ethtool_ksettings_get(struct net_device *netdev,
96100
struct ethtool_link_ksettings *cmd);
97101
int fbnic_phylink_get_fecparam(struct net_device *netdev,

drivers/net/ethernet/meta/fbnic/fbnic_phylink.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,22 @@ static phy_interface_t fbnic_phylink_select_interface(u8 aui)
2424
return PHY_INTERFACE_MODE_NA;
2525
}
2626

27+
void fbnic_phylink_get_pauseparam(struct net_device *netdev,
28+
struct ethtool_pauseparam *pause)
29+
{
30+
struct fbnic_net *fbn = netdev_priv(netdev);
31+
32+
phylink_ethtool_get_pauseparam(fbn->phylink, pause);
33+
}
34+
35+
int fbnic_phylink_set_pauseparam(struct net_device *netdev,
36+
struct ethtool_pauseparam *pause)
37+
{
38+
struct fbnic_net *fbn = netdev_priv(netdev);
39+
40+
return phylink_ethtool_set_pauseparam(fbn->phylink, pause);
41+
}
42+
2743
static void
2844
fbnic_phylink_get_supported_fec_modes(unsigned long *supported)
2945
{

0 commit comments

Comments
 (0)