From patchwork Mon Oct 19 16:24:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 55246 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lf0-f71.google.com (mail-lf0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 8925F22F11 for ; Mon, 19 Oct 2015 16:27:15 +0000 (UTC) Received: by lffv3 with SMTP id v3sf43371282lff.1 for ; Mon, 19 Oct 2015 09:27:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:delivered-to:from:to:date :message-id:subject:precedence:list-id:list-unsubscribe:list-archive :list-post:list-help:list-subscribe:mime-version:content-type :content-transfer-encoding:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=KsO5rNflWFlkJ78rZWdrmIsiwtkodma+xSHDbEbu/ok=; b=gSfR6ZX99H1h9Ol1Kb//jn0TrstsOZtFUUfxPsuKKBBYW+ufN+oRfVoFTIk+/RR5MB jFtN8HnP7YfDmaRJJjHN6P/ksLHgVyF2VSQpdwSGyiEg3tekFjbVbkrTxmX1ZzNHN9CM U0G6skp2mis7+rQz94R/MRFLRHmOE5BTm4af5EqZ+4gL2sKEQ0pL7llGF0kmMjgNtW8k /Ri7zRJgzDKTlIwQrL2aItTZH8m/d4y22jKOkyU01GLJyP6MVD0eKg2YDpSqbgLeOzlI 4Kwo5PrysOZuXHnlrQp1A9BH0bYuzTaVHiSZmpGfnSLNazqY743xSC1jREcOUQGE+IHP BcUA== X-Gm-Message-State: ALoCoQmFFaQ1BbuwX1ZfspSDew5fuE0apWCcODXSFQIUdhw7qBhvD2sq2NndrLyQqvG3Cr+N6kcf X-Received: by 10.112.173.170 with SMTP id bl10mr3880899lbc.7.1445272034589; Mon, 19 Oct 2015 09:27:14 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.41.4 with SMTP id p4ls568462lfp.58.gmail; Mon, 19 Oct 2015 09:27:14 -0700 (PDT) X-Received: by 10.112.162.162 with SMTP id yb2mr15290454lbb.94.1445272034382; Mon, 19 Oct 2015 09:27:14 -0700 (PDT) Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com. [2a00:1450:4010:c07::236]) by mx.google.com with ESMTPS id qq7si23421398lbb.141.2015.10.19.09.27.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Oct 2015 09:27:14 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c07::236 as permitted sender) client-ip=2a00:1450:4010:c07::236; Received: by lffy185 with SMTP id y185so114526687lff.2 for ; Mon, 19 Oct 2015 09:27:14 -0700 (PDT) X-Received: by 10.25.28.73 with SMTP id c70mr8074883lfc.76.1445272033928; Mon, 19 Oct 2015 09:27:13 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1569978lbq; Mon, 19 Oct 2015 09:27:12 -0700 (PDT) X-Received: by 10.140.239.82 with SMTP id k79mr39205991qhc.50.1445272032705; Mon, 19 Oct 2015 09:27:12 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id u4si6051368qkl.60.2015.10.19.09.27.11; Mon, 19 Oct 2015 09:27:12 -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; Received: by lists.linaro.org (Postfix, from userid 109) id 2597E6195E; Mon, 19 Oct 2015 16:27: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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID, 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 3F09B6196C; Mon, 19 Oct 2015 16:26:55 +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 41C5A6196E; Mon, 19 Oct 2015 16:26:49 +0000 (UTC) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) by lists.linaro.org (Postfix) with ESMTPS id 606CC6195E for ; Mon, 19 Oct 2015 16:24:49 +0000 (UTC) Received: by lbbwb3 with SMTP id wb3so86853306lbb.1 for ; Mon, 19 Oct 2015 09:24:48 -0700 (PDT) X-Received: by 10.112.171.69 with SMTP id as5mr15012096lbc.111.1445271888361; Mon, 19 Oct 2015 09:24:48 -0700 (PDT) Received: from localhost.localdomain (ppp91-76-161-180.pppoe.mtu-net.ru. [91.76.161.180]) by smtp.gmail.com with ESMTPSA id eu2sm5565135lbc.6.2015.10.19.09.24.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 19 Oct 2015 09:24:47 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 19 Oct 2015 19:24:45 +0300 Message-Id: <1445271885-20722-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [PATCHv3] api: pktio link X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" X-Original-Sender: maxim.uvarov@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c07::236 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Define API to get pktio link state: seed and link up/down. Signed-off-by: Maxim Uvarov --- v3: - even more simple, left only link up/down state and speed. v2: - use simple struct to return pktio link state; - odp will not modify link, only ready it's state; include/odp/api/packet_io.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index 3479af1..2fa3db8 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.h @@ -96,6 +96,25 @@ typedef struct odp_pktio_param_t { } odp_pktio_param_t; /** + * Packet IO link state information + */ +typedef struct odp_pktio_link_state_t { + uint32_t speed; /**< Speed in Mbps: 10, 100, 1000 etc */ + odp_bool_t up; /**< 1 - link up, 0 - link down */ +} odp_pktio_link_state_t; + +/** + * Get packet IO link state + * + * @param[in] pktio Packet IO handle + * @param[out] state Buffer to save link state + * + * @retval 0 on success (state info updated) + * @retval <0 on failure (state info not updated) + */ +int odp_pktio_link_state(odp_pktio_t pktio, odp_pktio_link_state_t *state); + +/** * Open a packet IO interface * * An ODP program can open a single packet IO interface per device, attempts