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: 75250 Delivered-To: patch@linaro.org Received: by 10.140.29.8 with SMTP id a8csp536784qga; Thu, 1 Sep 2016 15:30:14 -0700 (PDT) X-Received: by 10.66.159.170 with SMTP id xd10mr31312162pab.41.1472769014167; Thu, 01 Sep 2016 15:30:14 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g70si7664723pfc.293.2016.09.01.15.30.13; Thu, 01 Sep 2016 15:30:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753860AbcIAWaK (ORCPT + 27 others); Thu, 1 Sep 2016 18:30:10 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:35923 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752558AbcIAW22 (ORCPT ); Thu, 1 Sep 2016 18:28:28 -0400 Received: by mail-pa0-f48.google.com with SMTP id fu3so26012286pad.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=fzd16KaZS4RHNJkRXeileLhNixj8bZ0Elg2cPyZ+ImPdO9eQtAgP8Xqsww/PS9MGTm AtNPnP1O3ht4t2Uc0FUXNE6H0m/7sSH1/M6JtIH20t6bHBmvy3OeX+xnRUN7YthzqBtq DEjLW+Py4j/Ff7uwremxM+0URsQipE8sChvSmiTcqvdJAaAAM81/Tmni/SrdWsXdUMy7 dO1bd0rdMp2fmKUE2RT7O9G3Ech5G+7U+Z5VCF65QPir7jKx7RD5cE/yKwt1UZ04lw+t ihCaO30l7lV1h7sm60kfcmI+5cR8jCIN2ikVlnItW7dhsx+fiKdSV/g7WTXbVuu+/XjN ygpQ== X-Gm-Message-State: AE9vXwMYhJxwhBhFjRMS4+zbRSF7prqBcgsGEUk0r5j4yzAdSK3uI5mBvWtdrJ6JIX1znFxU 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.5.0 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