linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / infiniband / core / agent.c
index ecd1a30..34b724a 100644 (file)
@@ -78,6 +78,25 @@ ib_get_agent_port(struct ib_device *device, int port_num)
        return entry;
 }
 
+int smi_check_local_dr_smp(struct ib_smp *smp,
+                          struct ib_device *device,
+                          int port_num)
+{
+       struct ib_agent_port_private *port_priv;
+
+       if (smp->mgmt_class != IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE)
+               return 1;
+
+       port_priv = ib_get_agent_port(device, port_num);
+       if (!port_priv) {
+               printk(KERN_DEBUG SPFX "smi_check_local_dr_smp %s port %d "
+                      "not open\n", device->name, port_num);
+               return 1;
+       }
+
+       return smi_check_local_smp(port_priv->agent[0], smp);
+}
+
 int agent_send_response(struct ib_mad *mad, struct ib_grh *grh,
                        struct ib_wc *wc, struct ib_device *device,
                        int port_num, int qpn)