Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fbb9318be4b6eba36482e1275729c5c3dfdf8156
Commit:     fbb9318be4b6eba36482e1275729c5c3dfdf8156
Parent:     8fcea95a2a15444d5cc4bee174bb12233aa0a2aa
Author:     Joachim Fenkes <[EMAIL PROTECTED]>
AuthorDate: Thu Jul 12 17:47:45 2007 +0200
Committer:  Roland Dreier <[EMAIL PROTECTED]>
CommitDate: Tue Jul 17 18:37:39 2007 -0700

    IB/ehca: Fix HW level autodetection
    
    Autodetection was missing a few HW revisions, causing certain eHCA1
    revisions to be treated like eHCA2.  Fixed.
    
    Signed-off-by: Joachim Fenkes <[EMAIL PROTECTED]>
    Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>
---
 drivers/infiniband/hw/ehca/ehca_main.c |   29 +++++++++++++++++------------
 1 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_main.c 
b/drivers/infiniband/hw/ehca/ehca_main.c
index 28ba2dd..203d01f 100644
--- a/drivers/infiniband/hw/ehca/ehca_main.c
+++ b/drivers/infiniband/hw/ehca/ehca_main.c
@@ -263,22 +263,27 @@ int ehca_sense_attributes(struct ehca_shca *shca)
 
                ehca_gen_dbg(" ... hardware version=%x:%x", hcaaver, revid);
 
-               if ((hcaaver == 1) && (revid == 0))
-                       shca->hw_level = 0x11;
-               else if ((hcaaver == 1) && (revid == 1))
-                       shca->hw_level = 0x12;
-               else if ((hcaaver == 1) && (revid == 2))
-                       shca->hw_level = 0x13;
-               else if ((hcaaver == 2) && (revid == 0))
-                       shca->hw_level = 0x21;
-               else if ((hcaaver == 2) && (revid == 0x10))
-                       shca->hw_level = 0x22;
-               else {
+               if (hcaaver == 1) {
+                       if (revid <= 3)
+                               shca->hw_level = 0x10 | (revid + 1);
+                       else
+                               shca->hw_level = 0x14;
+               } else if (hcaaver == 2) {
+                       if (revid == 0)
+                               shca->hw_level = 0x21;
+                       else if (revid == 0x10)
+                               shca->hw_level = 0x22;
+                       else if (revid == 0x20 || revid == 0x21)
+                               shca->hw_level = 0x23;
+               }
+
+               if (!shca->hw_level) {
                        ehca_gen_warn("unknown hardware version"
                                      " - assuming default level");
                        shca->hw_level = 0x22;
                }
-       }
+       } else
+               shca->hw_level = ehca_hw_level;
        ehca_gen_dbg(" ... hardware level=%x", shca->hw_level);
 
        shca->sport[0].rate = IB_RATE_30_GBPS;
-
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