]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/firewire/fw-transaction.h
firewire: unnecessary BM delay after generation rollover
[linux-2.6-omap-h63xx.git] / drivers / firewire / fw-transaction.h
index c9ab12a15f6eb2974fd65e9b98b3e41d3c72faa0..1d78e9cc5940a5a2c51be2c8724157bd25b5369f 100644 (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