]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/firewire/fw-transaction.h
Merge branch 'fix/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
[mv-sheeva.git] / drivers / firewire / fw-transaction.h
index 0497a18dc59e04b92269db9afe477f5ddc520fd7..1d78e9cc5940a5a2c51be2c8724157bd25b5369f 100644 (file)
@@ -237,14 +237,6 @@ struct fw_card {
        int link_speed;
        int config_rom_generation;
 
-       /*
-        * We need to store up to 4 self ID for a maximum of 63
-        * devices plus 3 words for the topology map header.
-        */
-       int self_id_count;
-       u32 topology_map[252 + 3];
-       u32 broadcast_channel;
-
        spinlock_t lock; /* Take this lock when handling the lists in
                          * this struct. */
        struct fw_node *local_node;
@@ -262,6 +254,9 @@ struct fw_card {
        struct delayed_work work;
        int bm_retries;
        int bm_generation;
+
+       u32 broadcast_channel;
+       u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4];
 };
 
 static inline struct fw_card *fw_card_get(struct fw_card *card)
@@ -280,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