diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2008-03-24 15:54:28 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2008-04-18 11:55:36 -0400 |
commit | c9755e14a01987ada4063e8b4c50c2b6738d879e (patch) | |
tree | 41a593c4b9ac10ccc4ad031510438e4551e51b5b /drivers/firewire/fw-sbp2.c | |
parent | 1dadff71d6356ebb804c3f4f1d3049247e16111c (diff) |
firewire: reread config ROM when device reset the bus
When a device changes its configuration ROM, it announces this with a
bus reset. firewire-core has to check which node initiated a bus reset
and whether any unit directories went away or were added on this node.
Tested with an IOI FWB-IDE01AB which has its link-on bit set if bus
power is available but does not respond to ROM read requests if self
power is off. This implements
- recognition of the units if self power is switched on after fw-core
gave up the initial attempt to read the config ROM,
- shutdown of the units when self power is switched off.
Also tested with a second PC running Linux/ieee1394. When the eth1394
driver is inserted and removed on that node, fw-core now notices the
addition and removal of the IPv4 unit on the ieee1394 node.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/fw-sbp2.c')
-rw-r--r-- | drivers/firewire/fw-sbp2.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/firewire/fw-sbp2.c b/drivers/firewire/fw-sbp2.c index e99a33fcc923..2a999373863e 100644 --- a/drivers/firewire/fw-sbp2.c +++ b/drivers/firewire/fw-sbp2.c | |||
@@ -153,6 +153,7 @@ struct sbp2_target { | |||
153 | struct list_head lu_list; | 153 | struct list_head lu_list; |
154 | 154 | ||
155 | u64 management_agent_address; | 155 | u64 management_agent_address; |
156 | u64 guid; | ||
156 | int directory_id; | 157 | int directory_id; |
157 | int node_id; | 158 | int node_id; |
158 | int address_high; | 159 | int address_high; |
@@ -1114,6 +1115,7 @@ static int sbp2_probe(struct device *dev) | |||
1114 | kref_init(&tgt->kref); | 1115 | kref_init(&tgt->kref); |
1115 | INIT_LIST_HEAD(&tgt->lu_list); | 1116 | INIT_LIST_HEAD(&tgt->lu_list); |
1116 | tgt->bus_id = unit->device.bus_id; | 1117 | tgt->bus_id = unit->device.bus_id; |
1118 | tgt->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4]; | ||
1117 | 1119 | ||
1118 | if (fw_device_enable_phys_dma(device) < 0) | 1120 | if (fw_device_enable_phys_dma(device) < 0) |
1119 | goto fail_shost_put; | 1121 | goto fail_shost_put; |
@@ -1571,16 +1573,14 @@ sbp2_sysfs_ieee1394_id_show(struct device *dev, struct device_attribute *attr, | |||
1571 | { | 1573 | { |
1572 | struct scsi_device *sdev = to_scsi_device(dev); | 1574 | struct scsi_device *sdev = to_scsi_device(dev); |
1573 | struct sbp2_logical_unit *lu; | 1575 | struct sbp2_logical_unit *lu; |
1574 | struct fw_device *device; | ||
1575 | 1576 | ||
1576 | if (!sdev) | 1577 | if (!sdev) |
1577 | return 0; | 1578 | return 0; |
1578 | 1579 | ||
1579 | lu = sdev->hostdata; | 1580 | lu = sdev->hostdata; |
1580 | device = fw_device(lu->tgt->unit->device.parent); | ||
1581 | 1581 | ||
1582 | return sprintf(buf, "%08x%08x:%06x:%04x\n", | 1582 | return sprintf(buf, "%016llx:%06x:%04x\n", |
1583 | device->config_rom[3], device->config_rom[4], | 1583 | (unsigned long long)lu->tgt->guid, |
1584 | lu->tgt->directory_id, lu->lun); | 1584 | lu->tgt->directory_id, lu->lun); |
1585 | } | 1585 | } |
1586 | 1586 | ||