From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-eopbgr730044.outbound.protection.outlook.com [40.107.73.44]) by dpdk.org (Postfix) with ESMTP id 361C01B42B for ; Sat, 29 Sep 2018 12:32:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=AQUANTIA1COM.onmicrosoft.com; s=selector1-aquantia-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=y8nyMRSJWwCd0nq74Q2FS2VFZ7Lk46srYmC2dJOQR+U=; b=Q7/LZT3w5YaDy84f2lxOEEsswaqtbNumtN2Iyv/Q6QNRbFvwpP3r6PGn3U0oYBDhlsinEl2OSvi1lazLwgoJIXOBLNx5wnHTCdFhWz4gyWGX/xl5YvT0nLC82gI4uJJfdoFty+lfAS4fELhtKe2D8rF86Ww2BQBUoXbTHxYjyl0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Igor.Russkikh@aquantia.com; Received: from ubuntubox.rdc.aquantia.com (95.79.108.179) by BLUPR0701MB1650.namprd07.prod.outlook.com (2a01:111:e400:58c6::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.22; Sat, 29 Sep 2018 10:32:41 +0000 From: Igor Russkikh To: dev@dpdk.org Cc: pavel.belous@aquantia.com, igor.russkikh@aquantia.com, Pavel Belous Date: Sat, 29 Sep 2018 13:30:33 +0300 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [95.79.108.179] X-ClientProxiedBy: VI1P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:bd::19) To BLUPR0701MB1650.namprd07.prod.outlook.com (2a01:111:e400:58c6::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae7f9a8d-d007-4948-d39c-08d625f6e60e X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BLUPR0701MB1650; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 3:I3JSpTn684Pkjrzzy4lB8iXtORSG4W2FZlZa8QQMnLqse2C5CE7BzEKKBqpUoTYzTqfvT7OuRpkh+QeGMw4U169cuqqcivaxwjcCHhObybU81JAL6co6Xe178e0AB2AY72KlDEWjoH/ZbhHZy6+PhLcm38/w0pv0CQKQIxHlZVVLGEAPdkBZuhJR+n5eh2MCupd+SIEC13FS/qXySBZcy+/WWPC6vrnx1ZO+Qvi+GiPlHS8nasgYNeYhunLlwsGQ; 25:tyCRr5bUrqGvwHlBXy0NwC0zKN+Elr2bYOJ24kIvb8/ZSGgo76Qrc3MAwWPbE5hB9tWpYxb/vy/ux/OrdRxpmUWPZAKNp2p6aMQrpkk12oOcN5E05gguhefm0yRgK0oqksVsNjyltmXAdzuB/eNrYLWkNZxo5y0wTQSV5NNTYSqN/yY+EN1TdCxF8IbvMvrP4gS9lP+NPdi+prYaly9x4gM9WcH8mUsBg2LJ7yGneTb5BNsR+z4ChLTyUce7wY+iDTyqS19nQndtPCX1XN2z6xXwzoTSg9nx3sZJqtapdCLjdoAZcJM4sozRb+OIFBsZIijc0bNKHjqQNEl2CDpdHQ==; 31:Na35Bo26wN+psW2XQ0da8C0ylFVFS2RR3pz0aZSVJW170TLK5ATr50Ev01htQ3VFpNVEJ52ouv/F1sf7lrTrC6vcw0j79XcZFEO7/Gg5ZCnJ6lMjwckqOKjhwMjiPsY7pS6wWgE6FAv9J09uMoLwfq8awE4P+gkOceIsBFV2Jlut9MG/V5hUSc56+swh6gUwlHu5ebgmgNjWUJ02rzXGo1BixGMMMD/Vt9b9v0/DJPs= X-MS-TrafficTypeDiagnostic: BLUPR0701MB1650: X-Microsoft-Exchange-Diagnostics: 1; BLUPR0701MB1650; 20:4rtUVTEUbDNbHujw317enDOBSdZh07DVCYeiq9aiHFOc3+6NpjLTARWlMurb97AXVvbfTM7ufq4X/pxHmngiBQnZlrsJmwcfuZ+GPgI3kNRafd1i6m9roODsUZ0Kp1flIzrpqknSmGJ5Mv9W5VrqbjWdK8KWZG2eD2zErw0/CL/n7/uQ4uB6AgHGwO9GI9IONWOdkCgVpTMeaz5uzJ2tpOcz3AnWr55nAMoFx0Uix/xM8d3TgPrHf/92zHkjEURiRTi/NjlepdslHNwQBskQ1lLZee5t23+scwSALog7bVFmJAqjqGmwaRP86hOG1Swa9JT9b/xgzKg8h3tK1ZOhpwhdi1UwaxFS1Xq5CArGvbIX2qa59IdIMmr2qFyIaiY745L3fOP5a5PAiXhSSM9HXzF5hKsB4T6zCk/9okagfYqiLbUPJ4Ka9b5iCqUFHd9uEH2D+aN8OlPalWrZrFyoXiuOcdPl23p8H+iXoT7C3lHCcPE5HAhMTDYToUrqOFD0; 4:5R7ywR0ovuSyb9FUdzOgJZ/ZQpJUVil0zXXoP9ATOP71Onh9qAh4e8toIaHyTF07SvHhwnymXRudSAX+mVQuZo12IG5qR+dSnmtO6zxTx4gLY0lL4uSKk54MZmsXbVnw8FUwPnqApUp+xZhqjkh8x1haUps9zKi409ok6wZiLo1JEe45Pf8fOorceOHJEi8KW8Xb58WNJjqUBnXJwvIi1DVEE3+fc0xTX5tSq+8BPCZX9yJEW81Y863BNVeSLKEx2f/OWmAZ1o3vwas5axxCxg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231355)(944501410)(52105095)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201708071742011)(7699051); SRVR:BLUPR0701MB1650; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0701MB1650; X-Forefront-PRVS: 0810818DA0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(136003)(396003)(376002)(39850400004)(366004)(189003)(199004)(16526019)(446003)(76176011)(2906002)(6916009)(6666003)(97736004)(8676002)(81166006)(81156014)(36756003)(4326008)(316002)(8936002)(50226002)(34290500001)(86362001)(5660300001)(68736007)(16586007)(118296001)(72206003)(3846002)(6116002)(53936002)(386003)(105586002)(6486002)(47776003)(66066001)(486006)(25786009)(305945005)(50466002)(44832011)(956004)(2616005)(26005)(107886003)(52116002)(51416003)(7696005)(186003)(476003)(478600001)(2361001)(7736002)(2351001)(48376002)(106356001)(11346002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0701MB1650; H:ubuntubox.rdc.aquantia.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: aquantia.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0701MB1650; 23:9vQ/9KEVqL8c7/nWrpf/DIhfhhx04uraKuzxG6L?= =?us-ascii?Q?BnRPxUdJaJ/ZYuB84SU837z+OwdE2vWytAxFwJ2jgzQhneJRj8eJJ53klI6g?= =?us-ascii?Q?5QzOr73aVWRU7Albs2QtAtzTKknQUbReRDBGEPuH5Zp3mOQmCi2/feuql3Gh?= =?us-ascii?Q?J80aTSD9m+tgdGS3dDICCCGT1zsfjA+lObMLjwt9hf9ucx8lglI7ZeIGCkWc?= =?us-ascii?Q?DrWxFTpvzokGPaYL6CWhqn+rTtbeg9TVRN/YbkxNdaASItcXO4C59Hwjg2B6?= =?us-ascii?Q?k0pN0T49mEerOc6jEgaRB05UFQ42hqPRFNnhRWVU0JYHrqnMZiYDBduBJPRC?= =?us-ascii?Q?0szQbP2gcS1955xcRS6P/eAKwGqPstN5IoyDF+xXv+ibEojfPi64gswGBEN+?= =?us-ascii?Q?/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NWjzoec9iUE1xFpeFbNNhSy1LLDNvdXOpMtGXM=; 7:OX8aGQ9jRSKZbNpf4GJyu/4GTICMPyF7lvgRkfT1jT+Ynl0NrNPW69thjv7+NEzndd4QvxhwjkNkWaOc/kes61xKR9aa0PSDRe4vTrX+AOoCk7aWbVNsLTs0XdEyjnP6i4tGO9K5eIVzDnoUzfPyO3cMJZxEyfhJGvQXWV4B+6atvAcF/KqK3Zu6tMT8u1FXOSl+gpReME3bTEsgEiM6XbOIhh67i4KZiqbaGr1DDPJsCQhuZXU++/QDG+3tmhoy SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: aquantia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2018 10:32:41.0506 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ae7f9a8d-d007-4948-d39c-08d625f6e60e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 83e2e134-991c-4ede-8ced-34d47e38e6b1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1650 Subject: [dpdk-dev] [PATCH v3 19/22] net/atlantic: eeprom and register manipulation routines X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Sep 2018 10:32:51 -0000 From: Pavel Belous Signed-off-by: Igor Russkikh Signed-off-by: Pavel Belous --- drivers/net/atlantic/atl_ethdev.c | 47 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c index 792dd7be127a..b3a19f96e8c8 100644 --- a/drivers/net/atlantic/atl_ethdev.c +++ b/drivers/net/atlantic/atl_ethdev.c @@ -69,6 +69,13 @@ static void atl_vlan_strip_queue_set(struct rte_eth_dev *dev, static int atl_vlan_tpid_set(struct rte_eth_dev *dev, enum rte_vlan_type vlan_type, uint16_t tpid); +/* EEPROM */ +static int atl_dev_get_eeprom_length(struct rte_eth_dev *dev); +static int atl_dev_get_eeprom(struct rte_eth_dev *dev, + struct rte_dev_eeprom_info *eeprom); +static int atl_dev_set_eeprom(struct rte_eth_dev *dev, + struct rte_dev_eeprom_info *eeprom); + /* Flow control */ static int atl_flow_ctrl_get(struct rte_eth_dev *dev, @@ -266,6 +273,11 @@ static const struct eth_dev_ops atl_eth_dev_ops = { .rx_descriptor_status = atl_dev_rx_descriptor_status, .tx_descriptor_status = atl_dev_tx_descriptor_status, + /* EEPROM */ + .get_eeprom_length = atl_dev_get_eeprom_length, + .get_eeprom = atl_dev_get_eeprom, + .set_eeprom = atl_dev_set_eeprom, + /* Flow Control */ .flow_ctrl_get = atl_flow_ctrl_get, .flow_ctrl_set = atl_flow_ctrl_set, @@ -1171,6 +1183,41 @@ atl_dev_interrupt_handler(void *param) atl_dev_interrupt_action(dev, dev->intr_handle); } +#define SFP_EEPROM_SIZE 0xff + +static int +atl_dev_get_eeprom_length(struct rte_eth_dev *dev __rte_unused) +{ + return SFP_EEPROM_SIZE; +} + +static int +atl_dev_get_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *eeprom) +{ + struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + + if (hw->aq_fw_ops->get_eeprom == NULL) + return -ENOTSUP; + + if (eeprom->length != SFP_EEPROM_SIZE || eeprom->data == NULL) + return -EINVAL; + + return hw->aq_fw_ops->get_eeprom(hw, eeprom->data, eeprom->length); +} + +static int +atl_dev_set_eeprom(struct rte_eth_dev *dev, struct rte_dev_eeprom_info *eeprom) +{ + struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(dev->data->dev_private); + + if (hw->aq_fw_ops->set_eeprom == NULL) + return -ENOTSUP; + + if (eeprom->length != SFP_EEPROM_SIZE || eeprom->data == NULL) + return -EINVAL; + + return hw->aq_fw_ops->set_eeprom(hw, eeprom->data, eeprom->length); +} static int atl_flow_ctrl_get(struct rte_eth_dev *dev, struct rte_eth_fc_conf *fc_conf) -- 2.7.4