From: "John W. Linville" <linville@tuxdriver.com>
To: stable@kernel.org
Cc: linux-wireless@vger.kernel.org, Al Viro <viro@ftp.linux.org.uk>,
Al Viro <viro@zeniv.linux.org.uk>,
"John W. Linville" <linville@tuxdriver.com>
Subject: [PATCH] libertas: more endianness breakage
Date: Fri, 26 Oct 2007 17:04:28 -0400 [thread overview]
Message-ID: <11934326811535-git-send-email-linville@tuxdriver.com> (raw)
In-Reply-To: <11934326803330-git-send-email-linville@tuxdriver.com>
From: Al Viro <viro@ftp.linux.org.uk>
domain->header.len is le16 and has just been assigned
cpu_to_le16(arithmetical expression). And all fields of adapter->logmsg
are __le32; not a single 16-bit among them...
That's incremental to the previous one
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
drivers/net/wireless/libertas/11d.c | 2 +-
drivers/net/wireless/libertas/wext.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/libertas/11d.c b/drivers/net/wireless/libertas/11d.c
index 4cf0ff7..0560270 100644
--- a/drivers/net/wireless/libertas/11d.c
+++ b/drivers/net/wireless/libertas/11d.c
@@ -562,7 +562,7 @@ int libertas_cmd_802_11d_domain_info(wlan_private * priv,
nr_subband * sizeof(struct ieeetypes_subbandset));
cmd->size = cpu_to_le16(sizeof(pdomaininfo->action) +
- domain->header.len +
+ le16_to_cpu(domain->header.len) +
sizeof(struct mrvlietypesheader) +
S_DS_GEN);
} else {
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 2fcc3bf..873c405 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -973,7 +973,7 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev)
/* Quality by TX errors */
priv->wstats.discard.retries = priv->stats.tx_errors;
- tx_retries = le16_to_cpu(adapter->logmsg.retry);
+ tx_retries = le32_to_cpu(adapter->logmsg.retry);
if (tx_retries > 75)
tx_qual = (90 - tx_retries) * POOR / 15;
@@ -989,10 +989,10 @@ static struct iw_statistics *wlan_get_wireless_stats(struct net_device *dev)
(PERFECT - VERY_GOOD) / 50 + VERY_GOOD;
quality = min(quality, tx_qual);
- priv->wstats.discard.code = le16_to_cpu(adapter->logmsg.wepundecryptable);
- priv->wstats.discard.fragment = le16_to_cpu(adapter->logmsg.rxfrag);
+ priv->wstats.discard.code = le32_to_cpu(adapter->logmsg.wepundecryptable);
+ priv->wstats.discard.fragment = le32_to_cpu(adapter->logmsg.rxfrag);
priv->wstats.discard.retries = tx_retries;
- priv->wstats.discard.misc = le16_to_cpu(adapter->logmsg.ackfailure);
+ priv->wstats.discard.misc = le32_to_cpu(adapter->logmsg.ackfailure);
/* Calculate quality */
priv->wstats.qual.qual = max(quality, (u32)100);
--
1.5.2.4
next prev parent reply other threads:[~2007-10-26 21:07 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-26 21:04 [PATCH] Add get_unaligned to ieee80211_get_radiotap_len John W. Linville
2007-10-26 21:04 ` [PATCH] Improve sanity checks on injected packets John W. Linville
2007-10-26 21:04 ` [PATCH] mac80211: filter locally-originated multicast frames John W. Linville
2007-10-26 21:04 ` [PATCH] libertas: fix endianness breakage John W. Linville
2007-10-26 21:04 ` John W. Linville [this message]
2007-10-26 21:04 ` [PATCH] ieee80211: fix TKIP QoS bug John W. Linville
2007-10-26 21:04 ` [PATCH] mac80211: reorder association debug output John W. Linville
2007-10-26 21:04 ` [PATCH] mac80211: store channel info in sta_bss_list John W. Linville
2007-10-26 21:04 ` [PATCH] mac80211: store SSID " John W. Linville
2007-10-26 21:04 ` [PATCH] mac80211: honor IW_SCAN_THIS_ESSID in siwscan ioctl John W. Linville
2007-10-26 21:04 ` [PATCH] mac80211: only honor IW_SCAN_THIS_ESSID in STA, IBSS, and AP modes John W. Linville
2007-10-26 21:04 ` [PATCH] mac80211: make ieee802_11_parse_elems return void John W. Linville
2007-10-26 21:04 ` [PATCH] zd1201: avoid null ptr access of skb->dev John W. Linville
2007-10-26 21:04 ` [PATCH] ipw2100: send WEXT scan events John W. Linville
2007-10-26 21:04 ` [PATCH] rtl8187: Fix more frag bit checking, rts duration calc John W. Linville
2007-10-26 21:04 ` [PATCH] zd1211rw, fix oops when ejecting install media John W. Linville
2007-10-28 7:29 ` [PATCH] mac80211: honor IW_SCAN_THIS_ESSID in siwscan ioctl Michael Wu
2007-10-28 7:31 ` Michael Wu
2007-10-26 21:10 ` [PATCH] mac80211: reorder association debug output Johannes Berg
2007-10-26 21:23 ` John W. Linville
2007-10-26 21:31 ` [stable] " Greg KH
2007-10-26 21:44 ` Johannes Berg
2007-10-27 12:50 ` John W. Linville
2007-10-27 12:58 ` Johannes Berg
2007-10-28 7:57 ` Michael Wu
-- strict thread matches above, loose matches on Subject: below --
2007-10-10 1:30 [PATCH] Add get_unaligned to ieee80211_get_radiotap_len John W. Linville
2007-10-10 1:30 ` [PATCH] libertas: more endianness breakage John W. Linville
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=11934326811535-git-send-email-linville@tuxdriver.com \
--to=linville@tuxdriver.com \
--cc=linux-wireless@vger.kernel.org \
--cc=stable@kernel.org \
--cc=viro@ftp.linux.org.uk \
--cc=viro@zeniv.linux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.