From patchwork Tue Dec 19 16:53:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 181235 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2182543dyi; Tue, 19 Dec 2023 11:43:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFe9Y2z+iSvsBIy0isf+Ks6yu5XrniSuzgGSKI1Yw0olqqnwcsjLw+2ZYNFNZPW4eaFCnee X-Received: by 2002:a17:902:f548:b0:1d3:cd50:c715 with SMTP id h8-20020a170902f54800b001d3cd50c715mr2612594plf.42.1703014987110; Tue, 19 Dec 2023 11:43:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703014987; cv=none; d=google.com; s=arc-20160816; b=KL2h9S2abYjWpMzFKHBkhxkocJXkAf3y5/QD1SyjLSXauVnDhGmclWVq5wl+JGetdv K88IjmXUqEVk3VlJID37m1w5c99QqdXm22MbTmHB3/oS6npK3vK6f+7RQau5NG+PlaUl vr+O/m22PZUhpaZv1QPH+5iZrGz2QEm8NGvLCm9BCb51tJNGJlm2AY6eOEoFycYL/LY1 ec6P2rZgKAnKwgl7+YQvIORg6g9RqQFm6mUR0V2jAPjMolM6FsHBD02TyzpqYCVhJJKa 6L5LnGgyii6wAdtU7GkDkGjj9bkZTbKzR+ZLXobZpFVsx2BIpec18dbq/anwyqkkQd4y G6IQ== 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=2P9nyA4a467CCHc41H1cuZ6IA7gQD1kkIc1PJ1pADf4=; fh=Imhbom6fBVfa6bEZHR8XyvSktcmk4szwMjAJZjkv14o=; b=iXLxUSHdOO0xg3qeIhwa/HWsFcfdXp2Hs3b9EwPTMTa8MJug45O7MqRfs1TJezLvVM ket0Bye0fvhXnjbMoe+qhab0j9Ee4ZPB5645CSbk7tKwND/b1Tnhdf7ddEfgKEO589ZF e7lNtG2XJvLRqRUtuFuWL1xTEukW1r76jQUsd+OPyJlF0LcgqXaoTVwNc94tpGJgOLYY M3X8A7611+2vyHLrupctNwKBWVLG5Didy49rTWvsUxo/M4OYTSTWdUIvdqtwclwPvnO0 6yfyblBfKtQ/0NNc3dysJ6iqX8un5VKZ934W77qltmt4CPSZjCoDf8K7TXPRpx0p01N8 ciuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EpunAdOT; spf=pass (google.com: domain of linux-kernel+bounces-5884-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5884-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id b6-20020a170902bd4600b001d00c80f3b3si19713365plx.280.2023.12.19.11.43.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 11:43:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5884-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=EpunAdOT; spf=pass (google.com: domain of linux-kernel+bounces-5884-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5884-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4767DB2349E for ; Tue, 19 Dec 2023 19:43:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C37D339AEA; Tue, 19 Dec 2023 19:42:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EpunAdOT" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 6552139846; Tue, 19 Dec 2023 19:42:34 +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-wr1-f51.google.com with SMTP id ffacd0b85a97d-3363aa2bbfbso5286100f8f.0; Tue, 19 Dec 2023 11:42:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703014952; x=1703619752; 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=2P9nyA4a467CCHc41H1cuZ6IA7gQD1kkIc1PJ1pADf4=; b=EpunAdOTMWULFLp18Nyi4Qc+QH25MGdlUWk2M57uMYOy/w2JfqkMunfuTR774tJJ6I h0NxTAMgtZOWmMgRE356uuzUeovuRAgoJE7TfSJNpDNt+3EVgglKeewzQ67WnrOGW1SJ Gi8injnGaq1eyWtrrAsxL8vLt2Twv5m4UoGXabRqEUqYbrc3mI9JfJdUUOMQrP31vElB 9nUsOUaG4WZ3+dLHRmkCZJDlBI/GHsVKkx/XuFUdOejGZ7AUeOjWquEu4NozZD3C/mMf 0mBPkLjznd47bcqrt+Qa80kGD3C4x0dfxMgGXROzxFRKSGHbujdywsUD7i83BQOIjUhK c53g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703014952; x=1703619752; 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=2P9nyA4a467CCHc41H1cuZ6IA7gQD1kkIc1PJ1pADf4=; b=IiUDIYocPhXgRbWfEd3LrBMRgOzNaXG9emD8jvZ+t/XI2BtpmpRSj8l0xzqG/tII10 u54RG1KdiGI1xD/OxBzH2QkqXgM+Xrao5I2a38j1KTtkBfrwH4QdToiDXtU8QNI05KrN nrk742IgQazV9ayKxk8+wJmJZrEHx36uqhUFvDVW0APAcE2neSWRWxbA6gtZgdMSMjXQ s+vwCwP+HMoOn6mvflJNMh4UV2UUjDXHichj8dXDt8DYfvOletMy80pMsKxp54Z6Nl8A k7UKDkVBCF9LFqbOIooCqzAOM6jYGCvI36BUxOmeBjBbbQuaE7KwZtXrlpoH58CU/1jT NK5g== X-Gm-Message-State: AOJu0YybTrS3IUXr8Z7WNBt1kTCjC9JZ+Dkqf6I1sTKJ6/eARSounobi iJ3k1Eqv8yOY3+kmbs+POXM= X-Received: by 2002:a5d:518d:0:b0:336:4c9d:8d1a with SMTP id k13-20020a5d518d000000b003364c9d8d1amr4460463wrv.35.1703014952293; Tue, 19 Dec 2023 11:42:32 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id f18-20020adffcd2000000b0033660aabe76sm9131524wrs.39.2023.12.19.11.42.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 11:42:31 -0800 (PST) From: Christian Marangi To: Pavel Machek , Lee Jones , Andrew Lunn , Jakub Kicinski , Christian Marangi , =?utf-8?q?Marek_Beh=C3=BAn?= , Daniel Golle , "David S. Miller" , Li Zetao , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: [PATCH v4 1/2] leds: trigger: netdev: display only supported link speed attribute Date: Tue, 19 Dec 2023 17:53:52 +0100 Message-Id: <20231219165353.23233-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: 1785740642908116164 X-GMAIL-MSGID: 1785740642908116164 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 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 | 98 +++++++++++++++++++++++++-- 1 file changed, 92 insertions(+), 6 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index bd68da15c723..47733494aaf8 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,72 @@ 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, +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); + + if (attr == &dev_attr_link_10.attr && + link_ksettings.base.speed == SPEED_10) + return attr->mode; + + if (attr == &dev_attr_link_100.attr && + link_ksettings.base.speed == SPEED_100) + return attr->mode; + + if (attr == &dev_attr_link_1000.attr && + link_ksettings.base.speed == SPEED_1000) + return attr->mode; + + if (attr == &dev_attr_link_2500.attr && + link_ksettings.base.speed == SPEED_2500) + return attr->mode; + + if (attr == &dev_attr_link_5000.attr && + link_ksettings.base.speed == SPEED_5000) + return attr->mode; + + if (attr == &dev_attr_link_10000.attr && + link_ksettings.base.speed == SPEED_10000) + return attr->mode; + } + + 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 +529,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 +547,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 +582,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 Tue Dec 19 16:53:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 181236 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2182596dyi; Tue, 19 Dec 2023 11:43:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGbq4zOLnOtmkE+RsfR3OKe5cVkiC8l+10GIQP13Ovlw9fo3e39DAxpgpPLQnlh3h46ounY X-Received: by 2002:a17:903:2011:b0:1d3:e39b:2c36 with SMTP id s17-20020a170903201100b001d3e39b2c36mr1250857pla.58.1703014995694; Tue, 19 Dec 2023 11:43:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703014995; cv=none; d=google.com; s=arc-20160816; b=k9nnkYx+Ux7av4IQ9vHmJcd3JFI9LdpcToV7LFytM2WbDlplKR7gOvvJTAXtQypiYv uYc0wQgBPLs9qDEN7rx6jTfxVYll2Zbh3xw38T9tiFbsSQU9KX8GUnfdlsHUcNe2fGxd 8SRfBVJgitGGTdLb/f623+9Fbzv6SC7/rvykDzXXe4BKy5L/6RlBXeTZPhKYQejyM3Sy rWfLvi4xU6coD49YCwlI25cJ2EXlgyrIQZFWMz7utTueOFX8cXQxF6U9MacrGyciWvcp +j1N0Z19lw6tnpQ+9N2gp5kn2mOn1gCJm3kIGE2z0WKIm1k6uztj4yKmCmdplpUq1Ay5 qhmA== 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=Imhbom6fBVfa6bEZHR8XyvSktcmk4szwMjAJZjkv14o=; b=mlvHB+DayX3uWyWbSqWUHK0RylTYFYGYDFz5ALZlBxU9Gj8bbCals5qWkNKmM1r8X0 2JQXXdHZQcHS3uNyM4bDlVGgvyN9PKvROcZrUJwdbOu3FuQJsTsOMj8VPZD5V7LnboVw /XM6KJoJs/91j9+DKAml688/WXDhS1RFvPpa3zqf/X2bpFAHPFKfIS5sr8j7gVYWKemT 6tlbDqefyfm36I4OiZB5TUzNfTzq0NKXxnej+8cn2o6uCu99ZTm5kGxYcOx2J/bPfLEW LIglFa2iIfuo7KkSsRwe353lAXDoo1v5P6uZjcIqYEGRbPztZDoCVYJl9x9EXA8Ts8VB sLMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iu4HmzQE; spf=pass (google.com: domain of linux-kernel+bounces-5885-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5885-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id w21-20020a170902d3d500b001d3ed10c3c7si5829plb.196.2023.12.19.11.43.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 11:43:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5885-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iu4HmzQE; spf=pass (google.com: domain of linux-kernel+bounces-5885-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5885-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id DAAA2B24CF9 for ; Tue, 19 Dec 2023 19:43:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A98BB39AF9; Tue, 19 Dec 2023 19:42:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iu4HmzQE" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 78A1A3984A; Tue, 19 Dec 2023 19:42:35 +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-wr1-f41.google.com with SMTP id ffacd0b85a97d-33664b4e038so2823327f8f.3; Tue, 19 Dec 2023 11:42:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703014954; x=1703619754; 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=iu4HmzQE8VWD2eX/2gjxVit6GWIeaE3Ta4WAy93Zr9lieSHOMcynckmZaCzY7rPNwV mVAb+aXDquIEWNoi6yvNhIKrSO4MNrZBgW3UXNIeT1Z1AoTy0Shltr0VqXvcW4M9XiUF jEj7oa6rYLqfSN4BzquWgDxcCkggDwDIXQ7D9YP9RNeObb5/9fpTOF7Xv8ReA7RrkGxr wwIae6d36BDkzD5CUgH6EAtmbr1QM+rP3+Kfhfbv/d1VKkBPflgPuVp/XO4d5ah9j0Vq XXbBg+Rli8P5gAFc1XatIaeqnwfWU7xL+kU6yG83UqB8QL8fXDkRMGFXsIxKcp2Hi6w+ Rsrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703014954; x=1703619754; 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=F8I99CzhOqrrkySA2ssgQT6uzFY+Vobic2Rld4KpbLj4l2Ne54enMWQLps5y7qMyxZ WgDTSe8UEkKoy4Y62WbmU1e4Al48E9m1KN7mCciVTPpgUKP3C5IjrmgvZg6k/xYWqMx/ dYpjjtgWjZCUpHLnw8rbyjRGAh9vEPwpw5aoJTQ26wfwUfqiX8/vgKJJnYY/1MMA35o8 uNLbosbfL7txi0Fs0HdDqaVh86ERnTnjGMeHoj3J60nZbbvoOJcO+k1MPnT5dZXlHEwF kmZL9Fw17PmN4qcPVbVDN3fb8kVZkLM7LZqzEnj3mfKlHg15dpXs94SFJAzvonc7ABUj lZng== X-Gm-Message-State: AOJu0Ywu3Z2qS8m9yWSEVTZchPpxCE3Mb+/ArcZqFt47KX0JJZElpzxd 8BIxOkkC+sF6m2L40QF0FPE= X-Received: by 2002:adf:ef04:0:b0:336:6907:cbb4 with SMTP id e4-20020adfef04000000b003366907cbb4mr1681121wro.53.1703014953480; Tue, 19 Dec 2023 11:42:33 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id f18-20020adffcd2000000b0033660aabe76sm9131524wrs.39.2023.12.19.11.42.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 11:42:32 -0800 (PST) From: Christian Marangi To: Pavel Machek , Lee Jones , Andrew Lunn , Jakub Kicinski , Christian Marangi , =?utf-8?q?Marek_Beh=C3=BAn?= , Daniel Golle , "David S. Miller" , Li Zetao , linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org Subject: [PATCH v4 2/2] docs: ABI: sysfs-class-led-trigger-netdev: Document now hidable link_* Date: Tue, 19 Dec 2023 17:53:53 +0100 Message-Id: <20231219165353.23233-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231219165353.23233-1-ansuelsmth@gmail.com> References: <20231219165353.23233-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: 1785740651944480599 X-GMAIL-MSGID: 1785740651944480599 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