From: Ben Shelton <benjamin.h.shel...@intel.com>

The AE driver will call this function to enable the SyncE error reporting
mechanism and enable event reporting when errors occur.

Signed-off-by: Ben Shelton <benjamin.h.shel...@intel.com>
Signed-off-by: Ian Stokes <ian.sto...@intel.com>
---
 drivers/net/ice/base/ice_common.c | 29 +++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_common.h |  3 +++
 2 files changed, 32 insertions(+)

diff --git a/drivers/net/ice/base/ice_common.c 
b/drivers/net/ice/base/ice_common.c
index 8fcd27a594..536392776f 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -5490,6 +5490,35 @@ ice_cfg_vsi_lan(struct ice_port_info *pi, u16 
vsi_handle, u16 tc_bitmap,
                              ICE_SCHED_NODE_OWNER_LAN);
 }
 
+/**
+ * ice_aq_cfg_cgu_err
+ * @hw: pointer to the HW struct
+ * @ena_event_report: enable or disable event reporting
+ * @ena_err_report: enable/re-enable or disable error reporting mechanism
+ * @cd: pointer to command details structure or NULL
+ *
+ * Configure CGU error reporting mechanism (0x0C60)
+ */
+int
+ice_aq_cfg_cgu_err(struct ice_hw *hw, bool ena_event_report,
+                  bool ena_err_report, struct ice_sq_cd *cd)
+{
+       struct ice_aqc_cfg_cgu_err *cmd;
+       struct ice_aq_desc desc;
+
+       cmd = &desc.params.config_cgu_err;
+
+       ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_cfg_cgu_err);
+
+       if (!ena_event_report)
+               cmd->cmd |= ICE_AQC_CFG_CGU_EVENT_DIS;
+
+       if (!ena_err_report)
+               cmd->cmd |= ICE_AQC_CFG_CGU_ERR_DIS;
+
+       return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
+}
+
 /**
  * ice_aq_get_sensor_reading
  * @hw: pointer to the HW struct
diff --git a/drivers/net/ice/base/ice_common.h 
b/drivers/net/ice/base/ice_common.h
index d1ceb406de..71b1f34d0a 100644
--- a/drivers/net/ice/base/ice_common.h
+++ b/drivers/net/ice/base/ice_common.h
@@ -269,6 +269,9 @@ void ice_sbq_lock(struct ice_hw *hw);
 void ice_sbq_unlock(struct ice_hw *hw);
 int ice_sbq_rw_reg(struct ice_hw *hw, struct ice_sbq_msg_input *in, u16 flag);
 int
+ice_aq_cfg_cgu_err(struct ice_hw *hw, bool ena_event_report, bool 
ena_err_report,
+                  struct ice_sq_cd *cd);
+int
 ice_aq_get_sensor_reading(struct ice_hw *hw, u8 sensor, u8 format,
                          struct ice_aqc_get_sensor_reading_resp *data,
                          struct ice_sq_cd *cd);
-- 
2.43.0

Reply via email to