aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-03-20 20:58:35 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2007-03-21 19:48:50 -0400
commitbbd1494580462fa35bdd2073dba3902fb53981bf (patch)
tree8d3a4c46e67bdfb543531c7a2ecb2f19afa0ffe0 /drivers/firewire
parent7feb9cce2d07bea635256a2e226d7ca7a9f4585f (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')
-rw-r--r--drivers/firewire/fw-device.c15
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[] = {
348}; 348};
349 349
350static ssize_t 350static ssize_t
351config_rom_show(struct device *dev, 351config_rom_show(struct device *dev, struct device_attribute *attr, char *buf)
352 struct device_attribute *attr, char *buf)
353{ 352{
354 struct fw_device *device = fw_device(dev); 353 struct fw_device *device = fw_device(dev);
355 354
@@ -358,8 +357,20 @@ config_rom_show(struct device *dev,
358 return device->config_rom_length * 4; 357 return device->config_rom_length * 4;
359} 358}
360 359
360static ssize_t
361guid_show(struct device *dev, struct device_attribute *attr, char *buf)
362{
363 struct fw_device *device = fw_device(dev);
364 u64 guid;
365
366 guid = ((u64)device->config_rom[3] << 32) | device->config_rom[4];
367
368 return snprintf(buf, PAGE_SIZE, "0x%016llx\n", guid);
369}
370
361static struct device_attribute fw_device_attributes[] = { 371static struct device_attribute fw_device_attributes[] = {
362 __ATTR_RO(config_rom), 372 __ATTR_RO(config_rom),
373 __ATTR_RO(guid),
363 __ATTR_NULL, 374 __ATTR_NULL,
364}; 375};
365 376