mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-07 15:18:15 +00:00
libertas: fix data packet size errors
I wondered about junk bytes at the end when using "lbsdebug +hex +host" until I noticed that firmware for the CF card sends my extranous bytes. It says "I have 20 bytes", I take 20 bytes, but the last 8 bytes of this are just data junk. Also, in the new lbs_cmd() where was a size miscalulation that made itself clear after fixing this bug. Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de> Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
abe3ed14d3
commit
09d4fad6e8
2 changed files with 4 additions and 1 deletions
|
@ -882,7 +882,7 @@ int lbs_process_rx_command(struct lbs_private *priv)
|
||||||
|
|
||||||
if (adapter->cur_cmd->pdata_size) {
|
if (adapter->cur_cmd->pdata_size) {
|
||||||
struct cmd_ds_gen *r = (struct cmd_ds_gen *)resp;
|
struct cmd_ds_gen *r = (struct cmd_ds_gen *)resp;
|
||||||
u16 sz = cpu_to_le16(resp->size);
|
u16 sz = cpu_to_le16(resp->size) - S_DS_GEN;
|
||||||
if (sz > *adapter->cur_cmd->pdata_size) {
|
if (sz > *adapter->cur_cmd->pdata_size) {
|
||||||
lbs_pr_err("response 0x%04x doesn't fit into "
|
lbs_pr_err("response 0x%04x doesn't fit into "
|
||||||
"buffer (%d > %d)\n", respcmd,
|
"buffer (%d > %d)\n", respcmd,
|
||||||
|
|
|
@ -373,6 +373,9 @@ static int if_cs_receive_cmdres(struct lbs_private *priv, u8 *data, u32 *len)
|
||||||
if (*len & 1)
|
if (*len & 1)
|
||||||
data[*len-1] = if_cs_read8(priv->card, IF_CS_C_CMD);
|
data[*len-1] = if_cs_read8(priv->card, IF_CS_C_CMD);
|
||||||
|
|
||||||
|
/* This is a workaround for a firmware that reports too much
|
||||||
|
* bytes */
|
||||||
|
*len -= 8;
|
||||||
ret = 0;
|
ret = 0;
|
||||||
out:
|
out:
|
||||||
lbs_deb_leave_args(LBS_DEB_CS, "ret %d, len %d", ret, *len);
|
lbs_deb_leave_args(LBS_DEB_CS, "ret %d, len %d", ret, *len);
|
||||||
|
|
Loading…
Add table
Reference in a new issue