From patchwork Wed Feb 22 12:56:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 94325 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp929006obz; Wed, 22 Feb 2017 04:15:14 -0800 (PST) X-Received: by 10.107.11.92 with SMTP id v89mr23092750ioi.138.1487765714349; Wed, 22 Feb 2017 04:15:14 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id 15si1316023iou.239.2017.02.22.04.15.14; Wed, 22 Feb 2017 04:15:14 -0800 (PST) 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 D718B61063; Wed, 22 Feb 2017 12:15:13 +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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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 00EC1634C6; Wed, 22 Feb 2017 12:00:21 +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 B7CCD634C6; Wed, 22 Feb 2017 12:00:13 +0000 (UTC) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) by lists.linaro.org (Postfix) with ESMTPS id 3582860F2D for ; Wed, 22 Feb 2017 11:57:40 +0000 (UTC) Received: by mail-lf0-f50.google.com with SMTP id b80so119257lfe.3 for ; Wed, 22 Feb 2017 03:57:40 -0800 (PST) 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=pr7W00SiH2ALmVtst+2LCUpk2TP2yuZYDqMtSUOtEOo=; b=HUbkNcyNexz9KL5ReHG4+4AZEHyxQ+lEUb3pAsvV16IKbIR6h6rZT2GXS0ZT+Yn8Ps RJyisxEmIsGjgrxudguSWItTnE7k8cLFISpOxfLG15WE+T/S/XMr5It2xPjvwGxC1Ipv 8uHjW/jxD/boICMsGi+/z9xkN4Yrz5imIqExq387T6nbhs2KHxD7oYN0JFK9zYTgmXhu Kg5h1whS1FjeNqk/nOkmhVU5zD3K1VNF0iX/7rTJvRkYPRQXxjioeTk3AR79xmcyOy1U NytM4h0BdrfwJ61ht3674rTxblkRP8o5h7uXCXWATIWbkw3mqMDuTOCnX0MXlRSPdus+ LBxg== X-Gm-Message-State: AMke39nkK79a0pIhbIV6BjNuVE5bZ+KNUwehaCKaKUJzgSc/XTR0UCGW16PZxRHslmqt1so2tS0= X-Received: by 10.25.210.82 with SMTP id j79mr6443535lfg.96.1487764659048; Wed, 22 Feb 2017 03:57:39 -0800 (PST) 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 v21sm7035187ljd.9.2017.02.22.03.57.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Feb 2017 03:57:38 -0800 (PST) From: Christophe Milard To: mike.holmes@linaro.org, yi.he@linaro.org, forrest.shi@linaro.org, sachin.saxena@linaro.com, bill.fischofer@linaro.org, lng-odp@lists.linaro.org Date: Wed, 22 Feb 2017 13:56:02 +0100 Message-Id: <1487768164-43184-20-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487768164-43184-1-git-send-email-christophe.milard@linaro.org> References: <1487768164-43184-1-git-send-email-christophe.milard@linaro.org> Subject: [lng-odp] [API-NEXT PATCH 19/21] 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 b3c9b76..50ed3a0 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)