firewire: core: use more outbound tlabels

Tlabel is a 6 bits wide datum. Wrap it after 63 rather than 31 for more
safety against transaction label exhaustion and potential responders'
transaction layer bugs. (As noted by Guus Sliepen, this change requires
an expansion of tlabel_mask to 64 bits.)

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

+6 -5
+4 -4
drivers/firewire/core-transaction.c
··· 82 82 list_for_each_entry(t, &card->transaction_list, link) { 83 83 if (t == transaction) { 84 84 list_del(&t->link); 85 - card->tlabel_mask &= ~(1 << t->tlabel); 85 + card->tlabel_mask &= ~(1ULL << t->tlabel); 86 86 break; 87 87 } 88 88 } ··· 288 288 spin_lock_irqsave(&card->lock, flags); 289 289 290 290 tlabel = card->current_tlabel; 291 - if (card->tlabel_mask & (1 << tlabel)) { 291 + if (card->tlabel_mask & (1ULL << tlabel)) { 292 292 spin_unlock_irqrestore(&card->lock, flags); 293 293 callback(card, RCODE_SEND_ERROR, NULL, 0, callback_data); 294 294 return; 295 295 } 296 296 297 - card->current_tlabel = (card->current_tlabel + 1) & 0x1f; 298 - card->tlabel_mask |= (1 << tlabel); 297 + card->current_tlabel = (card->current_tlabel + 1) & 0x3f; 298 + card->tlabel_mask |= (1ULL << tlabel); 299 299 300 300 t->node_id = destination_id; 301 301 t->tlabel = tlabel;
+2 -1
include/linux/firewire.h
··· 98 98 99 99 int node_id; 100 100 int generation; 101 - int current_tlabel, tlabel_mask; 101 + int current_tlabel; 102 + u64 tlabel_mask; 102 103 struct list_head transaction_list; 103 104 struct timer_list flush_timer; 104 105 unsigned long reset_jiffies;