sqp->pkey_index, &sqp->ud_header.bth.pkey); 
sqp->pkey_index, &pkey); 
static int build_mlx_header(struct mthca_dev *dev, struct mthca_sqp *sqp,			    int ind, struct ib_send_wr *wr,			    struct mthca_mlx_seg *mlx,			    struct mthca_data_seg *data){	int header_size;	int err;	ib_ud_header_init(256, /* assume a MAD */			  sqp->ud_header.grh_present,			  &sqp->ud_header);	err = mthca_read_ah(dev, to_mah(wr->wr.ud.ah), &sqp->ud_header);	if (err)		return err;	mlx->flags &= ~cpu_to_be32(MTHCA_NEXT_SOLICIT | 1);	mlx->flags |= cpu_to_be32((!sqp->qp.ibqp.qp_num ? MTHCA_MLX_VL15 : 0) |				  (sqp->ud_header.lrh.destination_lid == 0xffff ?				   MTHCA_MLX_SLR : 0) |				  (sqp->ud_header.lrh.service_level << 8));	mlx->rlid = sqp->ud_header.lrh.destination_lid;	mlx->vcrc = 0;	switch (wr->opcode) {	case IB_WR_SEND:		sqp->ud_header.bth.opcode = IB_OPCODE_UD_SEND_ONLY;		sqp->ud_header.immediate_present = 0;		break;	case IB_WR_SEND_WITH_IMM:		sqp->ud_header.bth.opcode = IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE;		sqp->ud_header.immediate_present = 1;		sqp->ud_header.immediate_data = wr->imm_data;		break;	default:		return -EINVAL;	}	sqp->ud_header.lrh.virtual_lane    = !sqp->qp.ibqp.qp_num ? 15 : 0;	if (sqp->ud_header.lrh.destination_lid == 0xffff)		sqp->ud_header.lrh.source_lid = 0xffff;	sqp->ud_header.bth.solicited_event = !!(wr->send_flags & IB_SEND_SOLICITED);	if (!sqp->qp.ibqp.qp_num)		ib_get_cached_pkey(&dev->ib_dev, sqp->port,				   sqp->pkey_index,				   &sqp->ud_header.bth.pkey);	else		ib_get_cached_pkey(&dev->ib_dev, sqp->port,				   wr->wr.ud.pkey_index,				   &sqp->ud_header.bth.pkey);	cpu_to_be16s(&sqp->ud_header.bth.pkey);	sqp->ud_header.bth.destination_qpn = cpu_to_be32(wr->wr.ud.remote_qpn);	sqp->ud_header.bth.psn = cpu_to_be32((sqp->send_psn++) & ((1 << 24) - 1));	sqp->ud_header.deth.qkey = cpu_to_be32(wr->wr.ud.remote_qkey & 0x80000000 ?					       sqp->qkey : wr->wr.ud.remote_qkey);	sqp->ud_header.deth.source_qpn = cpu_to_be32(sqp->qp.ibqp.qp_num);	header_size = ib_ud_header_pack(&sqp->ud_header,					sqp->header_buf +					ind * MTHCA_UD_HEADER_SIZE);	data->byte_count = cpu_to_be32(header_size);	data->lkey       = cpu_to_be32(to_mpd(sqp->qp.ibqp.pd)->ntmr.ibmr.lkey);	data->addr       = cpu_to_be64(sqp->header_dma +				       ind * MTHCA_UD_HEADER_SIZE);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/97f52eb438be7caebe026421545619d8a0c1398a/mthca_qp.c/buggy/drivers/infiniband/hw/mthca/mthca_qp.c