diff options
author | Kristian Høgsberg <krh@redhat.com> | 2007-03-20 20:58:35 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2007-03-22 00:48:50 +0100 |
commit | bbd1494580462fa35bdd2073dba3902fb53981bf (patch) | |
tree | 8d3a4c46e67bdfb543531c7a2ecb2f19afa0ffe0 /drivers/firewire/fw-device.c | |
parent | 7feb9cce2d07bea635256a2e226d7ca7a9f4585f (diff) |
firewire: Export GUID as sysfs attribute.
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/fw-device.c')
-rw-r--r-- | drivers/firewire/fw-device.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c index 71bb9d1e8196..2bf86aa1c9bc 100644 --- a/drivers/firewire/fw-device.c +++ b/drivers/firewire/fw-device.c @@ -348,8 +348,7 @@ static struct device_attribute fw_unit_attributes[] = { }; static ssize_t -config_rom_show(struct device *dev, - struct device_attribute *attr, char *buf) +config_rom_show(struct device *dev, struct device_attribute *attr, char *buf) { struct fw_device *device = fw_device(dev); @@ -358,8 +357,20 @@ config_rom_show(struct device *dev, return device->config_rom_length * 4; } +static ssize_t +guid_show(struct device *dev, struct device_attribute *attr, char *buf) +{ + struct fw_device *device = fw_device(dev); + u64 guid; + + guid = ((u64)device->config_rom[3] << 32) | device->config_rom[4]; + + return snprintf(buf, PAGE_SIZE, "0x%016llx\n", guid); +} + static struct device_attribute fw_device_attributes[] = { __ATTR_RO(config_rom), + __ATTR_RO(guid), __ATTR_NULL, }; |