From patchwork Thu Jan 11 16:04:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 187431 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp1549991dyi; Thu, 11 Jan 2024 08:05:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGcGtZFvg658ssWOa2aQPdVaosymH9DC38oloOu0Gj/mzUvcgzDZJYkcEQoaa5B43mbumuo X-Received: by 2002:a81:aa48:0:b0:5f4:1540:48b8 with SMTP id z8-20020a81aa48000000b005f4154048b8mr17447ywk.4.1704989149743; Thu, 11 Jan 2024 08:05:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704989149; cv=none; d=google.com; s=arc-20160816; b=PTTEToo3wjOcLCwX7pKuDXUGlLKawnGzsACi+DJDj+rB+4A6GWPVOEgzCgmuv6je6/ nwctKtwLPL4iTX4VuB8CdF1isZM581CmQAJ7fs837nRWUZyYvYhQR4t2RPjIppYqdVLZ rLD1cDICMjBsX9fUnE0ylTgs4GK01gTrHHJ/b2iRbtclcFordnS7yYrYjHrDzE9F9EYX Kj7k1ZfnH78LZM2j9pEO0jldtrrjkrTKiLj6AilNz3dzKdmwFEryE3UVrxZlDfA88D9x H52ujVtpkbjJKrYumd9A4K+r8psnMG3f/WLx/gvXNWS7d1Vj9yWtn5XwvjdEAD80RZ/U G2nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=KgO2C2K3sxaq3X2gNkwdf4lQCjnJmutMW83/EFN7dt0=; fh=KQ7MkVTjAr5ghGDVJvNp/qJ6fmyHMjeiXM9R5K2C8Q4=; b=Ckk18maN6HqH4Kzb+RQ0Whf5ZY6Ctsy17WCn2lt8zslYqHZJW9I43deYpUf9cIyKYM UzwPCn7bWlvo+rsygeUFSazJTY/KHrCn2ON2/6jiErGMAxCXPpVH1FhfzfkFfCDDKasr OKD0GGNiDz85mo29GVU9S1s77w6qSm1Tm5nEVtsPP3+CvN8TAliBOPicgjXGa4MRuzee BTftXdJSrf96Te5FRnKY3cOtzcfCPAndNrJimLTRIKQOYN6DGjk71bnTja+3iA2H2hVo s7BTz3xtEuqET5R2+gmTfhMSmERb0M3mSS2XI1tCxq5oFGyn4eZiPJQJDyQZgAftBl7X V3NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eL28c4Ea; spf=pass (google.com: domain of linux-kernel+bounces-23827-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23827-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id z13-20020a05610236cd00b00466f60c8067si189294vss.530.2024.01.11.08.05.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 08:05:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23827-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eL28c4Ea; spf=pass (google.com: domain of linux-kernel+bounces-23827-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23827-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id C6D911C22EBF for ; Thu, 11 Jan 2024 16:05:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 25B0E4F8BC; Thu, 11 Jan 2024 16:05:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eL28c4Ea" Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1ADB2943E; Thu, 11 Jan 2024 16:05:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-40b5155e154so70618325e9.3; Thu, 11 Jan 2024 08:05:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704989112; x=1705593912; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=KgO2C2K3sxaq3X2gNkwdf4lQCjnJmutMW83/EFN7dt0=; b=eL28c4EapICFEDNr3AEuiHZEnIwsUy5v6Mb3dOyqz9vdu4b0SZnAJDspLmL8VLCRh0 x8ErxBqFDLm4/97NaY4UywQDU9lzhzEXY/8YQR5gTjUj6HSLZJCnBCNaKhx20c4APltE DpQC6xFCcvDLGgkf+JKm1GTdzyyA/goFY+NulimyYG9un4JEtYuykvJJBSDiZGBVsD2w tq8Tp50DeGj5i+QssCW89US00Us9ji6hz3u2Q31Bs4Vv8c+9Id8l7UeOi420y/MZN1ZZ bNMYQSmowgxiogYxtzQ88+GaYnTIrmzIWbJzjdFgxOGw35Ou3DKHLKqYOEuWix6ieNMO u2IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704989112; x=1705593912; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KgO2C2K3sxaq3X2gNkwdf4lQCjnJmutMW83/EFN7dt0=; b=wAo0X4/hEZhaMRIsaKqpncc8E3U4+Dund6PwhyudUs9plEOlOtGbNf2uTdCa1ScL+1 nTTjZesCyP2mkkisjZ3k/DjSJm1mSBqG89ClsbvqsCQnt4jYG/3oKyCqAigkvExsc4OR 7HLPJnTK9w4UffKKvnKlRnKQPA3lfU665IY6pdtwfh8KmsXgJEQfApwZfJMyssOmnJfR pGx4bYnHdraRth5soo5obxTIKuO0yfWoYXapO4xLDVMt2u/Hk7OkQMhQdfAGefA4qUyF 51vDN0clW6osq+8KWZqVT27Kc9Cr5Jcs2AOr2nC+W3NbiCKyMbzYQRnNi+EWDTueyv2+ KGmA== X-Gm-Message-State: AOJu0Yx+3PnPFlheUhovGLItIxglLf+HTWh5zqXwebMeR1LVKKsy901T JsyFGF5wK2Fav8mYn02lSDX/1QwEsSY= X-Received: by 2002:a05:600c:5251:b0:40e:490a:ed59 with SMTP id fc17-20020a05600c525100b0040e490aed59mr20601wmb.114.1704989111550; Thu, 11 Jan 2024 08:05:11 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id j17-20020a05600c1c1100b0040c46719966sm6350002wms.25.2024.01.11.08.05.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 08:05:10 -0800 (PST) From: Christian Marangi To: Pavel Machek , Lee Jones , Andrew Lunn , Christian Marangi , =?utf-8?q?Marek_Beh=C3=BAn?= , Jakub Kicinski , Daniel Golle , "David S. Miller" , Li Zetao , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: [PATCH v7 1/2] leds: trigger: netdev: display only supported link speed attribute Date: Thu, 11 Jan 2024 17:04:54 +0100 Message-ID: <20240111160501.1774-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787810702908333903 X-GMAIL-MSGID: 1787810702908333903 With the addition of more link speed mode to the netdev trigger, it was pointed out that there may be a problem with bloating the attribute list with modes that won't ever be supported by the trigger as the attached device name doesn't support them. To clear and address this problem, change the logic where these additional trigger modes are listed. Since the netdev trigger REQUIRE a device name to be set, attach to the device name change function additional logic to parse the supported link speed modes using ethtool APIs and show only the supported link speed modes attribute. Link speed attribute are refreshed on device_name set and on NETDEV_CHANGE events. This only apply to the link speed modes and every other mode is still provided by default. Signed-off-by: Christian Marangi Reviewed-by: Marek BehĂșn --- Took a while but I found a way to not use phy_speeds. Saddly that is way too specific to PHYs and we can't add PHYLIB as a dependency for leds. I instead found a handy way to keep everything to ethtool, it's a bit worse optimization wise but does the same work. (the perf penality is really minimal as we only parse supported speeds and it's difficult to have a device that have tons of speeds modes) Changes v7: - Fix comments to follow normal linux instead of net format Changes v6: - Improve comments wording - Add Reviewed-by tag Changes v5: - Add macro to make code less ugly Changes v4: - Rework to use an alternative to phy_speeds API Changes v3: - Use phy_speeds API to parse the ethtool mask Changes v2: - Use is_visibile instead of removing/adding attr drivers/leds/trigger/ledtrig-netdev.c | 90 +++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 6 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index 836610292b37..5807385593dc 100644 --- a/drivers/leds/trigger/ledtrig-netdev.c +++ b/drivers/leds/trigger/ledtrig-netdev.c @@ -18,10 +18,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include "../leds.h" @@ -65,12 +67,15 @@ struct led_netdev_data { unsigned long mode; int link_speed; + __ETHTOOL_DECLARE_LINK_MODE_MASK(supported_link_modes); u8 duplex; bool carrier_link_up; bool hw_control; }; +static const struct attribute_group netdev_trig_link_speed_attrs_group; + static void set_baseline_state(struct led_netdev_data *trigger_data) { int current_brightness; @@ -218,13 +223,20 @@ static void get_device_state(struct led_netdev_data *trigger_data) struct ethtool_link_ksettings cmd; trigger_data->carrier_link_up = netif_carrier_ok(trigger_data->net_dev); - if (!trigger_data->carrier_link_up) + + if (__ethtool_get_link_ksettings(trigger_data->net_dev, &cmd)) return; - if (!__ethtool_get_link_ksettings(trigger_data->net_dev, &cmd)) { + if (trigger_data->carrier_link_up) { trigger_data->link_speed = cmd.base.speed; trigger_data->duplex = cmd.base.duplex; } + + /* + * Have a local copy of the link speed supported to avoid rtnl lock every time + * modes are refreshed on any change event + */ + linkmode_copy(trigger_data->supported_link_modes, cmd.link_modes.supported); } static ssize_t device_name_show(struct device *dev, @@ -292,6 +304,10 @@ static ssize_t device_name_store(struct device *dev, if (ret < 0) return ret; + + /* Refresh link_speed visibility */ + sysfs_update_group(&dev->kobj, &netdev_trig_link_speed_attrs_group); + return size; } @@ -455,15 +471,63 @@ static ssize_t offloaded_show(struct device *dev, static DEVICE_ATTR_RO(offloaded); -static struct attribute *netdev_trig_attrs[] = { - &dev_attr_device_name.attr, - &dev_attr_link.attr, +#define CHECK_LINK_MODE_ATTR(link_speed) \ + do { \ + if (attr == &dev_attr_link_##link_speed.attr && \ + link_ksettings.base.speed == SPEED_##link_speed) \ + return attr->mode; \ + } while (0) + +static umode_t netdev_trig_link_speed_visible(struct kobject *kobj, + struct attribute *attr, int n) +{ + struct device *dev = kobj_to_dev(kobj); + struct led_netdev_data *trigger_data; + unsigned long *supported_link_modes; + u32 mode; + + trigger_data = led_trigger_get_drvdata(dev); + supported_link_modes = trigger_data->supported_link_modes; + + /* + * Search in the supported link mode mask a matching supported mode. + * Stop at the first matching entry as we care only to check if a particular + * speed is supported and not the kind. + */ + for_each_set_bit(mode, supported_link_modes, __ETHTOOL_LINK_MODE_MASK_NBITS) { + struct ethtool_link_ksettings link_ksettings; + + ethtool_params_from_link_mode(&link_ksettings, mode); + + CHECK_LINK_MODE_ATTR(10); + CHECK_LINK_MODE_ATTR(100); + CHECK_LINK_MODE_ATTR(1000); + CHECK_LINK_MODE_ATTR(2500); + CHECK_LINK_MODE_ATTR(5000); + CHECK_LINK_MODE_ATTR(10000); + } + + return 0; +} + +static struct attribute *netdev_trig_link_speed_attrs[] = { &dev_attr_link_10.attr, &dev_attr_link_100.attr, &dev_attr_link_1000.attr, &dev_attr_link_2500.attr, &dev_attr_link_5000.attr, &dev_attr_link_10000.attr, + NULL +}; + +static const struct attribute_group netdev_trig_link_speed_attrs_group = { + .attrs = netdev_trig_link_speed_attrs, + .is_visible = netdev_trig_link_speed_visible, +}; + +static struct attribute *netdev_trig_attrs[] = { + &dev_attr_device_name.attr, + &dev_attr_link.attr, &dev_attr_full_duplex.attr, &dev_attr_half_duplex.attr, &dev_attr_rx.attr, @@ -472,7 +536,16 @@ static struct attribute *netdev_trig_attrs[] = { &dev_attr_offloaded.attr, NULL }; -ATTRIBUTE_GROUPS(netdev_trig); + +static const struct attribute_group netdev_trig_attrs_group = { + .attrs = netdev_trig_attrs, +}; + +static const struct attribute_group *netdev_trig_groups[] = { + &netdev_trig_attrs_group, + &netdev_trig_link_speed_attrs_group, + NULL, +}; static int netdev_trig_notify(struct notifier_block *nb, unsigned long evt, void *dv) @@ -481,6 +554,7 @@ static int netdev_trig_notify(struct notifier_block *nb, netdev_notifier_info_to_dev((struct netdev_notifier_info *)dv); struct led_netdev_data *trigger_data = container_of(nb, struct led_netdev_data, notifier); + struct led_classdev *led_cdev = trigger_data->led_cdev; if (evt != NETDEV_UP && evt != NETDEV_DOWN && evt != NETDEV_CHANGE && evt != NETDEV_REGISTER && evt != NETDEV_UNREGISTER @@ -515,6 +589,10 @@ static int netdev_trig_notify(struct notifier_block *nb, case NETDEV_UP: case NETDEV_CHANGE: get_device_state(trigger_data); + /* Refresh link_speed visibility */ + if (evt == NETDEV_CHANGE) + sysfs_update_group(&led_cdev->dev->kobj, + &netdev_trig_link_speed_attrs_group); break; } From patchwork Thu Jan 11 16:04:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 187432 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp1550025dyi; Thu, 11 Jan 2024 08:05:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IHPEIC0TTL8Wnu8f0ubQxlUEPMgeGjnMOwcyX/LZZSAaHgLZsQIkFTyUAUaLFuCUt/pqt0c X-Received: by 2002:a17:907:9707:b0:a27:6615:1653 with SMTP id jg7-20020a170907970700b00a2766151653mr1092637ejc.34.1704989153067; Thu, 11 Jan 2024 08:05:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704989153; cv=none; d=google.com; s=arc-20160816; b=ZrMrz3wrYNZDMKzZGXm3DkrZU4dbUl1A8aRkmCyOWRoPLzlTZU3380Sr57feeri3cj vQD/bqrpjQ5H2TLyE9oR7/7QWa8M7yslqGPjjonrICU53riOo3806mMLiBtsG1Rq5D1f OKg6admOrDGXsS+HKq0a3fWBoHB/MglE0lXUK6xZRcnBhvZDEMRhXyYjJufCQ1Js7Q// GjzOGCmbqy1MRUATX2Fm0aNezlBAghHRaWusQ9Dk+mE26iw1WkBwCLgWWeUcGu6TuGQn SFmlthkxcMylQ6d+kbRb2P3K/ApXAqH1ALi61ZLw4WRNlXBUUX/n5fq9sy698SWopfPQ YwEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=Ge1javvkMyc2on9Y/XLUyyRYw7YHPVmAVzO564jDQSk=; fh=KQ7MkVTjAr5ghGDVJvNp/qJ6fmyHMjeiXM9R5K2C8Q4=; b=TJz+wAvkgS+Vv6PlQuI7p4wIvf/T/wbApblSua1qHF6DrK/qAnXQytgbe/da4hP48K QtEtnrtnSAVFCazgGzdxRQ/guQyHLdtIlLpL/bA9L3gGgH/3vSg15n/fIq2uwaxfHs1n ogqJijzOq0qTBHELrjdTXW9dRcdVh1JiNOChyXW0gQJvkKEBu1GKejJMDZ9xrCk5GTgl KbqjXVRQHYfzUuUDp5wdS+8cJcV4oq+dP4jSXY/mcjNZk54a2+0tfvE2rAN3rm72DAAb bjx2WXGHxkcOR71+vga4QkV24/7eMhA1gO2f2MSPBsCQyx+SfVVRx3Pwz6tjYhe3MKTH TjeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="HUzp57/e"; spf=pass (google.com: domain of linux-kernel+bounces-23828-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23828-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u14-20020a17090626ce00b00a28e96fef36si594951ejc.743.2024.01.11.08.05.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 08:05:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23828-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="HUzp57/e"; spf=pass (google.com: domain of linux-kernel+bounces-23828-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23828-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A665B1F24913 for ; Thu, 11 Jan 2024 16:05:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C331850249; Thu, 11 Jan 2024 16:05:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HUzp57/e" Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 792734EB5C; Thu, 11 Jan 2024 16:05:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-40e60e135a7so6081155e9.0; Thu, 11 Jan 2024 08:05:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704989114; x=1705593914; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Ge1javvkMyc2on9Y/XLUyyRYw7YHPVmAVzO564jDQSk=; b=HUzp57/eMCUmzJWOmHtiaYXthUB5rwXawDRTJcH2hWgkjs+Nykd2EqWXBsHQEv7ufd rCVZp7J0OjPRCKTPw091uVk1ghjIUyHiWWTfeUCzrRfxQFIWI/msgZ0cB/0lPsw5dKP1 LIGZke24U8zbEUD7TTjwE6DWHTvqo91zW2g9anOk8woGYFywdk4g1+Bl2MdwDnaWB8/K 1WQpNzpRBhIUijhCcdfIXH95fkf9hJnLXqzoQzBQyMj1A2EJI+1YjA6nnhcLSw/88/0I 0tQM4B6s5abyHHaDEAq5goJ70EEdNKXr6D5PO9UrHvGGus6EYem9wxiw1plCN7FOolFG nkFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704989114; x=1705593914; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ge1javvkMyc2on9Y/XLUyyRYw7YHPVmAVzO564jDQSk=; b=cXarkyUYg8dzK80ooX0mIRqyuichcTdewVo9foeVYqBu+N+NazfjkI8B7saqUOgveb xdMCwuPlwX1CWTyqSu9eat8R4t5OnUWoIOOMuip8HPSKvs7KY7lJD0gb0l6KFrag6UW+ AY1XV2M6pUAwbaQQerIZRXDvcrZgSJCHw8nL/n5hDt9uNRV+Ba/OJJgCb25b7Sf0P/og aJpHF23Cf5ty0XGQ39DsoLPyWoYMS3ujVwmtUeYNEvG1mIO1hBmgJeD/08tWQy3Ttc8o Cy1htIHQih9mJ1Mjf+efm1EwzmDs0DaK35vr58OpqSAGzH3GPUr2IS0BlY8rXqHCDcPv 6ymQ== X-Gm-Message-State: AOJu0YyKuMXAPmrtavqlo4F21qxNBqidpl4aHJh3/TAO/stiDDtj1R3I Z7f/l16iJWJbRvKkv+QStCc= X-Received: by 2002:a05:600c:2246:b0:40d:87eb:fa98 with SMTP id a6-20020a05600c224600b0040d87ebfa98mr37242wmm.28.1704989113327; Thu, 11 Jan 2024 08:05:13 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id j17-20020a05600c1c1100b0040c46719966sm6350002wms.25.2024.01.11.08.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 08:05:12 -0800 (PST) From: Christian Marangi To: Pavel Machek , Lee Jones , Andrew Lunn , Christian Marangi , =?utf-8?q?Marek_Beh=C3=BAn?= , Jakub Kicinski , Daniel Golle , "David S. Miller" , Li Zetao , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: [PATCH v7 2/2] docs: ABI: sysfs-class-led-trigger-netdev: Document now hidable link_* Date: Thu, 11 Jan 2024 17:04:55 +0100 Message-ID: <20240111160501.1774-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240111160501.1774-1-ansuelsmth@gmail.com> References: <20240111160501.1774-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787810706163950232 X-GMAIL-MSGID: 1787810706163950232 Document now hidable link speed modes for the LED netdev trigger. Link speed modes are now showed only if the named network device supports them and are hidden if not. Signed-off-by: Christian Marangi Reviewed-by: Marek BehĂșn Reviewed-by: Lee Jones --- Changes v7: - Add Reviewed-by tag (Lee) Changes v6: - Add Reviewed-by tag (Marek) Changes v2: - Add this patch .../ABI/testing/sysfs-class-led-trigger-netdev | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-class-led-trigger-netdev b/Documentation/ABI/testing/sysfs-class-led-trigger-netdev index a6c307c4befa..ed46b37ab8a2 100644 --- a/Documentation/ABI/testing/sysfs-class-led-trigger-netdev +++ b/Documentation/ABI/testing/sysfs-class-led-trigger-netdev @@ -88,6 +88,8 @@ Description: speed of 10MBps of the named network device. Setting this value also immediately changes the LED state. + Present only if the named network device supports 10Mbps link speed. + What: /sys/class/leds//link_100 Date: Jun 2023 KernelVersion: 6.5 @@ -101,6 +103,8 @@ Description: speed of 100Mbps of the named network device. Setting this value also immediately changes the LED state. + Present only if the named network device supports 100Mbps link speed. + What: /sys/class/leds//link_1000 Date: Jun 2023 KernelVersion: 6.5 @@ -114,6 +118,8 @@ Description: speed of 1000Mbps of the named network device. Setting this value also immediately changes the LED state. + Present only if the named network device supports 1000Mbps link speed. + What: /sys/class/leds//link_2500 Date: Nov 2023 KernelVersion: 6.8 @@ -127,6 +133,8 @@ Description: speed of 2500Mbps of the named network device. Setting this value also immediately changes the LED state. + Present only if the named network device supports 2500Mbps link speed. + What: /sys/class/leds//link_5000 Date: Nov 2023 KernelVersion: 6.8 @@ -140,6 +148,8 @@ Description: speed of 5000Mbps of the named network device. Setting this value also immediately changes the LED state. + Present only if the named network device supports 5000Mbps link speed. + What: /sys/class/leds//link_10000 Date: Nov 2023 KernelVersion: 6.8 @@ -153,6 +163,8 @@ Description: speed of 10000Mbps of the named network device. Setting this value also immediately changes the LED state. + Present only if the named network device supports 10000Mbps link speed. + What: /sys/class/leds//half_duplex Date: Jun 2023 KernelVersion: 6.5