]> err.no Git - linux-2.6/blobdiff - drivers/infiniband/hw/ipath/ipath_mad.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
[linux-2.6] / drivers / infiniband / hw / ipath / ipath_mad.c
index 72d1db89db8f6d3393154eb542c0b47a39208714..d61c030445451076f1d3fae4d01cde99f034cb44 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006 QLogic, Inc. All rights reserved.
+ * Copyright (c) 2006, 2007 QLogic Corporation. All rights reserved.
  * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
  *
  * This software is available to you under a choice of one of two
@@ -87,7 +87,8 @@ static int recv_subn_get_nodeinfo(struct ib_smp *smp,
        struct ipath_devdata *dd = to_idev(ibdev)->dd;
        u32 vendor, majrev, minrev;
 
-       if (smp->attr_mod)
+       /* GUID 0 is illegal */
+       if (smp->attr_mod || (dd->ipath_guid == 0))
                smp->status |= IB_SMP_INVALID_FIELD;
 
        nip->base_version = 1;
@@ -102,7 +103,7 @@ static int recv_subn_get_nodeinfo(struct ib_smp *smp,
        /* This is already in network order */
        nip->sys_guid = to_idev(ibdev)->sys_image_guid;
        nip->node_guid = dd->ipath_guid;
-       nip->port_guid = nip->sys_guid;
+       nip->port_guid = dd->ipath_guid;
        nip->partition_cap = cpu_to_be16(ipath_get_npkeys(dd));
        nip->device_id = cpu_to_be16(dd->ipath_deviceid);
        majrev = dd->ipath_majrev;
@@ -131,10 +132,15 @@ static int recv_subn_get_guidinfo(struct ib_smp *smp,
         * We only support one GUID for now.  If this changes, the
         * portinfo.guid_cap field needs to be updated too.
         */
-       if (startgx == 0)
-               /* The first is a copy of the read-only HW GUID. */
-               *p = to_idev(ibdev)->dd->ipath_guid;
-       else
+       if (startgx == 0) {
+               __be64 g = to_idev(ibdev)->dd->ipath_guid;
+               if (g == 0)
+                       /* GUID 0 is illegal */
+                       smp->status |= IB_SMP_INVALID_FIELD;
+               else
+                       /* The first is a copy of the read-only HW GUID. */
+                       *p = g;
+       } else
                smp->status |= IB_SMP_INVALID_FIELD;
 
        return reply(smp);
@@ -286,7 +292,12 @@ static int recv_subn_get_portinfo(struct ib_smp *smp,
        /* pip->vl_arb_high_cap; // only one VL */
        /* pip->vl_arb_low_cap; // only one VL */
        /* InitTypeReply = 0 */
-       pip->inittypereply_mtucap = IB_MTU_4096;
+       /*
+        * Note: the chips support a maximum MTU of 4096, but the driver
+        * hasn't implemented this feature yet, so set the maximum value
+        * to 2048.
+        */
+       pip->inittypereply_mtucap = IB_MTU_2048;
        // HCAs ignore VLStallCount and HOQLife
        /* pip->vlstallcnt_hoqlife; */
        pip->operationalvl_pei_peo_fpi_fpo = 0x10;      /* OVLs = 1 */