@@ -108,6 +108,20 @@ static void cmis_show_mod_fault_cause(const __u8 *id)
}
}
+/*
+ * Print the current Module-Level Controls. Relevant documents:
+ * [1] CMIS Rev. 5, pag. 58, section 6.3.2.2, Table 6-12
+ * [2] CMIS Rev. 5, pag. 111, section 8.2.6, Table 8-10
+ */
+static void cmis_show_mod_lvl_controls(const __u8 *id)
+{
+ printf("\t%-41s : ", "LowPwrAllowRequestHW");
+ printf("%s\n", ONOFF(id[CMIS_MODULE_CONTROL_OFFSET] &
+ CMIS_LOW_PWR_ALLOW_REQUEST_HW));
+ printf("\t%-41s : ", "LowPwrRequestSW");
+ printf("%s\n", ONOFF(id[CMIS_MODULE_CONTROL_OFFSET] &
+ CMIS_LOW_PWR_REQUEST_SW));
+}
/**
* Print information about the device's power consumption.
@@ -405,6 +419,7 @@ void qsfp_dd_show_all(const __u8 *id)
cmis_show_rev_compliance(id);
cmis_show_mod_state(id);
cmis_show_mod_fault_cause(id);
+ cmis_show_mod_lvl_controls(id);
}
void cmis_show_all(const struct ethtool_module_eeprom *page_zero,
@@ -427,4 +442,5 @@ void cmis_show_all(const struct ethtool_module_eeprom *page_zero,
cmis_show_rev_compliance(page_zero_data);
cmis_show_mod_state(page_zero_data);
cmis_show_mod_fault_cause(page_zero_data);
+ cmis_show_mod_lvl_controls(page_zero_data);
}
@@ -28,6 +28,11 @@
#define CMIS_CURR_TEMP_OFFSET 0x0E
#define CMIS_CURR_CURR_OFFSET 0x10
+/* Module-Level Controls (Page 0) */
+#define CMIS_MODULE_CONTROL_OFFSET 0x1A
+#define CMIS_LOW_PWR_ALLOW_REQUEST_HW (1 << 6)
+#define CMIS_LOW_PWR_REQUEST_SW (1 << 4)
+
#define CMIS_CTOR_OFFSET 0xCB
/* Vendor related information (Page 0) */