Lines Matching full:mailbox
468 /* Invoke a command with an output mailbox */
612 struct mthca_mailbox *mailbox; in mthca_alloc_mailbox() local
614 mailbox = kmalloc(sizeof *mailbox, gfp_mask); in mthca_alloc_mailbox()
615 if (!mailbox) in mthca_alloc_mailbox()
618 mailbox->buf = dma_pool_alloc(dev->cmd.pool, gfp_mask, &mailbox->dma); in mthca_alloc_mailbox()
619 if (!mailbox->buf) { in mthca_alloc_mailbox()
620 kfree(mailbox); in mthca_alloc_mailbox()
624 return mailbox; in mthca_alloc_mailbox()
627 void mthca_free_mailbox(struct mthca_dev *dev, struct mthca_mailbox *mailbox) in mthca_free_mailbox() argument
629 if (!mailbox) in mthca_free_mailbox()
632 dma_pool_free(dev->cmd.pool, mailbox->buf, mailbox->dma); in mthca_free_mailbox()
633 kfree(mailbox); in mthca_free_mailbox()
660 struct mthca_mailbox *mailbox; in mthca_map_cmd() local
669 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); in mthca_map_cmd()
670 if (IS_ERR(mailbox)) in mthca_map_cmd()
671 return PTR_ERR(mailbox); in mthca_map_cmd()
672 memset(mailbox->buf, 0, MTHCA_MAILBOX_SIZE); in mthca_map_cmd()
673 pages = mailbox->buf; in mthca_map_cmd()
705 err = mthca_cmd(dev, mailbox->dma, nent, 0, op, in mthca_map_cmd()
715 err = mthca_cmd(dev, mailbox->dma, nent, 0, op, in mthca_map_cmd()
732 mthca_free_mailbox(dev, mailbox); in mthca_map_cmd()
779 struct mthca_mailbox *mailbox; in mthca_QUERY_FW() local
805 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); in mthca_QUERY_FW()
806 if (IS_ERR(mailbox)) in mthca_QUERY_FW()
807 return PTR_ERR(mailbox); in mthca_QUERY_FW()
808 outbox = mailbox->buf; in mthca_QUERY_FW()
810 err = mthca_cmd_box(dev, 0, mailbox->dma, 0, 0, CMD_QUERY_FW, in mthca_QUERY_FW()
879 mthca_free_mailbox(dev, mailbox); in mthca_QUERY_FW()
885 struct mthca_mailbox *mailbox; in mthca_ENABLE_LAM() local
898 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); in mthca_ENABLE_LAM()
899 if (IS_ERR(mailbox)) in mthca_ENABLE_LAM()
900 return PTR_ERR(mailbox); in mthca_ENABLE_LAM()
901 outbox = mailbox->buf; in mthca_ENABLE_LAM()
903 err = mthca_cmd_box(dev, 0, mailbox->dma, 0, 0, CMD_ENABLE_LAM, in mthca_ENABLE_LAM()
929 mthca_free_mailbox(dev, mailbox); in mthca_ENABLE_LAM()
940 struct mthca_mailbox *mailbox; in mthca_QUERY_DDR() local
953 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); in mthca_QUERY_DDR()
954 if (IS_ERR(mailbox)) in mthca_QUERY_DDR()
955 return PTR_ERR(mailbox); in mthca_QUERY_DDR()
956 outbox = mailbox->buf; in mthca_QUERY_DDR()
958 err = mthca_cmd_box(dev, 0, mailbox->dma, 0, 0, CMD_QUERY_DDR, in mthca_QUERY_DDR()
984 mthca_free_mailbox(dev, mailbox); in mthca_QUERY_DDR()
991 struct mthca_mailbox *mailbox; in mthca_QUERY_DEV_LIM() local
1059 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); in mthca_QUERY_DEV_LIM()
1060 if (IS_ERR(mailbox)) in mthca_QUERY_DEV_LIM()
1061 return PTR_ERR(mailbox); in mthca_QUERY_DEV_LIM()
1062 outbox = mailbox->buf; in mthca_QUERY_DEV_LIM()
1064 err = mthca_cmd_box(dev, 0, mailbox->dma, 0, 0, CMD_QUERY_DEV_LIM, in mthca_QUERY_DEV_LIM()
1236 mthca_free_mailbox(dev, mailbox); in mthca_QUERY_DEV_LIM()
1271 struct mthca_mailbox *mailbox; in mthca_QUERY_ADAPTER() local
1282 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); in mthca_QUERY_ADAPTER()
1283 if (IS_ERR(mailbox)) in mthca_QUERY_ADAPTER()
1284 return PTR_ERR(mailbox); in mthca_QUERY_ADAPTER()
1285 outbox = mailbox->buf; in mthca_QUERY_ADAPTER()
1287 err = mthca_cmd_box(dev, 0, mailbox->dma, 0, 0, CMD_QUERY_ADAPTER, in mthca_QUERY_ADAPTER()
1307 mthca_free_mailbox(dev, mailbox); in mthca_QUERY_ADAPTER()
1314 struct mthca_mailbox *mailbox; in mthca_INIT_HCA() local
1356 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); in mthca_INIT_HCA()
1357 if (IS_ERR(mailbox)) in mthca_INIT_HCA()
1358 return PTR_ERR(mailbox); in mthca_INIT_HCA()
1359 inbox = mailbox->buf; in mthca_INIT_HCA()
1429 err = mthca_cmd(dev, mailbox->dma, 0, 0, in mthca_INIT_HCA()
1432 mthca_free_mailbox(dev, mailbox); in mthca_INIT_HCA()
1440 struct mthca_mailbox *mailbox; in mthca_INIT_IB() local
1459 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); in mthca_INIT_IB()
1460 if (IS_ERR(mailbox)) in mthca_INIT_IB()
1461 return PTR_ERR(mailbox); in mthca_INIT_IB()
1462 inbox = mailbox->buf; in mthca_INIT_IB()
1481 err = mthca_cmd(dev, mailbox->dma, port, 0, CMD_INIT_IB, in mthca_INIT_IB()
1484 mthca_free_mailbox(dev, mailbox); in mthca_INIT_IB()
1501 struct mthca_mailbox *mailbox; in mthca_SET_IB() local
1513 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); in mthca_SET_IB()
1514 if (IS_ERR(mailbox)) in mthca_SET_IB()
1515 return PTR_ERR(mailbox); in mthca_SET_IB()
1516 inbox = mailbox->buf; in mthca_SET_IB()
1527 err = mthca_cmd(dev, mailbox->dma, port, 0, CMD_SET_IB, in mthca_SET_IB()
1530 mthca_free_mailbox(dev, mailbox); in mthca_SET_IB()
1541 struct mthca_mailbox *mailbox; in mthca_MAP_ICM_page() local
1545 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); in mthca_MAP_ICM_page()
1546 if (IS_ERR(mailbox)) in mthca_MAP_ICM_page()
1547 return PTR_ERR(mailbox); in mthca_MAP_ICM_page()
1548 inbox = mailbox->buf; in mthca_MAP_ICM_page()
1553 err = mthca_cmd(dev, mailbox->dma, 1, 0, CMD_MAP_ICM, in mthca_MAP_ICM_page()
1556 mthca_free_mailbox(dev, mailbox); in mthca_MAP_ICM_page()
1602 int mthca_SW2HW_MPT(struct mthca_dev *dev, struct mthca_mailbox *mailbox, in mthca_SW2HW_MPT() argument
1605 return mthca_cmd(dev, mailbox->dma, mpt_index, 0, CMD_SW2HW_MPT, in mthca_SW2HW_MPT()
1609 int mthca_HW2SW_MPT(struct mthca_dev *dev, struct mthca_mailbox *mailbox, in mthca_HW2SW_MPT() argument
1612 return mthca_cmd_box(dev, 0, mailbox ? mailbox->dma : 0, mpt_index, in mthca_HW2SW_MPT()
1613 !mailbox, CMD_HW2SW_MPT, in mthca_HW2SW_MPT()
1617 int mthca_WRITE_MTT(struct mthca_dev *dev, struct mthca_mailbox *mailbox, in mthca_WRITE_MTT() argument
1620 return mthca_cmd(dev, mailbox->dma, num_mtt, 0, CMD_WRITE_MTT, in mthca_WRITE_MTT()
1639 int mthca_SW2HW_EQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox, in mthca_SW2HW_EQ() argument
1642 return mthca_cmd(dev, mailbox->dma, eq_num, 0, CMD_SW2HW_EQ, in mthca_SW2HW_EQ()
1646 int mthca_HW2SW_EQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox, in mthca_HW2SW_EQ() argument
1649 return mthca_cmd_box(dev, 0, mailbox->dma, eq_num, 0, in mthca_HW2SW_EQ()
1654 int mthca_SW2HW_CQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox, in mthca_SW2HW_CQ() argument
1657 return mthca_cmd(dev, mailbox->dma, cq_num, 0, CMD_SW2HW_CQ, in mthca_SW2HW_CQ()
1661 int mthca_HW2SW_CQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox, in mthca_HW2SW_CQ() argument
1664 return mthca_cmd_box(dev, 0, mailbox->dma, cq_num, 0, in mthca_HW2SW_CQ()
1671 struct mthca_mailbox *mailbox; in mthca_RESIZE_CQ() local
1679 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); in mthca_RESIZE_CQ()
1680 if (IS_ERR(mailbox)) in mthca_RESIZE_CQ()
1681 return PTR_ERR(mailbox); in mthca_RESIZE_CQ()
1682 inbox = mailbox->buf; in mthca_RESIZE_CQ()
1692 err = mthca_cmd(dev, mailbox->dma, cq_num, 1, CMD_RESIZE_CQ, in mthca_RESIZE_CQ()
1695 mthca_free_mailbox(dev, mailbox); in mthca_RESIZE_CQ()
1699 int mthca_SW2HW_SRQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox, in mthca_SW2HW_SRQ() argument
1702 return mthca_cmd(dev, mailbox->dma, srq_num, 0, CMD_SW2HW_SRQ, in mthca_SW2HW_SRQ()
1706 int mthca_HW2SW_SRQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox, in mthca_HW2SW_SRQ() argument
1709 return mthca_cmd_box(dev, 0, mailbox->dma, srq_num, 0, in mthca_HW2SW_SRQ()
1715 struct mthca_mailbox *mailbox) in mthca_QUERY_SRQ() argument
1717 return mthca_cmd_box(dev, 0, mailbox->dma, num, 0, in mthca_QUERY_SRQ()
1729 struct mthca_mailbox *mailbox, u32 optmask) in mthca_MODIFY_QP() argument
1779 if (!mailbox) { in mthca_MODIFY_QP()
1780 mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); in mthca_MODIFY_QP()
1781 if (!IS_ERR(mailbox)) { in mthca_MODIFY_QP()
1785 mailbox = NULL; in mthca_MODIFY_QP()
1788 err = mthca_cmd_box(dev, 0, mailbox ? mailbox->dma : 0, in mthca_MODIFY_QP()
1792 if (0 && mailbox) { in mthca_MODIFY_QP()
1795 printk(" %08x\n", be32_to_cpup(mailbox->buf)); in mthca_MODIFY_QP()
1800 be32_to_cpu(((__be32 *) mailbox->buf)[i + 2])); in mthca_MODIFY_QP()
1807 mthca_free_mailbox(dev, mailbox); in mthca_MODIFY_QP()
1812 printk(" opt param mask: %08x\n", be32_to_cpup(mailbox->buf)); in mthca_MODIFY_QP()
1817 be32_to_cpu(((__be32 *) mailbox->buf)[i + 2])); in mthca_MODIFY_QP()
1823 err = mthca_cmd(dev, mailbox->dma, optmask | (!!is_ee << 24) | num, in mthca_MODIFY_QP()
1831 struct mthca_mailbox *mailbox) in mthca_QUERY_QP() argument
1833 return mthca_cmd_box(dev, 0, mailbox->dma, (!!is_ee << 24) | num, 0, in mthca_QUERY_QP()
1942 struct mthca_mailbox *mailbox) in mthca_READ_MGM() argument
1944 return mthca_cmd_box(dev, 0, mailbox->dma, index, 0, in mthca_READ_MGM()
1949 struct mthca_mailbox *mailbox) in mthca_WRITE_MGM() argument
1951 return mthca_cmd(dev, mailbox->dma, index, 0, CMD_WRITE_MGM, in mthca_WRITE_MGM()
1955 int mthca_MGID_HASH(struct mthca_dev *dev, struct mthca_mailbox *mailbox, in mthca_MGID_HASH() argument
1961 err = mthca_cmd_imm(dev, mailbox->dma, &imm, 0, 0, CMD_MGID_HASH, in mthca_MGID_HASH()