aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_qp.c
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2006-08-25 14:24:32 -0400
committerRoland Dreier <rolandd@cisco.com>2006-09-22 18:22:31 -0400
commit34b2aafea38efdf02cd8107a6e1057e2a297c447 (patch)
treefc800510f947696156df70cf6608f8283bab868c /drivers/infiniband/hw/ipath/ipath_qp.c
parentb1c1b6a30eac88665a35a207cc5e6233090b9d65 (diff)
IB/ipath: simplify layering code
A lot of ipath layer code was only called in one place. Now that the ipath_core and ib_ipath drivers are merged, it's more sensible to simply inline the simple stuff that the layer code was doing. Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_qp.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_qp.c34
1 files changed, 30 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_qp.c b/drivers/infiniband/hw/ipath/ipath_qp.c
index 1ccfc909db1e..9228d59b59d4 100644
--- a/drivers/infiniband/hw/ipath/ipath_qp.c
+++ b/drivers/infiniband/hw/ipath/ipath_qp.c
@@ -461,7 +461,7 @@ int ipath_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
461 goto inval; 461 goto inval;
462 462
463 if (attr_mask & IB_QP_PKEY_INDEX) 463 if (attr_mask & IB_QP_PKEY_INDEX)
464 if (attr->pkey_index >= ipath_layer_get_npkeys(dev->dd)) 464 if (attr->pkey_index >= ipath_get_npkeys(dev->dd))
465 goto inval; 465 goto inval;
466 466
467 if (attr_mask & IB_QP_MIN_RNR_TIMER) 467 if (attr_mask & IB_QP_MIN_RNR_TIMER)
@@ -645,6 +645,33 @@ __be32 ipath_compute_aeth(struct ipath_qp *qp)
645} 645}
646 646
647/** 647/**
648 * set_verbs_flags - set the verbs layer flags
649 * @dd: the infinipath device
650 * @flags: the flags to set
651 */
652static int set_verbs_flags(struct ipath_devdata *dd, unsigned flags)
653{
654 struct ipath_devdata *ss;
655 unsigned long lflags;
656
657 spin_lock_irqsave(&ipath_devs_lock, lflags);
658
659 list_for_each_entry(ss, &ipath_dev_list, ipath_list) {
660 if (!(ss->ipath_flags & IPATH_INITTED))
661 continue;
662 if ((flags & IPATH_VERBS_KERNEL_SMA) &&
663 !(*ss->ipath_statusp & IPATH_STATUS_SMA))
664 *ss->ipath_statusp |= IPATH_STATUS_OIB_SMA;
665 else
666 *ss->ipath_statusp &= ~IPATH_STATUS_OIB_SMA;
667 }
668
669 spin_unlock_irqrestore(&ipath_devs_lock, lflags);
670
671 return 0;
672}
673
674/**
648 * ipath_create_qp - create a queue pair for a device 675 * ipath_create_qp - create a queue pair for a device
649 * @ibpd: the protection domain who's device we create the queue pair for 676 * @ibpd: the protection domain who's device we create the queue pair for
650 * @init_attr: the attributes of the queue pair 677 * @init_attr: the attributes of the queue pair
@@ -760,8 +787,7 @@ struct ib_qp *ipath_create_qp(struct ib_pd *ibpd,
760 787
761 /* Tell the core driver that the kernel SMA is present. */ 788 /* Tell the core driver that the kernel SMA is present. */
762 if (init_attr->qp_type == IB_QPT_SMI) 789 if (init_attr->qp_type == IB_QPT_SMI)
763 ipath_layer_set_verbs_flags(dev->dd, 790 set_verbs_flags(dev->dd, IPATH_VERBS_KERNEL_SMA);
764 IPATH_VERBS_KERNEL_SMA);
765 break; 791 break;
766 792
767 default: 793 default:
@@ -838,7 +864,7 @@ int ipath_destroy_qp(struct ib_qp *ibqp)
838 864
839 /* Tell the core driver that the kernel SMA is gone. */ 865 /* Tell the core driver that the kernel SMA is gone. */
840 if (qp->ibqp.qp_type == IB_QPT_SMI) 866 if (qp->ibqp.qp_type == IB_QPT_SMI)
841 ipath_layer_set_verbs_flags(dev->dd, 0); 867 set_verbs_flags(dev->dd, 0);
842 868
843 spin_lock_irqsave(&qp->s_lock, flags); 869 spin_lock_irqsave(&qp->s_lock, flags);
844 qp->state = IB_QPS_ERR; 870 qp->state = IB_QPS_ERR;