From patchwork Tue Jan 24 17:48:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Milard X-Patchwork-Id: 92375 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp1789139obz; Tue, 24 Jan 2017 08:50:48 -0800 (PST) X-Received: by 10.55.86.70 with SMTP id k67mr32153713qkb.280.1485276648359; Tue, 24 Jan 2017 08:50:48 -0800 (PST) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id o38si13516045qkh.312.2017.01.24.08.50.48; Tue, 24 Jan 2017 08:50:48 -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 E9EF860913; Tue, 24 Jan 2017 16:50:47 +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 D4DF660F1E; Tue, 24 Jan 2017 16:49:07 +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 45DC4608FF; Tue, 24 Jan 2017 16:48:57 +0000 (UTC) Received: from mail-lf0-f49.google.com (mail-lf0-f49.google.com [209.85.215.49]) by lists.linaro.org (Postfix) with ESMTPS id 2CD3A6075E for ; Tue, 24 Jan 2017 16:48:53 +0000 (UTC) Received: by mail-lf0-f49.google.com with SMTP id z134so114451233lff.3 for ; Tue, 24 Jan 2017 08:48:53 -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=aHMxVVAKrxztcVIjxi6Vj9LnAZOmYMmPVb+IMhLMYW4=; b=f1hCVy16F0nlXOYRCEbh3QbPyP67QS/2UVbkR+1pFR/905fkFMXAl1FxobkHiKSWl3 LFiZy9ExNsw4cXwI4CkSFPGeIw5dgs9Xhzyik2tiAsgIzBHnZkltdhX2Fqb9xrOvS9BG 2suMOH0cfhltBLxUx4Qf4tCWvrWNZX5u5QAJ8y7QIp1BgDN2YAlLklBdMy26wv5hdeIB /pIZHF2sJefDhOoaOtzoVlTWeoYPwafHh/t1TIUn4nwJxlt+zh6zpId32IW5jd4gUwx9 mQPwt9oRBzX73ER4oYd/9Y2/sJtwhO4rxW+V8HId+YoDdA5Cn3fJ7T6BvveaYw4D/qU3 vCsw== X-Gm-Message-State: AIkVDXKfmlHpjKNY+bdWP4LFbiv/H8E6EowWxVK61BfxO4xw/32KMqQTb2vB0iifMElSvKNtkLQ= X-Received: by 10.25.216.3 with SMTP id p3mr11268109lfg.16.1485276531537; Tue, 24 Jan 2017 08:48:51 -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 y10sm7605276lja.22.2017.01.24.08.48.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Jan 2017 08:48:50 -0800 (PST) From: Christophe Milard To: mike.holmes@linaro.org, yi.he@linaro.org, maxim.uvarov@linaro.com, lng-odp@lists.linaro.org Date: Tue, 24 Jan 2017 18:48:03 +0100 Message-Id: <1485280086-3958-3-git-send-email-christophe.milard@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485280086-3958-1-git-send-email-christophe.milard@linaro.org> References: <1485280086-3958-1-git-send-email-christophe.milard@linaro.org> Subject: [lng-odp] [API-NEXT PATCHv11 2/5] linux-gen: adding enum, devio and driver registration interface (stub) 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" The linux implementation for the enumerator class registration function, enumerator instance registration function, devio and driver registration functions (stub) Signed-off-by: Christophe Milard --- include/odp_drv.h | 1 + platform/linux-generic/Makefile.am | 3 + platform/linux-generic/drv_driver.c | 64 ++++++++++++++++++++++ platform/linux-generic/include/odp/drv/driver.h | 37 +++++++++++++ .../include/odp/drv/plat/driver_types.h | 52 ++++++++++++++++++ 5 files changed, 157 insertions(+) create mode 100644 platform/linux-generic/drv_driver.c create mode 100644 platform/linux-generic/include/odp/drv/driver.h create mode 100644 platform/linux-generic/include/odp/drv/plat/driver_types.h -- 2.7.4 diff --git a/include/odp_drv.h b/include/odp_drv.h index 0959879..96d81ba 100644 --- a/include/odp_drv.h +++ b/include/odp_drv.h @@ -23,6 +23,7 @@ extern C { #include #include #include +#include #include #include #include diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 74e606d..2d97414 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -109,6 +109,7 @@ odpdrvinclude_HEADERS = \ $(srcdir)/include/odp/drv/barrier.h \ $(srcdir)/include/odp/drv/byteorder.h \ $(srcdir)/include/odp/drv/compiler.h \ + $(srcdir)/include/odp/drv/driver.h \ $(srcdir)/include/odp/drv/shm.h \ $(srcdir)/include/odp/drv/spinlock.h \ $(srcdir)/include/odp/drv/std_types.h \ @@ -119,6 +120,7 @@ odpdrvplatinclude_HEADERS = \ $(srcdir)/include/odp/drv/plat/atomic_types.h \ $(srcdir)/include/odp/drv/plat/barrier_types.h \ $(srcdir)/include/odp/drv/plat/byteorder_types.h \ + $(srcdir)/include/odp/drv/plat/driver_types.h \ $(srcdir)/include/odp/drv/plat/shm_types.h \ $(srcdir)/include/odp/drv/plat/spinlock_types.h \ $(srcdir)/include/odp/drv/plat/strong_types.h @@ -233,6 +235,7 @@ __LIB__libodp_linux_la_SOURCES = \ odp_weak.c \ drv_atomic.c \ drv_barrier.c \ + drv_driver.c \ drv_shm.c \ drv_spinlock.c \ arch/@ARCH_DIR@/odp_cpu_arch.c \ diff --git a/platform/linux-generic/drv_driver.c b/platform/linux-generic/drv_driver.c new file mode 100644 index 0000000..529da48 --- /dev/null +++ b/platform/linux-generic/drv_driver.c @@ -0,0 +1,64 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include + +#include +#include +#include +#include + +odpdrv_enumr_class_t odpdrv_enumr_class_register(odpdrv_enumr_class_param_t + *param) +{ + ODP_ERR("NOT Supported yet! Enumerator Class %s Registration!\n.", + param->name); + + return ODPDRV_ENUMR_CLASS_INVALID; +} + +odpdrv_enumr_t odpdrv_enumr_register(odpdrv_enumr_param_t *param) +{ + ODP_ERR("NOT Supported yet! Enumerator API %s Registration!\n.", + param->api_name); + + return ODPDRV_ENUMR_INVALID; +} + +odpdrv_device_t odpdrv_device_create(odpdrv_device_param_t *param) +{ + ODP_ERR("odpdrv_device_create not Supported yet! devaddress: %s\n.", + param->address); + return ODPDRV_DEVICE_INVALID; +} + +void odpdrv_device_destroy(odpdrv_device_t dev) +{ + if (dev == ODPDRV_DEVICE_INVALID) + ODP_ERR("Invalid device\n"); +} + +odpdrv_devio_t odpdrv_devio_register(odpdrv_devio_param_t *param) +{ + ODP_ERR("NOT Supported yet! Driver %s Registration!\n.", + param->api_name); + + return ODPDRV_DEVIO_INVALID; +} + +odpdrv_driver_t odpdrv_driver_register(odpdrv_driver_param_t *param) +{ + ODP_ERR("NOT Supported yet! Driver %s Registration!\n.", + param->name); + + return ODPDRV_DRIVER_INVALID; +} + +int odpdrv_print_all(void) +{ + ODP_ERR("odpdrv_print_all not Supported yet!\n."); + return 0; +} diff --git a/platform/linux-generic/include/odp/drv/driver.h b/platform/linux-generic/include/odp/drv/driver.h new file mode 100644 index 0000000..b12c83d --- /dev/null +++ b/platform/linux-generic/include/odp/drv/driver.h @@ -0,0 +1,37 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODPDRV drivers + */ + +#ifndef ODPDRV_PLAT_DRIVER_H_ +#define ODPDRV_PLAT_DRIVER_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +/** @ingroup odpdrv_driver + * @{ + */ + +/** + * @} + */ + +#include +#include + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/platform/linux-generic/include/odp/drv/plat/driver_types.h b/platform/linux-generic/include/odp/drv/plat/driver_types.h new file mode 100644 index 0000000..6c611bd --- /dev/null +++ b/platform/linux-generic/include/odp/drv/plat/driver_types.h @@ -0,0 +1,52 @@ +/* Copyright (c) 2017, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP shared memory + */ + +#ifndef ODPDRV_DRIVER_TYPES_H_ +#define ODPDRV_DRIVER_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/** @addtogroup odpdrv_driver ODPDRV DRIVER + * Operations on driver related items (enumerator class, enumerators, + * devios and drivers). + * @{ + */ + +typedef ODPDRV_HANDLE_T(odpdrv_enumr_class_t); +#define ODPDRV_ENUMR_CLASS_INVALID _odpdrv_cast_scalar(odpdrv_enumr_class_t, 0) + +typedef ODPDRV_HANDLE_T(odpdrv_enumr_t); +#define ODPDRV_ENUMR_INVALID _odpdrv_cast_scalar(odpdrv_enumr_t, 0) + +typedef ODPDRV_HANDLE_T(odpdrv_device_t); +#define ODPDRV_DEVICE_INVALID _odpdrv_cast_scalar(odpdrv_device_t, 0) + +typedef ODPDRV_HANDLE_T(odpdrv_devio_t); +#define ODPDRV_DEVIO_INVALID _odpdrv_cast_scalar(odpdrv_devio_t, 0) + +typedef ODPDRV_HANDLE_T(odpdrv_driver_t); +#define ODPDRV_DRIVER_INVALID _odpdrv_cast_scalar(odpdrv_driver_t, 0) + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif