init_waitqueue_head(&qp->wait); 
static int mthca_alloc_qp_common(struct mthca_dev *dev,				 struct mthca_pd *pd,				 struct mthca_cq *send_cq,				 struct mthca_cq *recv_cq,				 enum ib_sig_type send_policy,				 struct mthca_qp *qp){	int ret;	int i;	atomic_set(&qp->refcount, 1);	qp->state    	 = IB_QPS_RESET;	qp->atomic_rd_en = 0;	qp->resp_depth   = 0;	qp->sq_policy    = send_policy;	mthca_wq_init(&qp->sq);	mthca_wq_init(&qp->rq);	ret = mthca_map_memfree(dev, qp);	if (ret)		return ret;	ret = mthca_alloc_wqe_buf(dev, pd, qp);	if (ret) {		mthca_unmap_memfree(dev, qp);		return ret;	}	/*	 * If this is a userspace QP, we're done now.  The doorbells	 * will be allocated and buffers will be initialized in	 * userspace.	 */	if (pd->ibpd.uobject)		return 0;	ret = mthca_alloc_memfree(dev, qp);	if (ret) {		mthca_free_wqe_buf(dev, qp);		mthca_unmap_memfree(dev, qp);		return ret;	}	if (mthca_is_memfree(dev)) {		struct mthca_next_seg *next;		struct mthca_data_seg *scatter;		int size = (sizeof (struct mthca_next_seg) +			    qp->rq.max_gs * sizeof (struct mthca_data_seg)) / 16;		for (i = 0; i < qp->rq.max; ++i) {			next = get_recv_wqe(qp, i);			next->nda_op = cpu_to_be32(((i + 1) & (qp->rq.max - 1)) <<						   qp->rq.wqe_shift);			next->ee_nds = cpu_to_be32(size);			for (scatter = (void *) (next + 1);			     (void *) scatter < (void *) next + (1 << qp->rq.wqe_shift);			     ++scatter)				scatter->lkey = cpu_to_be32(MTHCA_INVAL_LKEY);		}		for (i = 0; i < qp->sq.max; ++i) {			next = get_send_wqe(qp, i);			next->nda_op = cpu_to_be32((((i + 1) & (qp->sq.max - 1)) <<						    qp->sq.wqe_shift) +						   qp->send_wqe_offset);		}	}	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/30a7e8ef13b2ff0db7b15af9afdd12b93783f01e/mthca_qp.c/clean/drivers/infiniband/hw/mthca/mthca_qp.c