[PATCH 2/2] libertas: fix oops on the blackfin architecture

Dan Williams dcbw at redhat.com
Thu Sep 6 21:46:31 EDT 2007


On Fri, 2007-08-31 at 17:16 +0300, Vladimir Davydov wrote:
> Fixing memory alignment problems on the blackfin architecture (maybe on the 
> ARM also)

Committed; thanks.

> Signed-off-by: Vladimir Davydov <vladimir.davydov at promwad.com>
> 
> ---
> 
> diff -Naur libertas.orig/scan.c libertas/scan.c
> --- libertas.orig/scan.c        2007-08-30 15:45:59.000000000 +0300
> +++ libertas/scan.c     2007-08-31 15:33:59.000000000 +0300
> @@ -13,6 +13,8 @@
>  #include <net/ieee80211.h>
>  #include <net/iw_handler.h>
> 
> +#include <asm/unaligned.h>
> +
>  #include "host.h"
>  #include "decl.h"
>  #include "dev.h"
> @@ -886,7 +888,7 @@
> 
>         if (*bytesleft >= sizeof(beaconsize)) {
>                 /* 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);
>                 *pbeaconinfo += sizeof(beaconsize);
>         }
> @@ -1696,10 +1698,10 @@
>                 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);
> 
> -       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",
>                pscan->nr_sets);
> 




More information about the libertas-dev mailing list