]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
IB/ehca: Return physical link information in query_port()
authorJoachim Fenkes <fenkes@de.ibm.com>
Fri, 2 Nov 2007 13:33:51 +0000 (15:33 +0200)
committerRoland Dreier <rolandd@cisco.com>
Tue, 13 Nov 2007 23:26:59 +0000 (15:26 -0800)
Newer firmware versions return physical port information to the
partition, so hand that information to the consumer if it's present.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ehca/ehca_hca.c
drivers/infiniband/hw/ehca/hipz_hw.h

index 15806d1404612d1b34c849080ef4fb2d26627b94..5bd7b591987ed3c77b545197714858a62a470108 100644 (file)
@@ -151,7 +151,6 @@ int ehca_query_port(struct ib_device *ibdev,
        }
 
        memset(props, 0, sizeof(struct ib_port_attr));
-       props->state = rblock->state;
 
        switch (rblock->max_mtu) {
        case 0x1:
@@ -188,11 +187,20 @@ int ehca_query_port(struct ib_device *ibdev,
        props->subnet_timeout  = rblock->subnet_timeout;
        props->init_type_reply = rblock->init_type_reply;
 
-       props->active_width    = IB_WIDTH_12X;
-       props->active_speed    = 0x1;
-
-       /* at the moment (logical) link state is always LINK_UP */
-       props->phys_state      = 0x5;
+       if (rblock->state && rblock->phys_width) {
+               props->phys_state      = rblock->phys_pstate;
+               props->state           = rblock->phys_state;
+               props->active_width    = rblock->phys_width;
+               props->active_speed    = rblock->phys_speed;
+       } else {
+               /* old firmware releases don't report physical
+                * port info, so use default values
+                */
+               props->phys_state      = 5;
+               props->state           = rblock->state;
+               props->active_width    = IB_WIDTH_12X;
+               props->active_speed    = 0x1;
+       }
 
 query_port1:
        ehca_free_fw_ctrlblock(rblock);
index d9739e554515eb7796803f55b88e82bf80572925..485b8400359e756898f864f767695e3292affe35 100644 (file)
@@ -402,7 +402,11 @@ struct hipz_query_port {
        u64 max_msg_sz;
        u32 max_mtu;
        u32 vl_cap;
-       u8  reserved2[1900];
+       u32 phys_pstate;
+       u32 phys_state;
+       u32 phys_speed;
+       u32 phys_width;
+       u8  reserved2[1884];
        u64 guid_entries[255];
 } __attribute__ ((packed));