aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorCliff Cai <cliff.cai@analog.com>2009-05-27 14:03:09 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-06-03 14:05:11 -0400
commit2c5b9e511fee1a856ffe6332e15c72a20d2c72f6 (patch)
tree4f89eeb26547218a87797b9e1f3f886af490213c /drivers
parent2493928e4dbefa1869413cf24b7f605b9b69d0d2 (diff)
wireless: libertas: fix unaligned accesses
Signed-off-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Bryan Wu <cooloney@kernel.org> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/libertas/cmdresp.c10
-rw-r--r--drivers/net/wireless/libertas/scan.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 14b3d562db09..c42d3faa2660 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -5,7 +5,7 @@
5#include <linux/delay.h> 5#include <linux/delay.h>
6#include <linux/if_arp.h> 6#include <linux/if_arp.h>
7#include <linux/netdevice.h> 7#include <linux/netdevice.h>
8 8#include <asm/unaligned.h>
9#include <net/iw_handler.h> 9#include <net/iw_handler.h>
10 10
11#include "host.h" 11#include "host.h"
@@ -154,11 +154,11 @@ static int lbs_ret_802_11_rssi(struct lbs_private *priv,
154 lbs_deb_enter(LBS_DEB_CMD); 154 lbs_deb_enter(LBS_DEB_CMD);
155 155
156 /* store the non average value */ 156 /* store the non average value */
157 priv->SNR[TYPE_BEACON][TYPE_NOAVG] = le16_to_cpu(rssirsp->SNR); 157 priv->SNR[TYPE_BEACON][TYPE_NOAVG] = get_unaligned_le16(&rssirsp->SNR);
158 priv->NF[TYPE_BEACON][TYPE_NOAVG] = le16_to_cpu(rssirsp->noisefloor); 158 priv->NF[TYPE_BEACON][TYPE_NOAVG] = get_unaligned_le16(&rssirsp->noisefloor);
159 159
160 priv->SNR[TYPE_BEACON][TYPE_AVG] = le16_to_cpu(rssirsp->avgSNR); 160 priv->SNR[TYPE_BEACON][TYPE_AVG] = get_unaligned_le16(&rssirsp->avgSNR);
161 priv->NF[TYPE_BEACON][TYPE_AVG] = le16_to_cpu(rssirsp->avgnoisefloor); 161 priv->NF[TYPE_BEACON][TYPE_AVG] = get_unaligned_le16(&rssirsp->avgnoisefloor);
162 162
163 priv->RSSI[TYPE_BEACON][TYPE_NOAVG] = 163 priv->RSSI[TYPE_BEACON][TYPE_NOAVG] =
164 CAL_RSSI(priv->SNR[TYPE_BEACON][TYPE_NOAVG], 164 CAL_RSSI(priv->SNR[TYPE_BEACON][TYPE_NOAVG],
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index e5e30b24cf02..601b54249677 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -1129,7 +1129,7 @@ static int lbs_ret_80211_scan(struct lbs_private *priv, unsigned long dummy,
1129 goto done; 1129 goto done;
1130 } 1130 }
1131 1131
1132 bytesleft = le16_to_cpu(scanresp->bssdescriptsize); 1132 bytesleft = get_unaligned_le16(&scanresp->bssdescriptsize);
1133 lbs_deb_scan("SCAN_RESP: bssdescriptsize %d\n", bytesleft); 1133 lbs_deb_scan("SCAN_RESP: bssdescriptsize %d\n", bytesleft);
1134 1134
1135 scanrespsize = le16_to_cpu(resp->size); 1135 scanrespsize = le16_to_cpu(resp->size);