summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/libertas/if_cs.c
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2007-12-06 13:50:30 +0100
committerDavid S. Miller <davem@davemloft.net>2008-01-28 15:06:08 -0800
commit09d4fad6e8972061fbb0e2e5ae9e686d84f57af6 (patch)
tree48c5151452013f7b551cf38743bebf26cf535a08 /drivers/net/wireless/libertas/if_cs.c
parentabe3ed14d39adcea9ae186cf741b15d11544458f (diff)
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>
Diffstat (limited to 'drivers/net/wireless/libertas/if_cs.c')
-rw-r--r--drivers/net/wireless/libertas/if_cs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index 54b1ba3e250a..8508260a286b 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -373,6 +373,9 @@ static int if_cs_receive_cmdres(struct lbs_private *priv, u8 *data, u32 *len)
if (*len & 1)
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;
out:
lbs_deb_leave_args(LBS_DEB_CS, "ret %d, len %d", ret, *len);