aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-commands.h
diff options
context:
space:
mode:
authorDaniel C Halperin <daniel.c.halperin@intel.com>2009-08-13 16:31:01 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-08-20 11:33:13 -0400
commit396887a2b2ad1ef5e5526fec34dec582baf39b81 (patch)
tree5730d04dedb1cbd97ececce93c039b642d8abaa1 /drivers/net/wireless/iwlwifi/iwl-commands.h
parent15993e08ac027b64b6f3400d32754966b4cac7b0 (diff)
iwlwifi: fix erroneous use of iwl_rx_packet.len as a length
The field called 'len' in struct iwl_rx_packet is in fact not just a length field but also includes some flags from the flow handler. In several places throughout the driver, this causes incorrect values to be interpreted as lengths when the field is improperly masked. In most situations the improper use is for debugging output, and simply results in an erroneous message, such as: [551933.070224] ieee80211 phy0: I iwl_rx_statistics Statistics notification received (480 vs -1367342620). which should read '(480 vs 484)'. In at least one case this could case bad things to happen: void iwl_rx_pm_debug_statistics_notif(struct iwl_priv *priv, struct iwl_rx_mem_buffer *rxb) { struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data; IWL_DEBUG_RADIO(priv, "Dumping %d bytes of unhandled " "notification for %s:\n", le32_to_cpu(pkt->len), get_cmd_string(pkt->hdr.cmd)); iwl_print_hex_dump(priv, IWL_DL_RADIO, pkt->u.raw, le32_to_cpu(pkt->len) ); } EXPORT_SYMBOL(iwl_rx_pm_debug_statistics_notif); Given the rampant misuse of this field without proper masking throughout the driver (every use but one), this patch renames the field from 'len' to 'len_n_flags' to reduce confusion. It also adds the proper masking when this field is used as a length value. Signed-off-by: Daniel C Halperin <daniel.c.halperin@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-commands.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index 9398ad7e42b1..f4303843ff9b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -3482,7 +3482,7 @@ struct iwl_wimax_coex_cmd {
3482 *****************************************************************************/ 3482 *****************************************************************************/
3483 3483
3484struct iwl_rx_packet { 3484struct iwl_rx_packet {
3485 __le32 len; 3485 __le32 len_n_flags;
3486 struct iwl_cmd_header hdr; 3486 struct iwl_cmd_header hdr;
3487 union { 3487 union {
3488 struct iwl3945_rx_frame rx_frame; 3488 struct iwl3945_rx_frame rx_frame;