• Ping-Ke Shih's avatar
    wifi: rtw89: load RFK log format string from firmware file · 7a9192ee
    Ping-Ke Shih authored
    To debug RFK (RF calibration) in firmware, it sends log via firmware C2H
    events to driver with string format ID and four arguments. Load formatted
    string from firmware file, and the string ID can get back its string. Then,
    use regular print format to show the message.
    
    This firmware element layout looks like
    
        +============================================+
        |  elm ID  | elm size | version  |           |
        +----------+----------+----------+-----------+
        |                     | nr |rsvd |rfk_id|rsvd|
        +--------------------------------------------+
        | offset[] (__le16 * nr)                     |
        | ...                                        |
        +--------------------------------------------+
        | formatted string with null termintor (*nr) |
        | ...                                        |
        +============================================+
    
     * a firmware file can contains more than one elements with this element ID
       named RTW89_FW_ELEMENT_ID_RFKLOG_FMT (19), because many RFK needs its
       own formatted strings, so add 'rfk_id' to know it belongs to which RFK.
     * the 'formatted string' just follow 'offset[]' without padding to align
       32bits.
    Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
    Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
    Link: https://msgid.link/20231213005054.10568-4-pkshih@realtek.com
    7a9192ee
core.h 139 KB