[Prism54-devel] Bug with endianess
Aurelien
slts@free.fr
Wed, 10 Dec 2003 02:30:51 +0100
> There's a bug in function
> prism54_get_freq
>
> You use macro MGT_GET_REQUEST_U32, which already converts le32_to_cpu,
> and later you also do
> fwrq->m = le32_to_cpu(channel);
> which converts back to le32 and iwconfig displays unnormal frequencies.
> The same bug also happens when state is not READY yet.
> The fix is just do simple :
>
> fwrq->m = channel;
> fwrq->e = ((channel < 1000) ? 0 : 3);
That's true. Thanks for the report. Moreover, it shows that this function is totally stupid (hehe that piece of code was written by intersil ;-)) Because we know that
MGT_GET_REQUEST_U32(priv, DOT11_OID_FREQUENCY...
will return a frequency and not a channel.
But the fix is not so simple because when the card is not ready (ie we cache the set requests), it is possible that channel is set but not frequency...
Aurelien
...And jutice for all