From patchwork Thu Sep 1 22:28:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 9309925 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1ADF160865 for ; Thu, 1 Sep 2016 22:30:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CABF42843F for ; Thu, 1 Sep 2016 22:30:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BFA95293E7; Thu, 1 Sep 2016 22:30:24 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable 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 4E638293DE for ; Thu, 1 Sep 2016 22:30:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753119AbcIAWaI (ORCPT ); Thu, 1 Sep 2016 18:30:08 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:34282 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752564AbcIAW22 (ORCPT ); Thu, 1 Sep 2016 18:28:28 -0400 Received: by mail-pa0-f54.google.com with SMTP id fi15so33782831pac.1 for ; Thu, 01 Sep 2016 15:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bqS5Zl+vcqYeuz1/6Di1hlt7x7uASuQ1F6TW8XRR8a4=; b=abC52oMXGq7nOwoMjRjee/GVcRoREEVtahFmoZO39uXgrDI30lGUgZ0kRjBL4TBTM2 NbCqFPzJ5lzCN/enhCgCKWja1cBWkLNlWb7+yZ2Tr7VN/qpybe/wNLqrufDOpEgENgCf OSJ5lmgSZwVeD8KsSiIem+O8YtkEK/rE4i+Rs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bqS5Zl+vcqYeuz1/6Di1hlt7x7uASuQ1F6TW8XRR8a4=; b=dpnZi0F7+BJNlbCdSYn7wJN04b7yDIwSObdvnI2yxsMdjGoz5IFvN7vDV4yHsWO2s0 7CqnkVLdWjWvm9I0tPMOOsWZpC6G+/DyOhCP0rDO5eaJSO3ETiRr+Lg/jysWnfSqlHRi 48EuZYmd/X+lFuWX7oB8ySzaLKDd9wIRcyT1RmwPsZrufG3g9KLlhsfruJdPlDyzGNdL sY9ki3XysefdA6o9GJBlALhjG0w7AAu+XHTE7M23UTgb5xodZ4+BbiOU0G/lyORFHPgU 8rIGV/xpH7Es3k70jMOJ0ZgJ3SP8j2WjhBct7iOnU1l6Rxu7ied4pox9on+jnzMmTPkL D/QA== X-Gm-Message-State: AE9vXwNpvc23gXEzN5vEQ4Up9EOdKZ6Zz/OHQS1z99mlsfuLuL/q+eQYLPp+CgwsE3oR72Ml X-Received: by 10.66.237.71 with SMTP id va7mr30854683pac.124.1472768907717; Thu, 01 Sep 2016 15:28:27 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id iw10sm8887131pac.14.2016.09.01.15.28.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Sep 2016 15:28:27 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: linux-remoteproc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 13/17] rpmsg: Hide rpmsg indirection tables Date: Thu, 1 Sep 2016 15:28:05 -0700 Message-Id: <1472768889-3906-14-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1472768889-3906-1-git-send-email-bjorn.andersson@linaro.org> References: <1472768889-3906-1-git-send-email-bjorn.andersson@linaro.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move the device and endpoint indirection tables to the rpmsg internal header file, to hide them from the public API. Signed-off-by: Bjorn Andersson --- Changes since v1: - None drivers/rpmsg/rpmsg_core.c | 3 +++ drivers/rpmsg/rpmsg_internal.h | 47 ++++++++++++++++++++++++++++++++++++++++++ include/linux/rpmsg.h | 47 ------------------------------------------ 3 files changed, 50 insertions(+), 47 deletions(-) diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c index e1d765a7372c..b6ea9ffa7381 100644 --- a/drivers/rpmsg/rpmsg_core.c +++ b/drivers/rpmsg/rpmsg_core.c @@ -20,7 +20,10 @@ #define pr_fmt(fmt) "%s: " fmt, __func__ #include +#include #include +#include +#include #include "rpmsg_internal.h" diff --git a/drivers/rpmsg/rpmsg_internal.h b/drivers/rpmsg/rpmsg_internal.h index 8ac98fd0bf1d..8075a20f919b 100644 --- a/drivers/rpmsg/rpmsg_internal.h +++ b/drivers/rpmsg/rpmsg_internal.h @@ -25,6 +25,53 @@ #define to_rpmsg_device(d) container_of(d, struct rpmsg_device, dev) #define to_rpmsg_driver(d) container_of(d, struct rpmsg_driver, drv) +/** + * struct rpmsg_device_ops - indirection table for the rpmsg_device operations + * @create_ept: create backend-specific endpoint, requried + * @announce_create: announce presence of new channel, optional + * @announce_destroy: announce destruction of channel, optional + * + * Indirection table for the operations that a rpmsg backend should implement. + * @announce_create and @announce_destroy are optional as the backend might + * advertise new channels implicitly by creating the endpoints. + */ +struct rpmsg_device_ops { + struct rpmsg_endpoint *(*create_ept)(struct rpmsg_device *rpdev, + rpmsg_rx_cb_t cb, void *priv, + struct rpmsg_channel_info chinfo); + + int (*announce_create)(struct rpmsg_device *ept); + int (*announce_destroy)(struct rpmsg_device *ept); +}; + +/** + * struct rpmsg_endpoint_ops - indirection table for rpmsg_endpoint operations + * @destroy_ept: destroy the given endpoint, required + * @send: see @rpmsg_send(), required + * @sendto: see @rpmsg_sendto(), optional + * @send_offchannel: see @rpmsg_send_offchannel(), optional + * @trysend: see @rpmsg_trysend(), required + * @trysendto: see @rpmsg_trysendto(), optional + * @trysend_offchannel: see @rpmsg_trysend_offchannel(), optional + * + * Indirection table for the operations that a rpmsg backend should implement. + * In addition to @destroy_ept, the backend must at least implement @send and + * @trysend, while the variants sending data off-channel are optional. + */ +struct rpmsg_endpoint_ops { + void (*destroy_ept)(struct rpmsg_endpoint *ept); + + int (*send)(struct rpmsg_endpoint *ept, void *data, int len); + int (*sendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst); + int (*send_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst, + void *data, int len); + + int (*trysend)(struct rpmsg_endpoint *ept, void *data, int len); + int (*trysendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst); + int (*trysend_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst, + void *data, int len); +}; + int rpmsg_register_device(struct rpmsg_device *rpdev); int rpmsg_unregister_device(struct device *parent, struct rpmsg_channel_info *chinfo); diff --git a/include/linux/rpmsg.h b/include/linux/rpmsg.h index 99efd598590e..4f9445f71f2f 100644 --- a/include/linux/rpmsg.h +++ b/include/linux/rpmsg.h @@ -138,25 +138,6 @@ struct rpmsg_device { typedef void (*rpmsg_rx_cb_t)(struct rpmsg_device *, void *, int, void *, u32); /** - * struct rpmsg_device_ops - indirection table for the rpmsg_device operations - * @create_ept: create backend-specific endpoint, requried - * @announce_create: announce presence of new channel, optional - * @announce_destroy: announce destruction of channel, optional - * - * Indirection table for the operations that a rpmsg backend should implement. - * @announce_create and @announce_destroy are optional as the backend might - * advertise new channels implicitly by creating the endpoints. - */ -struct rpmsg_device_ops { - struct rpmsg_endpoint *(*create_ept)(struct rpmsg_device *rpdev, - rpmsg_rx_cb_t cb, void *priv, - struct rpmsg_channel_info chinfo); - - int (*announce_create)(struct rpmsg_device *ept); - int (*announce_destroy)(struct rpmsg_device *ept); -}; - -/** * struct rpmsg_endpoint - binds a local rpmsg address to its user * @rpdev: rpmsg channel device * @refcount: when this drops to zero, the ept is deallocated @@ -191,34 +172,6 @@ struct rpmsg_endpoint { }; /** - * struct rpmsg_endpoint_ops - indirection table for rpmsg_endpoint operations - * @destroy_ept: destroy the given endpoint, required - * @send: see @rpmsg_send(), required - * @sendto: see @rpmsg_sendto(), optional - * @send_offchannel: see @rpmsg_send_offchannel(), optional - * @trysend: see @rpmsg_trysend(), required - * @trysendto: see @rpmsg_trysendto(), optional - * @trysend_offchannel: see @rpmsg_trysend_offchannel(), optional - * - * Indirection table for the operations that a rpmsg backend should implement. - * In addition to @destroy_ept, the backend must at least implement @send and - * @trysend, while the variants sending data off-channel are optional. - */ -struct rpmsg_endpoint_ops { - void (*destroy_ept)(struct rpmsg_endpoint *ept); - - int (*send)(struct rpmsg_endpoint *ept, void *data, int len); - int (*sendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst); - int (*send_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst, - void *data, int len); - - int (*trysend)(struct rpmsg_endpoint *ept, void *data, int len); - int (*trysendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst); - int (*trysend_offchannel)(struct rpmsg_endpoint *ept, u32 src, u32 dst, - void *data, int len); -}; - -/** * struct rpmsg_driver - rpmsg driver struct * @drv: underlying device driver * @id_table: rpmsg ids serviced by this driver