[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9235D6609DB808459E95D78E17F2E43D404B3871@CHN-SV-EXMX02.mchp-main.com>
Date: Fri, 19 Feb 2016 00:03:50 +0000
From: <Woojung.Huh@...rochip.com>
To: <ben@...adent.org.uk>, <davem@...emloft.net>
CC: <netdev@...r.kernel.org>
Subject: RE: [PATCH V2 net-next 2/3] lan78xx: add ethtool set & get pause
functions
> > Add ethtool operations of set_pauseram and get_pauseparm.
> [...]
> > +static void lan78xx_get_pause(struct net_device *net,
> > + struct ethtool_pauseparam *pause)
> > +{
> > + struct lan78xx_net *dev = netdev_priv(net);
> > + struct phy_device *phydev = net->phydev;
> > + struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
> > +
> > + phy_ethtool_gset(phydev, &ecmd);
> > +
> > + pause->autoneg = dev->fc_autoneg;
> > +
> > + if (dev->fc_autoneg) {
> > + if (dev->fc_autoneg_control & FLOW_CTRL_TX)
> > + pause->tx_pause = 1;
> > +
> > + if (dev->fc_autoneg_control & FLOW_CTRL_RX)
> > + pause->rx_pause = 1;
>
> This is incorrect; you should always return the manual settings
> (fc_request_control flags) here. If autonegotiation is enabled then
> your get_settings function will return the actual pause flags.
>
> Ben.
Ben, thanks for comments.
How about comment in include/uapi/linux/ethtool.h?
It says
** struct ethtool_pauseparam - Ethernet pause (flow control) parameters
...
* If @autoneg is non-zero, the MAC is configured to send and/or
* receive pause frames according to the result of autonegotiation.
Doesn't this mean get_pauseparam() returns pause settings based on
Result of autonegotation? Not manual settings of rx_param & tx_param?
Woojung
Powered by blists - more mailing lists