From patchwork Wed Mar 22 14:48:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 95734 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp227673obz; Wed, 22 Mar 2017 06:58:36 -0700 (PDT) X-Received: by 10.36.92.84 with SMTP id q81mr8407351itb.46.1490191116882; Wed, 22 Mar 2017 06:58:36 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id f72si1841530iod.55.2017.03.22.06.58.36; Wed, 22 Mar 2017 06:58: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 4534C642C6; Wed, 22 Mar 2017 13:58:36 +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 36DB8642C4; Wed, 22 Mar 2017 13:50:44 +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 C87A3609C2; Wed, 22 Mar 2017 13:50:37 +0000 (UTC) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by lists.linaro.org (Postfix) with ESMTPS id A65DE642BE for ; Wed, 22 Mar 2017 13:49:26 +0000 (UTC) Received: by mail-wm0-f46.google.com with SMTP id t189so38380439wmt.1 for ; Wed, 22 Mar 2017 06:49:26 -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=IL9D3/o2XEsxccXyL0kyF5/AMxxG5nWAuB3SU3pOTNI=; b=Ayeo8knPVeBZ5cQcdXOLOiDl/ZR7+/grZqw2lQ8sX69Y2vWlRRFUIwTsCANTu+d1tx lr52qmhFyRKAwS707QuL3ALxlAsiGGT/Dl8xQlNevryZuwfDxtGau3r3xoo265h/WoKU R+duDXTkpAxlbes1N1JSqR++oe8ljOeMDdoQHvJPyr9L6KkDnVsS31zUZuq+BqRo8NKl elhdXRjgsS2mUAu0j8uR1XWIHb9ADkhGI6PZ+dURlHRRFL50/aPHCOYecVfLdIVRwsAu kE84x6DsZxvgaiAGmyG58uyj1Q+oxrKd3Ef0qWmZORC6vAJjZKx0wMVYB/8EzTreHFWR 6GHQ== X-Gm-Message-State: AFeK/H2HDx+p89XjlFnG8R805LEtDlRP2LuyDZKSOlisfSlx7Bo7Gf7mdZLvhNGruQOLfIfecVQ= X-Received: by 10.25.79.69 with SMTP id a5mr11342947lfk.58.1490190565602; Wed, 22 Mar 2017 06:49:25 -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.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Mar 2017 06:49:25 -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:18 +0100 Message-Id: <1490194110-40168-12-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 11/23] 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 9643268..e861396 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.