aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2008-02-03 17:03:00 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2008-02-16 09:40:34 -0500
commitfa6e697b85d705d37b3b03829095c22bcbe95ab6 (patch)
tree97a04a835efb45646391e265c8e5ea17b3b9a384 /drivers/firewire
parentbe6f48b0174584c9c415012ca14803c7e941e27e (diff)
firewire: log GUID of new devices
This should help to interpret user reports. E.g. one can look up the vendor OUI (first three bytes of the GUID) and thus tell what is what. Also simplifies the math in the GUID sysfs attribute. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Jarod Wilson <jwilson@redhat.com>
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/fw-device.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/firewire/fw-device.c b/drivers/firewire/fw-device.c
index c04c28800f1d..2ab13e0f3469 100644
--- a/drivers/firewire/fw-device.c
+++ b/drivers/firewire/fw-device.c
@@ -358,12 +358,9 @@ static ssize_t
358guid_show(struct device *dev, struct device_attribute *attr, char *buf) 358guid_show(struct device *dev, struct device_attribute *attr, char *buf)
359{ 359{
360 struct fw_device *device = fw_device(dev); 360 struct fw_device *device = fw_device(dev);
361 u64 guid;
362 361
363 guid = ((u64)device->config_rom[3] << 32) | device->config_rom[4]; 362 return snprintf(buf, PAGE_SIZE, "0x%08x%08x\n",
364 363 device->config_rom[3], device->config_rom[4]);
365 return snprintf(buf, PAGE_SIZE, "0x%016llx\n",
366 (unsigned long long)guid);
367} 364}
368 365
369static struct device_attribute fw_device_attributes[] = { 366static struct device_attribute fw_device_attributes[] = {
@@ -723,13 +720,22 @@ static void fw_device_init(struct work_struct *work)
723 */ 720 */
724 if (atomic_cmpxchg(&device->state, 721 if (atomic_cmpxchg(&device->state,
725 FW_DEVICE_INITIALIZING, 722 FW_DEVICE_INITIALIZING,
726 FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN) 723 FW_DEVICE_RUNNING) == FW_DEVICE_SHUTDOWN) {
727 fw_device_shutdown(&device->work.work); 724 fw_device_shutdown(&device->work.work);
728 else 725 } else {
729 fw_notify("created new fw device %s " 726 if (device->config_rom_retries)
730 "(%d config rom retries, S%d00)\n", 727 fw_notify("created device %s: GUID %08x%08x, S%d00, "
731 device->device.bus_id, device->config_rom_retries, 728 "%d config ROM retries\n",
732 1 << device->max_speed); 729 device->device.bus_id,
730 device->config_rom[3], device->config_rom[4],
731 1 << device->max_speed,
732 device->config_rom_retries);
733 else
734 fw_notify("created device %s: GUID %08x%08x, S%d00\n",
735 device->device.bus_id,
736 device->config_rom[3], device->config_rom[4],
737 1 << device->max_speed);
738 }
733 739
734 /* 740 /*
735 * Reschedule the IRM work if we just finished reading the 741 * Reschedule the IRM work if we just finished reading the