Additional enhancements of thermal and fan statistics

General

This feature adds monitoring capabilities of fan’s thermal state, target RPM, and LED state.

The Statistics Manager (SM) is extended with thermal state, fan RPM and LED state.

This information is essential for detecting potential fan failures. If the actual fan RPM deviates outside a specified range from the target RPM, PM reacts by setting the LED state to a hardware error state.

Northbound API

New fields have been introduced to src/lib/protobuf/opensync_stats.proto:

message Device { ... message Thermal { message RadioTxChainMask{ optional RadioBandType band = 1; optional uint32 value = 2; } repeated RadioTxChainMask txchainmask = 1; optional uint32 fan_rpm = 2; optional uint64 timestamp_ms = 3; optional uint32 fan_duty_cycle = 4; + optional uint32 thermal_state = 5; + optional uint32 target_rpm = 6; + optional uint32 led_state = 7; } repeated Thermal thermal_stats = 5; ... }

 

A quick description of newly added stats parameters:

  • thermal_state… Represents the currently active thermal state, determined from the SPFAN_State entry with key equal to Node_Services. This value is written into OVSDB by PM.

  • target_rpm… Indicates the RPM we are trying to set on the fan. This value is derived from the device's thermal table, translating the current thermal state into the target RPM.

  • led_state… Represents the current LED state, determined from the led_config entry of AWLAN_Node. This value is written into OVSDB by PM.

Southbound API

No Southbound API functions need implementation, as all required data is obtainable from OVSDB tables and existing helper functions within PM.

Requirements

New fields thermal_state and target_rpm are related to thermal management and fan control which is why PM and its plugin TM need to be enabled via the following kconfig options:

  • CONFIG_MANAGER_PM

  • CONFIG_PM_ENABLE_TM

To determine the value of led_state, an additional kconfig option needs to be enabled:

  • CONFIG_OSP_LED

If these kconfig options are not enabled, “null” implementations of required functions are compiled. They return either empty or error values.