From patchwork Wed Mar 22 14:48:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 95751 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp232284obz; Wed, 22 Mar 2017 07:08:36 -0700 (PDT) X-Received: by 10.107.12.80 with SMTP id w77mr38171161ioi.124.1490191716207; Wed, 22 Mar 2017 07:08:36 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id b62si1869344ith.93.2017.03.22.07.08.35; Wed, 22 Mar 2017 07:08:36 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id B0AD5642C1; Wed, 22 Mar 2017 14:08:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id EBC3A642DD; Wed, 22 Mar 2017 13:51:45 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 1F373642DD; Wed, 22 Mar 2017 13:51:38 +0000 (UTC) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by lists.linaro.org (Postfix) with ESMTPS id 9935C642DD for ; Wed, 22 Mar 2017 13:49:37 +0000 (UTC) Received: by mail-wm0-f51.google.com with SMTP id n11so37225269wma.1 for ; Wed, 22 Mar 2017 06:49:37 -0700 (PDT) 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=g/LSpV0ad6TQ1iUkkTxwbKv+bFvGt8ZBJOT7LpNANKo=; b=LIOMOZxEqlgUnr3kA0MzhdGHreWBsTNZlmCBzRMAu8Kwe5py7mL5WdT5qBFKrNOw9D 3yO7/jYMAd2W5FZJsNk8H2RUHh514OaCryM1f68c+u9Md67sFhGIDSv9ALqmsEum5pIK DocM4MwTemxthD960fqEW1PjYXw0TggLT8Ww2R53dHuNg+Toq0LX9Ksy+OdjwQti8phZ ISe2V8MTEtQ/q4VUl7RkfoWPoQj/AqY0aBSSvamXgqOHMsRa09YdqOibzsw+yLxE9HmW +uv47DBYAdvK8k2vRQrzCQBSeLoNiz0eWGHyrJlu3CmOslgBphw59JKyPjSjvVE9Kibb W7OQ== X-Gm-Message-State: AFeK/H2/5Iix2URLtO4ILuZz2dLcbStsgAyc4Yg7I7ngANe6MpBK7GAWLZ354cEKGCYku7B/Kqk= X-Received: by 10.25.23.33 with SMTP id n33mr10298990lfi.48.1490190576404; Wed, 22 Mar 2017 06:49:36 -0700 (PDT) Received: from erachmi-ericsson.ki.sw.ericsson.se (c-83-233-76-66.cust.bredband2.com. [83.233.76.66]) by smtp.gmail.com with ESMTPSA id l23sm522305lfk.27.2017.03.22.06.49.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Mar 2017 06:49:35 -0700 (PDT) From: Christophe Milard To: yi.he@linaro.org, bill.fischofer@linaro.org, lng-odp@lists.linaro.org Date: Wed, 22 Mar 2017 15:48:28 +0100 Message-Id: <1490194110-40168-22-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490194110-40168-1-git-send-email-christophe.milard@linaro.org> References: <1490194110-40168-1-git-send-email-christophe.milard@linaro.org> Subject: [lng-odp] [API-NEXT PATCHv2 21/23] drv: driver: adding functions to attach driver's data to the device X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Driver will need to attach their data to devices when bound. The patch introduce a data setter and a data getter function to do so. Signed-off-by: Christophe Milard --- include/odp/drv/spec/driver.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) -- 2.7.4 diff --git a/include/odp/drv/spec/driver.h b/include/odp/drv/spec/driver.h index ad2b8db..224baf4 100644 --- a/include/odp/drv/spec/driver.h +++ b/include/odp/drv/spec/driver.h @@ -450,6 +450,27 @@ odpdrv_devio_t odpdrv_devio_register(odpdrv_devio_param_t *param); odpdrv_driver_t odpdrv_driver_register(odpdrv_driver_param_t *param); /** +* Sets the device driver data, i.e. the driver data which should be attached to +* the device. +* After a driver is bound to a device, this driver will need to keep +* data attached to this device. This data is, of course, driver dependent. +* +* @param dev: the device to which data should be attached. +* @param data Pointer to whatever thre driver want to keep attached to the +* device +*/ +void odpdrv_device_set_data(odpdrv_device_t dev, void *data); + +/** +* Gets the device driver data, i.e. the driver data which should be attached to +* the device. +* Retrieve the pointer which was set with odpdrv_device_set_data() +* @param dev: the device from which the driver data should be retrieved. +* @return the driver data pointer (as set by odpdrv_device_set_data()) or NULL. +*/ +void *odpdrv_device_get_data(odpdrv_device_t dev); + +/** * Print (ODP_DBG) the driver interface status (debug). * * @return 0 on success, less than zero on error (inconsistency detected)