diff options
author | Roland Dreier <rolandd@cisco.com> | 2006-01-30 17:31:33 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-03-20 13:08:08 -0500 |
commit | 4885bf64bc2eb242ebebe67077cfe3688283b586 (patch) | |
tree | ed40e3eb7c05e923919f1e8ef2a9186b32c916a4 /drivers/infiniband/hw/mthca/mthca_cmd.c | |
parent | 33b9b3ee9709b19c4f02ab91571d53540d05c3d1 (diff) |
IB/mthca: Add device-specific support for resizing CQs
Add low-level driver support for resizing CQs (both kernel and
userspace) to mthca.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_cmd.c')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_cmd.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c index 2825615ce81c..7780e974cfb5 100644 --- a/drivers/infiniband/hw/mthca/mthca_cmd.c +++ b/drivers/infiniband/hw/mthca/mthca_cmd.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. | 2 | * Copyright (c) 2004, 2005 Topspin Communications. All rights reserved. |
3 | * Copyright (c) 2005 Mellanox Technologies. All rights reserved. | 3 | * Copyright (c) 2005 Mellanox Technologies. All rights reserved. |
4 | * Copyright (c) 2005 Cisco Systems. All rights reserved. | 4 | * Copyright (c) 2005, 2006 Cisco Systems. All rights reserved. |
5 | * | 5 | * |
6 | * This software is available to you under a choice of one of two | 6 | * This software is available to you under a choice of one of two |
7 | * licenses. You may choose to be licensed under the terms of the GNU | 7 | * licenses. You may choose to be licensed under the terms of the GNU |
@@ -1514,6 +1514,37 @@ int mthca_HW2SW_CQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox, | |||
1514 | CMD_TIME_CLASS_A, status); | 1514 | CMD_TIME_CLASS_A, status); |
1515 | } | 1515 | } |
1516 | 1516 | ||
1517 | int mthca_RESIZE_CQ(struct mthca_dev *dev, int cq_num, u32 lkey, u8 log_size, | ||
1518 | u8 *status) | ||
1519 | { | ||
1520 | struct mthca_mailbox *mailbox; | ||
1521 | __be32 *inbox; | ||
1522 | int err; | ||
1523 | |||
1524 | #define RESIZE_CQ_IN_SIZE 0x40 | ||
1525 | #define RESIZE_CQ_LOG_SIZE_OFFSET 0x0c | ||
1526 | #define RESIZE_CQ_LKEY_OFFSET 0x1c | ||
1527 | |||
1528 | mailbox = mthca_alloc_mailbox(dev, GFP_KERNEL); | ||
1529 | if (IS_ERR(mailbox)) | ||
1530 | return PTR_ERR(mailbox); | ||
1531 | inbox = mailbox->buf; | ||
1532 | |||
1533 | memset(inbox, 0, RESIZE_CQ_IN_SIZE); | ||
1534 | /* | ||
1535 | * Leave start address fields zeroed out -- mthca assumes that | ||
1536 | * MRs for CQs always start at virtual address 0. | ||
1537 | */ | ||
1538 | MTHCA_PUT(inbox, log_size, RESIZE_CQ_LOG_SIZE_OFFSET); | ||
1539 | MTHCA_PUT(inbox, lkey, RESIZE_CQ_LKEY_OFFSET); | ||
1540 | |||
1541 | err = mthca_cmd(dev, mailbox->dma, cq_num, 1, CMD_RESIZE_CQ, | ||
1542 | CMD_TIME_CLASS_B, status); | ||
1543 | |||
1544 | mthca_free_mailbox(dev, mailbox); | ||
1545 | return err; | ||
1546 | } | ||
1547 | |||
1517 | int mthca_SW2HW_SRQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox, | 1548 | int mthca_SW2HW_SRQ(struct mthca_dev *dev, struct mthca_mailbox *mailbox, |
1518 | int srq_num, u8 *status) | 1549 | int srq_num, u8 *status) |
1519 | { | 1550 | { |