dect
/
linux-2.6
Archived
13
0
Fork 0

[LIBERTAS]: fix oops on the blackfin architecture

Fixing memory alignment problems on the blackfin architecture (maybe on the
ARM also)

Signed-off-by: Vladimir Davydov <vladimir.davydov@promwad.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Vladimir Davydov 2007-09-06 21:45:36 -04:00 committed by David S. Miller
parent f31ce76b78
commit ac630c2b19
1 changed files with 5 additions and 3 deletions

View File

@ -13,6 +13,8 @@
#include <net/ieee80211.h> #include <net/ieee80211.h>
#include <net/iw_handler.h> #include <net/iw_handler.h>
#include <asm/unaligned.h>
#include "host.h" #include "host.h"
#include "decl.h" #include "decl.h"
#include "dev.h" #include "dev.h"
@ -888,7 +890,7 @@ static int libertas_process_bss(struct bss_descriptor * bss,
if (*bytesleft >= sizeof(beaconsize)) { if (*bytesleft >= sizeof(beaconsize)) {
/* Extract & convert beacon size from the command buffer */ /* Extract & convert beacon size from the command buffer */
beaconsize = le16_to_cpup((void *)*pbeaconinfo); beaconsize = le16_to_cpu(get_unaligned((u16 *)*pbeaconinfo));
*bytesleft -= sizeof(beaconsize); *bytesleft -= sizeof(beaconsize);
*pbeaconinfo += sizeof(beaconsize); *pbeaconinfo += sizeof(beaconsize);
} }
@ -1698,10 +1700,10 @@ int libertas_ret_80211_scan(wlan_private * priv, struct cmd_ds_command *resp)
goto done; goto done;
} }
bytesleft = le16_to_cpu(pscan->bssdescriptsize); bytesleft = le16_to_cpu(get_unaligned((u16*)&pscan->bssdescriptsize));
lbs_deb_scan("SCAN_RESP: bssdescriptsize %d\n", bytesleft); lbs_deb_scan("SCAN_RESP: bssdescriptsize %d\n", bytesleft);
scanrespsize = le16_to_cpu(resp->size); scanrespsize = le16_to_cpu(get_unaligned((u16*)&resp->size));
lbs_deb_scan("SCAN_RESP: returned %d AP before parsing\n", lbs_deb_scan("SCAN_RESP: returned %d AP before parsing\n",
pscan->nr_sets); pscan->nr_sets);