drivers/platform/wmi/tests/marshalling_kunit.c
Source file repositories/reference/linux-study-clean/drivers/platform/wmi/tests/marshalling_kunit.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/platform/wmi/tests/marshalling_kunit.c- Extension
.c- Size
- 10169 bytes
- Lines
- 473
- Domain
- Driver Families
- Bucket
- drivers/platform
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/acpi.hlinux/align.hlinux/module.hlinux/slab.hlinux/string.hlinux/types.hlinux/wmi.hkunit/resource.hkunit/test.h../internal.h
Detected Declarations
struct wmi_acpi_paramstruct wmi_string_paramstruct wmi_invalid_acpi_paramstruct wmi_invalid_string_paramfunction wmi_acpi_param_get_descfunction wmi_string_param_get_descfunction wmi_invalid_acpi_param_get_descfunction wmi_invalid_string_param_get_descfunction wmi_unmarshal_acpi_object_testfunction wmi_unmarshal_acpi_object_failure_testfunction wmi_marshal_string_testfunction wmi_marshal_string_failure_testfunction wmi_unmarshal_acpi_object_undersized_test
Annotated Snippet
struct wmi_acpi_param {
const char *name;
const union acpi_object obj;
const struct wmi_buffer buffer;
};
struct wmi_string_param {
const char *name;
const char *string;
const struct wmi_buffer buffer;
};
struct wmi_invalid_acpi_param {
const char *name;
const union acpi_object obj;
};
struct wmi_invalid_string_param {
const char *name;
const struct wmi_buffer buffer;
};
/* 0xdeadbeef */
static u8 expected_single_integer[] = {
0xef, 0xbe, 0xad, 0xde,
};
/* "TEST" */
static u8 expected_single_string[] = {
0x0a, 0x00, 0x54, 0x00, 0x45, 0x00, 0x53, 0x00, 0x54, 0x00, 0x00, 0x00,
};
static u8 test_buffer[] = {
0xab, 0xcd,
};
static u8 expected_single_buffer[] = {
0xab, 0xcd,
};
static union acpi_object simple_package_elements[] = {
{
.buffer = {
.type = ACPI_TYPE_BUFFER,
.length = sizeof(test_buffer),
.pointer = test_buffer,
},
},
{
.integer = {
.type = ACPI_TYPE_INTEGER,
.value = 0x01020304,
},
},
};
static u8 expected_simple_package[] = {
0xab, 0xcd,
0x00, 0x00,
0x04, 0x03, 0x02, 0x01,
};
static u8 test_small_buffer[] = {
0xde,
};
static union acpi_object complex_package_elements[] = {
{
.integer = {
.type = ACPI_TYPE_INTEGER,
.value = 0xdeadbeef,
},
},
{
.buffer = {
.type = ACPI_TYPE_BUFFER,
.length = sizeof(test_small_buffer),
.pointer = test_small_buffer,
},
},
{
.string = {
.type = ACPI_TYPE_STRING,
.length = sizeof("TEST") - 1,
.pointer = "TEST",
},
},
{
.buffer = {
.type = ACPI_TYPE_BUFFER,
Annotation
- Immediate include surface: `linux/acpi.h`, `linux/align.h`, `linux/module.h`, `linux/slab.h`, `linux/string.h`, `linux/types.h`, `linux/wmi.h`, `kunit/resource.h`.
- Detected declarations: `struct wmi_acpi_param`, `struct wmi_string_param`, `struct wmi_invalid_acpi_param`, `struct wmi_invalid_string_param`, `function wmi_acpi_param_get_desc`, `function wmi_string_param_get_desc`, `function wmi_invalid_acpi_param_get_desc`, `function wmi_invalid_string_param_get_desc`, `function wmi_unmarshal_acpi_object_test`, `function wmi_unmarshal_acpi_object_failure_test`.
- Atlas domain: Driver Families / drivers/platform.
- Implementation status: source implementation candidate.
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.