aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire/core-topology.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire/core-topology.c')
-rw-r--r--drivers/firewire/core-topology.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/firewire/core-topology.c b/drivers/firewire/core-topology.c
index fddf2b358936..93ec64cdeef7 100644
--- a/drivers/firewire/core-topology.c
+++ b/drivers/firewire/core-topology.c
@@ -28,9 +28,9 @@
28#include <linux/module.h> 28#include <linux/module.h>
29#include <linux/slab.h> 29#include <linux/slab.h>
30#include <linux/spinlock.h> 30#include <linux/spinlock.h>
31#include <linux/string.h>
32 31
33#include <asm/atomic.h> 32#include <asm/atomic.h>
33#include <asm/byteorder.h>
34#include <asm/system.h> 34#include <asm/system.h>
35 35
36#include "core.h" 36#include "core.h"
@@ -183,7 +183,7 @@ static inline struct fw_node *fw_node(struct list_head *l)
183 * This function builds the tree representation of the topology given 183 * This function builds the tree representation of the topology given
184 * by the self IDs from the latest bus reset. During the construction 184 * by the self IDs from the latest bus reset. During the construction
185 * of the tree, the function checks that the self IDs are valid and 185 * of the tree, the function checks that the self IDs are valid and
186 * internally consistent. On succcess this function returns the 186 * internally consistent. On success this function returns the
187 * fw_node corresponding to the local card otherwise NULL. 187 * fw_node corresponding to the local card otherwise NULL.
188 */ 188 */
189static struct fw_node *build_tree(struct fw_card *card, 189static struct fw_node *build_tree(struct fw_card *card,
@@ -510,13 +510,16 @@ static void update_tree(struct fw_card *card, struct fw_node *root)
510static void update_topology_map(struct fw_card *card, 510static void update_topology_map(struct fw_card *card,
511 u32 *self_ids, int self_id_count) 511 u32 *self_ids, int self_id_count)
512{ 512{
513 int node_count; 513 int node_count = (card->root_node->node_id & 0x3f) + 1;
514 __be32 *map = card->topology_map;
515
516 *map++ = cpu_to_be32((self_id_count + 2) << 16);
517 *map++ = cpu_to_be32(be32_to_cpu(card->topology_map[1]) + 1);
518 *map++ = cpu_to_be32((node_count << 16) | self_id_count);
519
520 while (self_id_count--)
521 *map++ = cpu_to_be32p(self_ids++);
514 522
515 card->topology_map[1]++;
516 node_count = (card->root_node->node_id & 0x3f) + 1;
517 card->topology_map[2] = (node_count << 16) | self_id_count;
518 card->topology_map[0] = (self_id_count + 2) << 16;
519 memcpy(&card->topology_map[3], self_ids, self_id_count * 4);
520 fw_compute_block_crc(card->topology_map); 523 fw_compute_block_crc(card->topology_map);
521} 524}
522 525