Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2323886rdb; Fri, 8 Dec 2023 05:09:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFC/HkGnSFcG0GPpnm09CEEIBgMBRFxwJkbL+WtlXyHWjJRGHR7VyG15KxeLBCpqN74B8+K X-Received: by 2002:a05:6a00:2288:b0:6ce:2731:a095 with SMTP id f8-20020a056a00228800b006ce2731a095mr4519551pfe.68.1702040944869; Fri, 08 Dec 2023 05:09:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702040944; cv=none; d=google.com; s=arc-20160816; b=bo8TZTogLTbNnjSdGt26JD3K36F94E766dU/ZzTEntp7sK0RFtx8RkI4CrUQ6hLi79 ECuXXoFbE7TgefZECFuV/Ua1ADabNRabf5wdUUUb0YgvUUUVcLAcKMYC8khNHSUvKREr B7Mh33V78vYvegZ7Bx+GYv539QwYZgRFPxW+TzL22VwElhaje5tsx+t4LYHMF6/BvR4G uHr5sj98ilILrexNdwRzlm+209AZX2sirYtH6NVt+HDE54W6SpR7LanWqD19tHOhCdey QHlUU9l4tr8utisGTBsVhm4B/GfQ99G6D73rosVyC8WabAZXvWiPcSV52LSnLq5EFdnb qjcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2uqrxoJfKu97qTEB3nwXnMLgOA8AJ2MT8uVklnbJidk=; fh=ttZsY8jb7AwbD8F+uDO0j2ZVzMg7PhGR0kui8Ium2q8=; b=Be++gHKX9I9JCQZOZyIYLh5FxkqwumCsdegxVwLGPivlYg7s5Icl26x4och1A75g+O 1QvvY2x3P4kQyp7Wi0vq08anNUBQbaUJDI8dZYgljsVzyEwBJKnOu4OGdg4Mt/etzI2e euKWhffOt2IdVmouZ2uaaUqdRWJrAcjyOaJqKgCifnNtRSFOKt5K13g5E8vROSErmyad 9rdDw4PkUvMtquCtQGB0soPyq8H1D2gfy1FoOZLItzQxMz9BuTU4b3f1AGLpUTUhreDu MAjbP1ADWdc/wMtUD3BKPWOWVq65bZW8ULrVeysKzz7Soyd6fy6JmL4yHxE7IBBfmwkX TXPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=6I+obFWl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id l5-20020a656805000000b005c60319034csi1498250pgt.644.2023.12.08.05.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 05:09:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=6I+obFWl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 4D6B682516D7; Fri, 8 Dec 2023 05:09:02 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233578AbjLHNIr (ORCPT + 99 others); Fri, 8 Dec 2023 08:08:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230256AbjLHNIq (ORCPT ); Fri, 8 Dec 2023 08:08:46 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2196C171F; Fri, 8 Dec 2023 05:08:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=2uqrxoJfKu97qTEB3nwXnMLgOA8AJ2MT8uVklnbJidk=; b=6I+obFWleDOwa+2LqL7HXGXT+J 8l1Kz4XRqO89xKXU7AEyM6dT4XM3X5AJovokahzxzKNyVjlP+sQcZ/4UH/D29bd8AJNhGhj5is9JG SfeYoxKdIKzhDsqz0MydIAL5PsOvNM7JL1xWbjj1hhz+MWzqqA+KhdoUrv5O4n0OR/9E=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rBaap-002Ptv-Ge; Fri, 08 Dec 2023 14:08:35 +0100 Date: Fri, 8 Dec 2023 14:08:35 +0100 From: Andrew Lunn To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: Daniel Golle , Lee Jones , Pavel Machek , Jakub Kicinski , Christian Marangi , "David S. Miller" , Li Zetao , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: Re: [PATCH v3 1/2] leds: trigger: netdev: extend speeds up to 10G Message-ID: References: <99e7d3304c6bba7f4863a4a80764a869855f2085.1701143925.git.daniel@makrotopia.org> <20231207172923.62ce530e@dellmb> <20231208075804.4f8559e6@dellmb> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231208075804.4f8559e6@dellmb> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 08 Dec 2023 05:09:02 -0800 (PST) > What if the netdev does not have a PHY? The MAC also has speed > information. The ethtool API provides a list of link modes the MAC supports: /usr/sbin/ethtool enp2s0 Settings for enp2s0: Supported ports: [ TP MII ] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full The MAC driver can provide this information by calling into phylib or phylink, or it can do it some other way. In fact, none of the LED code goes direct to the PHY when determining when to blink in software, its all via the struct net_device. We should use the ethtool API to determine which speed sysfs files should exist. Andrew