{"id":2221737,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2221737/?format=json","web_url":"http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260410074921.1254213-9-aleksandr.loktionov@intel.com/","project":{"id":46,"url":"http://patchwork.ozlabs.org/api/1.1/projects/46/?format=json","name":"Intel Wired Ethernet development","link_name":"intel-wired-lan","list_id":"intel-wired-lan.osuosl.org","list_email":"intel-wired-lan@osuosl.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260410074921.1254213-9-aleksandr.loktionov@intel.com>","date":"2026-04-10T07:49:19","name":"[iwl-next,8/10] ice: move ice_phy_get_speed_eth56g() from ice_ptp_hw.c to ice_common.c","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"02d60b7161cb8b5512320239dd3a38d744042091","submitter":{"id":75597,"url":"http://patchwork.ozlabs.org/api/1.1/people/75597/?format=json","name":"Loktionov, Aleksandr","email":"aleksandr.loktionov@intel.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20260410074921.1254213-9-aleksandr.loktionov@intel.com/mbox/","series":[{"id":499419,"url":"http://patchwork.ozlabs.org/api/1.1/series/499419/?format=json","web_url":"http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=499419","date":"2026-04-10T07:49:11","name":"ice: misc cleanups and improvements","version":1,"mbox":"http://patchwork.ozlabs.org/series/499419/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2221737/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2221737/checks/","tags":{},"headers":{"Return-Path":"<intel-wired-lan-bounces@osuosl.org>","X-Original-To":["incoming@patchwork.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256\n header.s=default header.b=lfTGDGIz;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fsTV63Vxnz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 10 Apr 2026 17:49:50 +1000 (AEST)","from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 8847B6089D;\n\tFri, 10 Apr 2026 07:49:40 +0000 (UTC)","from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id 2BRqtEDHU4zk; Fri, 10 Apr 2026 07:49:38 +0000 (UTC)","from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id C952D60BAB;\n\tFri, 10 Apr 2026 07:49:38 +0000 (UTC)","from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])\n by lists1.osuosl.org (Postfix) with ESMTP id 60F321F6\n for <intel-wired-lan@lists.osuosl.org>; Fri, 10 Apr 2026 07:49:37 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp1.osuosl.org (Postfix) with ESMTP id 4741D81A81\n for <intel-wired-lan@lists.osuosl.org>; Fri, 10 Apr 2026 07:49:37 +0000 (UTC)","from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id 15eKPrPNIfFl for <intel-wired-lan@lists.osuosl.org>;\n Fri, 10 Apr 2026 07:49:36 +0000 (UTC)","from mgamail.intel.com (mgamail.intel.com [198.175.65.16])\n by smtp1.osuosl.org (Postfix) with ESMTPS id 923CE816EE\n for <intel-wired-lan@lists.osuosl.org>; Fri, 10 Apr 2026 07:49:36 +0000 (UTC)","from orviesa008.jf.intel.com ([10.64.159.148])\n by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Apr 2026 00:49:36 -0700","from amlin-019-225.igk.intel.com ([10.102.19.225])\n by orviesa008.jf.intel.com with ESMTP; 10 Apr 2026 00:49:35 -0700"],"X-Virus-Scanned":["amavis at osuosl.org","amavis at osuosl.org"],"X-Comment":"SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=<UNKNOWN> ","DKIM-Filter":["OpenDKIM Filter v2.11.0 smtp3.osuosl.org C952D60BAB","OpenDKIM Filter v2.11.0 smtp1.osuosl.org 923CE816EE"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1775807378;\n\tbh=OUTCdFQltu1dbkcgiF/618QfP1pIn7qM/kY4ea73GQ0=;\n\th=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t From;\n\tb=lfTGDGIzkwDpiNPKj+sX+LLO8+JgtnV5xu++D4g5eJEnrQ8AG/aWG/4g7a7JsNxpf\n\t cCp0Il30GqK+aPvJoCjvO9xfZsQUwtA47bF7LbDJjXw+uvGCGhxUNuB3pnV8OpTncK\n\t kRa4oHAYaMUGuTe7VRxExPDL7HBub195+VGK0Qc1h/mQ1eQMS0NqJ2nUcH5jBqiO/V\n\t CN0GUmDXdonX1r7w1Nd/WZOhvqtMpQ21O7aNSpZG7pMCkFFkTg85Xa9wuiYzNnKove\n\t R1ET2ZdjNll8NgfmjFH12vIJ1NBYoM3T1CIQ+JVHoXqCaUHC6/XNx21mqSMZNaMUOK\n\t sz62CniGTQTFQ==","Received-SPF":"Pass (mailfrom) identity=mailfrom; client-ip=198.175.65.16;\n helo=mgamail.intel.com; envelope-from=aleksandr.loktionov@intel.com;\n receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp1.osuosl.org 923CE816EE","X-CSE-ConnectionGUID":["2B8tTk+0RoiRgdnLSEi5YA==","P2JMCbCZRdiv7CpQKluA+g=="],"X-CSE-MsgGUID":["qvenbS4dQO6mbU4/taI+Cg==","us4bh296TrO2QRq2vlpOcQ=="],"X-IronPort-AV":["E=McAfee;i=\"6800,10657,11754\"; a=\"77007943\"","E=Sophos;i=\"6.23,171,1770624000\"; d=\"scan'208\";a=\"77007943\"","E=Sophos;i=\"6.23,171,1770624000\"; d=\"scan'208\";a=\"228941899\""],"X-ExtLoop1":"1","From":"Aleksandr Loktionov <aleksandr.loktionov@intel.com>","To":"intel-wired-lan@lists.osuosl.org, anthony.l.nguyen@intel.com,\n aleksandr.loktionov@intel.com","Cc":"netdev@vger.kernel.org","Date":"Fri, 10 Apr 2026 09:49:19 +0200","Message-ID":"<20260410074921.1254213-9-aleksandr.loktionov@intel.com>","X-Mailer":"git-send-email 2.52.0","In-Reply-To":"<20260410074921.1254213-1-aleksandr.loktionov@intel.com>","References":"<20260410074921.1254213-1-aleksandr.loktionov@intel.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Mailman-Original-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1775807377; x=1807343377;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=Tl3EkNAWXZS7VSusaCuL0Eb4xS+3persYVF/W/GWM1w=;\n b=hPJQApxj0ob/wlnkioW41Mvu9tT68OjvOk7kjQ8fHMHTpkjqRGFGAEUT\n 22Wp0B09kDnfPor6jq1v95iWhgpJX+KuOnpUzMBxlIgaKSKfKQPvWHxkc\n uFFk3bjMjECzjJRAhHrnwUmpjRyVQBmfboxBiMZlYkvu+7s6vnp/FTdoQ\n JOtZzNHstyqOolhw6WqBCMl3MCjl8TT1eWMZqkbKP2bjmeDVmdZRrZcyZ\n LlxFLFpiL2JMRYqp2wMiRd7Klllw8FyDKzyBRMQF3RlaUmLZq/4d2OV2C\n JdzM6r6cQmO9aLD1uCEGTypzFKx/gyGh+GCYcjJ39Zr7iAIhu02c09F+j\n g==;","X-Mailman-Original-Authentication-Results":["smtp1.osuosl.org;\n dmarc=pass (p=none dis=none)\n header.from=intel.com","smtp1.osuosl.org;\n dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com\n header.a=rsa-sha256 header.s=Intel header.b=hPJQApxj"],"Subject":"[Intel-wired-lan] [PATCH iwl-next 8/10] ice: move\n ice_phy_get_speed_eth56g() from ice_ptp_hw.c to ice_common.c","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>","List-Unsubscribe":"<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>","List-Archive":"<http://lists.osuosl.org/pipermail/intel-wired-lan/>","List-Post":"<mailto:intel-wired-lan@osuosl.org>","List-Help":"<mailto:intel-wired-lan-request@osuosl.org?subject=help>","List-Subscribe":"<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"},"content":"ice_phy_get_speed_eth56g() is currently a file-local (static)\nhelper in ice_ptp_hw.c. Future users outside that compilation\nunit require access to it.\n\nMove the function to ice_common.c, add a declaration in\nice_common.h, and relocate the enum ice_eth56g_link_spd from\nice_ptp_hw.h to ice_type.h so it is visible to callers of the\nnew exported function.\n\nSuggested-by: Karol Kolacinski <karol.kolacinski@intel.com>\nSigned-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>\n---\n drivers/net/ethernet/intel/ice/ice_common.c | 45 +++++++++++++++++++++\n drivers/net/ethernet/intel/ice/ice_common.h |  1 +\n drivers/net/ethernet/intel/ice/ice_ptp_hw.c | 45 ---------------------\n drivers/net/ethernet/intel/ice/ice_ptp_hw.h | 13 ------\n drivers/net/ethernet/intel/ice/ice_type.h   | 13 ++++++\n 5 files changed, 59 insertions(+), 58 deletions(-)","diff":"diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c\nindex ce11fea..2cebe4e 100644\n--- a/drivers/net/ethernet/intel/ice/ice_common.c\n+++ b/drivers/net/ethernet/intel/ice/ice_common.c\n@@ -3513,6 +3513,51 @@ u16 ice_get_link_speed_based_on_phy_type(u64 phy_type_low, u64 phy_type_high)\n \t\treturn speed_phy_type_high;\n }\n \n+/**\n+ * ice_phy_get_speed_eth56g - Get link speed based on PHY link type\n+ * @li: pointer to link information struct\n+ *\n+ * Return: simplified ETH56G PHY speed\n+ */\n+enum ice_eth56g_link_spd ice_phy_get_speed_eth56g(struct ice_link_status *li)\n+{\n+\tu16 speed = ice_get_link_speed_based_on_phy_type(li->phy_type_low,\n+\t\t\t\t\t\t\t li->phy_type_high);\n+\n+\tswitch (speed) {\n+\tcase ICE_AQ_LINK_SPEED_1000MB:\n+\t\treturn ICE_ETH56G_LNK_SPD_1G;\n+\tcase ICE_AQ_LINK_SPEED_2500MB:\n+\t\treturn ICE_ETH56G_LNK_SPD_2_5G;\n+\tcase ICE_AQ_LINK_SPEED_10GB:\n+\t\treturn ICE_ETH56G_LNK_SPD_10G;\n+\tcase ICE_AQ_LINK_SPEED_25GB:\n+\t\treturn ICE_ETH56G_LNK_SPD_25G;\n+\tcase ICE_AQ_LINK_SPEED_40GB:\n+\t\treturn ICE_ETH56G_LNK_SPD_40G;\n+\tcase ICE_AQ_LINK_SPEED_50GB:\n+\t\tswitch (li->phy_type_low) {\n+\t\tcase ICE_PHY_TYPE_LOW_50GBASE_SR:\n+\t\tcase ICE_PHY_TYPE_LOW_50GBASE_FR:\n+\t\tcase ICE_PHY_TYPE_LOW_50GBASE_LR:\n+\t\tcase ICE_PHY_TYPE_LOW_50GBASE_KR_PAM4:\n+\t\tcase ICE_PHY_TYPE_LOW_50G_AUI1_AOC_ACC:\n+\t\tcase ICE_PHY_TYPE_LOW_50G_AUI1:\n+\t\t\treturn ICE_ETH56G_LNK_SPD_50G;\n+\t\tdefault:\n+\t\t\treturn ICE_ETH56G_LNK_SPD_50G2;\n+\t\t}\n+\tcase ICE_AQ_LINK_SPEED_100GB:\n+\t\tif (li->phy_type_high ||\n+\t\t    li->phy_type_low == ICE_PHY_TYPE_LOW_100GBASE_SR2)\n+\t\t\treturn ICE_ETH56G_LNK_SPD_100G2;\n+\t\telse\n+\t\t\treturn ICE_ETH56G_LNK_SPD_100G;\n+\tdefault:\n+\t\treturn ICE_ETH56G_LNK_SPD_1G;\n+\t}\n+}\n+\n /**\n  * ice_update_phy_type\n  * @phy_type_low: pointer to the lower part of phy_type\ndiff --git a/drivers/net/ethernet/intel/ice/ice_common.h b/drivers/net/ethernet/intel/ice/ice_common.h\nindex e700ac0..cc5cee8 100644\n--- a/drivers/net/ethernet/intel/ice/ice_common.h\n+++ b/drivers/net/ethernet/intel/ice/ice_common.h\n@@ -342,6 +342,7 @@ ice_aq_get_gpio(struct ice_hw *hw, u16 gpio_ctrl_handle, u8 pin_idx,\n \t\tbool *value, struct ice_sq_cd *cd);\n bool ice_is_100m_speed_supported(struct ice_hw *hw);\n u16 ice_get_link_speed_based_on_phy_type(u64 phy_type_low, u64 phy_type_high);\n+enum ice_eth56g_link_spd ice_phy_get_speed_eth56g(struct ice_link_status *li);\n int\n ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,\n \t\t    struct ice_sq_cd *cd);\ndiff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c\nindex 61c0a0d..54a8afa 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.c\n+++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.c\n@@ -1401,51 +1401,6 @@ static int ice_ptp_write_port_cmd_eth56g(struct ice_hw *hw, u8 port,\n \treturn 0;\n }\n \n-/**\n- * ice_phy_get_speed_eth56g - Get link speed based on PHY link type\n- * @li: pointer to link information struct\n- *\n- * Return: simplified ETH56G PHY speed\n- */\n-static enum ice_eth56g_link_spd\n-ice_phy_get_speed_eth56g(struct ice_link_status *li)\n-{\n-\tu16 speed = ice_get_link_speed_based_on_phy_type(li->phy_type_low,\n-\t\t\t\t\t\t\t li->phy_type_high);\n-\n-\tswitch (speed) {\n-\tcase ICE_AQ_LINK_SPEED_1000MB:\n-\t\treturn ICE_ETH56G_LNK_SPD_1G;\n-\tcase ICE_AQ_LINK_SPEED_2500MB:\n-\t\treturn ICE_ETH56G_LNK_SPD_2_5G;\n-\tcase ICE_AQ_LINK_SPEED_10GB:\n-\t\treturn ICE_ETH56G_LNK_SPD_10G;\n-\tcase ICE_AQ_LINK_SPEED_25GB:\n-\t\treturn ICE_ETH56G_LNK_SPD_25G;\n-\tcase ICE_AQ_LINK_SPEED_40GB:\n-\t\treturn ICE_ETH56G_LNK_SPD_40G;\n-\tcase ICE_AQ_LINK_SPEED_50GB:\n-\t\tswitch (li->phy_type_low) {\n-\t\tcase ICE_PHY_TYPE_LOW_50GBASE_SR:\n-\t\tcase ICE_PHY_TYPE_LOW_50GBASE_FR:\n-\t\tcase ICE_PHY_TYPE_LOW_50GBASE_LR:\n-\t\tcase ICE_PHY_TYPE_LOW_50GBASE_KR_PAM4:\n-\t\tcase ICE_PHY_TYPE_LOW_50G_AUI1_AOC_ACC:\n-\t\tcase ICE_PHY_TYPE_LOW_50G_AUI1:\n-\t\t\treturn ICE_ETH56G_LNK_SPD_50G;\n-\t\tdefault:\n-\t\t\treturn ICE_ETH56G_LNK_SPD_50G2;\n-\t\t}\n-\tcase ICE_AQ_LINK_SPEED_100GB:\n-\t\tif (li->phy_type_high ||\n-\t\t    li->phy_type_low == ICE_PHY_TYPE_LOW_100GBASE_SR2)\n-\t\t\treturn ICE_ETH56G_LNK_SPD_100G2;\n-\t\telse\n-\t\t\treturn ICE_ETH56G_LNK_SPD_100G;\n-\tdefault:\n-\t\treturn ICE_ETH56G_LNK_SPD_1G;\n-\t}\n-}\n \n /**\n  * ice_phy_cfg_parpcs_eth56g - Configure TUs per PAR/PCS clock cycle\ndiff --git a/drivers/net/ethernet/intel/ice/ice_ptp_hw.h b/drivers/net/ethernet/intel/ice/ice_ptp_hw.h\nindex 9bfd3e7..a13256a 100644\n--- a/drivers/net/ethernet/intel/ice/ice_ptp_hw.h\n+++ b/drivers/net/ethernet/intel/ice/ice_ptp_hw.h\n@@ -50,19 +50,6 @@ enum eth56g_res_type {\n \tNUM_ETH56G_PHY_RES\n };\n \n-enum ice_eth56g_link_spd {\n-\tICE_ETH56G_LNK_SPD_1G,\n-\tICE_ETH56G_LNK_SPD_2_5G,\n-\tICE_ETH56G_LNK_SPD_10G,\n-\tICE_ETH56G_LNK_SPD_25G,\n-\tICE_ETH56G_LNK_SPD_40G,\n-\tICE_ETH56G_LNK_SPD_50G,\n-\tICE_ETH56G_LNK_SPD_50G2,\n-\tICE_ETH56G_LNK_SPD_100G,\n-\tICE_ETH56G_LNK_SPD_100G2,\n-\tNUM_ICE_ETH56G_LNK_SPD /* Must be last */\n-};\n-\n /**\n  * struct ice_phy_reg_info_eth56g - ETH56G PHY register parameters\n  * @base_addr: base address for each PHY block\ndiff --git a/drivers/net/ethernet/intel/ice/ice_type.h b/drivers/net/ethernet/intel/ice/ice_type.h\nindex 1e82f4c..4db235a 100644\n--- a/drivers/net/ethernet/intel/ice/ice_type.h\n+++ b/drivers/net/ethernet/intel/ice/ice_type.h\n@@ -859,6 +859,19 @@ struct ice_mbx_data {\n #define ICE_PORTS_PER_QUAD\t4\n #define ICE_GET_QUAD_NUM(port) ((port) / ICE_PORTS_PER_QUAD)\n \n+enum ice_eth56g_link_spd {\n+\tICE_ETH56G_LNK_SPD_1G,\n+\tICE_ETH56G_LNK_SPD_2_5G,\n+\tICE_ETH56G_LNK_SPD_10G,\n+\tICE_ETH56G_LNK_SPD_25G,\n+\tICE_ETH56G_LNK_SPD_40G,\n+\tICE_ETH56G_LNK_SPD_50G,\n+\tICE_ETH56G_LNK_SPD_50G2,\n+\tICE_ETH56G_LNK_SPD_100G,\n+\tICE_ETH56G_LNK_SPD_100G2,\n+\tNUM_ICE_ETH56G_LNK_SPD /* Must be last */\n+};\n+\n #define ATQBAL_FLAGS_INTR_IN_PROGRESS\tBIT(0)\n \n struct ice_e810_params {\n","prefixes":["iwl-next","8/10"]}