err = mthca_cmd_box(dev, 0, outdma, 0, 0, CMD_QUERY_FW, 
err = mthca_cmd_box(dev, 0, mailbox->dma, 0, 0, CMD_QUERY_FW, 
int mthca_QUERY_FW(struct mthca_dev *dev, u8 *status){	u32 *outbox;	dma_addr_t outdma;	int err = 0;	u8 lg;#define QUERY_FW_OUT_SIZE             0x100#define QUERY_FW_VER_OFFSET            0x00#define QUERY_FW_MAX_CMD_OFFSET        0x0f#define QUERY_FW_ERR_START_OFFSET      0x30#define QUERY_FW_ERR_SIZE_OFFSET       0x38#define QUERY_FW_START_OFFSET          0x20#define QUERY_FW_END_OFFSET            0x28#define QUERY_FW_SIZE_OFFSET           0x00#define QUERY_FW_CLR_INT_BASE_OFFSET   0x20#define QUERY_FW_EQ_ARM_BASE_OFFSET    0x40#define QUERY_FW_EQ_SET_CI_BASE_OFFSET 0x48	outbox = pci_alloc_consistent(dev->pdev, QUERY_FW_OUT_SIZE, &outdma);	if (!outbox) {		return -ENOMEM;	}	err = mthca_cmd_box(dev, 0, outdma, 0, 0, CMD_QUERY_FW,			    CMD_TIME_CLASS_A, status);	if (err)		goto out;	MTHCA_GET(dev->fw_ver,   outbox, QUERY_FW_VER_OFFSET);	/*	 * FW subminor version is at more signifant bits than minor	 * version, so swap here.	 */	dev->fw_ver = (dev->fw_ver & 0xffff00000000ull) |		((dev->fw_ver & 0xffff0000ull) >> 16) |		((dev->fw_ver & 0x0000ffffull) << 16);	MTHCA_GET(lg, outbox, QUERY_FW_MAX_CMD_OFFSET);	dev->cmd.max_cmds = 1 << lg;	mthca_dbg(dev, "FW version %012llx, max commands %d\n",		  (unsigned long long) dev->fw_ver, dev->cmd.max_cmds);	if (mthca_is_memfree(dev)) {		MTHCA_GET(dev->fw.arbel.fw_pages,       outbox, QUERY_FW_SIZE_OFFSET);		MTHCA_GET(dev->fw.arbel.clr_int_base,   outbox, QUERY_FW_CLR_INT_BASE_OFFSET);		MTHCA_GET(dev->fw.arbel.eq_arm_base,    outbox, QUERY_FW_EQ_ARM_BASE_OFFSET);		MTHCA_GET(dev->fw.arbel.eq_set_ci_base, outbox, QUERY_FW_EQ_SET_CI_BASE_OFFSET);		mthca_dbg(dev, "FW size %d KB\n", dev->fw.arbel.fw_pages << 2);		/*		 * Arbel page size is always 4 KB; round up number of		 * system pages needed.		 */		dev->fw.arbel.fw_pages =			(dev->fw.arbel.fw_pages + (1 << (PAGE_SHIFT - 12)) - 1) >>			(PAGE_SHIFT - 12);		mthca_dbg(dev, "Clear int @ %llx, EQ arm @ %llx, EQ set CI @ %llx\n",			  (unsigned long long) dev->fw.arbel.clr_int_base,			  (unsigned long long) dev->fw.arbel.eq_arm_base,			  (unsigned long long) dev->fw.arbel.eq_set_ci_base);	} else {		MTHCA_GET(dev->fw.tavor.fw_start, outbox, QUERY_FW_START_OFFSET);		MTHCA_GET(dev->fw.tavor.fw_end,   outbox, QUERY_FW_END_OFFSET);		mthca_dbg(dev, "FW size %d KB (start %llx, end %llx)\n",			  (int) ((dev->fw.tavor.fw_end - dev->fw.tavor.fw_start) >> 10),			  (unsigned long long) dev->fw.tavor.fw_start,			  (unsigned long long) dev->fw.tavor.fw_end);	}out:	pci_free_consistent(dev->pdev, QUERY_FW_OUT_SIZE, outbox, outdma);	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