[PATCH rdma-next 11/18] RDMA/nes: Initialize ib_device_ops struct

Kamal Heib
2018-10-09T16:29:55Z

drivers/infiniband/hw/nes/nes_verbs.c | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
index 94054bc611bd..a305bb8115e9 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -3627,6 +3627,39 @@ static void get_dev_fw_str(struct ib_device *dev, char *str)
(nesvnic->nesdev->nesadapter->firmware_version & 0x000000ff));
}

+static struct ib_device_ops nes_dev_ops = {
+ .query_device = nes_query_device,
+ .query_port = nes_query_port,
+ .query_pkey = nes_query_pkey,
+ .query_gid = nes_query_gid,
+ .alloc_ucontext = nes_alloc_ucontext,
+ .dealloc_ucontext = nes_dealloc_ucontext,
+ .mmap = nes_mmap,
+ .alloc_pd = nes_alloc_pd,
+ .dealloc_pd = nes_dealloc_pd,
+ .create_qp = nes_create_qp,
+ .modify_qp = nes_modify_qp,
+ .query_qp = nes_query_qp,
+ .destroy_qp = nes_destroy_qp,
+ .create_cq = nes_create_cq,
+ .destroy_cq = nes_destroy_cq,
+ .poll_cq = nes_poll_cq,
+ .get_dma_mr = nes_get_dma_mr,
+ .reg_user_mr = nes_reg_user_mr,
+ .dereg_mr = nes_dereg_mr,
+ .alloc_mw = nes_alloc_mw,
+ .dealloc_mw = nes_dealloc_mw,
+ .alloc_mr = nes_alloc_mr,
+ .map_mr_sg = nes_map_mr_sg,
+ .req_notify_cq = nes_req_notify_cq,
+ .post_send = nes_post_send,
+ .post_recv = nes_post_recv,
+ .drain_sq = nes_drain_sq,
+ .drain_rq = nes_drain_rq,
+ .get_port_immutable = nes_port_immutable,
+ .get_dev_fw_str = get_dev_fw_str,
+};
+
/**
* nes_init_ofa_device
*/
@@ -3719,6 +3752,7 @@ struct nes_ib_device *nes_init_ofa_device(struct net_device *netdev)
nesibdev->ibdev.iwcm->destroy_listen = nes_destroy_listen;
nesibdev->ibdev.get_port_immutable = nes_port_immutable;
nesibdev->ibdev.get_dev_fw_str = get_dev_fw_str;
+ ib_set_device_ops(&nesibdev->ibdev, &nes_dev_ops);
memcpy(nesibdev->ibdev.iwcm->ifname, netdev->name,
sizeof(nesibdev->ibdev.iwcm->ifname));

--
2.14.4