From patchwork Wed Dec 13 15:00:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 178070 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp7834970dys; Wed, 13 Dec 2023 07:01:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFdQg+ARk7w0UdLW/5vPgre+2IgmTMxm3xEWZRU5IGhZFSJFsYLgyYRV82JTJkVO5uG77ID X-Received: by 2002:a17:90a:f295:b0:28a:e16e:6a85 with SMTP id fs21-20020a17090af29500b0028ae16e6a85mr799023pjb.68.1702479685194; Wed, 13 Dec 2023 07:01:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702479685; cv=none; d=google.com; s=arc-20160816; b=iL7KBEpZQeVpslqQ3aTo/BwsbrOLQjh+pm8TM17FzWPGOIvPez47GjewM025/6r+lm 3j+XMC29mdu15eZQp2/xw3j3ahlcWMnV1kICaL6o5vQ9SWfHGjnMHkqdlQmhBuxGrUzA NCa2xjDQ6SbYYvZMdKaoKvGK/Pt0A3OdrzxjQV3j6IbeD2GTxcq0GKt5bX7Xj8BYGf49 tJBKOBa81arv6GlS/0AiAkQdSquOjMbR4aUpnYuboA9bLRf9PTJRO0yOyV2Pdlh2lIX5 GHFOe22U6fBvwOiTqPor1zGGHw/iEU4MGIVPSbmVv9CLIOfce48pXyobW7lAEAJQ94Mj nERQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=2SO2+BrR+SqnVNVhmwzorIkGMHMJFcnZZ8bwmNp3Xw8=; fh=/ZwUlXQxfLLucigM+S8pep3j7awwM7+JOEA6S5CXrbY=; b=MLRwKVPUxA3Idsfqva1oIO1FiOAIhhTL69Gi2PEmjC9DaPMtxU/BHJJ9x0mosxB3K6 MK8GHvxMvtfbL5klhskgbtgK0AjQZILfaPsV29qc7zyxAcirZAk103068fHITDphYTeI fLzwJ4V9KCk6Vm0D6gOUBJZjp7Z2ta5tJctxqFYJs/zWPKz7iUmvBbHzwIjAA2o490oZ CCsRActAw8/gsr50wQpGc67tRC3v2gagqJclhVcYAH55AcU+2MzHb7k+vSWKbQWG1ju4 yhj9I7rz0y4UXl3nB6DVGWmKxEIOBsv/u8TnB8BUs+DQSq6v/Z4dcXDiEyFwkh4vyODh ICdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=av0l4gI6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id ca29-20020a056a02069d00b005c67bf38069si10190204pgb.320.2023.12.13.07.01.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 07:01:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=av0l4gI6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 226A08080EC0; Wed, 13 Dec 2023 07:01:19 -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 S1442064AbjLMPBJ (ORCPT + 99 others); Wed, 13 Dec 2023 10:01:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442010AbjLMPBI (ORCPT ); Wed, 13 Dec 2023 10:01:08 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E1A793; Wed, 13 Dec 2023 07:01:14 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3333131e08dso7505799f8f.2; Wed, 13 Dec 2023 07:01:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702479672; x=1703084472; 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=2SO2+BrR+SqnVNVhmwzorIkGMHMJFcnZZ8bwmNp3Xw8=; b=av0l4gI6C2cijxN17TZeMF1/6xLLqd9Aztp2L7BucD7ajdvJlpw/GxtyrlP+k3vgxh S1RJaFbLmsL+M8bw9zMYA6Msn3PUnu8QMDv4DRSsvHFQ5i/Mu13a/v7BTJmb6m1KGfcW 9gsmJ9kZjqmGHBcIGNIzwvXAJ5J/srGw4lEaGsEeIt8G6G+xUP9LwRM0LVSUzC0QcN/1 1MdypzOxOKTrEGakMU8O4CukWrRKdjRGonKqvH5Xo/NY+YtVeYjJAgJMI8bPyFhh30XI sVoaBKesMUOUxmhOAgFXOyYrN44dw/CzCFwQb3N2qts1rl4ew0L9szQ4qSvrDH/yJGRL dw1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702479672; x=1703084472; 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=2SO2+BrR+SqnVNVhmwzorIkGMHMJFcnZZ8bwmNp3Xw8=; b=d7xy5q5j1iMQq2MUtXMbQBlmN3lzAi/8S/zhQSA/shTue0plgvwBdHSJGtmPz2rnCP MhB3DYcsOxn0vHfEZ4eHIIykJsjNERvTKbAwBS3kZM+vjz5rumOnMlWMNMKl/U1nEp2P 2KOsolge2c/MPcQGfss9BF304aGPFmlD2mDOKTn1hJgdYHpMkrfAeqwOCiBX/VDM71+i rUDDKjopnFLIsNoIvJix4dFj9KXgioDDOgTb9+ZYvru5rXTUmFdBwNH+hVvICEvp67rk K8qY5itTJEcS6DGPyywZrU5V6bqGCb/BgMz0neet6iVEpiIJ0plOheOAFce6hjOEqAOt UnXA== X-Gm-Message-State: AOJu0YwH4cNh8rEhBDOkcWPwRr4cQnxI9dHEIwvh9meTkjdZboLj0n/W F4cDTTAsT5Q/6wek6l//Y7Y= X-Received: by 2002:a05:600c:4449:b0:40c:4b43:d98f with SMTP id v9-20020a05600c444900b0040c4b43d98fmr2151358wmn.28.1702479672305; Wed, 13 Dec 2023 07:01:12 -0800 (PST) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id e6-20020a5d4e86000000b00336365d1dafsm2814378wru.69.2023.12.13.07.01.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 07:01:10 -0800 (PST) From: Christian Marangi To: Pavel Machek , Lee Jones , Jakub Kicinski , Andrew Lunn , Christian Marangi , 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 v2 1/2] leds: trigger: netdev: display only supported link speed attribute Date: Wed, 13 Dec 2023 16:00:32 +0100 Message-Id: <20231213150033.17057-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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]); Wed, 13 Dec 2023 07:01:19 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784817370943723383 X-GMAIL-MSGID: 1785179338393021913 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 --- Changes v2: - Use is_visibile instead of removing/adding attr drivers/leds/trigger/ledtrig-netdev.c | 91 +++++++++++++++++++++++++-- 1 file changed, 85 insertions(+), 6 deletions(-) diff --git a/drivers/leds/trigger/ledtrig-netdev.c b/drivers/leds/trigger/ledtrig-netdev.c index bd68da15c723..6b81836b2ea8 100644 --- a/drivers/leds/trigger/ledtrig-netdev.c +++ b/drivers/leds/trigger/ledtrig-netdev.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -55,12 +56,15 @@ struct led_netdev_data { unsigned long mode; int link_speed; + __ETHTOOL_DECLARE_LINK_MODE_MASK(supported_link_speed); 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 +212,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 advertised to not rtnl lock every time + * Modes are refreshed on any change event to handle mode changes + */ + linkmode_copy(trigger_data->supported_link_speed, cmd.link_modes.supported); } static ssize_t device_name_show(struct device *dev, @@ -257,6 +267,7 @@ static int set_device_name(struct led_netdev_data *trigger_data, trigger_data->carrier_link_up = false; trigger_data->link_speed = SPEED_UNKNOWN; trigger_data->duplex = DUPLEX_UNKNOWN; + linkmode_zero(trigger_data->supported_link_speed); if (trigger_data->net_dev != NULL) { rtnl_lock(); get_device_state(trigger_data); @@ -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,65 @@ 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_speed; + + trigger_data = led_trigger_get_drvdata(dev); + supported_link_speed = trigger_data->supported_link_speed; + + /* Display only supported entry */ + if (attr == &dev_attr_link_10.attr && + (test_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, supported_link_speed) || + test_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, supported_link_speed))) + return attr->mode; + + if (attr == &dev_attr_link_100.attr && + (test_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, supported_link_speed) || + test_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, supported_link_speed))) + return attr->mode; + + if (attr == &dev_attr_link_1000.attr && + (test_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, supported_link_speed) || + test_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, supported_link_speed))) + return attr->mode; + + if (attr == &dev_attr_link_2500.attr && + test_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, supported_link_speed)) + return attr->mode; + + if (attr == &dev_attr_link_5000.attr && + test_bit(ETHTOOL_LINK_MODE_5000baseT_Full_BIT, supported_link_speed)) + return attr->mode; + + if (attr == &dev_attr_link_10000.attr && + test_bit(ETHTOOL_LINK_MODE_10000baseT_Full_BIT, supported_link_speed)) + 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 +522,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 +540,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 +575,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 13 15:00:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 178071 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp7835167dys; Wed, 13 Dec 2023 07:01:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IHMpnujIfSl/kiiQjWG0oui6fcjEFc8L06GN/bP/uCxL4y17+WAVduuc7PAWZOWQjX9cq7j X-Received: by 2002:a05:6a00:2d9e:b0:6ce:2731:5f70 with SMTP id fb30-20020a056a002d9e00b006ce27315f70mr4411112pfb.47.1702479698498; Wed, 13 Dec 2023 07:01:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702479698; cv=none; d=google.com; s=arc-20160816; b=TPq2s9Sx1gUeeepEavX17xYdNeK1ZsvfumwqEqzQ8QWXKjDWzQmpzVvEFQ0dFt8NPO rAqB55TzBrYrYbQNCQNSogIrKdTF562y6XGfQuVFABq9vwqHGi/rpTvStlpW4QUn4bmn lCi3uO0kon/Hw018cqQVDZ7eUfQYa1bVFkum64HP/JSzSTG+u93K6MV/kqy+/cX/3q04 pcd1iihsa7EVAYSCULgDt3JGVcaPMJqXZN27sYXIJnl1t4zCL6815EVy8Cr1S3AzdsTU Qg0AkuCOFy5tm94pXBe3+ix2tGM5Y12pJWwXG4N0J/8lYphptz2yaYVm29hss/mC9T3e n35w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=XsKFunyIEF//ykMeSfV/a0SwdfxlBLJSsRhTiMN79G0=; fh=/ZwUlXQxfLLucigM+S8pep3j7awwM7+JOEA6S5CXrbY=; b=SXxHg0vL5omrBmtTJh2kKsL0NR3MhEsjGu9XbiXqh1zFrNrAVP1B54/h8KONzbFDZE Lby4KAqOKhjR5Yabynu5LULZXNRKNA6Re82YdvUBKLuzJ0Gexjptw8GuQqVZdeuEWTRq HE/uUf/3aHbFG3byr6GyWYRg52/7gykqlsZUfql2dPfYwYYTynC/EkNYvN+kYU01Jutg F/ml0Vgb7Cu6zXe4UAPQ2lU0AYIG+C4RaxN757FLeV/pNHyRVmoRD+Yg3hYj0XnbfFZh 64b2hEM/HQT+jxMrYkLh2P+FidrceEREa4NazzX2janc7bQdNT6p9z+TxeaFrm1sTdOK 57PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VFpINTgX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id 4-20020a631744000000b005bd2b354a42si9729241pgx.207.2023.12.13.07.01.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 07:01:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=VFpINTgX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8B244824774E; Wed, 13 Dec 2023 07:01:35 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442074AbjLMPBM (ORCPT + 99 others); Wed, 13 Dec 2023 10:01:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442020AbjLMPBJ (ORCPT ); Wed, 13 Dec 2023 10:01:09 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DAF383; Wed, 13 Dec 2023 07:01:15 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3363880e9f3so704336f8f.3; Wed, 13 Dec 2023 07:01:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702479674; x=1703084474; 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=VFpINTgXdBbtq1z4JzZmHFhADCfKPWcMySqfnF4Etu6mzSX1gGGLSmG5XdZYmw+sd4 2O8TPHivEWR3zuu9oNFI5kxC/R1yq7PTp2rsHWo8CKVycUMz+t50bRr0fiEv8HBGwkAJ xFbXFGsDDbD4XdG291H3+gbe6GiEnDZUEgD1T89fIKjXJ9wGb53KNKxcc+/BvFhkUBK2 wmrigUgWWaZ+2udjg6gdSowe+8bAP45CiFiJ8HpHA7uNC0SOvV5scGQmNcdnoRlj8p8e lznZLH/BlcbhK/I3GZTDvuEBIdekv+cnxKJB/LdLJvCbrNz43hGZFdIy+Yp2I6s0LDX3 MkRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702479674; x=1703084474; 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=ajzbNMZThtuPtziUNzjWtZdipBeYTcMCycMrWxPKNnuHRxAdwfDRJOM6yOeMbe8XZj N1ZIAyQT+7rxDwzhEGS5BeBsK90+IfGdKM6eJDL6GauQIPX3eWsACKFjyZNly7OxADpI IMPhFGGIm4KVXC73xDam1zMjalb4WxiQKCSs2pwmzEn2gyORSmjTlIUyrG2LSDWvS4d8 0SdSSiWZuM6+4XiIKfsMdpTOomwb4Z4z66mIDLGMT5Jo+or1cNZrZP6Ztz5viIz2v1qg bxJSidlUV4Su58J31j4klGsMZF0dtR8wJ2Aj5b17KddG4xQjWyn27tUhq5TC0Lfr7Wxa PEcA== X-Gm-Message-State: AOJu0Yxz0iohTg2O5lOS0sgNwaIdfxCbJYJLEuqJR7Y8E9gin0wBmYyb Qem9sQQmlhrdzuqy3sNzI6g= X-Received: by 2002:a5d:4887:0:b0:333:145e:f529 with SMTP id g7-20020a5d4887000000b00333145ef529mr4121057wrq.33.1702479673783; Wed, 13 Dec 2023 07:01: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 e6-20020a5d4e86000000b00336365d1dafsm2814378wru.69.2023.12.13.07.01.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 07:01:12 -0800 (PST) From: Christian Marangi To: Pavel Machek , Lee Jones , Jakub Kicinski , Andrew Lunn , Christian Marangi , 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 v2 2/2] docs: ABI: sysfs-class-led-trigger-netdev: Document now hidable link_* Date: Wed, 13 Dec 2023 16:00:33 +0100 Message-Id: <20231213150033.17057-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231213150033.17057-1-ansuelsmth@gmail.com> References: <20231213150033.17057-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 howler.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 (howler.vger.email [0.0.0.0]); Wed, 13 Dec 2023 07:01:35 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785179352669438651 X-GMAIL-MSGID: 1785179352669438651 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