]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/infiniband/hw/mthca/mthca_mad.c
Merge branch 'upstream' of git://lost.foo-projects.org/~ahkok/git/netdev-2.6 into...
[linux-2.6-omap-h63xx.git] / drivers / infiniband / hw / mthca / mthca_mad.c
index f235c7ea42f07d7ed4e6d5aee255e834d7fdc2a6..d9bc030bcccc78627f434a226f199110dafefa15 100644 (file)
@@ -49,7 +49,7 @@ enum {
        MTHCA_VENDOR_CLASS2 = 0xa
 };
 
-int mthca_update_rate(struct mthca_dev *dev, u8 port_num)
+static int mthca_update_rate(struct mthca_dev *dev, u8 port_num)
 {
        struct ib_port_attr *tprops = NULL;
        int                  ret;
@@ -114,14 +114,22 @@ static void smp_snoop(struct ib_device *ibdev,
             mad->mad_hdr.mgmt_class  == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) &&
            mad->mad_hdr.method     == IB_MGMT_METHOD_SET) {
                if (mad->mad_hdr.attr_id == IB_SMP_ATTR_PORT_INFO) {
+                       struct ib_port_info *pinfo =
+                               (struct ib_port_info *) ((struct ib_smp *) mad)->data;
+
                        mthca_update_rate(to_mdev(ibdev), port_num);
                        update_sm_ah(to_mdev(ibdev), port_num,
-                                    be16_to_cpup((__be16 *) (mad->data + 58)),
-                                    (*(u8 *) (mad->data + 76)) & 0xf);
+                                    be16_to_cpu(pinfo->lid),
+                                    pinfo->neighbormtu_mastersmsl & 0xf);
 
                        event.device           = ibdev;
-                       event.event            = IB_EVENT_LID_CHANGE;
                        event.element.port_num = port_num;
+
+                       if(pinfo->clientrereg_resv_subnetto & 0x80)
+                               event.event    = IB_EVENT_CLIENT_REREGISTER;
+                       else
+                               event.event    = IB_EVENT_LID_CHANGE;
+
                        ib_dispatch_event(&event);
                }