firewire: unnecessary BM delay after generation rollover

Noticed by Jarod Wilson:  The bus manager work was unnecessarily delayed
each time the bus generation counter rolled over.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Jarod Wilson <jwilson@redhat.com>
This commit is contained in:
Stefan Richter
2008-03-24 20:56:40 +01:00
parent a5c7f4710f
commit 8cd0bbbdff
3 changed files with 11 additions and 2 deletions

View File

@@ -275,6 +275,15 @@ static inline void fw_card_put(struct fw_card *card)
extern void fw_schedule_bm_work(struct fw_card *card, unsigned long delay);
/*
* Check whether new_generation is the immediate successor of old_generation.
* Take counter roll-over at 255 (as per to OHCI) into account.
*/
static inline bool is_next_generation(int new_generation, int old_generation)
{
return (new_generation & 0xff) == ((old_generation + 1) & 0xff);
}
/*
* The iso packet format allows for an immediate header/payload part
* stored in 'header' immediately after the packet info plus an