diff options
author | Roland Dreier <roland@topspin.com> | 2005-04-16 15:26:14 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 15:26:14 -0700 |
commit | 8cf2daf3feae982db9804df3d4b8ec20fa7d6d41 (patch) | |
tree | 3f6047bf50f7d37c43b698c4f87cc0caa181ea23 /drivers/infiniband/hw/mthca/mthca_provider.c | |
parent | 86562a139182bb19c984347f9625b61f3e6f7815 (diff) |
[PATCH] IB/mthca: fill in more device query fields
Implement more of the device_query method in mthca.
Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_provider.c')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_provider.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c index bbf74cf4334..132fcb854c1 100644 --- a/drivers/infiniband/hw/mthca/mthca_provider.c +++ b/drivers/infiniband/hw/mthca/mthca_provider.c @@ -52,6 +52,8 @@ static int mthca_query_device(struct ib_device *ibdev, if (!in_mad || !out_mad) goto out; + memset(props, 0, sizeof props); + props->fw_ver = mdev->fw_ver; memset(in_mad, 0, sizeof *in_mad); @@ -71,14 +73,26 @@ static int mthca_query_device(struct ib_device *ibdev, goto out; } - props->device_cap_flags = mdev->device_cap_flags; - props->vendor_id = be32_to_cpup((u32 *) (out_mad->data + 36)) & + props->device_cap_flags = mdev->device_cap_flags; + props->vendor_id = be32_to_cpup((u32 *) (out_mad->data + 36)) & 0xffffff; - props->vendor_part_id = be16_to_cpup((u16 *) (out_mad->data + 30)); - props->hw_ver = be16_to_cpup((u16 *) (out_mad->data + 32)); + props->vendor_part_id = be16_to_cpup((u16 *) (out_mad->data + 30)); + props->hw_ver = be16_to_cpup((u16 *) (out_mad->data + 32)); memcpy(&props->sys_image_guid, out_mad->data + 4, 8); memcpy(&props->node_guid, out_mad->data + 12, 8); + props->max_mr_size = ~0ull; + props->max_qp = mdev->limits.num_qps - mdev->limits.reserved_qps; + props->max_qp_wr = 0xffff; + props->max_sge = mdev->limits.max_sg; + props->max_cq = mdev->limits.num_cqs - mdev->limits.reserved_cqs; + props->max_cqe = 0xffff; + props->max_mr = mdev->limits.num_mpts - mdev->limits.reserved_mrws; + props->max_pd = mdev->limits.num_pds - mdev->limits.reserved_pds; + props->max_qp_rd_atom = 1 << mdev->qp_table.rdb_shift; + props->max_qp_init_rd_atom = 1 << mdev->qp_table.rdb_shift; + props->local_ca_ack_delay = mdev->limits.local_ca_ack_delay; + err = 0; out: kfree(in_mad); |