Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351822
b: refs/heads/master
c: fc40ca9
h: refs/heads/master
v: v3
  • Loading branch information
Sasha Levin authored and John W. Linville committed Jan 7, 2013
1 parent 88d80bb commit 243ccd7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 28 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6960af6dce1f0b2d9d1b4ddf75952d54e633b923
refs/heads/master: fc40ca92344a4e4a45bf916cf067e92085b881ea
30 changes: 3 additions & 27 deletions trunk/drivers/net/wireless/mwifiex/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,21 +786,6 @@ static int mwifiex_register_dev(struct mwifiex_adapter *adapter)
return 0;
}

/* This function reads one block of firmware data. */
static int mwifiex_get_fw_data(struct mwifiex_adapter *adapter,
u32 offset, u32 len, u8 *buf)
{
if (!buf || !len)
return -1;

if (offset + len > adapter->firmware->size)
return -1;

memcpy(buf, adapter->firmware->data + offset, len);

return 0;
}

static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
struct mwifiex_fw_image *fw)
{
Expand Down Expand Up @@ -836,23 +821,14 @@ static int mwifiex_prog_fw_w_helper(struct mwifiex_adapter *adapter,
dlen = 0;
} else {
/* copy the header of the fw_data to get the length */
if (firmware)
memcpy(&fwdata->fw_hdr, &firmware[tlen],
sizeof(struct fw_header));
else
mwifiex_get_fw_data(adapter, tlen,
sizeof(struct fw_header),
(u8 *)&fwdata->fw_hdr);
memcpy(&fwdata->fw_hdr, &firmware[tlen],
sizeof(struct fw_header));

dlen = le32_to_cpu(fwdata->fw_hdr.data_len);
dnld_cmd = le32_to_cpu(fwdata->fw_hdr.dnld_cmd);
tlen += sizeof(struct fw_header);

if (firmware)
memcpy(fwdata->data, &firmware[tlen], dlen);
else
mwifiex_get_fw_data(adapter, tlen, dlen,
(u8 *)fwdata->data);
memcpy(fwdata->data, &firmware[tlen], dlen);

fwdata->seq_num = cpu_to_le32(fw_seqnum);
tlen += dlen;
Expand Down

0 comments on commit 243ccd7

Please sign in to comment.