* p54: fix EEPROM structure endianness
@ 2008-02-29 12:56 Johannes Berg
2008-03-02 12:24 ` Florian Fainelli
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2008-02-29 12:56 UTC (permalink / raw)
To: John Linville; +Cc: Michael Wu, linux-wireless
Since the EEPROM structure is read from hardware, it is
always little endian, annotate that in the struct and
make sure to convert where applicable.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Michael Wu <flamingice@sourmilk.net>
---
Does anybody have a p54 card and big endian hardware to test it on? I'm
fairly sure this is a correct change but if it currently works on big
endian the change would be bad (and I'd be rather surprised.)
drivers/net/wireless/p54common.c | 2 +-
drivers/net/wireless/p54common.h | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
--- everything.orig/drivers/net/wireless/p54common.c 2008-02-28 17:26:23.000000000 +0100
+++ everything/drivers/net/wireless/p54common.c 2008-02-29 13:53:05.000000000 +0100
@@ -212,7 +212,7 @@ int p54_parse_eeprom(struct ieee80211_hw
int err;
wrap = (struct eeprom_pda_wrap *) eeprom;
- entry = (void *)wrap->data + wrap->len;
+ entry = (void *)wrap->data + le16_to_cpu(wrap->len);
i += 2;
i += le16_to_cpu(entry->len)*2;
while (i < len) {
--- everything.orig/drivers/net/wireless/p54common.h 2008-02-19 23:10:32.000000000 +0100
+++ everything/drivers/net/wireless/p54common.h 2008-02-29 13:53:05.000000000 +0100
@@ -53,10 +53,10 @@ struct pda_entry {
} __attribute__ ((packed));
struct eeprom_pda_wrap {
- u32 magic;
- u16 pad;
- u16 len;
- u32 arm_opcode;
+ __le32 magic;
+ __le16 pad;
+ __le16 len;
+ __le32 arm_opcode;
u8 data[0];
} __attribute__ ((packed));
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: p54: fix EEPROM structure endianness
2008-02-29 12:56 p54: fix EEPROM structure endianness Johannes Berg
@ 2008-03-02 12:24 ` Florian Fainelli
2008-03-02 13:40 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Florian Fainelli @ 2008-03-02 12:24 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, Michael Wu, linux-wireless
Hi Johannes,
Le vendredi 29 f=E9vrier 2008, Johannes Berg a =E9crit=A0:
> ---
> Does anybody have a p54 card and big endian hardware to test it on? I=
'm
> fairly sure this is a correct change but if it currently works on big
> endian the change would be bad (and I'd be rather surprised.)
>
This patch fixes the eeprom fields reading errors that I mentionned on =
the=20
list : http://article.gmane.org/gmane.linux.kernel.wireless.general/117=
94.=20
This also makes the dongle work on my iBook G4.
Can you pleas merge it ?
Thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: p54: fix EEPROM structure endianness
2008-03-02 12:24 ` Florian Fainelli
@ 2008-03-02 13:40 ` Johannes Berg
2008-03-02 14:59 ` Florian Fainelli
0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2008-03-02 13:40 UTC (permalink / raw)
To: Florian Fainelli; +Cc: John Linville, Michael Wu, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 661 bytes --]
On Sun, 2008-03-02 at 13:24 +0100, Florian Fainelli wrote:
> Hi Johannes,
>
> Le vendredi 29 février 2008, Johannes Berg a écrit :
> > ---
> > Does anybody have a p54 card and big endian hardware to test it on? I'm
> > fairly sure this is a correct change but if it currently works on big
> > endian the change would be bad (and I'd be rather surprised.)
> >
>
> This patch fixes the eeprom fields reading errors that I mentionned on the
> list : http://article.gmane.org/gmane.linux.kernel.wireless.general/11794.
> This also makes the dongle work on my iBook G4.
>
> Can you pleas merge it ?
You mean my patch fixes it?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: p54: fix EEPROM structure endianness
2008-03-02 13:40 ` Johannes Berg
@ 2008-03-02 14:59 ` Florian Fainelli
2008-03-02 15:11 ` Johannes Berg
0 siblings, 1 reply; 5+ messages in thread
From: Florian Fainelli @ 2008-03-02 14:59 UTC (permalink / raw)
To: Johannes Berg; +Cc: John Linville, Michael Wu, linux-wireless
Hi Johannes,
Le dimanche 2 mars 2008, Johannes Berg a =E9crit=A0:
> You mean my patch fixes it?
Yes absolutely, before, I got error from the eeprom parsing function th=
at it=20
could not read all required eeprom fields, leading to a non-working wir=
eless=20
interface, causing oopses sometimes.
With your patch, MAC address, calibration values are read correctly and=
I can=20
use the USB dongle successfully. Of course the dongle does not oops any=
more=20
on big-endian hosts.
Tested-by: Florian Fainelli <florian.fainelli@telecomint.eu>
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: p54: fix EEPROM structure endianness
2008-03-02 14:59 ` Florian Fainelli
@ 2008-03-02 15:11 ` Johannes Berg
0 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2008-03-02 15:11 UTC (permalink / raw)
To: Florian Fainelli; +Cc: John Linville, Michael Wu, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 758 bytes --]
> Le dimanche 2 mars 2008, Johannes Berg a écrit :
> > You mean my patch fixes it?
>
> Yes absolutely, before, I got error from the eeprom parsing function that it
> could not read all required eeprom fields, leading to a non-working wireless
> interface, causing oopses sometimes.
>
> With your patch, MAC address, calibration values are read correctly and I can
> use the USB dongle successfully. Of course the dongle does not oops anymore
> on big-endian hosts.
>
> Tested-by: Florian Fainelli <florian.fainelli@telecomint.eu>
Great, thanks for testing, confirms my suspicions about the eeprom
reading code. Can you do me a favour and also test my patch titled
"[PATCH] p54: fix eeprom parser length sanity checks"?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-03-02 15:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-29 12:56 p54: fix EEPROM structure endianness Johannes Berg
2008-03-02 12:24 ` Florian Fainelli
2008-03-02 13:40 ` Johannes Berg
2008-03-02 14:59 ` Florian Fainelli
2008-03-02 15:11 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox