STRUCT TEST_CONFIG(9)
π struct test_config(9) β the Kernel API Manual glow-up β¨
okay so before we even start: this is a page from the Kernel API Manual, section 9, and it's all about struct test_config β no cap, it's the whole personality of this page π
β¨ NAME β¨
struct test_config β literally the configuration struct for the test, one for each of the different triggers π¦
πΈ SYNOPSIS πΈ
here's the whole shape of it, bestie β every field, exactly as it lives:
struct test_config {
char *name;
bool into_buf;
size_t buf_size;
size_t file_offset;
bool partial;
bool sync_direct;
bool send_uevent;
u8 num_requests;
u8 read_fw_idx;
char *upload_name;
struct test_batched_req *reqs;
int test_result;
int (*req_firmware)(const struct firmware **fw, const char *name,
struct device *device);
};
π Members π
okay this is the main character section, let's go member by member π
nameβ the name of the firmware file we're looking for πinto_bufβ wheninto_bufis used, if this is true thenrequest_firmware_into_bufwill be used instead. iykyk π«Άbuf_sizeβ size of buf to allocate wheninto_bufis truefile_offsetβ file offset to request when callingrequest_firmware_into_bufpartialβ the partial read opt, used when callingrequest_firmware_into_bufsync_directβ when the sync trigger is used, if this is true thenrequest_firmware_directwill be used instead β¨send_ueventβ whether or not to send a uevent for async requests π¨num_requestsβ number of requests to try per test case. this one is trigger specific, so it's giving "depends on the vibe" πread_fw_idxβ index of the thread from which we want to read firmware results from, through theread_fwtrigger π§΅upload_nameβ firmware name to be used with theupload_readsysfs nodereqsβ stores all requests information πtest_resultβ a test may use this to collect the result from the call of therequest_firmware*()calls used in their tests.
in order of priority we always keep first any setup error. if no setup errors were found, then we move on to the first error encountered while running the API.
note that for async calls this typically will be a successful result (0) unless of course you've used bogus parameters, or the system is out of memory π in the async case the callback is expected to do a bit more homework to figure out what happened β unfortunately the only information passed today on error is the fact that no firmware was found, so we can only assume -ENOENT on async calls if the firmware is NULL. not me crying over missing context π
req_firmwareβ ifsync_directis true this is set torequest_firmware_direct, otherwiserequest_firmwareπ₯
π¦ Description π¦
the errors you can expect, laid out for you bestie π
API specific π
0: success for sync β for async it means request was sent β¨-EINVAL: invalid parameters or request-ENOENT: files not found π
System environment πΈ
-ENOMEM: memory pressure on system-ENODEV: out of number of devices to test-EINVAL: an unexpected error has occurred π
π SEE ALSO π
- Kernel file
./lib/test_firmware.cβ go read it, it ate π
aaaand that's the whole page, you're officially educated πβ¨ this was brought to you by the ./lib crew, October 2026 era, filed under struct test_config(9) β periodt π
π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms