History

ethtool: Update documentation of struct ethtool_pauseparam

Convert the inline comments to kernel-doc format. Explicitly specify that non-zero autoneg is an error if link autonegotiation is disabled. Specify that pause capabilities should be advertised dependent on link autonegotiation, not the autoneg flag here. There is no way to opt-out of pause frame autonegotiation, and this improves behaviour when the link partner is configured to follow pause frame autonegotiation and our interface is not.

Ben Hutchings committed 12 years ago

Commit 6a7a1081 parent af440a81 file · +23 −13Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/ethtool.h+23−13
@@ -466,20 +466,30 @@ struct ethtool_channels { · 465 unmodified lines
466466 __u32 combined_count;
467467 };
468468
469−/* for configuring link flow control parameters */
469+/**
470+ * struct ethtool_pauseparam - Ethernet pause (flow control) parameters
471+ * @cmd: Command number = %ETHTOOL_GPAUSEPARAM or %ETHTOOL_SPAUSEPARAM
472+ * @autoneg: Flag to enable autonegotiation of pause frame use
473+ * @rx_pause: Flag to enable reception of pause frames
474+ * @tx_pause: Flag to enable transmission of pause frames
475+ *
476+ * Drivers should reject a non-zero setting of @autoneg when
477+ * autoneogotiation is disabled (or not supported) for the link.
478+ *
479+ * If the link is autonegotiated, drivers should use
480+ * mii_advertise_flowctrl() or similar code to set the advertised
481+ * pause frame capabilities based on the @rx_pause and @tx_pause flags,
482+ * even if @autoneg is zero. They should also allow the advertised
483+ * pause frame capabilities to be controlled directly through the
484+ * advertising field of &struct ethtool_cmd.
485+ *
486+ * If @autoneg is non-zero, the MAC is configured to send and/or
487+ * receive pause frames according to the result of autonegotiation.
488+ * Otherwise, it is configured directly based on the @rx_pause and
489+ * @tx_pause flags.
490+ */
470491 struct ethtool_pauseparam {
471− __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
472−
473− /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
474− * being true) the user may set 'autoneg' here non-zero to have the
475− * pause parameters be auto-negotiated too. In such a case, the
476− * {rx,tx}_pause values below determine what capabilities are
477− * advertised.
478− *
479− * If 'autoneg' is zero or the link is not being auto-negotiated,
480− * then {rx,tx}_pause force the driver to use/not-use pause
481− * flow control.
482− */
492+ __u32 cmd;
483493 __u32 autoneg;
484494 __u32 rx_pause;
485495 __u32 tx_pause;