From patchwork Tue Oct 13 12:39:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 54847 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f199.google.com (mail-wi0-f199.google.com [209.85.212.199]) by patches.linaro.org (Postfix) with ESMTPS id 1DF2423001 for ; Tue, 13 Oct 2015 12:39:50 +0000 (UTC) Received: by wicgb1 with SMTP id gb1sf9770947wic.3 for ; Tue, 13 Oct 2015 05:39:49 -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=NYoXT+AeTb+5moyhd1CZPyTvQURPbNxmDrF4IdH0+Xc=; b=P7UgngmDHeAv4wld5NLf09+UxTHUhBQXlkCY6uu6Ft9R7j7FThUdNHTpYg57CFv1M7 tGlmQV3KUTLYd4n5ibKZCpz/JuHpR8mONSLEtjYm01L+JrP0YCJXQHen+Ag47GMIBJy8 m7mNHRc0m8cN8Rz63xodpLqRXqGzbosUd8NlqFgq++jZ2H2ibV4tbBm1jerZh72X0whj 5wcL29GRKzRiYjX+Um9FivymgZVM1ZaLjxgSl7QEFzRYn74XqvrJ9ucPEnQkW5I/q4ty NQYaG3tsj5fJo9/w1tKkGNrWjW9IKxtrkgVhzQ2qBCMibLaathiQETOkcWnrhtwCaL0N HeAg== X-Gm-Message-State: ALoCoQkEuf+AXqx6NJkMYPR35fKymnsT0WODe1/YpjjwQI7VZ0BESZGxiyvQ3BTauDRjZ8Jw4QBE X-Received: by 10.194.156.193 with SMTP id wg1mr6958214wjb.3.1444739989372; Tue, 13 Oct 2015 05:39:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.164.77 with SMTP id n74ls593800lfe.94.gmail; Tue, 13 Oct 2015 05:39:49 -0700 (PDT) X-Received: by 10.112.159.168 with SMTP id xd8mr14788644lbb.118.1444739989220; Tue, 13 Oct 2015 05:39:49 -0700 (PDT) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id j134si2037950lfe.165.2015.10.13.05.39.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Oct 2015 05:39:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by lbcao8 with SMTP id ao8so18160935lbc.3 for ; Tue, 13 Oct 2015 05:39:49 -0700 (PDT) X-Received: by 10.112.202.35 with SMTP id kf3mr14938529lbc.19.1444739989008; Tue, 13 Oct 2015 05:39:49 -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 w3csp2106680lbq; Tue, 13 Oct 2015 05:39:48 -0700 (PDT) X-Received: by 10.50.50.137 with SMTP id c9mr17873103igo.23.1444739986828; Tue, 13 Oct 2015 05:39:46 -0700 (PDT) Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id p19si12512893igs.100.2015.10.13.05.39.44; Tue, 13 Oct 2015 05:39:46 -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 AEE9161A24; Tue, 13 Oct 2015 12:39:44 +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 78AAC619D1; Tue, 13 Oct 2015 12:39:40 +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 A9E6C619D9; Tue, 13 Oct 2015 12:39:38 +0000 (UTC) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by lists.linaro.org (Postfix) with ESMTPS id B764061971 for ; Tue, 13 Oct 2015 12:39:37 +0000 (UTC) Received: by lbcao8 with SMTP id ao8so18153350lbc.3 for ; Tue, 13 Oct 2015 05:39:36 -0700 (PDT) X-Received: by 10.112.13.34 with SMTP id e2mr3580775lbc.120.1444739976152; Tue, 13 Oct 2015 05:39:36 -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 f8sm495128lff.28.2015.10.13.05.39.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Oct 2015 05:39:35 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Tue, 13 Oct 2015 15:39:29 +0300 Message-Id: <1444739969-7936-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 1.9.1 X-Topics: patch Subject: [lng-odp] [API-NEXT PATCHv2] 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-Removed-Original-Auth: Dkim didn't pass. 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 209.85.217.174 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org 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, autoneg, link up/down, duplex, started/stopped state. Signed-off-by: Maxim Uvarov --- 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 | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/odp/api/packet_io.h b/include/odp/api/packet_io.h index d8e69ed..6c77e8d 100644 --- a/include/odp/api/packet_io.h +++ b/include/odp/api/packet_io.h @@ -96,6 +96,28 @@ 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_bool_t autoneg; /**< 1 - autoneg on, 0 - off */ + odp_bool_t fd; /**< 1 - full duplex, 0 - half duplex */ + odp_bool_t stopped; /**< 1 - pktio stopped, 0 - started */ +} 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