提交 f9951c13 编写于 作者: H Hante Meuleman 提交者: John W. Linville

brcmfmac: simplify sdio code download routine.

brcmf_sdio_download_code_file is using a loop to send small blobs
of data. This is unnecessarily complex and was simplified with this
patch.
Reviewed-by: NArend Van Spriel <arend@broadcom.com>
Reviewed-by: NFranky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: NPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: NDaniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: NHante Meuleman <meuleman@broadcom.com>
Signed-off-by: NArend van Spriel <arend@broadcom.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 79c868e5
...@@ -3291,30 +3291,15 @@ static int brcmf_sdio_download_code_file(struct brcmf_sdio *bus, ...@@ -3291,30 +3291,15 @@ static int brcmf_sdio_download_code_file(struct brcmf_sdio *bus,
const struct firmware *fw) const struct firmware *fw)
{ {
int err; int err;
int offset;
int address;
int len;
brcmf_dbg(TRACE, "Enter\n"); brcmf_dbg(TRACE, "Enter\n");
err = 0; err = brcmf_sdiod_ramrw(bus->sdiodev, true, bus->ci->rambase,
offset = 0; (u8 *)fw->data, fw->size);
address = bus->ci->rambase; if (err)
while (offset < fw->size) {
len = ((offset + MEMBLOCK) < fw->size) ? MEMBLOCK :
fw->size - offset;
err = brcmf_sdiod_ramrw(bus->sdiodev, true, address,
(u8 *)&fw->data[offset], len);
if (err) {
brcmf_err("error %d on writing %d membytes at 0x%08x\n", brcmf_err("error %d on writing %d membytes at 0x%08x\n",
err, len, address); err, (int)fw->size, bus->ci->rambase);
return err; else if (!brcmf_sdio_verifymemory(bus->sdiodev, bus->ci->rambase,
}
offset += len;
address += len;
}
if (!err)
if (!brcmf_sdio_verifymemory(bus->sdiodev, bus->ci->rambase,
(u8 *)fw->data, fw->size)) (u8 *)fw->data, fw->size))
err = -EIO; err = -EIO;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册