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: 9310091 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 726E9607D6 for ; Thu, 1 Sep 2016 22:46:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E9012951E for ; Thu, 1 Sep 2016 22:46:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21B9F29551; Thu, 1 Sep 2016 22:46:05 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 332772951E for ; Thu, 1 Sep 2016 22:46:04 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bfajH-00027o-En; Thu, 01 Sep 2016 22:45:03 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bfaTU-0002El-4h for linux-arm-kernel@lists.infradead.org; Thu, 01 Sep 2016 22:28:50 +0000 Received: by mail-pa0-x229.google.com with SMTP id fu3so26012285pad.3 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=Z3Ia1QXrvXjeNVNjC/8pxgEFMBMgILWQ+Az5CtPnbIWRRhdVfSXeInSgcxfKLP2qtK YUk1kTgsaIixe/a6TLUqbgF8Xm+Ey7a44vIWWRt94nrK60IK9K6k6vZn8bp3oU6UxvId DULaWsjs5VZNxoHFy/5qiAK+GujtWKc7NxyC6gtLJ+alpVoYP6DTBzAOHiHJLG1VunZS 0aiqUXdEsac+aPKFlUO0/pD56NVJsmfUM6kLFfF6oq8kEQvVWy4/QbChSKhVR4vS7Yc4 rQ8P4Pu5TMDcjwSfQGjXIgFo+1F4d30ZcmkhKNSOkXZB/p1lMduph3ldxTT94J2cZtEO BN1w== X-Gm-Message-State: AE9vXwMP2XY3oAQ1CjC851tfEZPwQYvN+nWsEyM6ae0o2M5h/wU+UBD6df5jNIcCZCgbwM1w 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160901_152844_383071_1D4B1DFE X-CRM114-Status: GOOD ( 14.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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