err = mthca_cmd_box(dev, 0, indma, (!!is_ee << 24) | num, op_mod, op[trans], CMD_TIME_CLASS_C, status); 
err = mthca_cmd_box(dev, 0, mailbox ? mailbox->dma : 0, (!!is_ee << 24) | num, op_mod, op[trans], CMD_TIME_CLASS_C, status); 
int mthca_MODIFY_QP(struct mthca_dev *dev, int trans, u32 num,		    int is_ee, void *qp_context, u32 optmask,		    u8 *status){	static const u16 op[] = {		[MTHCA_TRANS_RST2INIT]  = CMD_RST2INIT_QPEE,		[MTHCA_TRANS_INIT2INIT] = CMD_INIT2INIT_QPEE,		[MTHCA_TRANS_INIT2RTR]  = CMD_INIT2RTR_QPEE,		[MTHCA_TRANS_RTR2RTS]   = CMD_RTR2RTS_QPEE,		[MTHCA_TRANS_RTS2RTS]   = CMD_RTS2RTS_QPEE,		[MTHCA_TRANS_SQERR2RTS] = CMD_SQERR2RTS_QPEE,		[MTHCA_TRANS_ANY2ERR]   = CMD_2ERR_QPEE,		[MTHCA_TRANS_RTS2SQD]   = CMD_RTS2SQD_QPEE,		[MTHCA_TRANS_SQD2SQD]   = CMD_SQD2SQD_QPEE,		[MTHCA_TRANS_SQD2RTS]   = CMD_SQD2RTS_QPEE,		[MTHCA_TRANS_ANY2RST]   = CMD_ERR2RST_QPEE	};	u8 op_mod = 0;	dma_addr_t indma;	int err;	if (trans < 0 || trans >= ARRAY_SIZE(op))		return -EINVAL;	if (trans == MTHCA_TRANS_ANY2RST) {		indma  = 0;		op_mod = 3;	/* don't write outbox, any->reset */		/* For debugging */		qp_context = pci_alloc_consistent(dev->pdev, MTHCA_QP_CONTEXT_SIZE,						  &indma);		op_mod = 2;	/* write outbox, any->reset */	} else {		indma = pci_map_single(dev->pdev, qp_context,				       MTHCA_QP_CONTEXT_SIZE,				       PCI_DMA_TODEVICE);		if (pci_dma_mapping_error(indma))			return -ENOMEM;		if (0) {			int i;			mthca_dbg(dev, "Dumping QP context:\n");			printk("  opt param mask: %08x\n", be32_to_cpup(qp_context));			for (i = 0; i < 0x100 / 4; ++i) {				if (i % 8 == 0)					printk("  [%02x] ", i * 4);				printk(" %08x", be32_to_cpu(((u32 *) qp_context)[i + 2]));				if ((i + 1) % 8 == 0)					printk("\n");			}		}	}	if (trans == MTHCA_TRANS_ANY2RST) {		err = mthca_cmd_box(dev, 0, indma, (!!is_ee << 24) | num,				    op_mod, op[trans], CMD_TIME_CLASS_C, status);		if (0) {			int i;			mthca_dbg(dev, "Dumping QP context:\n");			printk(" %08x\n", be32_to_cpup(qp_context));			for (i = 0; i < 0x100 / 4; ++i) {				if (i % 8 == 0)					printk("[%02x] ", i * 4);				printk(" %08x", be32_to_cpu(((u32 *) qp_context)[i + 2]));				if ((i + 1) % 8 == 0)					printk("\n");			}		}	} else		err = mthca_cmd(dev, indma, (!!is_ee << 24) | num,				op_mod, op[trans], CMD_TIME_CLASS_C, status);	if (trans != MTHCA_TRANS_ANY2RST)		pci_unmap_single(dev->pdev, indma,				 MTHCA_QP_CONTEXT_SIZE, PCI_DMA_TODEVICE);	else		pci_free_consistent(dev->pdev, MTHCA_QP_CONTEXT_SIZE,				    qp_context, indma);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/ed878458eeff9754d66f1b0325df6ebbfcdce668/mthca_cmd.c/clean/drivers/infiniband/hw/mthca/mthca_cmd.c