linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libertas: fix memory alignment problems on the blackfin
@ 2008-07-09  0:18 Ihar Hrachyshka
  2008-07-09  0:24 ` Harvey Harrison
  2008-07-09 13:21 ` Holger Schurig
  0 siblings, 2 replies; 13+ messages in thread
From: Ihar Hrachyshka @ 2008-07-09  0:18 UTC (permalink / raw)
  To: libertas-dev; +Cc: linux-wireless

Fixing unaligned memory access on the blackfin architecture (maybe on the ARM also).

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@promwad.com>

---

diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index 343ed38..9dbfad3 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -567,11 +567,11 @@ static int lbs_process_bss(struct bss_descriptor *bss,
	pos += 8;

	/* beacon interval is 2 bytes long */
-	bss->beaconperiod = le16_to_cpup((void *) pos);
+	bss->beaconperiod = le16_to_cpu(get_unaligned((__le16 *)pos));
	pos += 2;

	/* capability information is 2 bytes long */
-	bss->capability = le16_to_cpup((void *) pos);
+	bss->capability = le16_to_cpu(get_unaligned((__le16 *)pos));
	lbs_deb_scan("process_bss: capabilities 0x%04x\n", bss->capability);
	pos += 2;


^ permalink raw reply related	[flat|nested] 13+ messages in thread
* [PATCH] libertas: fix memory alignment problems on the blackfin
@ 2008-01-25 13:15 Holger Schurig
  2008-01-25 15:46 ` Dan Williams
  0 siblings, 1 reply; 13+ messages in thread
From: Holger Schurig @ 2008-01-25 13:15 UTC (permalink / raw)
  To: John W. Linville; +Cc: Dan Williams, libertas-dev, linux-wireless

From: Ihar Hrachyshka <ihar.hrachyshka@promwad.com>

Fixing unaligned memory access on the blackfin architecture (maybe on the 
ARM also).

Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@promwad.com>
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>

Index: wireless-2.6/drivers/net/wireless/libertas/dev.h
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/libertas/dev.h	2008-01-25 10:03:29.000000000 +0100
+++ wireless-2.6/drivers/net/wireless/libertas/dev.h	2008-01-25 14:03:00.000000000 +0100
@@ -349,7 +349,7 @@ struct assoc_request {
 	u8 channel;
 	u8 band;
 	u8 mode;
-	u8 bssid[ETH_ALEN];
+	u8 bssid[ETH_ALEN] __attribute__ ((aligned (2)));
 
 	/** WEP keys */
 	struct enc_key wep_keys[4];
Index: wireless-2.6/drivers/net/wireless/libertas/assoc.c
===================================================================
--- wireless-2.6.orig/drivers/net/wireless/libertas/assoc.c	2008-01-25 14:03:14.000000000 +0100
+++ wireless-2.6/drivers/net/wireless/libertas/assoc.c	2008-01-25 14:03:33.000000000 +0100
@@ -12,8 +12,10 @@
 #include "cmd.h"
 
 
-static const u8 bssid_any[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
-static const u8 bssid_off[ETH_ALEN] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
+static const u8 bssid_any[ETH_ALEN]  __attribute__ ((aligned (2))) =
+	{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
+static const u8 bssid_off[ETH_ALEN]  __attribute__ ((aligned (2))) =
+	{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
 
 
 static int assoc_helper_essid(struct lbs_private *priv,

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-07-10 11:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-09  0:18 [PATCH] libertas: fix memory alignment problems on the blackfin Ihar Hrachyshka
2008-07-09  0:24 ` Harvey Harrison
2008-07-09  6:29   ` Ihar Hrachyshka
2008-07-10 11:29     ` Dan Williams
2008-07-09 13:21 ` Holger Schurig
2008-07-09 20:03   ` Ihar Hrachyshka
2008-07-09 20:07     ` Johannes Berg
2008-07-09 20:55       ` Ihar Hrachyshka
2008-07-09 21:02         ` Johannes Berg
2008-07-10  6:41     ` Holger Schurig
2008-07-09 21:07   ` Ihar Hrachyshka
  -- strict thread matches above, loose matches on Subject: below --
2008-01-25 13:15 Holger Schurig
2008-01-25 15:46 ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).