From patchwork Tue Oct 9 18:45:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Heib X-Patchwork-Id: 10633173 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C9C115E8 for ; Tue, 9 Oct 2018 18:47:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3216A294F9 for ; Tue, 9 Oct 2018 18:47:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 268D3294FD; Tue, 9 Oct 2018 18:47:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C7FB8294F9 for ; Tue, 9 Oct 2018 18:47:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727181AbeJJCF0 (ORCPT ); Tue, 9 Oct 2018 22:05:26 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:40325 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726897AbeJJCF0 (ORCPT ); Tue, 9 Oct 2018 22:05:26 -0400 Received: by mail-wm1-f66.google.com with SMTP id z204-v6so3111862wmc.5 for ; Tue, 09 Oct 2018 11:47:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pW4H/oLkMUquIMiCs18y3wN7hCaDV3HqSP/jxxq3Qe8=; b=pyt8SKQn9d1VjZggTQXcdJi30d3H1aTgUeLCLLF9/P2xKe5E6TbcZ1dBtjZu6eFKDc mwck38gLVUxR6zXGRd053rphPLvzPY0LbSE9Ih00MJCF9FYJNUeDfRiMtrtx3IBIuglb 2enXBN5yPQiD4gQDvr4+kq3Trnf+Mp0RBnuPhwes5iQjHtcVjVvlnGFG2HEQm0cDSLg6 0BYnEkFiqqobW9iV4C/f5cPbGBqR8h0L+3X54Qxld07/7YRLlbp25hK3w6YKBWWcK0b1 J33YkpLrHBVTjsPuL8e/k0cnwpYg6Co6dWpZ0m+bCRyujqC83i4if85fs8hA6382pLz7 ZxOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pW4H/oLkMUquIMiCs18y3wN7hCaDV3HqSP/jxxq3Qe8=; b=WqXG/gI1NfPK9cpAFeURFnuJZdhP6in0B6UwnDhPFhvjyOPKKqcqjADO0T0y0Xtd/d SvPJXRWVahkakSWmkLnlT1lruc2CvL4l4NZXlE1lqm5ARGmbDN32I4cMuNxluZ0DSMgE M2tcaXchtbpxiUGtJnaelhURRkZDh6wA5p4Duah/ZslyqCpdlnlFeBGj1Ckdmfoj1Qz8 9ndgaZXdheZoTtvDJMRxcnj2Nh4grUdnZUBQiPKo12Qhc26I0or2JEM5co4DzguYBH65 8qwD0DLBUSDTYjKKWtSghSbNL5/K6UB4+dSjER/nxBsTKDjreaJag63+yOT1RWUJzaT+ yY4g== X-Gm-Message-State: ABuFfoj5lVZvDwL43tiZH/Jy+6MNxGNCgEAdwJZiD/b/n2u2UOnIF7WI deDPJ0fYODYAhPygaJ1sgCg= X-Google-Smtp-Source: ACcGV62WoZwGa8bHTsSzjcq83ibQWRGM+ufBDbOyr+uK8znsEKazrWyGngbEV1HOFBeHancusYN8vw== X-Received: by 2002:a1c:9a4a:: with SMTP id c71-v6mr2859868wme.71.1539110823630; Tue, 09 Oct 2018 11:47:03 -0700 (PDT) Received: from localhost.localdomain (bzq-79-179-121-186.red.bezeqint.net. [79.179.121.186]) by smtp.gmail.com with ESMTPSA id r16-v6sm27093327wrv.21.2018.10.09.11.47.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Oct 2018 11:47:03 -0700 (PDT) From: Kamal Heib To: Doug Ledford , Jason Gunthorpe Cc: linux-rdma@vger.kernel.org, kamalheib1@gmail.com Subject: [PATCH rdma-next 15/18] RDMA/usnic: Initialize ib_device_ops struct Date: Tue, 9 Oct 2018 21:45:44 +0300 Message-Id: <20181009184547.5907-16-kamalheib1@gmail.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181009184547.5907-1-kamalheib1@gmail.com> References: <20181009184547.5907-1-kamalheib1@gmail.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Initialize ib_device_ops with the supported operations. Signed-off-by: Kamal Heib --- drivers/infiniband/hw/usnic/usnic_ib_main.c | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/drivers/infiniband/hw/usnic/usnic_ib_main.c b/drivers/infiniband/hw/usnic/usnic_ib_main.c index e3f98fe2f1e6..e327f5ec818e 100644 --- a/drivers/infiniband/hw/usnic/usnic_ib_main.c +++ b/drivers/infiniband/hw/usnic/usnic_ib_main.c @@ -330,6 +330,37 @@ static void usnic_get_dev_fw_str(struct ib_device *device, char *str) snprintf(str, IB_FW_VERSION_NAME_MAX, "%s", info.fw_version); } +static struct ib_device_ops usnic_dev_ops = { + .query_device = usnic_ib_query_device, + .query_port = usnic_ib_query_port, + .query_pkey = usnic_ib_query_pkey, + .query_gid = usnic_ib_query_gid, + .get_netdev = usnic_get_netdev, + .get_link_layer = usnic_ib_port_link_layer, + .alloc_pd = usnic_ib_alloc_pd, + .dealloc_pd = usnic_ib_dealloc_pd, + .create_qp = usnic_ib_create_qp, + .modify_qp = usnic_ib_modify_qp, + .query_qp = usnic_ib_query_qp, + .destroy_qp = usnic_ib_destroy_qp, + .create_cq = usnic_ib_create_cq, + .destroy_cq = usnic_ib_destroy_cq, + .reg_user_mr = usnic_ib_reg_mr, + .dereg_mr = usnic_ib_dereg_mr, + .alloc_ucontext = usnic_ib_alloc_ucontext, + .dealloc_ucontext = usnic_ib_dealloc_ucontext, + .mmap = usnic_ib_mmap, + .create_ah = usnic_ib_create_ah, + .destroy_ah = usnic_ib_destroy_ah, + .post_send = usnic_ib_post_send, + .post_recv = usnic_ib_post_recv, + .poll_cq = usnic_ib_poll_cq, + .req_notify_cq = usnic_ib_req_notify_cq, + .get_dma_mr = usnic_ib_get_dma_mr, + .get_port_immutable = usnic_port_immutable, + .get_dev_fw_str = usnic_get_dev_fw_str, +}; + /* Start of PF discovery section */ static void *usnic_ib_device_add(struct pci_dev *dev) { @@ -415,6 +446,7 @@ static void *usnic_ib_device_add(struct pci_dev *dev) us_ibdev->ib_dev.get_port_immutable = usnic_port_immutable; us_ibdev->ib_dev.get_dev_fw_str = usnic_get_dev_fw_str; + ib_set_device_ops(&us_ibdev->ib_dev, &usnic_dev_ops); us_ibdev->ib_dev.driver_id = RDMA_DRIVER_USNIC; if (ib_register_device(&us_ibdev->ib_dev, "usnic_%d", NULL))