mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-08-11 08:18:01 +00:00
net: add helpers to resolve negotiated flow control
Add a couple of helpers to resolve negotiated flow control. Two helpers are provided: - linkmode_resolve_pause() which takes the link partner and local advertisements, and decodes whether we should enable TX or RX pause at the MAC. This is useful outside of phylib, e.g. in phylink. - phy_get_pause(), which returns the TX/RX enablement status for the current negotiation results of the PHY. This allows us to centralise the flow control resolution, rather than spreading it around. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8062e2333f
commit
a87ae8a963
5 changed files with 79 additions and 1 deletions
include/linux
|
@ -88,4 +88,8 @@ static inline int linkmode_subset(const unsigned long *src1,
|
|||
return bitmap_subset(src1, src2, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
||||
}
|
||||
|
||||
void linkmode_resolve_pause(const unsigned long *local_adv,
|
||||
const unsigned long *partner_adv,
|
||||
bool *tx_pause, bool *rx_pause);
|
||||
|
||||
#endif /* __LINKMODE_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue