From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 46089A0350;
	Mon, 22 Jun 2020 09:17:13 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 7C4561D61E;
	Mon, 22 Jun 2020 09:07:23 +0200 (CEST)
Received: from mga18.intel.com (mga18.intel.com [134.134.136.126])
 by dpdk.org (Postfix) with ESMTP id DB0641D612
 for <dev@dpdk.org>; Mon, 22 Jun 2020 09:07:20 +0200 (CEST)
IronPort-SDR: 5oQuW9qnWTZXtUP+eiy9bfSwQXXfih9mB3cvlLOcRaXthfQ/L9QpyfVfG8JhWZQR+fC3QPQFQI
 95LmH/ngUilw==
X-IronPort-AV: E=McAfee;i="6000,8403,9659"; a="131070899"
X-IronPort-AV: E=Sophos;i="5.75,266,1589266800"; d="scan'208";a="131070899"
X-Amp-Result: SKIPPED(no attachment in message)
X-Amp-File-Uploaded: False
Received: from fmsmga001.fm.intel.com ([10.253.24.23])
 by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 22 Jun 2020 00:07:20 -0700
IronPort-SDR: kdm/d9umKj/yXP+uHdj6VYehpJwzJX9LcwYvWITqrE46ZARGDLwxra9EMAOBgoQxOJuMGDPZJO
 QDr4TuS+kdeg==
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.75,266,1589266800"; d="scan'208";a="384409289"
Received: from dpdk.sh.intel.com ([10.239.255.83])
 by fmsmga001.fm.intel.com with ESMTP; 22 Jun 2020 00:07:18 -0700
From: Guinan Sun <guinanx.sun@intel.com>
To: dev@dpdk.org
Cc: Jeff Guo <jia.guo@intel.com>, Zhao1 Wei <wei.zhao1@intel.com>,
 Guinan Sun <guinanx.sun@intel.com>, Evgeny Efimov <evgeny.efimov@intel.com>
Date: Mon, 22 Jun 2020 06:46:28 +0000
Message-Id: <20200622064634.70941-65-guinanx.sun@intel.com>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20200622064634.70941-1-guinanx.sun@intel.com>
References: <20200622064634.70941-1-guinanx.sun@intel.com>
Subject: [dpdk-dev] [PATCH 64/70] net/e1000/base: add EEE set function to
	share code API
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

For the e1000_set_eee function to be used by windows E2F driver
added a reference function at api.c file.

Signed-off-by: Evgeny Efimov <evgeny.efimov@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
 drivers/net/e1000/base/e1000_api.c | 16 ++++++++++++++++
 drivers/net/e1000/base/e1000_api.h |  2 ++
 2 files changed, 18 insertions(+)

diff --git a/drivers/net/e1000/base/e1000_api.c b/drivers/net/e1000/base/e1000_api.c
index 65c155b93..64b6dd185 100644
--- a/drivers/net/e1000/base/e1000_api.c
+++ b/drivers/net/e1000/base/e1000_api.c
@@ -1376,3 +1376,19 @@ void e1000_shutdown_fiber_serdes_link(struct e1000_hw *hw)
 		hw->mac.ops.shutdown_serdes(hw);
 }
 
+/**
+ *  e1000_set_eee_i225 - Set EEE
+ *  @hw: pointer to the HW structure
+ *  @adv2p5G: boolean flag enabling 2.5G EEE advertisement
+ *  @adv1G: boolean flag enabling 1G EEE advertisement
+ *  @adv100M: boolean flag enabling 100M EEE advertisement
+ *
+ *  Enable/disable EEE based on setting in dev_spec structure.
+ **/
+s32 e1000_set_eee(struct e1000_hw *hw, bool adv2p5G, bool adv1G, bool adv100M)
+{
+	if (hw->mac.ops.set_eee)
+		return hw->mac.ops.set_eee(hw, adv2p5G, adv1G, adv100M);
+
+	return -E1000_ERR_CONFIG;
+}
diff --git a/drivers/net/e1000/base/e1000_api.h b/drivers/net/e1000/base/e1000_api.h
index 0b7b9016a..0786654fd 100644
--- a/drivers/net/e1000/base/e1000_api.h
+++ b/drivers/net/e1000/base/e1000_api.h
@@ -89,6 +89,8 @@ s32 e1000_mng_write_cmd_header(struct e1000_hw *hw,
 s32 e1000_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length);
 u32  e1000_translate_register_82542(u32 reg);
 
+s32 e1000_set_eee(struct e1000_hw *hw, bool adv2p5G, bool adv1G, bool adv100M);
+
 
 
 /*
-- 
2.17.1