From patchwork Wed Feb 22 12:55:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 94315 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp924743obz; Wed, 22 Feb 2017 04:05:12 -0800 (PST) X-Received: by 10.36.207.136 with SMTP id y130mr1743402itf.56.1487765112083; Wed, 22 Feb 2017 04:05:12 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id d75si1301904ioj.178.2017.02.22.04.05.11; Wed, 22 Feb 2017 04:05:12 -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 9EAB362C40; Wed, 22 Feb 2017 12:05:11 +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 22E3660D92; Wed, 22 Feb 2017 11:58:42 +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 BC5D862D9A; Wed, 22 Feb 2017 11:58:34 +0000 (UTC) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) by lists.linaro.org (Postfix) with ESMTPS id 0438F60D92 for ; Wed, 22 Feb 2017 11:57:29 +0000 (UTC) Received: by mail-lf0-f54.google.com with SMTP id g134so161536lfe.1 for ; Wed, 22 Feb 2017 03:57:28 -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=zYiVPErxFgykoqvy9DZmcr9SZmR/9XPJvasY4pgm6K4=; b=c5jAOkZwvQnDsCx7i4qEISq8eFvE4Ug/QZzaCID1mVo6GWeqvOh8AT4csK4Y+Xbu8D lr0kXVS0mwoA3e8bsU7y/VQc5L69SVae+l5q6adNhv15IE2AUmZ6orYAxrVQb/OJlOKP t75UWFYf7REB/IG08Ty0O+j5nFFT6KevDa2AZOQmVCsHvjKpGVKNCHcmo85QlrUn2fc/ YwPBkuh8a/c5moOgv5qlDOPDqsMbYJT8MWUDUT/aZiMZlI4fEf22c8XIt33fMF1+LWQr WhhKPZULx256YWOGTqVixQXvKv3pNuLE/EYp7xzI4OOjCzg9JV/QBh6tsoFwPtZ7yW+G KHKQ== X-Gm-Message-State: AMke39l4PZHrTnxc2EHxXK6ES95wxjflifxKiG8Vcr8JmmeGfCGCjy7g4M7wuUgrma1o4J3H0xA= X-Received: by 10.25.21.214 with SMTP id 83mr1200950lfv.66.1487764647776; Wed, 22 Feb 2017 03:57:27 -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.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Feb 2017 03:57:27 -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:55:52 +0100 Message-Id: <1487768164-43184-10-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 09/21] drv: driver: adding device query function 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" Adding a function for querying a list of devices: this function may be used by enumerators to query for the list of their registered devices or for a subset of them. Note that this function returns a malloc'd list of devices which is to be freed by the caller. Signed-off-by: Christophe Milard --- include/odp/drv/spec/driver.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- 2.7.4 diff --git a/include/odp/drv/spec/driver.h b/include/odp/drv/spec/driver.h index 21a5fe1..abac138 100644 --- a/include/odp/drv/spec/driver.h +++ b/include/odp/drv/spec/driver.h @@ -387,6 +387,18 @@ int odpdrv_device_destroy(odpdrv_device_t dev, /** The callback function must be called by the current ODP thread */ #define ODPDRV_DEV_DESTROY_IMMEDIATE 0x00000001 +/** query for a list of devices + * Enumerators are responsable for device creation and destruction. + * Upon request, ODP can build a list of devices belonging to a given enumerator + * and possibly having a specific address. + * This function builds this list. + * @param enumr The enumerator which created the device + * @param address The device address (or NULL if don't care) + * @return A malloc'd ODPDRV_DEVICE_INVALID terminated array of odpdrv_device_t + * This array MUST BE FREED by the caller! + */ +odpdrv_device_t *odpdrv_device_query(odpdrv_enumr_t enumr, const char *address); + /** * Register an devio. * Each devio calls this function at init time.