drivers/hwmon/hp-wmi-sensors.c
Source file repositories/reference/linux-study-clean/drivers/hwmon/hp-wmi-sensors.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/hwmon/hp-wmi-sensors.c- Extension
.c- Size
- 56755 bytes
- Lines
- 2078
- Domain
- Driver Families
- Bucket
- drivers/hwmon
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/debugfs.hlinux/hwmon.hlinux/jiffies.hlinux/mutex.hlinux/nls.hlinux/units.hlinux/wmi.h
Detected Declarations
struct hp_wmi_numeric_sensorstruct hp_wmi_platform_eventsstruct hp_wmi_eventstruct hp_wmi_infostruct hp_wmi_sensorsenum hp_wmi_typeenum hp_wmi_categoryenum hp_wmi_severityenum hp_wmi_statusenum hp_wmi_unitsenum hp_wmi_propertyenum hp_wmi_platform_events_propertyenum hp_wmi_event_propertyfunction is_raw_wmi_stringfunction kfreefunction hp_wmi_wobj_instance_countfunction check_wobjfunction extract_acpi_valuefunction check_numeric_sensor_wobjfunction numeric_sensor_is_connectedfunction numeric_sensor_has_faultfunction scale_numeric_sensorfunction classify_numeric_sensorfunction populate_numeric_sensor_from_wobjfunction update_numeric_sensor_from_wobjfunction check_platform_events_wobjfunction populate_platform_events_from_wobjfunction check_event_wobjfunction populate_event_from_wobjfunction classify_eventfunction interpret_infofunction hp_wmi_update_infofunction basic_string_showfunction fungible_showfunction operational_status_showfunction current_state_showfunction possible_states_showfunction unit_modifier_showfunction current_reading_showfunction hp_wmi_devm_debugfs_removefunction hp_wmi_debugfs_initfunction hp_wmi_hwmon_is_visiblefunction hp_wmi_hwmon_readfunction hp_wmi_hwmon_read_stringfunction hp_wmi_hwmon_writefunction match_temp_eventsfunction hp_wmi_devm_notify_removefunction hp_wmi_notify
Annotated Snippet
struct hp_wmi_numeric_sensor {
const char *name;
const char *description;
u32 sensor_type;
const char *other_sensor_type; /* Explains "Other" SensorType. */
u32 operational_status;
u8 size; /* Count of PossibleStates[]. */
const char **possible_states;
const char *current_state;
u32 base_units;
s32 unit_modifier;
u32 current_reading;
u32 rate_units;
};
/*
* struct hp_wmi_platform_events - a HPBIOS_PlatformEvents instance
*
* Instances of this object reveal the set of possible HPBIOS_BIOSEvent
* instances for the current system, but it may not always be present.
*
* Effective MOF definition:
*
* #pragma namespace("\\\\.\\root\\HP\\InstrumentedBIOS");
* class HPBIOS_PlatformEvents {
* [read] string Name;
* [read] string Description;
* [read] string SourceNamespace;
* [read] string SourceClass;
* [read, ValueMap {"0","1","2","3","4",".."}, Values {
* "Unknown","Configuration Change","Button Pressed",
* "Sensor","BIOS Settings","Reserved"}]
* uint32 Category;
* [read, ValueMap{"0","5","10","15","20","25","30",".."},
* Values{"Unknown","OK","Degraded/Warning","Minor Failure",
* "Major Failure","Critical Failure","Non-recoverable Error",
* "DMTF Reserved"}]
* uint32 PossibleSeverity;
* [read, ValueMap {"0","1","2","3","4","5","6","7","8","9",
* "10","11","12","13","14","15","16","17","18","..",
* "0x8000.."}, Values {"Unknown","Other","OK","Degraded",
* "Stressed","Predictive Failure","Error",
* "Non-Recoverable Error","Starting","Stopping","Stopped",
* "In Service","No Contact","Lost Communication","Aborted",
* "Dormant","Supporting Entity in Error","Completed",
* "Power Mode","DMTF Reserved","Vendor Reserved"}]
* uint32 PossibleStatus;
* };
*/
struct hp_wmi_platform_events {
const char *name;
const char *description;
const char *source_namespace;
const char *source_class;
u32 category;
u32 possible_severity;
u32 possible_status;
};
/*
* struct hp_wmi_event - a HPBIOS_BIOSEvent instance
*
* Effective MOF definition [1] (corrected below from original):
*
* #pragma namespace("\\\\.\\root\\WMI");
* class HPBIOS_BIOSEvent : WMIEvent {
* [read] string Name;
* [read] string Description;
* [read ValueMap {"0","1","2","3","4"}, Values {"Unknown",
* "Configuration Change","Button Pressed","Sensor",
* "BIOS Settings"}]
* uint32 Category;
* [read, ValueMap {"0","5","10","15","20","25","30"},
* Values {"Unknown","OK","Degraded/Warning",
* "Minor Failure","Major Failure","Critical Failure",
* "Non-recoverable Error"}]
* uint32 Severity;
* [read, ValueMap {"0","1","2","3","4","5","6","7","8",
* "9","10","11","12","13","14","15","16","17","18","..",
* "0x8000.."}, Values {"Unknown","Other","OK","Degraded",
* "Stressed","Predictive Failure","Error",
* "Non-Recoverable Error","Starting","Stopping","Stopped",
* "In Service","No Contact","Lost Communication","Aborted",
* "Dormant","Supporting Entity in Error","Completed",
* "Power Mode","DMTF Reserved","Vendor Reserved"}]
* uint32 Status;
* };
*/
struct hp_wmi_event {
const char *name;
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/debugfs.h`, `linux/hwmon.h`, `linux/jiffies.h`, `linux/mutex.h`, `linux/nls.h`, `linux/units.h`, `linux/wmi.h`.
- Detected declarations: `struct hp_wmi_numeric_sensor`, `struct hp_wmi_platform_events`, `struct hp_wmi_event`, `struct hp_wmi_info`, `struct hp_wmi_sensors`, `enum hp_wmi_type`, `enum hp_wmi_category`, `enum hp_wmi_severity`, `enum hp_wmi_status`, `enum hp_wmi_units`.
- Atlas domain: Driver Families / drivers/hwmon.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.