drivers/platform/x86/dell/dell-wmi-descriptor.c
Source file repositories/reference/linux-study-clean/drivers/platform/x86/dell/dell-wmi-descriptor.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/x86/dell/dell-wmi-descriptor.c- Extension
.c- Size
- 4779 bytes
- Lines
- 206
- Domain
- Driver Families
- Bucket
- drivers/platform
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/list.hlinux/module.hlinux/wmi.hdell-wmi-descriptor.h
Detected Declarations
struct descriptor_privfunction dell_wmi_get_descriptor_validfunction dell_wmi_get_interface_versionfunction dell_wmi_get_sizefunction dell_wmi_get_hotfixfunction dell_wmi_descriptor_probefunction dell_wmi_descriptor_removeexport dell_wmi_get_descriptor_validexport dell_wmi_get_interface_versionexport dell_wmi_get_sizeexport dell_wmi_get_hotfix
Annotated Snippet
struct descriptor_priv {
struct list_head list;
u32 interface_version;
u32 size;
u32 hotfix;
};
static int descriptor_valid = -EPROBE_DEFER;
static LIST_HEAD(wmi_list);
static DEFINE_MUTEX(list_mutex);
int dell_wmi_get_descriptor_valid(void)
{
if (!wmi_has_guid(DELL_WMI_DESCRIPTOR_GUID))
return -ENODEV;
return descriptor_valid;
}
EXPORT_SYMBOL_GPL(dell_wmi_get_descriptor_valid);
bool dell_wmi_get_interface_version(u32 *version)
{
struct descriptor_priv *priv;
bool ret = false;
mutex_lock(&list_mutex);
priv = list_first_entry_or_null(&wmi_list,
struct descriptor_priv,
list);
if (priv) {
*version = priv->interface_version;
ret = true;
}
mutex_unlock(&list_mutex);
return ret;
}
EXPORT_SYMBOL_GPL(dell_wmi_get_interface_version);
bool dell_wmi_get_size(u32 *size)
{
struct descriptor_priv *priv;
bool ret = false;
mutex_lock(&list_mutex);
priv = list_first_entry_or_null(&wmi_list,
struct descriptor_priv,
list);
if (priv) {
*size = priv->size;
ret = true;
}
mutex_unlock(&list_mutex);
return ret;
}
EXPORT_SYMBOL_GPL(dell_wmi_get_size);
bool dell_wmi_get_hotfix(u32 *hotfix)
{
struct descriptor_priv *priv;
bool ret = false;
mutex_lock(&list_mutex);
priv = list_first_entry_or_null(&wmi_list,
struct descriptor_priv,
list);
if (priv) {
*hotfix = priv->hotfix;
ret = true;
}
mutex_unlock(&list_mutex);
return ret;
}
EXPORT_SYMBOL_GPL(dell_wmi_get_hotfix);
/*
* Descriptor buffer is 128 byte long and contains:
*
* Name Offset Length Value
* Vendor Signature 0 4 "DELL"
* Object Signature 4 4 " WMI"
* WMI Interface Version 8 4 <version>
* WMI buffer length 12 4 <length>
* WMI hotfix number 16 4 <hotfix>
*/
static int dell_wmi_descriptor_probe(struct wmi_device *wdev,
const void *context)
{
union acpi_object *obj = NULL;
struct descriptor_priv *priv;
u32 *buffer;
int ret;
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/list.h`, `linux/module.h`, `linux/wmi.h`, `dell-wmi-descriptor.h`.
- Detected declarations: `struct descriptor_priv`, `function dell_wmi_get_descriptor_valid`, `function dell_wmi_get_interface_version`, `function dell_wmi_get_size`, `function dell_wmi_get_hotfix`, `function dell_wmi_descriptor_probe`, `function dell_wmi_descriptor_remove`, `export dell_wmi_get_descriptor_valid`, `export dell_wmi_get_interface_version`, `export dell_wmi_get_size`.
- Atlas domain: Driver Families / drivers/platform.
- Implementation status: integration 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.