]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/infiniband/hw/ipath/ipath_verbs.c
device create: infiniband: convert device_create_drvdata to device_create
[linux-2.6-omap-h63xx.git] / drivers / infiniband / hw / ipath / ipath_verbs.c
index b766e40e9ebf601624e3e33eb072e6a9f9e327b6..eabc4247860b429db0d6603bba4e16c943d0af7c 100644 (file)
@@ -340,9 +340,16 @@ static int ipath_post_one_send(struct ipath_qp *qp, struct ib_send_wr *wr)
        int acc;
        int ret;
        unsigned long flags;
+       struct ipath_devdata *dd = to_idev(qp->ibqp.device)->dd;
 
        spin_lock_irqsave(&qp->s_lock, flags);
 
+       if (qp->ibqp.qp_type != IB_QPT_SMI &&
+           !(dd->ipath_flags & IPATH_LINKACTIVE)) {
+               ret = -ENETDOWN;
+               goto bail;
+       }
+
        /* Check that state is OK to post send. */
        if (unlikely(!(ib_ipath_state_ops[qp->state] & IPATH_POST_SEND_OK)))
                goto bail_inval;