From patchwork Thu Dec 21 17:11:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 182363 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp556071dyi; Thu, 21 Dec 2023 09:12:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IEF51GawjSJNj6cyFuwey6LaNbEwxC2YWYiMDTlGg+x4VQdcMhhM1CW7pRwEvJm5oNAN2wA X-Received: by 2002:a17:902:cecd:b0:1cc:5671:8d9 with SMTP id d13-20020a170902cecd00b001cc567108d9mr1384630plg.27.1703178724644; Thu, 21 Dec 2023 09:12:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703178724; cv=none; d=google.com; s=arc-20160816; b=KdW9sRMNfVPhUJAPkWK9hPMNQHFZYBnVjJFCcicIdcQkQpYJFzMULF1SxZZRHoZkjr mW8CwMxcfx5czyTw9MLU7Iy+qF+3p4mMYKqufy5GTVe/QMlDnTQYJFzYKZOGi+sgrkf1 PIwv2B3JKj0q4rDcGpn4C+wkHOD1pPHD6PcMWPgCsWBo8XhBpIeMMYNLUWSJqNdExWtd pTVoePUmV/Ulcj07JzqsIgbahGZnVhy8nxIjHDfioKP7O/O5N39cRh9Da7cAt44FdGy0 anbV4AFDmbOyL9jXFzhpl/mnWq3jtvJtJHPJCopLtI6Y0sis14pqtDHT+gIOJvA7Flcm xGZw== 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=xxyyNz03V4YUou6bGUQaIh6mW7VTZjF7uWLvt+WkU0A=; fh=hBcJLwJVA2oyjHCL8/2cOmre1VhYFPWuwmOws2ptgyU=; b=DnuuJkUTtg3IDR/yYuwXaXJG4+i3p/qdvbl7HpQviwUaVVkawfiudd5VMoK+Dz/R4Y OctZHFN/CCQ7rc2BZYVCji0vEk7OTIBOeqW5G8zj7KxSVc5qwsYzOAVAFw8t1F14bVuP Kh1yrc7aZj+ORmsSVowcz1yHYge37R6LjoVapCTc5Hv9AAAe9BJLjXheLye6p2P4h5kD t+/0oGvmBgNZiUUa1C7vzSzKw9ginx7wHGe+ogP6Hrx0OWyqs/VbXOzX2udUezNJN2AV KxUEr48CbvA2BqyzO3yZBzKsIuyloyu1emPD9nJZ5ZDo+BCU6dYZe2E+kptFMyFL7BjR ggvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=D5cQnDG8; spf=pass (google.com: domain of linux-kernel+bounces-8817-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8817-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j70-20020a638b49000000b005cd84872621si1905532pge.700.2023.12.21.09.12.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 09:12:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8817-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=D5cQnDG8; spf=pass (google.com: domain of linux-kernel+bounces-8817-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8817-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 68D75286C43 for ; Thu, 21 Dec 2023 17:12:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4BF5627E2; Thu, 21 Dec 2023 17:11:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="D5cQnDG8" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 6790D5990A; Thu, 21 Dec 2023 17:11:44 +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-f48.google.com with SMTP id 5b1f17b1804b1-40c39ef63d9so10491695e9.3; Thu, 21 Dec 2023 09:11:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703178702; x=1703783502; 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=xxyyNz03V4YUou6bGUQaIh6mW7VTZjF7uWLvt+WkU0A=; b=D5cQnDG8Ah4vEnofdcWJvcSC0ppVbRi8CoNKSFBeKoF/rcfok44xhXdTxZH2VstdF5 /AmzlQ52d0Qp2YqUUqlbzQODbgEiYJMlRjUOIFXQO1n72qxuuq5uGsxDLmfQ6SW+FdXs PSthtFb2VanDqt1pjZ87g4JDkt38ealClPjazbqgQdnPT/AeUJXL7Hs7iTwXoN50PrGq R49KJg0K7kQEWoGlK2N7jAoUHktnvOmzqXBKH3OyhJXfeVhOXoGuUOBY1iBKEfdDUmuE TXb4V38ewidI+q0mrCHeXefYZ0/l5PupiWyBFnwzhJi9Jkl3wiDcj/04rR/9zhwWb6Ug d+rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703178702; x=1703783502; 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=xxyyNz03V4YUou6bGUQaIh6mW7VTZjF7uWLvt+WkU0A=; b=G9F6XXszzxqBYCDNI1kub4XEoZBqgXfkmvxdX6zLc6EsfEve9ztuXxC6EBgF9+Axvf Ae3HMY9QCBdXJULCM8SxRNKAR3DRrb3Uz03bZ4xD4umjn5A7rmK5BfCmBu1DoXKeCz8a 89qcDWo08QdK6if4G2rKbuxS93hZVRlzIOXI5N4psK3wr7QuQ7t/W4CZjOYjuukMAiOM OMeYtH4DB6a6ZnOYOgy+8/hAmgBQDSeb74VIL7d719xq1vL3ZBUMz5+UoPyKBq1K42iE 8QrRoJmXGstM5vNoKSWCwCdIsJcGdUzfkYDd6KTab7Sc/MQYOPZhIYM9MG8EgMyGloNC ykPg== X-Gm-Message-State: AOJu0YwZ5NoIQpCagCjuUnt2RmNWE4LVcYimdavMAq8RJr1NGW37nLWw o9sKY9T/drJWnFaA7VXZYPA= X-Received: by 2002:a05:600c:524e:b0:40c:295f:1195 with SMTP id fc14-20020a05600c524e00b0040c295f1195mr28321wmb.55.1703178702368; Thu, 21 Dec 2023 09:11:42 -0800 (PST) Received: from localhost.localdomain (host-95-250-248-68.retail.telecomitalia.it. [95.250.248.68]) by smtp.googlemail.com with ESMTPSA id m20-20020a05600c4f5400b0040c44b4a282sm4020727wmq.43.2023.12.21.09.11.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 09:11:41 -0800 (PST) From: Christian Marangi To: Pavel Machek , Lee Jones , =?utf-8?q?Marek?= =?utf-8?q?_Beh=C3=BAn?= , Jakub Kicinski , Andrew Lunn , Christian Marangi , Daniel Golle , "David S. Miller" , Li Zetao , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: [PATCH v6 1/2] leds: trigger: netdev: display only supported link speed attribute Date: Thu, 21 Dec 2023 18:11:24 +0100 Message-Id: <20231221171125.1732-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 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: 1785912334400398938 X-GMAIL-MSGID: 1785912334400398938 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 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 | 88 +++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 6 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index 836610292b37..f082a952bd4d 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,19 @@ 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 +303,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 +470,62 @@ 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 +534,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 +552,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 +587,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 Dec 21 17:11:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 182364 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp556249dyi; Thu, 21 Dec 2023 09:12:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPVdh7C3sRbQtebdAFzFclD9RgBZdoK9MvXRsM9qFDVBK+oocEAjHLil2/+kVyN43gu/mv X-Received: by 2002:a17:906:3885:b0:a23:58b1:11b8 with SMTP id q5-20020a170906388500b00a2358b111b8mr38203ejd.185.1703178737116; Thu, 21 Dec 2023 09:12:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703178737; cv=none; d=google.com; s=arc-20160816; b=b3EoX12CrVUAKFjiisdRCSe9JMVLvfL8e/pf13sc8HZT3u83+tsMj5TF+nwpgUd87V UHRNpU3TOThOxykpqIk4ruzDdkHAMtrMpt11+eks7A+4F2brPhs0Ak10kKvlEjS0lWqK j9SybKPcVzfFYWezjvlpJGHv+6bGQBN8qGgrI/XJGG9LDFummp6zkAUhlFoFSHZHYAe1 +xLZYa0UMNRm9jEHpUU83RAxWxlvAXODkHkucceTMnBQ1rqlMVt94xzIVSwSUUjF/vL0 Yi6N1nYwlSu+YzXvX0OybyfK9kCWFCyDW2ePID+q8P8//qQ7XT12cKlc1jaFNhBqmsUt BfUQ== 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=3hihuwD9LbPKxqf+5u/wIYAygOzw3x2ScxGnztieWIY=; fh=hBcJLwJVA2oyjHCL8/2cOmre1VhYFPWuwmOws2ptgyU=; b=o8OCNys9xjllP/ccYSYsgdXIIW5UGKryqkQWWPsxcYD29lUvLBgZCVGURVEklSf/aV iNGeXXkGmB2mIhx+Npd8xTmC9eIIjP1RbJ33XuPdzovfLl5SGCKz2ymSC0JssQMZM58U DItJoHgZ0P3LJuGsU1YBJKwGZQx4cKItuXf/BXEpw78XgW51T+GmmJEd71IrlL4QRHE6 kJmVLvwmJbkh+Uo4mjVuj9vTlcZjv1iUmUCFDqAXdGmQoI44UnKFCOfLMXzOSL8Pn/5S kW3WhJy1BnF3KVFc3gbIzORsLSafJTvoX1j0LfqzjTtslBZ56ndJ7koAdWy4rLCzG3Ef aS0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="g/Ks9dfX"; spf=pass (google.com: domain of linux-kernel+bounces-8818-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8818-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 qu18-20020a170907111200b00a2356689ab4si1030701ejb.843.2023.12.21.09.12.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 09:12:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8818-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="g/Ks9dfX"; spf=pass (google.com: domain of linux-kernel+bounces-8818-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8818-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 B85361F2470B for ; Thu, 21 Dec 2023 17:12:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 72A84627F6; Thu, 21 Dec 2023 17:11:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="g/Ks9dfX" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 70A505990D; Thu, 21 Dec 2023 17:11:46 +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-f45.google.com with SMTP id 5b1f17b1804b1-40c6ea99429so11290215e9.3; Thu, 21 Dec 2023 09:11:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703178704; x=1703783504; 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=3hihuwD9LbPKxqf+5u/wIYAygOzw3x2ScxGnztieWIY=; b=g/Ks9dfXIIRlAeccp1BL6Hc+uoIGLlwxajFeImZtV0TTPG2n/+RWHLuGHgVaLBTb4P uccFoARcW26L7aDOTB3JSKh+lOk9Aci3+Qovryxhit7LQ6HzkPg2AdnjpwnGgbYvwKUU 3tfvHDpseJk696liEfp8TA3s0Vkn/9k9LyunA5jR62EvbyUVKo6ETbolTNRaVfeCyysv +HMmIXJsDxaS4C8H49cW1zFYx23519wWrNQTShCPO85nNo1mIO9r7b3loNRXjYAE1x0M 4aOTj8AWJMenS/t9/V2PfQHTLOhVsCU9PiGmEtISFZ1pvOYGHRU1gYAQ1bJVGA1NUGeY HykA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703178704; x=1703783504; 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=3hihuwD9LbPKxqf+5u/wIYAygOzw3x2ScxGnztieWIY=; b=I+0hY+zeF/kFcPXjwRur8bBXW06ILEQqdMch6bXNlmxlAWXd5lSTAsaiHEtot2MnEO +olIJGnQsaVz5GjOj2bjGmfaw3g9fbOlmcF0/gCXOidLZISbZDyUFgbpZFT/0+3oGppd FA+ZTqKHGmMEzR3TTR+HdLNvmInVSIzNSb7d/p4cVnABuo1J4/oEu1MrArojqbrYOfY2 p5dD6aApeOFbA37dOJLHaNfFC8T0JKSn1Rf5yXWivpx7WRB4bpryZ40UmdPOFzkIV6z3 wJ0ChozBSp7JB9+j6RCpd3jFiNdUd/NqM7wEJbw5jj/GdvjgWLZclMr888ZdTkyq0TTW siCA== X-Gm-Message-State: AOJu0YypXUqaKhI48mu/5p220ZwaR7xfB1BFNcZnxuagZxecKOegA05S sjidWfRZ6DjenICilP4lfhk= X-Received: by 2002:a05:600c:b8f:b0:40c:3548:1f0e with SMTP id fl15-20020a05600c0b8f00b0040c35481f0emr15196wmb.64.1703178704340; Thu, 21 Dec 2023 09:11:44 -0800 (PST) Received: from localhost.localdomain (host-95-250-248-68.retail.telecomitalia.it. [95.250.248.68]) by smtp.googlemail.com with ESMTPSA id m20-20020a05600c4f5400b0040c44b4a282sm4020727wmq.43.2023.12.21.09.11.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 09:11:44 -0800 (PST) From: Christian Marangi To: Pavel Machek , Lee Jones , =?utf-8?q?Marek?= =?utf-8?q?_Beh=C3=BAn?= , Jakub Kicinski , Andrew Lunn , Christian Marangi , Daniel Golle , "David S. Miller" , Li Zetao , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: [PATCH v6 2/2] docs: ABI: sysfs-class-led-trigger-netdev: Document now hidable link_* Date: Thu, 21 Dec 2023 18:11:25 +0100 Message-Id: <20231221171125.1732-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231221171125.1732-1-ansuelsmth@gmail.com> References: <20231221171125.1732-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: 1785912347143425755 X-GMAIL-MSGID: 1785912347143425755 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 v6: - Add Reviewed-by tag 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