aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/libertas/scan.c')
-rw-r--r--drivers/net/wireless/libertas/scan.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index 8f073ad1957f..fab93d8fe9c7 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -13,6 +13,8 @@
13#include <net/ieee80211.h> 13#include <net/ieee80211.h>
14#include <net/iw_handler.h> 14#include <net/iw_handler.h>
15 15
16#include <asm/unaligned.h>
17
16#include "host.h" 18#include "host.h"
17#include "decl.h" 19#include "decl.h"
18#include "dev.h" 20#include "dev.h"
@@ -888,7 +890,7 @@ static int libertas_process_bss(struct bss_descriptor * bss,
888 890
889 if (*bytesleft >= sizeof(beaconsize)) { 891 if (*bytesleft >= sizeof(beaconsize)) {
890 /* Extract & convert beacon size from the command buffer */ 892 /* Extract & convert beacon size from the command buffer */
891 beaconsize = le16_to_cpup((void *)*pbeaconinfo); 893 beaconsize = le16_to_cpu(get_unaligned((u16 *)*pbeaconinfo));
892 *bytesleft -= sizeof(beaconsize); 894 *bytesleft -= sizeof(beaconsize);
893 *pbeaconinfo += sizeof(beaconsize); 895 *pbeaconinfo += sizeof(beaconsize);
894 } 896 }
@@ -1698,10 +1700,10 @@ int libertas_ret_80211_scan(wlan_private * priv, struct cmd_ds_command *resp)
1698 goto done; 1700 goto done;
1699 } 1701 }
1700 1702
1701 bytesleft = le16_to_cpu(pscan->bssdescriptsize); 1703 bytesleft = le16_to_cpu(get_unaligned((u16*)&pscan->bssdescriptsize));
1702 lbs_deb_scan("SCAN_RESP: bssdescriptsize %d\n", bytesleft); 1704 lbs_deb_scan("SCAN_RESP: bssdescriptsize %d\n", bytesleft);
1703 1705
1704 scanrespsize = le16_to_cpu(resp->size); 1706 scanrespsize = le16_to_cpu(get_unaligned((u16*)&resp->size));
1705 lbs_deb_scan("SCAN_RESP: returned %d AP before parsing\n", 1707 lbs_deb_scan("SCAN_RESP: returned %d AP before parsing\n",
1706 pscan->nr_sets); 1708 pscan->nr_sets);
1707 1709