Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=24d40125f1f59a6de9d9e6e046676bd60532596c
Commit:     24d40125f1f59a6de9d9e6e046676bd60532596c
Parent:     25d83f583b334ac671fbb905c97c374ba34a597a
Author:     Stefan Richter <[EMAIL PROTECTED]>
AuthorDate: Mon Jun 18 19:44:12 2007 +0200
Committer:  Stefan Richter <[EMAIL PROTECTED]>
CommitDate: Tue Jul 10 00:07:43 2007 +0200

    firewire: optimize gap count with 1394b leaf nodes
    
    Table-based gap count optimization cannot be used if 1394b repeater PHYs
    are present.  But it does work with 1394b leaf nodes.
    
    Signed-off-by: Stefan Richter <[EMAIL PROTECTED]>
    Signed-off-by: Kristian Høgsberg <[EMAIL PROTECTED]>
---
 drivers/firewire/fw-card.c        |    7 +++++--
 drivers/firewire/fw-topology.c    |   16 ++++++++--------
 drivers/firewire/fw-topology.h    |    6 ------
 drivers/firewire/fw-transaction.h |    2 +-
 4 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c
index 9eb1eda..0aeab32 100644
--- a/drivers/firewire/fw-card.c
+++ b/drivers/firewire/fw-card.c
@@ -336,8 +336,11 @@ fw_card_bm_work(struct work_struct *work)
        }
 
  pick_me:
-       /* Now figure out what gap count to set. */
-       if (card->topology_type == FW_TOPOLOGY_A &&
+       /*
+        * Pick a gap count from 1394a table E-1.  The table doesn't cover
+        * the typically much larger 1394b beta repeater delays though.
+        */
+       if (!card->beta_repeaters_present &&
            card->root_node->max_hops < ARRAY_SIZE(gap_count_table))
                gap_count = gap_count_table[card->root_node->max_hops];
        else
diff --git a/drivers/firewire/fw-topology.c b/drivers/firewire/fw-topology.c
index 4e35850..77e3f82 100644
--- a/drivers/firewire/fw-topology.c
+++ b/drivers/firewire/fw-topology.c
@@ -172,7 +172,8 @@ static struct fw_node *build_tree(struct fw_card *card,
        struct list_head stack, *h;
        u32 *next_sid, *end, q;
        int i, port_count, child_port_count, phy_id, parent_count, stack_depth;
-       int gap_count, topology_type;
+       int gap_count;
+       bool beta_repeaters_present;
 
        local_node = NULL;
        node = NULL;
@@ -182,7 +183,7 @@ static struct fw_node *build_tree(struct fw_card *card,
        phy_id = 0;
        irm_node = NULL;
        gap_count = SELF_ID_GAP_COUNT(*sid);
-       topology_type = 0;
+       beta_repeaters_present = false;
 
        while (sid < end) {
                next_sid = count_ports(sid, &port_count, &child_port_count);
@@ -224,11 +225,6 @@ static struct fw_node *build_tree(struct fw_card *card,
                if (SELF_ID_CONTENDER(q))
                        irm_node = node;
 
-               if (node->phy_speed == SCODE_BETA)
-                       topology_type |= FW_TOPOLOGY_B;
-               else
-                       topology_type |= FW_TOPOLOGY_A;
-
                parent_count = 0;
 
                for (i = 0; i < port_count; i++) {
@@ -278,6 +274,10 @@ static struct fw_node *build_tree(struct fw_card *card,
                list_add_tail(&node->link, &stack);
                stack_depth += 1 - child_port_count;
 
+               if (node->phy_speed == SCODE_BETA &&
+                   parent_count + child_port_count > 1)
+                       beta_repeaters_present = true;
+
                /*
                 * If all PHYs does not report the same gap count
                 * setting, we fall back to 63 which will force a gap
@@ -295,7 +295,7 @@ static struct fw_node *build_tree(struct fw_card *card,
        card->root_node = node;
        card->irm_node = irm_node;
        card->gap_count = gap_count;
-       card->topology_type = topology_type;
+       card->beta_repeaters_present = beta_repeaters_present;
 
        return local_node;
 }
diff --git a/drivers/firewire/fw-topology.h b/drivers/firewire/fw-topology.h
index 363b6cb..aced9f7 100644
--- a/drivers/firewire/fw-topology.h
+++ b/drivers/firewire/fw-topology.h
@@ -20,12 +20,6 @@
 #define __fw_topology_h
 
 enum {
-       FW_TOPOLOGY_A =         0x01,
-       FW_TOPOLOGY_B =         0x02,
-       FW_TOPOLOGY_MIXED =     0x03,
-};
-
-enum {
        FW_NODE_CREATED =   0x00,
        FW_NODE_UPDATED =   0x01,
        FW_NODE_DESTROYED = 0x02,
diff --git a/drivers/firewire/fw-transaction.h 
b/drivers/firewire/fw-transaction.h
index f54eee4..5abed19 100644
--- a/drivers/firewire/fw-transaction.h
+++ b/drivers/firewire/fw-transaction.h
@@ -245,7 +245,7 @@ struct fw_card {
        struct fw_node *irm_node;
        int color;
        int gap_count;
-       int topology_type;
+       bool beta_repeaters_present;
 
        int index;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to