Commit 44f0fb8d authored by Marek Behún's avatar Marek Behún Committed by Jakub Kicinski

leds: trigger: netdev: rename 'hw_control' sysfs entry to 'offloaded'

Commit b655892f ("leds: trigger: netdev: expose hw_control status
via sysfs") exposed to sysfs the flag that tells whether the LED trigger
is offloaded to hardware, under the name "hw_control", since that is the
name under which this setting is called in the code.

Everywhere else in kernel when some work that is normally done in
software can be made to be done by hardware instead, we use the word
"offloading" to describe this, e.g. "LED blinking is offloaded to
hardware".

Normally renaming sysfs entries is a no-go because of backwards
compatibility. But since this patch was not yet released in a stable
kernel, I think it is still possible to rename it, if there is
consensus.

Fixes: b655892f ("leds: trigger: netdev: expose hw_control status via sysfs")
Signed-off-by: default avatarMarek Behún <kabel@kernel.org>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20230821121453.30203-1-kabel@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 604204fc
...@@ -13,7 +13,7 @@ Description: ...@@ -13,7 +13,7 @@ Description:
Specifies the duration of the LED blink in milliseconds. Specifies the duration of the LED blink in milliseconds.
Defaults to 50 ms. Defaults to 50 ms.
With hw_control ON, the interval value MUST be set to the When offloaded is true, the interval value MUST be set to the
default value and cannot be changed. default value and cannot be changed.
Trying to set any value in this specific mode will return Trying to set any value in this specific mode will return
an EINVAL error. an EINVAL error.
...@@ -44,8 +44,8 @@ Description: ...@@ -44,8 +44,8 @@ Description:
If set to 1, the LED will blink for the milliseconds specified If set to 1, the LED will blink for the milliseconds specified
in interval to signal transmission. in interval to signal transmission.
With hw_control ON, the blink interval is controlled by hardware When offloaded is true, the blink interval is controlled by
and won't reflect the value set in interval. hardware and won't reflect the value set in interval.
What: /sys/class/leds/<led>/rx What: /sys/class/leds/<led>/rx
Date: Dec 2017 Date: Dec 2017
...@@ -59,21 +59,21 @@ Description: ...@@ -59,21 +59,21 @@ Description:
If set to 1, the LED will blink for the milliseconds specified If set to 1, the LED will blink for the milliseconds specified
in interval to signal reception. in interval to signal reception.
With hw_control ON, the blink interval is controlled by hardware When offloaded is true, the blink interval is controlled by
and won't reflect the value set in interval. hardware and won't reflect the value set in interval.
What: /sys/class/leds/<led>/hw_control What: /sys/class/leds/<led>/offloaded
Date: Jun 2023 Date: Jun 2023
KernelVersion: 6.5 KernelVersion: 6.5
Contact: linux-leds@vger.kernel.org Contact: linux-leds@vger.kernel.org
Description: Description:
Communicate whether the LED trigger modes are driven by hardware Communicate whether the LED trigger modes are offloaded to
or software fallback is used. hardware or whether software fallback is used.
If 0, the LED is using software fallback to blink. If 0, the LED is using software fallback to blink.
If 1, the LED is using hardware control to blink and signal the If 1, the LED blinking in requested mode is offloaded to
requested modes. hardware.
What: /sys/class/leds/<led>/link_10 What: /sys/class/leds/<led>/link_10
Date: Jun 2023 Date: Jun 2023
......
...@@ -406,15 +406,15 @@ static ssize_t interval_store(struct device *dev, ...@@ -406,15 +406,15 @@ static ssize_t interval_store(struct device *dev,
static DEVICE_ATTR_RW(interval); static DEVICE_ATTR_RW(interval);
static ssize_t hw_control_show(struct device *dev, static ssize_t offloaded_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct led_netdev_data *trigger_data = led_trigger_get_drvdata(dev); struct led_netdev_data *trigger_data = led_trigger_get_drvdata(dev);
return sprintf(buf, "%d\n", trigger_data->hw_control); return sprintf(buf, "%d\n", trigger_data->hw_control);
} }
static DEVICE_ATTR_RO(hw_control); static DEVICE_ATTR_RO(offloaded);
static struct attribute *netdev_trig_attrs[] = { static struct attribute *netdev_trig_attrs[] = {
&dev_attr_device_name.attr, &dev_attr_device_name.attr,
...@@ -427,7 +427,7 @@ static struct attribute *netdev_trig_attrs[] = { ...@@ -427,7 +427,7 @@ static struct attribute *netdev_trig_attrs[] = {
&dev_attr_rx.attr, &dev_attr_rx.attr,
&dev_attr_tx.attr, &dev_attr_tx.attr,
&dev_attr_interval.attr, &dev_attr_interval.attr,
&dev_attr_hw_control.attr, &dev_attr_offloaded.attr,
NULL NULL
}; };
ATTRIBUTE_GROUPS(netdev_trig); ATTRIBUTE_GROUPS(netdev_trig);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment