Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=851b3e5e3de0feea7bfee634f99a940648de58c8 Commit: 851b3e5e3de0feea7bfee634f99a940648de58c8 Parent: 977b143c13e685081625704ac356b741d71c6a73 Author: Al Viro <[EMAIL PROTECTED]> AuthorDate: Wed Dec 19 19:20:12 2007 -0500 Committer: David S. Miller <[EMAIL PROTECTED]> CommitDate: Mon Jan 28 15:08:50 2008 -0800
airo: fix endianness bug in ->dBm handling airo_translate_scan() reads BSSListRid directly, does _not_ byteswap and uses ->dBm (__le16) as host-endian. Signed-off-by: Al Viro <[EMAIL PROTECTED]> Signed-off-by: John W. Linville <[EMAIL PROTECTED]> --- drivers/net/wireless/airo.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index 24fa0d6..6d4cc68 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c @@ -7239,6 +7239,7 @@ static inline char *airo_translate_scan(struct net_device *dev, char * current_val; /* For rates */ int i; char * buf; + u16 dBm; /* First entry *MUST* be the AP MAC address */ iwe.cmd = SIOCGIWAP; @@ -7277,16 +7278,18 @@ static inline char *airo_translate_scan(struct net_device *dev, iwe.u.freq.e = 1; current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_FREQ_LEN); + dBm = le16_to_cpu(bss->dBm); + /* Add quality statistics */ iwe.cmd = IWEVQUAL; if (ai->rssi) { - iwe.u.qual.level = 0x100 - bss->dBm; - iwe.u.qual.qual = airo_dbm_to_pct( ai->rssi, bss->dBm ); + iwe.u.qual.level = 0x100 - dBm; + iwe.u.qual.qual = airo_dbm_to_pct(ai->rssi, dBm); iwe.u.qual.updated = IW_QUAL_QUAL_UPDATED | IW_QUAL_LEVEL_UPDATED | IW_QUAL_DBM; } else { - iwe.u.qual.level = (bss->dBm + 321) / 2; + iwe.u.qual.level = (dBm + 321) / 2; iwe.u.qual.qual = 0; iwe.u.qual.updated = IW_QUAL_QUAL_INVALID | IW_QUAL_LEVEL_UPDATED - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html