diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-06-21 17:24:35 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2010-07-08 10:52:02 -0400 |
commit | 250b2b6dd421c9f8844a867d2ac06e0661e0ad93 (patch) | |
tree | b86719d2c442676a52c6307471c9e278b1bd21f5 /drivers/firewire/core-card.c | |
parent | ae948011071c12ff6a328348859c717ea885ed40 (diff) |
firewire: cdev: fix fw_cdev_event_bus_reset.bm_node_id
Fix an obscure ABI feature that is a bit of a hassle to implement.
However, somebody put it into the ABI, so let's fill in a sensible
value there.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/core-card.c')
-rw-r--r-- | drivers/firewire/core-card.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c index 11fc81500f82..6c316cfe70c4 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c | |||
@@ -239,7 +239,7 @@ static void fw_card_bm_work(struct work_struct *work) | |||
239 | struct fw_card *card = container_of(work, struct fw_card, work.work); | 239 | struct fw_card *card = container_of(work, struct fw_card, work.work); |
240 | struct fw_device *root_device; | 240 | struct fw_device *root_device; |
241 | struct fw_node *root_node; | 241 | struct fw_node *root_node; |
242 | int root_id, new_root_id, irm_id, local_id; | 242 | int root_id, new_root_id, irm_id, bm_id, local_id; |
243 | int gap_count, generation, grace, rcode; | 243 | int gap_count, generation, grace, rcode; |
244 | bool do_reset = false; | 244 | bool do_reset = false; |
245 | bool root_device_is_running; | 245 | bool root_device_is_running; |
@@ -301,9 +301,15 @@ static void fw_card_bm_work(struct work_struct *work) | |||
301 | /* Another bus reset, BM work has been rescheduled. */ | 301 | /* Another bus reset, BM work has been rescheduled. */ |
302 | goto out; | 302 | goto out; |
303 | 303 | ||
304 | if (rcode == RCODE_COMPLETE && | 304 | bm_id = be32_to_cpu(card->bm_transaction_data[0]); |
305 | card->bm_transaction_data[0] != cpu_to_be32(0x3f)) { | ||
306 | 305 | ||
306 | spin_lock_irq(&card->lock); | ||
307 | if (rcode == RCODE_COMPLETE && generation == card->generation) | ||
308 | card->bm_node_id = | ||
309 | bm_id == 0x3f ? local_id : 0xffc0 | bm_id; | ||
310 | spin_unlock_irq(&card->lock); | ||
311 | |||
312 | if (rcode == RCODE_COMPLETE && bm_id != 0x3f) { | ||
307 | /* Somebody else is BM. Only act as IRM. */ | 313 | /* Somebody else is BM. Only act as IRM. */ |
308 | if (local_id == irm_id) | 314 | if (local_id == irm_id) |
309 | allocate_broadcast_channel(card, generation); | 315 | allocate_broadcast_channel(card, generation); |