From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH v2 net-next 18/21] net: usb: aqc111: Implement get/set_link_ksettings callbacks Date: Tue, 13 Nov 2018 21:50:41 +0100 Message-ID: <20181113205041.GA9828@lunn.ch> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "David S . Miller" , "linux-usb@vger.kernel.org" , "netdev@vger.kernel.org" , Dmitry Bezrukov To: Igor Russkikh Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:33794 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725748AbeKNGui (ORCPT ); Wed, 14 Nov 2018 01:50:38 -0500 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Tue, Nov 13, 2018 at 02:45:13PM +0000, Igor Russkikh wrote: > +static int aqc111_get_link_ksettings(struct net_device *net, > + struct ethtool_link_ksettings *elk) > +{ > + struct usbnet *dev = netdev_priv(net); > + struct aqc111_data *aqc111_data = dev->driver_priv; > + enum usb_device_speed usb_speed = dev->udev->speed; > + u32 speed = SPEED_UNKNOWN; > + > + ethtool_link_ksettings_zero_link_mode(elk, supported); > + ethtool_link_ksettings_add_link_mode(elk, supported, > + 100baseT_Full); > + ethtool_link_ksettings_add_link_mode(elk, supported, > + 1000baseT_Full); > + if (usb_speed == USB_SPEED_SUPER) { > + ethtool_link_ksettings_add_link_mode(elk, supported, > + 2500baseT_Full); > + ethtool_link_ksettings_add_link_mode(elk, supported, > + 5000baseT_Full); > + } Hi Igor We discussed this with the first version of the patches. I think you should add a comment explaining why 2.5G and 5G is disabled unless Super speed is available. > + if (aqc111_data->autoneg) > + bitmap_copy(elk->link_modes.advertising, > + elk->link_modes.supported, > + __ETHTOOL_LINK_MODE_MASK_NBITS); linkmode_copy(). It is quite new, so you probably don't know about it. Andrew