Reserve the external PQC Root of Trust capability ID in the shared libie
capability list and parse its value into the common capabilities.

Firmware reports 1 for present and 0 for absent. Treat an omitted
capability as absent to preserve legacy behavior. Keep a separate invalid
bit so consumers can reject an explicitly reported unknown encoding
instead of treating it as absence. Log the reported value for debugging.

Leave the decision to the capability consumer. No NVM layout assumptions
or probe-time derived state are needed.

Signed-off-by: Aleksandr Loktionov <[email protected]>
---
 drivers/net/ethernet/intel/ice/ice_common.c | 6 ++++++
 drivers/net/ethernet/intel/ice/ice_type.h   | 2 ++
 include/linux/net/intel/libie/adminq.h      | 1 +
 3 files changed, 9 insertions(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_common.c 
b/drivers/net/ethernet/intel/ice/ice_common.c
index 6bde8f5..f1262d9 100644
--- a/drivers/net/ethernet/intel/ice/ice_common.c
+++ b/drivers/net/ethernet/intel/ice/ice_common.c
@@ -2484,6 +2484,12 @@ ice_parse_common_caps(struct ice_hw *hw, struct 
ice_hw_common_caps *caps,
        case LIBIE_AQC_CAPS_TX_SCHED_TOPO_COMP_MODE:
                caps->tx_sched_topo_comp_mode_en = (number == 1);
                break;
+       case LIBIE_AQC_CAPS_EXTERNAL_PQC_ROT_PRESENT:
+               caps->external_pqc_rot_present = (number == 1);
+               caps->external_pqc_rot_invalid = (number != 0 && number != 1);
+               ice_debug(hw, ICE_DBG_INIT, "%s: external_pqc_rot = %u\n",
+                         prefix, number);
+               break;
        default:
                /* Not one of the recognized common capabilities */
                found = false;
diff --git a/drivers/net/ethernet/intel/ice/ice_type.h 
b/drivers/net/ethernet/intel/ice/ice_type.h
index 67b90c0..1fede0f 100644
--- a/drivers/net/ethernet/intel/ice/ice_type.h
+++ b/drivers/net/ethernet/intel/ice/ice_type.h
@@ -311,6 +311,8 @@ struct ice_hw_common_caps {
        /* Post update reset restriction */
        bool reset_restrict_support;
        bool tx_sched_topo_comp_mode_en;
+       bool external_pqc_rot_present;
+       bool external_pqc_rot_invalid;
 };
 
 /* IEEE 1588 TIME_SYNC specific info */
diff --git a/include/linux/net/intel/libie/adminq.h 
b/include/linux/net/intel/libie/adminq.h
index 839114d..df42f5b 100644
--- a/include/linux/net/intel/libie/adminq.h
+++ b/include/linux/net/intel/libie/adminq.h
@@ -175,6 +175,7 @@ LIBIE_CHECK_STRUCT_LEN(16, libie_aqc_list_caps);
 #define LIBIE_AQC_CAPS_PENDING_OROM_VER                        0x004B
 #define LIBIE_AQC_CAPS_NET_VER                         0x004C
 #define LIBIE_AQC_CAPS_PENDING_NET_VER                 0x004D
+#define LIBIE_AQC_CAPS_EXTERNAL_PQC_ROT_PRESENT                0x004E
 #define LIBIE_AQC_CAPS_RDMA                            0x0051
 #define LIBIE_AQC_CAPS_LED                             0x0061
 #define LIBIE_AQC_CAPS_SDP                             0x0062
-- 
2.52.0

Reply via email to