Skip to contentSkip to conversation

libertas: fix memory alignment problems on the blackfin

PATCH In review Holger Schurig 2 participants 2 messages Jan 25, 2008 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libertas: fix memory alignment problems on the blackfin

From: Ihar Hrachyshka <[email protected]>

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

drivers/net/wireless/libertas/dev.h +1 -1
Index: wireless-2.6/drivers/net/wireless/libertas/dev.h
===================================================================
@@ -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];
drivers/net/wireless/libertas/assoc.c +4 -2
Index: wireless-2.6/drivers/net/wireless/libertas/assoc.c
===================================================================
@@ -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,
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Holger Schurig

From: Ihar Hrachyshka <[email protected]>

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

Quoted 31 lines

Index: wireless-2.6/drivers/net/wireless/libertas/dev.h
===================================================================

drivers/net/wireless/libertas/dev.h +1 -1
@@ -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
===================================================================

drivers/net/wireless/libertas/assoc.c +4 -2
@@ -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,