diff options
author | Roland Dreier <roland@topspin.com> | 2005-04-16 18:26:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:26:14 -0400 |
commit | 8cf2daf3feae982db9804df3d4b8ec20fa7d6d41 (patch) | |
tree | 3f6047bf50f7d37c43b698c4f87cc0caa181ea23 | |
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>
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_cmd.c | 2 | ||||
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_provider.c | 22 |
2 files changed, 20 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c index 9def0981f630..1bc1ce758165 100644 --- a/drivers/infiniband/hw/mthca/mthca_cmd.c +++ b/drivers/infiniband/hw/mthca/mthca_cmd.c | |||
@@ -987,6 +987,8 @@ int mthca_QUERY_DEV_LIM(struct mthca_dev *dev, | |||
987 | if (dev->hca_type == ARBEL_NATIVE) { | 987 | if (dev->hca_type == ARBEL_NATIVE) { |
988 | MTHCA_GET(field, outbox, QUERY_DEV_LIM_RSZ_SRQ_OFFSET); | 988 | MTHCA_GET(field, outbox, QUERY_DEV_LIM_RSZ_SRQ_OFFSET); |
989 | dev_lim->hca.arbel.resize_srq = field & 1; | 989 | dev_lim->hca.arbel.resize_srq = field & 1; |
990 | MTHCA_GET(field, outbox, QUERY_DEV_LIM_MAX_SG_RQ_OFFSET); | ||
991 | dev_lim->max_sg = min_t(int, field, dev_lim->max_sg); | ||
990 | MTHCA_GET(size, outbox, QUERY_DEV_LIM_MTT_ENTRY_SZ_OFFSET); | 992 | MTHCA_GET(size, outbox, QUERY_DEV_LIM_MTT_ENTRY_SZ_OFFSET); |
991 | dev_lim->mtt_seg_sz = size; | 993 | dev_lim->mtt_seg_sz = size; |
992 | MTHCA_GET(size, outbox, QUERY_DEV_LIM_MPT_ENTRY_SZ_OFFSET); | 994 | MTHCA_GET(size, outbox, QUERY_DEV_LIM_MPT_ENTRY_SZ_OFFSET); |
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c index bbf74cf43343..132fcb854c1a 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, | |||
52 | if (!in_mad || !out_mad) | 52 | if (!in_mad || !out_mad) |
53 | goto out; | 53 | goto out; |
54 | 54 | ||
55 | memset(props, 0, sizeof props); | ||
56 | |||
55 | props->fw_ver = mdev->fw_ver; | 57 | props->fw_ver = mdev->fw_ver; |
56 | 58 | ||
57 | memset(in_mad, 0, sizeof *in_mad); | 59 | memset(in_mad, 0, sizeof *in_mad); |
@@ -71,14 +73,26 @@ static int mthca_query_device(struct ib_device *ibdev, | |||
71 | goto out; | 73 | goto out; |
72 | } | 74 | } |
73 | 75 | ||
74 | props->device_cap_flags = mdev->device_cap_flags; | 76 | props->device_cap_flags = mdev->device_cap_flags; |
75 | props->vendor_id = be32_to_cpup((u32 *) (out_mad->data + 36)) & | 77 | props->vendor_id = be32_to_cpup((u32 *) (out_mad->data + 36)) & |
76 | 0xffffff; | 78 | 0xffffff; |
77 | props->vendor_part_id = be16_to_cpup((u16 *) (out_mad->data + 30)); | 79 | props->vendor_part_id = be16_to_cpup((u16 *) (out_mad->data + 30)); |
78 | props->hw_ver = be16_to_cpup((u16 *) (out_mad->data + 32)); | 80 | props->hw_ver = be16_to_cpup((u16 *) (out_mad->data + 32)); |
79 | memcpy(&props->sys_image_guid, out_mad->data + 4, 8); | 81 | memcpy(&props->sys_image_guid, out_mad->data + 4, 8); |
80 | memcpy(&props->node_guid, out_mad->data + 12, 8); | 82 | memcpy(&props->node_guid, out_mad->data + 12, 8); |
81 | 83 | ||
84 | props->max_mr_size = ~0ull; | ||
85 | props->max_qp = mdev->limits.num_qps - mdev->limits.reserved_qps; | ||
86 | props->max_qp_wr = 0xffff; | ||
87 | props->max_sge = mdev->limits.max_sg; | ||
88 | props->max_cq = mdev->limits.num_cqs - mdev->limits.reserved_cqs; | ||
89 | props->max_cqe = 0xffff; | ||
90 | props->max_mr = mdev->limits.num_mpts - mdev->limits.reserved_mrws; | ||
91 | props->max_pd = mdev->limits.num_pds - mdev->limits.reserved_pds; | ||
92 | props->max_qp_rd_atom = 1 << mdev->qp_table.rdb_shift; | ||
93 | props->max_qp_init_rd_atom = 1 << mdev->qp_table.rdb_shift; | ||
94 | props->local_ca_ack_delay = mdev->limits.local_ca_ack_delay; | ||
95 | |||
82 | err = 0; | 96 | err = 0; |
83 | out: | 97 | out: |
84 | kfree(in_mad); | 98 | kfree(in_mad); |