aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-device.h
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2008-03-24 15:54:28 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2008-04-18 11:55:36 -0400
commitc9755e14a01987ada4063e8b4c50c2b6738d879e (patch)
tree41a593c4b9ac10ccc4ad031510438e4551e51b5b /drivers/firewire/fw-device.h
parent1dadff71d6356ebb804c3f4f1d3049247e16111c (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-device.h')
-rw-r--r--drivers/firewire/fw-device.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/firewire/fw-device.h b/drivers/firewire/fw-device.h
index 0d771fda86de..5f131f5129da 100644
--- a/drivers/firewire/fw-device.h
+++ b/drivers/firewire/fw-device.h
@@ -21,6 +21,7 @@
21 21
22#include <linux/fs.h> 22#include <linux/fs.h>
23#include <linux/cdev.h> 23#include <linux/cdev.h>
24#include <linux/rwsem.h>
24#include <asm/atomic.h> 25#include <asm/atomic.h>
25 26
26enum fw_device_state { 27enum fw_device_state {
@@ -46,6 +47,11 @@ struct fw_attribute_group {
46 * fw_device.node_id is guaranteed to be current too. 47 * fw_device.node_id is guaranteed to be current too.
47 * 48 *
48 * The same applies to fw_device.card->node_id vs. fw_device.generation. 49 * The same applies to fw_device.card->node_id vs. fw_device.generation.
50 *
51 * fw_device.config_rom and fw_device.config_rom_length may be accessed during
52 * the lifetime of any fw_unit belonging to the fw_device, before device_del()
53 * was called on the last fw_unit. Alternatively, they may be accessed while
54 * holding fw_device_rwsem.
49 */ 55 */
50struct fw_device { 56struct fw_device {
51 atomic_t state; 57 atomic_t state;
@@ -53,6 +59,7 @@ struct fw_device {
53 int node_id; 59 int node_id;
54 int generation; 60 int generation;
55 unsigned max_speed; 61 unsigned max_speed;
62 bool cmc;
56 struct fw_card *card; 63 struct fw_card *card;
57 struct device device; 64 struct device device;
58 struct list_head link; 65 struct list_head link;
@@ -92,8 +99,12 @@ int fw_device_enable_phys_dma(struct fw_device *device);
92void fw_device_cdev_update(struct fw_device *device); 99void fw_device_cdev_update(struct fw_device *device);
93void fw_device_cdev_remove(struct fw_device *device); 100void fw_device_cdev_remove(struct fw_device *device);
94 101
102extern struct rw_semaphore fw_device_rwsem;
95extern int fw_cdev_major; 103extern int fw_cdev_major;
96 104
105/*
106 * fw_unit.directory must not be accessed after device_del(&fw_unit.device).
107 */
97struct fw_unit { 108struct fw_unit {
98 struct device device; 109 struct device device;
99 u32 *directory; 110 u32 *directory;