2020/9/22

request_firmware : read file from kernel

kernel driver 可以從 filesystem 中讀檔。
用 request_firmware( ) 這個function。

file 的 path 呢?
在 driver/base/firmware_class.c:
/* direct firmware loading support */
static char fw_path_para[256];
static const char * const fw_path[] = {
    fw_path_para,
    "/lib/firmware/updates/" UTS_RELEASE,
    "/lib/firmware/updates",
    "/lib/firmware/" UTS_RELEASE,
    "/lib/firmware"
};

/*
 * Typical usage is that passing 'firmware_class.path=$CUSTOMIZED_PATH'
 * from kernel command line because firmware_class is generally built in
 * kernel instead of module.
 */
module_param_string(path, fw_path_para, sizeof(fw_path_para), 0644);
MODULE_PARM_DESC(path, "customized firmware image search path with a higher priority than default path");
其中 fw_path_para 是 啟動 kernel 時指定的

沒有留言:

張貼留言