Skip to content

Commit cf0d9a7

Browse files
rtkbt-maxholtmann
authored andcommitted
Bluetooth: btrtl: Fix an issue that failing to download the FW which size is over 32K bytes
Fix the issue that when the FW size is 32K+, it will fail for the download process because of the incorrect index. When firmware patch length is over 32K, "dl_cmd->index" may >= 0x80. It will be thought as "data end" that download process will not complete. However, driver should recount the index from 1. Signed-off-by: Max Chou <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 72bb169 commit cf0d9a7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/bluetooth/btrtl.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,11 @@ static int rtl_download_firmware(struct hci_dev *hdev,
401401

402402
BT_DBG("download fw (%d/%d)", i, frag_num);
403403

404-
dl_cmd->index = i;
404+
if (i > 0x7f)
405+
dl_cmd->index = (i & 0x7f) + 1;
406+
else
407+
dl_cmd->index = i;
408+
405409
if (i == (frag_num - 1)) {
406410
dl_cmd->index |= 0x80; /* data end */
407411
frag_len = fw_len % RTL_FRAG_LEN;

0 commit comments

Comments
 (0)