From mboxrd@z Thu Jan 1 00:00:00 1970 List-Id: Return-Path: Received: from localhost (localhost [127.0.0.1]) by mail.ignore.pl (Postfix) with ESMTP id 01B3D43557 for ; Mon, 19 Jan 2026 16:16:54 +0000 (UTC) X-Virus-Scanned: Debian amavis at ignore.pl Received: from mail.ignore.pl ([127.0.0.1]) by localhost (geidontei.ignore.pl [127.0.0.1]) (amavis, port 10024) with ESMTP id XNDa2ngRhGmu for ; Mon, 19 Jan 2026 16:16:52 +0000 (UTC) Authentication-Results: mail.ignore.pl; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=I0rg1tna; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by mail.ignore.pl (Postfix) with ESMTPS id C9756401BB for ; Mon, 19 Jan 2026 16:16:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768839410; x=1800375410; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qEbvC2OmhFueicMSVxHx5i4BeJCopQ4k5/SAh8oCc08=; b=I0rg1tnaQi/CfjLBVtyIBuWILUblsKNZjdie48ZZGuis5niR81nOdCsD TtmkeQCnDO+lwUuFgxQKSnuAOQCUfYgtnxury8a5aQIakQOxgC8Ytroke 6NeXAehX45vqoZJLXNZT69EclwXaBVP9xl3USK2LueDnf1o4FTzBtqxou dvvIOeKDDvS2E/GtYOEzqupjzvqiHf/8zE7vQE2NJzBsCx8qiztN1KIN3 Ar6Gro6Lrc7CafX5UPG/VQ9+hfs7jXhs1S9pImrWyukw64nTz1WqbCp8A JrbSc6aRCRf9TBEH184KtG/E2CsucNkl0+eqxVCfITmxq8AQljk9i6XPr w==; X-CSE-ConnectionGUID: JIusRjFgQmGwcFimVPQAZQ== X-CSE-MsgGUID: BBr57C3ZT92l8FFn91pNzg== X-IronPort-AV: E=McAfee;i="6800,10657,11676"; a="69960189" X-IronPort-AV: E=Sophos;i="6.21,238,1763452800"; d="scan'208";a="69960189" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2026 08:16:50 -0800 X-CSE-ConnectionGUID: Mburzv3aRwiY5YgvhO24fQ== X-CSE-MsgGUID: rlNs6r4AQcSxXIDho3bxlQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,238,1763452800"; d="scan'208";a="206155245" Received: from soc-5cg4396xfb.clients.intel.com ([172.28.180.200]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2026 08:16:50 -0800 From: Dawid Osuchowski To: patches@ignore.pl Cc: Dawid Osuchowski Subject: [PATCH what v2 2/2] ice: implement support for 0x0601 opcode Date: Mon, 19 Jan 2026 17:16:30 +0100 Message-ID: <20260119161630.20162-3-dawid.osuchowski@linux.intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260119161630.20162-1-dawid.osuchowski@linux.intel.com> References: <20260119161630.20162-1-dawid.osuchowski@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Signed-off-by: Dawid Osuchowski --- v2: - extract extended_phy_capabilities into separate file and include it in opcode - appended sample to samples/linux.log - removed unused bit declaration samples/linux.log | 12 ++++ what/ice/opcodes/0x0601.lua | 131 ++++++++++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 what/ice/opcodes/0x0601.lua diff --git a/samples/linux.log b/samples/linux.log index ce1c0a9df1e1..a32fcd06bf75 100644 --- a/samples/linux.log +++ b/samples/linux.log @@ -14,3 +14,15 @@ [ 5.000000] ice 0x00000008 0x0000C000 00000000: 00 10 e1 e0 00 00 00 26 00 00 20 00 00 00 00 00 [ 5.000000] ice 0x00000008 0x0000C000 00000010: 00 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 5.000000] example: this line is something completely unrelated +[ 5.000000] ice 0000:01:00.0: AQ Command: opcode 0x0601, flags 0x3400, datalen 0x0018, retval 0x0000 + cookie (h,l) 0x00000000 0x00000000 + param (0,1) 0x00000000 0x00000000 + addr (h,l) 0x00000004 0x3CB75000 +[ 5.000000] ice 0x00000004 0x3CB75000 00000000: 00 40 80 00 00 00 00 00 00 00 00 00 00 00 00 00 +[ 5.000000] ice 0x00000004 0x3CB75000 00000010: e0 00 00 00 00 00 04 00 +[ 5.000000] ice 0000:01:00.0: AQ Response: opcode 0x0601, flags 0x3403, datalen 0x0018, retval 0x0000 + cookie (h,l) 0x00000000 0x00000000 + param (0,1) 0x00000000 0x00000000 + addr (h,l) 0x00000004 0x3CB75000 +[ 5.000000] ice 0x00000004 0x3CB75000 00000000: 00 40 80 00 00 00 00 00 00 00 00 00 00 00 00 00 +[ 5.000000] ice 0x00000004 0x3CB75000 00000010: e0 00 00 00 00 00 04 00 diff --git a/what/ice/opcodes/0x0601.lua b/what/ice/opcodes/0x0601.lua new file mode 100644 index 000000000000..487be10cbcb6 --- /dev/null +++ b/what/ice/opcodes/0x0601.lua @@ -0,0 +1,131 @@ +local dis = require "what.dissecting" +local bits = require "what.bits" +local flags = require "what.ice.flags" +local extended_phy_capabilities = require "what.ice.extended_phy_capabilities" +local set_phy_config = {} +local dump = [[ +--- +opcode: 0x0601 (Set PHY Config) +kind: %s %s +flags: %s +retval: 0x%x +cookie: 0x%08x 0x%08x +%s...]] + + +function set_phy_config:dump () + return dump:format( + self.queue, self.kind, + flags.dump(self.flags), + self.retval, + self.cookie_h, self.cookie_l, + self:dump_indirect_buffer()) +end + +local +function bit_list (entries, count, offset) + offset = offset or 0 + local list = {} + for i=1,count do + list[i] = entries[offset + i] + end + return bits.list(list) +end + + +--- Table 3-28. Set PHY Config Command Data Structure[E810] +local indirect_buffer = dis.new { + -- TODO: Consider handling >8 bytes in one range definition. + -- TODO: Consider supporting default value if lookup fails + ["0.0-3.7"] = dis.insert_if_empty("PHY Type", bit_list(extended_phy_capabilities, 32)), + ["4.0-7.7"] = dis.insert_if_empty("PHY Type", bit_list(extended_phy_capabilities, 32, 32)), + ["8.0-11.7"] = dis.insert_if_empty("PHY Type", bit_list(extended_phy_capabilities, 32, 64)), + ["12.0-15.7"] = dis.insert_if_empty("PHY Type", bit_list(extended_phy_capabilities, 32, 96)), + ["16.0-16.1"] = dis.list "Pause Ability" { + "Enable Tx Link Pause", + "Enable Rx Link Pause", + neither = "Tx and Rx Disabled", + }, + ["16.2"] = dis.toggle "Power Mode" { + [0] = "High Power Mode", + [1] = "Low Power Mode", + }, + ["16.3"] = dis.yes_no "Enable Link", + ["16.5"] = dis.yes_no "Enable Automatic Link Update", + ["16.6"] = dis.yes_no "LESM Enable", + ["16.7"] = dis.yes_no "Auto FEC Enable", + ["17.0-17.3"] = dis.list "Low Power Control" { + "Enable D3cold low power auto-negotiation", + nil, -- Reserved + nil, -- Reserved + "AN37 enabled on 1G links", + neither = "D3cold and AN37 disabled", + }, + ["18.0-19.2"] = dis.list "EEE Capability Enable" { + "100BASE-TX", + "1000BASE-T", + "10GBASE-T", + "1000BASE-KX", + "10GBASE-KR", + "25GBASE-KR", + "50GBASE-KR2", + "50GBASE-KR-PAM4", + "100GBASE-KR4", + "100GBASE-KR2-PAM4", + neither = "Disabled", + }, + ["20.0-21.7"] = dis.hexadecimal "EEER Value", + ["22.0-22.7"] = dis.list "Link FEC Options" { + "FIRE_CODE_10_ABILITY Enable", + "FIRE_CODE_10_REQUEST", + "RS_528_REQUEST", + "FIRE_CODE_25_REQUEST", + "RS_544_REQUEST", + "No FEC", + "RS_528_ABILITY", + "FIRE_CODE_25_ABILITY", + neither = "None", + }, + ["23.0"] = dis.toggle "Module Compliance Enforcement" { + [0] = "Lenient", + [1] = "Strict", + }, +} +local order = { + "PHY Type", + "Pause Ability", + "Power Mode", + "Enable Link", + "Enable Automatic Link Update", + "LESM Enable", + "Auto FEC Enable", + "Low Power Control", + "EEE Capability Enable", + "EEER Value", + "Link FEC Options", + "Module Compliance Enforcement", +} + + +function set_phy_config:dump_indirect_buffer () + local str = "" + local result = indirect_buffer({}, self.buffer) + for _, key in ipairs(order) do + local value = result[key] + if value then + str = str .. key .. ":" + if type(value) == "string" then + str = string.format("%s %s", str, value) + elseif type(value) == "table" then + for _, x in ipairs(value) do + str = str .. "\n - " .. x + end + end + str = str .. "\n" + end + end + return str +end + + +return set_phy_config -- 2.52.0