firewire: core: add is_local sysfs device attribute
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · On Jun 17 Clemens Ladisch wrote:
Making this information available in sysfs allows to differentiate between controllers in the local and remote Linux PCs, and thus is useful for servers that are started with udev rules.
Signed-off-by Clemens Ladisch <[email protected]>
Looks good to me. Cc'ing LKML, and sending ABI documentation in a reply.
Quoted 41 lines
--- drivers/firewire/core-device.c | 9 +++++++++ include/linux/firewire.h | 2 +- 2 files changed, 10 insertions(+), 1 deletions(-)drivers/firewire/core-device.c +9
-0@@ -398,6 +398,14 @@ static ssize_t guid_show(struct device *dev,return ret; } +static ssize_t is_local_show (struct device *dev, +struct device_attribute *attr,char *buf) +{ +struct fw_device *device =fw_device (dev); + +return sprintf (buf,"%u\n" , device->is_local); +} +static int units_sprintf (char *buf,const u32 *directory) {struct fw_csr_iterator ci;@@ -447,6 +455,7 @@ static ssize_t units_show(struct device *dev,static struct device_attribute fw_device_attributes[] = {__ATTR_RO (config_rom),__ATTR_RO (guid), +__ATTR_RO (is_local),__ATTR_RO (units), __ATTR_NULL, };include/linux/firewire.h +1
-1@@ -152,7 +152,7 @@ static inline void fw_card_put(struct fw_card *card)struct fw_attribute_group {struct attribute_group *groups[2 ];struct attribute_group group; -struct attribute *attrs[12 ]; +struct attribute *attrs[13 ]; };enum fw_device_state {
Signature · 3 lines
Stefan Richter -=====-===-- -==- =---= http://arcgraph.de/sr/
PATCH 1/1 firewire: core: document is_local sysfs attribute
Signed-off-by Stefan Richter <[email protected]>
--- Documentation/ABI/stable/sysfs-bus-firewire | 11 +++++++++++ 1 file changed, 11 insertions(+)
Documentation/ABI/stable/sysfs-bus-firewire +11 -0
@@ -39,6 +39,17 @@ Users: udev rules to set ownership and /dev/fw[0-9]+ character device files +What: /sys/bus/firewire/devices/fw[0-9]+/is_local +Date: July 2012 +KernelVersion: 3.6 +Contact: [email protected] +Description: + IEEE 1394 node device attribute. + Read-only and immutable. +Values: 1: The sysfs entry represents a local node (a controller card). + 0: The sysfs entry represents a remote node. + + What: /sys/bus/firewire/devices/fw[0-9]+[.][0-9]+/ Date: May 2007 KernelVersion: 2.6.22
Signature · 3 lines
Stefan Richter -=====-===-- -==- =---= http://arcgraph.de/sr/