From patchwork Wed Feb 22 12:55:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 94319 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp926081obz; Wed, 22 Feb 2017 04:08:04 -0800 (PST) X-Received: by 10.200.35.225 with SMTP id r30mr14614807qtr.183.1487765283987; Wed, 22 Feb 2017 04:08:03 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id t190si627875qkf.315.2017.02.22.04.08.03; Wed, 22 Feb 2017 04:08:03 -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 9803560F0D; Wed, 22 Feb 2017 12:08:03 +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 74FDA62DB3; Wed, 22 Feb 2017 11:58:56 +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 3420A60E23; Wed, 22 Feb 2017 11:58:44 +0000 (UTC) Received: from mail-lf0-f43.google.com (mail-lf0-f43.google.com [209.85.215.43]) by lists.linaro.org (Postfix) with ESMTPS id 4E2D460E23 for ; Wed, 22 Feb 2017 11:57:32 +0000 (UTC) Received: by mail-lf0-f43.google.com with SMTP id l12so179385lfe.0 for ; Wed, 22 Feb 2017 03:57:32 -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=kAmx38f64/5mgAlc9j+0zeLEhnJ+YUxs6mAnCNqO/oA=; b=eIoBzAw4RWF1tWvdTv3RkP1hnky46Bs9BJw4vSbQhAO0zmczxiTHNae0Q6PW/bq6LX rz9JGhY6fUTnJjdYGSX6EP5xnpff8Q8DItBItOI3r27E6Ior1h8IC3BBu+EBByi+IhS+ r3sWBgdls8YPQs2jMEaE7nmnYZzk3VuqMaG0YccqQiuJ1rgjNpNeTiqXd7zNeqJgz+ZM wP7VWYkfHLL9NeeY9+qh7dwE+y6SJk6iEszJb0aOJix83vBTbvTkLFv/UKykMlOfwh+H OKFATUW6BsV2pk5+Az5muBMf5hQ9IVqZMGxVenRBvE433JiMEdlLD5mWDy6lsVqwJ1nd H66g== X-Gm-Message-State: AMke39kzdTmlin7gdGRaATDHmaIHjOyjmSj3kYQiDCwjMIdPuiParJe/XBwNVolyLAAa6d9nNaI= X-Received: by 10.46.21.18 with SMTP id s18mr8315986ljd.73.1487764651215; Wed, 22 Feb 2017 03:57:31 -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.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Feb 2017 03:57:30 -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:55 +0100 Message-Id: <1487768164-43184-13-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 12/21] drv: driver: adding a probe and remove callback for devio 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" Needed to delete the resources needed for the devio. That is possibly the memory allocated for its "ops" part if it was allocated. May be NULL if nothing needs to be done at devio deletion time. Signed-off-by: Christophe Milard --- include/odp/drv/spec/driver.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) -- 2.7.4 diff --git a/include/odp/drv/spec/driver.h b/include/odp/drv/spec/driver.h index abac138..0b62c1b 100644 --- a/include/odp/drv/spec/driver.h +++ b/include/odp/drv/spec/driver.h @@ -269,6 +269,24 @@ struct odpdrv_devio_param_t { char enumr_api_name[ODPDRV_NAME_SIZE]; uint32_t enumr_api_version; /**<< required enumerator API version */ + /** Probe function: + * Tell whether this devio can handle the given device. + * The devio is hence given a chance to reject a given device for + * any reason. No binding occurs here. binding occurs when the + * driver is probed. + * returns 0 if this devio can handle the given device, or a negative + * value if not. + * If left to NULL, a 0 returned value is assumed + */ + int (*probe)(odpdrv_device_t dev); + + /** Remove function: + * Should destroy the memory allocated for ops and anything else + * under it, or any resource for this devio. + * Returns 0 on success or a negative value on error. + */ + int (*remove)(void); + /** Ops * Pointer to a devio ops structure (specific to each devio) */