From: Michael Buesch <mb@bu3sch.de>
To: David Woodhouse <dwmw2@infradead.org>
Cc: John Linville <linville@tuxdriver.com>,
Dan Williams <dcbw@redhat.com>,
libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 14/48] libertas: fix data packet size errors
Date: Mon, 10 Dec 2007 16:49:39 +0100 [thread overview]
Message-ID: <200712101649.39391.mb@bu3sch.de> (raw)
In-Reply-To: <E1J1kpI-0006lF-Pz@shinybook.infradead.org>
On Monday 10 December 2007 16:45:48 David Woodhouse wrote:
> From: Holger Schurig <hs4233@mail.mn-solutions.de>
> Date: Thu, 6 Dec 2007 13:50:30 +0100
>
> 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>
> ---
> drivers/net/wireless/libertas/cmdresp.c | 2 +-
> drivers/net/wireless/libertas/if_cs.c | 3 +++
> 2 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
> index 6a43de7..22a6973 100644
> --- a/drivers/net/wireless/libertas/cmdresp.c
> +++ b/drivers/net/wireless/libertas/cmdresp.c
> @@ -882,7 +882,7 @@ int lbs_process_rx_command(struct lbs_private *priv)
>
> if (adapter->cur_cmd->pdata_size) {
> 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;
Whoops, something's wrong here.
You are subtracting from a LE value.
> if (sz > *adapter->cur_cmd->pdata_size) {
> lbs_pr_err("response 0x%04x doesn't fit into "
> "buffer (%d > %d)\n", respcmd,
> diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
> index 54b1ba3..8508260 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);
--
Greetings Michael.
next prev parent reply other threads:[~2007-12-10 15:52 UTC|newest]
Thread overview: 141+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-10 15:45 [PATCH] [00/48] libertas update David Woodhouse
2007-12-10 15:45 ` [PATCH 01/48] libertas: Fix memory leak of RX skbs David Woodhouse
2007-12-10 15:45 ` [PATCH 02/48] libertas: Remove cmd_oid from struct cmd_ctrl_node David Woodhouse
2007-12-10 15:45 ` [PATCH 03/48] libertas: Consolidate lbs_host_to_card_done() function David Woodhouse
2007-12-10 15:45 ` [PATCH 04/48] libertas: select WIRELESS_EXT David Woodhouse
2007-12-10 15:45 ` [PATCH 05/48] libertas: remove cmd_ctrl_node->cmdflags David Woodhouse
2007-12-10 15:45 ` [PATCH 06/48] libertas: remove cmd_ctrl_node->status David Woodhouse
2007-12-10 15:45 ` [PATCH 07/48] libertas: make more functions static David Woodhouse
2007-12-10 16:08 ` Arnd Bergmann
2007-12-10 16:23 ` Holger Schurig
2007-12-10 16:30 ` David Woodhouse
2007-12-10 15:45 ` [PATCH 08/48] libertas: handy function to call firmware commands David Woodhouse
2007-12-10 15:45 ` [PATCH 09/48] libertas: Don't claim to have checksummed incoming packets David Woodhouse
2007-12-10 15:45 ` [PATCH 10/48] libertas: Move SET_BOOT2_VER command to if_usb where it belongs David Woodhouse
2007-12-10 15:45 ` [PATCH 11/48] libertas: Zero 'pdata_size' field in cmd_ctrl_node reliably David Woodhouse
2007-12-10 15:45 ` [PATCH 12/48] libertas: Byteswap cmdptr->size in lbs_cmd() David Woodhouse
2007-12-10 15:45 ` [PATCH 13/48] libertas: don't cast a pointer to pointer of David Woodhouse
2007-12-10 15:45 ` [PATCH 14/48] libertas: fix data packet size errors David Woodhouse
2007-12-10 15:49 ` Michael Buesch [this message]
2007-12-10 16:01 ` Holger Schurig
2007-12-10 16:03 ` David Woodhouse
2007-12-10 15:45 ` [PATCH 15/48] libertas: Use lbs_cmd() for setting Boot2 version David Woodhouse
2007-12-10 15:45 ` [PATCH 16/48] libertas: Remove SET_BOOT2_VER support from the Big Switch Statement David Woodhouse
2007-12-10 15:45 ` [PATCH 17/48] libertas: Fix endianness in boot2_version handling David Woodhouse
2007-12-10 15:45 ` [PATCH 18/48] libertas: implement new scanning logic David Woodhouse
2007-12-10 15:45 ` [PATCH 19/48] libertas: when usb_submit_usb fails, include the error code in the printk David Woodhouse
2007-12-10 15:45 ` [PATCH 20/48] libertas: Switch to using a callback function pointer for commands David Woodhouse
2007-12-10 15:45 ` [PATCH 21/48] libertas: endianness fixes David Woodhouse
2007-12-10 15:45 ` [PATCH 22/48] libertas: Don't set IW_ENCODE_NOKEY when returning WEP keys David Woodhouse
2007-12-10 15:45 ` [PATCH 23/48] libertas: Fix up error handling in lbs_setuserscan() David Woodhouse
2007-12-10 15:45 ` [PATCH 24/48] libertas: kill adapter->nr_cmd_pending David Woodhouse
2007-12-10 15:46 ` [PATCH 25/48] libertas: switch lbs_cmd() to take a callback function pointer David Woodhouse
2007-12-10 15:46 ` [PATCH 26/48] libertas: clean up lbs_thread() to make it slightly more readable David Woodhouse
2007-12-10 15:46 ` [PATCH 27/48] libertas: fix lbs_rtap attribute in sysfs David Woodhouse
2007-12-10 15:46 ` [PATCH 28/48] libertas: kill TxLockFlag David Woodhouse
2007-12-10 15:46 ` [PATCH 29/48] libertas: kill struct lbs_adapter David Woodhouse
2007-12-10 15:46 ` [PATCH 30/48] libertas: use lbs_host_to_card_done() in lbs_tx_timeout() David Woodhouse
2007-12-10 15:46 ` [PATCH 31/48] libertas: cope with device which already has firmware loaded David Woodhouse
2007-12-10 15:46 ` [PATCH 32/48] libertas: stop debugfs code looking at cmdpendingq David Woodhouse
2007-12-10 15:46 ` [PATCH 33/48] libertas: kill internal tx queue for PS mode David Woodhouse
2007-12-10 15:46 ` [PATCH 34/48] libertas: kill SendSinglePacket() function David Woodhouse
2007-12-10 15:46 ` [PATCH 35/48] libertas: move lbs_hard_start_xmit() into tx.c David Woodhouse
2007-12-10 15:46 ` [PATCH 36/48] libertas: kill lbs_process_tx() by merging it into lbs_hard_start_xmit() David Woodhouse
2007-12-10 15:46 ` [PATCH 37/48] libertas: clean up lbs_hard_start_xmit() David Woodhouse
2007-12-10 15:46 ` [PATCH 38/48] libertas: kill lbs_pre_start_xmit(), lib_mesh_pre_start_xmit() David Woodhouse
2007-12-10 15:46 ` [PATCH 39/48] libertas: stop using ieee80211 for radiotap device David Woodhouse
2007-12-10 15:46 ` [PATCH 40/48] libertas: set dev_addr on rtap device David Woodhouse
2007-12-10 15:46 ` [PATCH 41/48] libertas: TX packet is radiotap iff it comes from rtap_dev David Woodhouse
2007-12-10 15:46 ` [PATCH 42/48] libertas: free successfully transmitted skbs again David Woodhouse
2007-12-10 15:46 ` [PATCH 43/48] libertas: refactor the 'should I sleep?' decision in lbs_thread() David Woodhouse
2007-12-10 15:46 ` [PATCH 44/48] libertas: Move actual transmission to main thread David Woodhouse
2007-12-10 15:46 ` [PATCH 45/48] libertas: remove unreachable code from process_rxed_802_11_packet() David Woodhouse
2007-12-10 15:46 ` [PATCH 46/48] libertas: fix error cases in lbs_process_rxed_802_11_packet() David Woodhouse
2007-12-10 15:46 ` [PATCH 47/48] libertas: kill lbs_upload_tx_packet() David Woodhouse
2007-12-10 15:46 ` [PATCH 48/48] libertas: kill (IS,SET,UNSET)_MESH_FRAME David Woodhouse
2007-12-13 6:59 ` [PATCH 49/48] libertas: fix use-after-free error David Woodhouse
2007-12-13 6:59 ` [PATCH 50/48] libertas: add opaque extra argument to cmd callback function David Woodhouse
2007-12-13 6:59 ` [PATCH 51/48] libertas: clean up lbs_interrupt() David Woodhouse
2007-12-13 6:59 ` [PATCH 52/48] libertas: make lbs_cmd() usage nicer David Woodhouse
2007-12-13 6:59 ` [PATCH 53/48] libertas: remove pre_open_check() David Woodhouse
2007-12-13 6:59 ` [PATCH 54/48] libertas: clean up is_command_allowed_in_ps() David Woodhouse
2007-12-13 6:59 ` [PATCH 55/48] libertas: make rtap and normal modes mutually exclusive, clean up open/stop David Woodhouse
2007-12-13 6:59 ` [PATCH 56/48] libertas: improve reliability of firmware reloading on USB David Woodhouse
2007-12-13 6:59 ` [PATCH 57/48] libertas: switch to a waitqueue and timer for handling USB firmware load David Woodhouse
2007-12-13 6:59 ` [PATCH 58/48] libertas: don't run thread while firmware not yet ready David Woodhouse
2007-12-13 6:59 ` [PATCH 59/48] libertas: clean up direct command handling David Woodhouse
2007-12-13 6:59 ` [PATCH 60/48] libertas: add simple copyback command callback David Woodhouse
2007-12-13 6:59 ` [PATCH 61/48] libertas: convert GET_HW_SPEC to a direct command David Woodhouse
2007-12-13 6:59 ` [PATCH 62/48] libertas: switch USB cardp->priv to 'struct lbs_private *' and resulting fix David Woodhouse
2007-12-13 6:59 ` [PATCH 63/48] libertas: move removal of lbs_rtap file to lbs_stop_card() David Woodhouse
2007-12-13 6:59 ` [PATCH 64/48] libertas: wait for 'firmware ready' event from firmware after loading David Woodhouse
2007-12-13 6:59 ` [PATCH 65/48] libertas: rename and re-type bufvirtualaddr to cmdbuf David Woodhouse
2007-12-13 6:59 ` [PATCH 66/48] libertas: fix debug output in lbs_cmd_copyback() function David Woodhouse
2007-12-13 6:59 ` [PATCH 67/48] libertas: convert CMD_MESH_ACCESS to a direct command David Woodhouse
2007-12-13 6:59 ` [PATCH 68/48] libertas: remove casts from lbs_cmd() and lbs_cmd_with_response() macros David Woodhouse
2007-12-13 6:59 ` [PATCH 69/48] libertas: fix case of FWT_ACCESS_LIST_ROUTE and FWT_ACCESS_LIST_NEIGHBOR commands David Woodhouse
2007-12-13 6:59 ` [PATCH 70/48] libertas: convert DATA_RATE to a direct command David Woodhouse
2007-12-13 6:59 ` [PATCH 71/48] libertas: convert RF_CHANNEL " David Woodhouse
2007-12-13 6:59 ` [PATCH 72/48] libertas: endianness fixes for get_channel/set_channel David Woodhouse
2007-12-13 6:59 ` [PATCH 73/48] libertas: make some more functions static David Woodhouse
2007-12-13 6:59 ` [PATCH 74/48] libertas: fix sparse endianness warnings in scan.c David Woodhouse
2007-12-13 6:59 ` [PATCH 75/48] libertas: add lbs_mesh sysfs attribute for enabling mesh David Woodhouse
2007-12-13 6:59 ` [PATCH 76/48] libertas: kill references to mesh autostart David Woodhouse
2007-12-13 6:59 ` [PATCH 77/48] libertas: kill rx_urb_recall and eth_dev members of struct usb_card_rec David Woodhouse
2007-12-13 6:59 ` [PATCH 78/48] libertas: whitespace cleanup in host.h David Woodhouse
2007-12-13 6:59 ` [PATCH 79/48] libertas: allow get/set SSID on mshX device David Woodhouse
2007-12-13 6:59 ` [PATCH 80/48] libertas: allow setting channel " David Woodhouse
2007-12-13 6:59 ` [PATCH 81/48] libertas: add missing newline on debug message David Woodhouse
2007-12-13 6:59 ` [PATCH 82/48] libertas: disable mesh temporarily while setting eth channel/assoc David Woodhouse
2007-12-13 7:00 ` [PATCH 83/48] libertas: add debugging output to lbs_mesh_config() David Woodhouse
2007-12-13 7:00 ` [PATCH 84/48] libertas: be more careful about command responses matching cur_cmd David Woodhouse
2007-12-13 7:00 ` [PATCH 85/48] libertas: add missing newlines in debugging statements David Woodhouse
2007-12-13 7:00 ` [PATCH 86/48] libertas: slight cleanup of netif queue stop/wake David Woodhouse
2007-12-13 7:00 ` [PATCH 87/48] libertas: add lbs_host_sleep_cfg() command function David Woodhouse
2007-12-13 7:00 ` [PATCH 88/48] libertas: switch lbs_cmd() to take a _pointer_ to the command structure David Woodhouse
2007-12-13 7:00 ` [PATCH 89/48] libertas: make worker thread not freezable David Woodhouse
2007-12-13 7:00 ` [PATCH 90/48] libertas: implement suspend and resume core methods David Woodhouse
2007-12-13 7:00 ` [PATCH 91/48] libertas: implement suspend/resume for USB devices David Woodhouse
2007-12-13 7:00 ` [PATCH 92/48] libertas: add ethtool support for wake-on-lan configuration David Woodhouse
2007-12-13 7:00 ` [PATCH 93/48] libertas: make lbs_update_channel() function non-static David Woodhouse
2007-12-13 7:00 ` [PATCH 94/48] libertas: cope with both old and new mesh TLV values David Woodhouse
2007-12-13 7:00 ` [PATCH 95/48] libertas: pass channel argument directly to lbs_mesh_config() David Woodhouse
2007-12-13 7:00 ` [PATCH 96/48] libertas: use spin_is_locked() instead of spin_trylock() in lbs_interrupt() David Woodhouse
2007-12-16 22:58 ` [PATCH 97/48] libertas: don't exit worker thread until kthread_stop() is called David Woodhouse
2007-12-16 22:58 ` [PATCH 98/48] libertas: stop attempting to reset devices on unload David Woodhouse
2007-12-16 22:58 ` [PATCH 99/48] libertas: clean up if_usb driver David Woodhouse
2007-12-16 22:59 ` [PATCH 100/48] libertas: kill whitespace at end of lines David Woodhouse
2007-12-16 22:59 ` [PATCH 101/48] libertas: kill unused wait_option field in struct cmd_ctrl_node David Woodhouse
2007-12-16 22:59 ` [PATCH 102/48] libertas: rename and clean up DownloadcommandToStation David Woodhouse
2007-12-16 22:59 ` [PATCH 103/48] libertas: don't use __lbs_cmd() with empty callback in if_usb.c David Woodhouse
2007-12-16 22:59 ` [PATCH 104/48] libertas: remove some pointless checks for cmdnode buffer being present David Woodhouse
2007-12-16 22:59 ` [PATCH 105/48] libertas: introduce and use lbs_complete_command() for command completion David Woodhouse
2007-12-16 22:59 ` [PATCH 106/48] libertas: don't re-initialise cmdnode when taking it off the free queue David Woodhouse
2007-12-16 22:59 ` [PATCH 107/48] libertas: kill cleanup_cmdnode() David Woodhouse
2007-12-16 22:59 ` [PATCH 108/48] libertas: let __lbs_cmd() free its own cmdnode David Woodhouse
2007-12-16 22:59 ` [PATCH 109/48] libertas: kill pdata_buf member of struct cmd_ctrl_node David Woodhouse
2007-12-16 22:59 ` [PATCH 110/48] libertas: store command result in cmdnode instead of priv->cur_cmd_retcode David Woodhouse
2007-12-16 22:59 ` [PATCH 111/48] libertas: add __lbs_cmd_async() for asynchronous command submission David Woodhouse
2007-12-16 22:59 ` [PATCH 112/48] libertas: ensure response buffer size is always set for lbs_cmd_with_response David Woodhouse
2007-12-16 22:59 ` [PATCH 113/48] libertas: handle command timeout in main thread instead of directly in timer David Woodhouse
2007-12-16 22:59 ` [PATCH 114/48] libertas: kill 'addtail' argument to lbs_queue_cmd() and make it static David Woodhouse
2007-12-16 22:59 ` [PATCH 115/48] libertas: fix return from lbs_update_channel() David Woodhouse
2007-12-19 15:31 ` [PATCH 116/48] libertas: add SLEEP_PERIOD and FW_WAKE_METHOD command definitions David Woodhouse
2007-12-19 15:31 ` [PATCH 117/48] libertas: fix buffer handling of PS_MODE commands and responses David Woodhouse
2007-12-19 15:32 ` [PATCH 118/48] libertas: don't clear priv->dnld_sent after sending sleep confirm David Woodhouse
2007-12-19 15:32 ` [PATCH 119/48] libertas: handle HOST_AWAKE event by sending WAKEUP_CONFIRM command David Woodhouse
2007-12-19 15:32 ` [PATCH 120/48] libertas: allow for PS mode to be disabled when firmware doesn't support it David Woodhouse
2007-12-19 15:32 ` [PATCH 121/48] libertas: Check for PS mode support on USB devices David Woodhouse
2007-12-19 15:32 ` [PATCH 122/48] libertas: reduce explicit references to priv->cur_cmd->cmdbuf David Woodhouse
2007-12-19 15:32 ` [PATCH 123/48] libertas: use priv->upld_buf for command responses David Woodhouse
2007-12-19 15:33 ` [PATCH 124/48] libertas: discard DEFER responses to commands; let the timeout trigger David Woodhouse
2007-12-19 15:33 ` [PATCH 125/48] libertas: make lbs_submit_command always 'succeed' and set command timer David Woodhouse
2007-12-19 15:33 ` [PATCH 126/48] libertas: submit RSSI command on tx timeout, to check whether module is dead David Woodhouse
2007-12-19 15:33 ` [PATCH 127/48] libertas: convert RADIO_CONTROL to a direct command David Woodhouse
2007-12-19 15:33 ` [PATCH 128/48] libertas: convert INACTIVITY_TIMEOUT " David Woodhouse
2007-12-19 15:33 ` [PATCH 129/48] libertas: convert SLEEP_PARAMS " David Woodhouse
2007-12-19 15:33 ` [PATCH 130/48] libertas: convert SET_WEP " David Woodhouse
2007-12-19 15:33 ` [PATCH 131/48] libertas: convert ENABLE_RSN " David Woodhouse
2007-12-19 15:33 ` [PATCH 132/48] libertas: change inference about buffer size in lbs_cmd() David Woodhouse
2007-12-19 15:33 ` [PATCH 133/48] libertas: convert SUBSCRIBE_EVENT to a direct command David Woodhouse
2007-12-19 15:33 ` [PATCH 134/48] libertas: remove check for driver_lock in lbs_interrupt() David Woodhouse
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200712101649.39391.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=dcbw@redhat.com \
--cc=dwmw2@infradead.org \
--cc=libertas-dev@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).