linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/RFT] p54: Fix for big-endian architecture
@ 2008-10-09 15:19 Larry Finger
  2008-10-09 16:58 ` Christian Lamparter
  2008-10-13 21:44 ` Pavel Roskin
  0 siblings, 2 replies; 20+ messages in thread
From: Larry Finger @ 2008-10-09 15:19 UTC (permalink / raw)
  To: Pavel Roskin, Chr; +Cc: wireless

This patch is meant for testing on big-endian hardware. Every indication
is that the data in the bootrec structure is little endian. This patch fixes
a usage of the u32 data array as a string of u8's.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
---

Index: wireless-testing/drivers/net/wireless/p54/p54common.h
===================================================================
--- wireless-testing.orig/drivers/net/wireless/p54/p54common.h
+++ wireless-testing/drivers/net/wireless/p54/p54common.h
@@ -18,7 +18,10 @@
 struct bootrec {
 	__le32 code;
 	__le32 len;
-	u32 data[10];
+	union {
+		u32 data[10];
+		u8 data_char[40];
+	} __attribute__((packed));
 	__le16 rx_mtu;
 } __attribute__((packed));

Index: wireless-testing/drivers/net/wireless/p54/p54common.c
===================================================================
--- wireless-testing.orig/drivers/net/wireless/p54/p54common.c
+++ wireless-testing/drivers/net/wireless/p54/p54common.c
@@ -171,8 +171,8 @@ int p54_parse_firmware(struct ieee80211_
 			break;
 		case BR_CODE_COMPONENT_VERSION:
 			/* 24 bytes should be enough for all firmwares */
-			if (strnlen((unsigned char*)bootrec->data, 24) < 24)
-				fw_version = (unsigned char*)bootrec->data;
+			if (strnlen(bootrec->data_char, 24) < 24)
+				fw_version = bootrec->data_char;
 			break;
 		case BR_CODE_DESCR: {
 			struct bootrec_desc *desc =


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

end of thread, other threads:[~2008-10-14  8:16 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-09 15:19 [RFC/RFT] p54: Fix for big-endian architecture Larry Finger
2008-10-09 16:58 ` Christian Lamparter
2008-10-10  0:39   ` Larry Finger
2008-10-10  1:29     ` Christian Lamparter
2008-10-13 21:44 ` Pavel Roskin
2008-10-13 22:24   ` Johannes Berg
2008-10-13 22:36     ` Pavel Roskin
2008-10-13 22:55       ` Christian Lamparter
2008-10-13 22:55         ` Pavel Roskin
2008-10-13 23:05           ` Pavel Roskin
2008-10-13 23:07             ` Johannes Berg
2008-10-13 23:36               ` Pavel Roskin
2008-10-14  0:00                 ` Pavel Roskin
2008-10-14  0:15                   ` Christian Lamparter
2008-10-14  1:20                     ` Pavel Roskin
2008-10-14  2:10                       ` Christian Lamparter
2008-10-14  2:42                         ` [RFC/RFT][PATCH] p54: enable 2.4/5GHz spectrum by eeprom bits Christian Lamparter
2008-10-14  8:15                         ` [RFC/RFT] p54: Fix for big-endian architecture Johannes Berg
2008-10-13 23:31             ` Christian Lamparter
2008-10-13 23:36               ` Johannes Berg

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).