aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/fw-card.c
diff options
context:
space:
mode:
authorStefan Richter <stefanr@s5r6.in-berlin.de>2008-03-24 15:57:12 -0400
committerStefan Richter <stefanr@s5r6.in-berlin.de>2008-04-18 11:55:36 -0400
commit25b1c3d8889f982ebc6c7b996cfc7fa5f1dce533 (patch)
tree1af972dbd20246573115769af3b6baa9d489fdab /drivers/firewire/fw-card.c
parent2a0a2590498be7b92e3e76409c9b8ee722e23c8f (diff)
firewire: fix synchronization of gap counts
Fix: The fact that nodes had different gap counts would be overlooked if the bus manager code would pick gap count 63 because of beta repeaters or because of very large hop counts. In this case, the bus manager code would miss that it actually has to send the PHY config packet with gap count 63. Related trivial changes: Use bool for an int used as bool, touch up some comments. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Diffstat (limited to 'drivers/firewire/fw-card.c')
-rw-r--r--drivers/firewire/fw-card.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index 7e4012db6ad2..681bb8d4ef63 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -220,7 +220,7 @@ fw_card_bm_work(struct work_struct *work)
220 struct bm_data bmd; 220 struct bm_data bmd;
221 unsigned long flags; 221 unsigned long flags;
222 int root_id, new_root_id, irm_id, gap_count, generation, grace; 222 int root_id, new_root_id, irm_id, gap_count, generation, grace;
223 int do_reset = 0; 223 bool do_reset = false;
224 224
225 spin_lock_irqsave(&card->lock, flags); 225 spin_lock_irqsave(&card->lock, flags);
226 local_node = card->local_node; 226 local_node = card->local_node;
@@ -360,14 +360,14 @@ fw_card_bm_work(struct work_struct *work)
360 gap_count = 63; 360 gap_count = 63;
361 361
362 /* 362 /*
363 * Finally, figure out if we should do a reset or not. If we've 363 * Finally, figure out if we should do a reset or not. If we have
364 * done less that 5 resets with the same physical topology and we 364 * done less than 5 resets with the same physical topology and we
365 * have either a new root or a new gap count setting, let's do it. 365 * have either a new root or a new gap count setting, let's do it.
366 */ 366 */
367 367
368 if (card->bm_retries++ < 5 && 368 if (card->bm_retries++ < 5 &&
369 (card->gap_count != gap_count || new_root_id != root_id)) 369 (card->gap_count != gap_count || new_root_id != root_id))
370 do_reset = 1; 370 do_reset = true;
371 371
372 spin_unlock_irqrestore(&card->lock, flags); 372 spin_unlock_irqrestore(&card->lock, flags);
373 373