From patchwork Wed Dec 20 22:48:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 181869 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp63985dyi; Wed, 20 Dec 2023 15:09:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IG53UTA4xOnDVHAo5Fa864JVq4mXK9HLVYd1Zy6Hm4KCUGKrRhSXTopx720ayH2WJ1VZaxB X-Received: by 2002:a05:6358:339e:b0:172:caa6:52d2 with SMTP id i30-20020a056358339e00b00172caa652d2mr595475rwd.29.1703113786224; Wed, 20 Dec 2023 15:09:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703113786; cv=none; d=google.com; s=arc-20160816; b=bH4EPZT9pr+2/xoMgKHK7ptTr2T35R59saOr0o0MQ2VXSOlNxVAuHPGFj/ma8HDHOs lOp2WmzejJxAtDY7w+Jf/lqRSS2JA95frJLC5WOIZkpPvxiZa9U2MBSf5Ord9d4XPKdS QnsxztDOx53vks7kDF+Eev3T3s36n8P91/29qJonsZrCiGOEv06GIhp73OhTDGm5JqDo 2gYY4TlSL2MgJwaqdy8fsGgu2xRkJL7O6mRGYnktCirCnQvCcBGFfpqB5WU7jwMIQRqU kltXPG8BU8JWc8+lh1VU7fXpZ8ftXP0V8YUgy/oxEU9aLd8WBlY1wYIgMUBNnSTOGxh/ t+ag== 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=ZLG+WS5lbsTbYWBSLepysO/8E3wFqMQRDPLf36qaA0M=; fh=QOrG5/W8ri+IYqs809jupQxEvT8IMTKMegYvIri3yQU=; b=Jb01sbUIAN3f7/eyhHHszZZJtbu8eN8aYwKIqkH36idj7jfg+MSfV7WEk9VtT7UecE UdBaC+EX6UVRRg3TJwYSlHfgxzsrZnAwZMJX8faHv0s0Iu4x7n1fb5v63lfHZrecuwIL ltFryQK1JrRWuUItgHQNrb71/Uk9OCLyQo+aigxPjXVJXvuuyKmM1u8vL8gaGWbRw8b3 2qZWUEwp3ufyM1SBt+lJGDe2OqtQgEekmpL2YL/8n1yDNOo6qOAD5b24/asPmk/ISYdq EFgYmK1E+Bin4q7JVt6DFvC9Bc95k1IDglyghX7BiZbz/xpU6onlldxPXWvZpn/rZ54M dpvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=HKiIzYXE; spf=pass (google.com: domain of linux-kernel+bounces-7608-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7608-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 x1-20020a631701000000b005cd9399dc5csi481733pgl.119.2023.12.20.15.09.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:09:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7608-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=HKiIzYXE; spf=pass (google.com: domain of linux-kernel+bounces-7608-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7608-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 79EAF2818E5 for ; Wed, 20 Dec 2023 23:09:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 79FFE4CB53; Wed, 20 Dec 2023 22:49:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HKiIzYXE" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 2C44C4AF8F; Wed, 20 Dec 2023 22:49:04 +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-f52.google.com with SMTP id 5b1f17b1804b1-40c41b43e1eso2439455e9.1; Wed, 20 Dec 2023 14:49:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703112543; x=1703717343; 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=ZLG+WS5lbsTbYWBSLepysO/8E3wFqMQRDPLf36qaA0M=; b=HKiIzYXEtwM/SRDi7ZKNZoJ7+c6Kxut8nTwet/uWbAmsvfA7CPAq62y/04LYqJ+u7s AByoVKwI9TvE4fo/Q7LMFVIt9cs1Ra6LzcGOCQNeCx+1zNRt9iJrutNqOOWfN6gv4lqi rEF/l+o2/B1KFAFrvKBkjd+y3xO2pDCGHfOMQWAqApo/mQVtoh2lZtgsZJRA8IQ1kfcB s9kUdFn6z8/wACQcb0/YWcW66bZLdgu0Ygoq4b51v5ZQptoWrqvI9E8GT09ologryhIm ME6qGi5/CZNuK5/my15GY8jl2UU9vGU67WorZtZkmuZhlfcq/QzrcVRjGEK8qVQ9YdoA QDzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703112543; x=1703717343; 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=ZLG+WS5lbsTbYWBSLepysO/8E3wFqMQRDPLf36qaA0M=; b=hEkhVLawlUcpfDueDgTeATw4M+VblDwScVJutD/g7euilnSTcKf0dbOlZY8yAwuQzG 7JXU1TKcqDoGSlr5vn03ueMOvcIjM2XfAYY2+vRsb0avNtrwsZ7m86k1a7ZUuCneBjnu Kt0rnFalQIyIAVa3ObG5CA043t4ji0rwJYIkdK/Vr0cL0+ddlbZr/Vsy0BFhxIab1FDG DgZXooqsCh1uhqT3ILJohi8jTrPHRWhcI3j1pOIuUrLVrgsMsJh7tihcpSgb86qh9Tnx PMjxgUvpyLyRxwDnlZfbje04MkM0R7LsqrzQfJtT0WpE3HZQA58n5asFtp260aOdslkn 74Rg== X-Gm-Message-State: AOJu0Yzu41NwmXt0QsQJXQK1m+VJlH7gXIzXi3h4tkKa6stis51hxmue LtS5njgmFFtK5S+SizupQxc= X-Received: by 2002:a05:600c:68c8:b0:40d:379c:f749 with SMTP id jd8-20020a05600c68c800b0040d379cf749mr181795wmb.198.1703112543157; Wed, 20 Dec 2023 14:49:03 -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 bi8-20020a05600c3d8800b0040d28bbaf7bsm8220838wmb.10.2023.12.20.14.49.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 14:49:02 -0800 (PST) From: Christian Marangi To: Pavel Machek , Lee Jones , Christian Marangi , Andrew Lunn , Jakub Kicinski , Daniel Golle , =?utf-8?q?Marek_Beh=C3=BAn?= , "David S. Miller" , Li Zetao , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: [PATCH v5 1/2] leds: trigger: netdev: display only supported link speed attribute Date: Wed, 20 Dec 2023 23:48:26 +0100 Message-Id: <20231220224827.27667-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: 1785844241599226216 X-GMAIL-MSGID: 1785844241599226216 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 --- 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 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 bd68da15c723..f0f946747ff5 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" @@ -55,12 +57,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; @@ -208,13 +213,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 not rtnl lock every time + * Modes are refreshed on any change event to handle mode changes + */ + linkmode_copy(trigger_data->supported_link_modes, cmd.link_modes.supported); } static ssize_t device_name_show(struct device *dev, @@ -282,6 +293,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; } @@ -440,15 +455,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, @@ -457,7 +519,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) @@ -466,6 +537,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 @@ -500,6 +572,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 Wed Dec 20 22:48:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 181870 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2483:b0:fb:cd0c:d3e with SMTP id q3csp64055dyi; Wed, 20 Dec 2023 15:09:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjlWvtWN5V7T1GhKO/Ai1Q3Fvb4wSno11a/Ca/BVUfMwrZUjPajPSocZ4bb+iEyAyUkOhL X-Received: by 2002:a05:6e02:1c41:b0:35f:b0dc:ea3b with SMTP id d1-20020a056e021c4100b0035fb0dcea3bmr9983916ilg.26.1703113795049; Wed, 20 Dec 2023 15:09:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703113795; cv=none; d=google.com; s=arc-20160816; b=i1PXzyLwW2P4nHOEyZasoJobwOujhM4QXlOjEetK73OYKkWbVQdClBEj1PTCNI5TQV JcWFg4bBoemb9u4QLx8Lzy8jStVb7ry4E5G4tKJxqCnsTL8XHOwBUO98R8Kl+ib21NeX VnA1UQf2xL9MmiB9Ne56sbGvnhFz6BKn5YPeevX+5wUZ/K3OpDwdhTghy5tbKKKz4v5X WYnJoHZi9mszwPQyWBcRS7REf5MV+yp2LaMbzkjI2OjnRp2rMUNdYwqVb//klYk3o8vM dYrjBJqVMPY1WIhgAj/HRZwj9sEHZwySkdfiHxD3UTTjeOMYlNo7ZHnUxbcc/fPpbcCw b24w== 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=XsKFunyIEF//ykMeSfV/a0SwdfxlBLJSsRhTiMN79G0=; fh=QOrG5/W8ri+IYqs809jupQxEvT8IMTKMegYvIri3yQU=; b=XydJRFwZDdceFsj4/yr9Rp13APvEt5RhLM0WZjnO4We7RB4DlXbrhGx/+fCeiHnv8Z lmkoEt2PkgelsncLseGSHef1IHzNwjuqP9f0hlmGV6j/LdmwfNE9bBJpFQBXGQ1b6R70 3X9E3o9GQLJ1HXBdXHTgQzrd6sttEPTw/WaYpBkq32U1Q1ydZSI4u630d40bs4PZ0Xcv JNG6CLR+Zghf98defYPyHBGFzrD4fKpfw4joq1j3C0iZs1ppzKD7JVBTezhxkZtZFhwD o1l73A5I1ECTvwcUB/R+hACU6QySoA3MXugKDEZOdVSN0+4WSFVdNxSyFRS5B8neaxZ8 2FLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZwOXiCHa; spf=pass (google.com: domain of linux-kernel+bounces-7609-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7609-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 g20-20020a633754000000b005cd8446a4e2si448910pgn.450.2023.12.20.15.09.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 15:09:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7609-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=ZwOXiCHa; spf=pass (google.com: domain of linux-kernel+bounces-7609-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7609-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 3BCEB2810AA for ; Wed, 20 Dec 2023 23:09:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 32BD24CDF0; Wed, 20 Dec 2023 22:49:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZwOXiCHa" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 08D6A4C634; Wed, 20 Dec 2023 22:49:06 +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-f44.google.com with SMTP id 5b1f17b1804b1-40d05ebe642so7820055e9.0; Wed, 20 Dec 2023 14:49:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703112545; x=1703717345; 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=XsKFunyIEF//ykMeSfV/a0SwdfxlBLJSsRhTiMN79G0=; b=ZwOXiCHasH2dqJ1hZ0lVqm8bm7LQXXSUC15smv25RqICJmzN4MAsbLI5CX4qvmw3iI LKxh7hgd3qxi9z0OL6GzDafXySkTYoMjgTlNHPGoh6m8HcXMEpvfGIZbladbsuMhZBvN x+FhIcbmV04Af0J+LLkMzzjIFSuieleslJaEiz1gRZPuvhv6haZm+XWuueLmM1JyzvSu iBOI0hP7B9Mo5Ov+GkrgxSjRH1MpwFjtaS/a1D8f0Laej7AO0zMwQzQushs/mKfWuQQ1 gjfkShuNuKVUc0c2o4b9HnVadte0uyRn1UJC5/6n56fyCOtp2iEpYOWf8c4dyuaAOopt +gSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703112545; x=1703717345; 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=XsKFunyIEF//ykMeSfV/a0SwdfxlBLJSsRhTiMN79G0=; b=UWtEsrvD2m6nKQrareyGTGlbVylIn+bwtEW3y8ywdx32kfLi6KmLEpmZVAo68Qm8C4 q2Kai5EfFLbZ1KpqKKmoplFEmQIL4WuVJFGQKLUQ4XchQAZrj+G5DClbhe8ETMTIfLPQ H2thKnMVuf9NaeWFewFlu4JpvcoI7fRDT8cghNkEd1Eplccvk6Jl4k/8aS5HchO7/XOh +HOQcTL32+UzMgqYOhmWPxEuhr+ptMrr31L5P4wCSruo774qFJSkSYE2SvwJSEIwlpXS 5pxTR2vz3XWP94k4u2CU7AGRD6Zgek1q5IS31Qo4Fg4o70nWkQc1ykihH0XxHZ5EXKK9 +h+Q== X-Gm-Message-State: AOJu0Yw14VUrMGl4C2HpblmMhhK4AZuByDSAoaAh2Dzi7ctJsHsCHQ+D oaM/DZqhvxhAZUKkZr1QXMU= X-Received: by 2002:a7b:ce0f:0:b0:40c:3c2b:b72e with SMTP id m15-20020a7bce0f000000b0040c3c2bb72emr142289wmc.116.1703112544559; Wed, 20 Dec 2023 14:49:04 -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 bi8-20020a05600c3d8800b0040d28bbaf7bsm8220838wmb.10.2023.12.20.14.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 14:49:04 -0800 (PST) From: Christian Marangi To: Pavel Machek , Lee Jones , Christian Marangi , Andrew Lunn , Jakub Kicinski , Daniel Golle , =?utf-8?q?Marek_Beh=C3=BAn?= , "David S. Miller" , Li Zetao , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: [PATCH v5 2/2] docs: ABI: sysfs-class-led-trigger-netdev: Document now hidable link_* Date: Wed, 20 Dec 2023 23:48:27 +0100 Message-Id: <20231220224827.27667-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231220224827.27667-1-ansuelsmth@gmail.com> References: <20231220224827.27667-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: 1785844250257692943 X-GMAIL-MSGID: 1785844250257692943 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 --- 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