>>>> + bt_dev_info(hdev, "QCA Downloading %s", config->fwname); >>>> + ret = request_firmware(&fw, config->fwname, &hdev->dev); >>>> + if (ret) { >>>> + bt_dev_err(hdev, "QCA Failed to request file: %s (%d)", >>>> + config->fwname, ret); >>>> + return ret; >>>> + } >>>> } else { >>>> bt_dev_err(hdev, "QCA Failed to request file: %s (%d)", >>>> config->fwname, ret); >>>> @@ -730,15 +768,38 @@ static inline void qca_get_nvm_name_generic(struct qca_fw_config *cfg, >>>> "qca/%snv%02x.b%02x", stem, rom_ver, bid); >>>> } >>>> >>>> +static void qca_get_nvm_name_by_board(char *fwname, size_t max_size, >>>> + const char *firmware_name, struct qca_btsoc_version ver, >>>> + enum qca_btsoc_type soc_type, u16 bid) >>>> +{ >>>> + const char *variant; >>>> + >>>> + /* Set the variant to empty by default */ >>>> + variant = ""; >>>> + /* hsp gf chip */ >>>> + if (soc_type == QCA_WCN6855) { >>>> + if ((le32_to_cpu(ver.soc_id) & QCA_HSP_GF_SOC_MASK) == QCA_HSP_GF_SOC_ID) >>>> + variant = "g"; >>> >>> Didn't you get the 'set but unused' here? >>> >> Yes, miss this part. Thank you! >>>> + } >>>> + >>>> + if (bid == 0x0) >>> >>> 0x0 or 0xff? >> board is set to 0 by default, 0x0 means read board id fails, then we should use >> the default one. > > What is the 'unprogrammed' board_id? On the WiFi side it's usually 0xff. > Yes, the 'unprogrammed' board_id should be 0xffff. Then 0 and 0xffff should use the default nvm. >>> >>>> + snprintf(fwname, max_size, "qca/%s.bin", firmware_name); >>>> + else if (bid & 0xff00) >>>> + snprintf(fwname, max_size, "qca/%s.b%x", firmware_name, bid); >>> >>> Doesn't ".b%02x" work in this case too? >>> >> No, board id are two bytes, it coudl be 0x0206, then we need .b206. Or it is >> 0x000a, then we need .b0a. > > What will ".b%02x" write in those two cases? > Yes, it works for both cases. Thanks! >>>> + else >>>> + snprintf(fwname, max_size, "qca/%s.b%02x", firmware_name, bid); >>>> +} >>>> + > >