Re: eepro100 driver update

From: Andrey Savochkin (saw@saw.sw.com.sg)
Date: Mon Mar 27 2000 - 07:44:18 EST


On Mon, Mar 27, 2000 at 03:34:22AM -0800, David S. Miller wrote:
> From: Andrey Savochkin <saw@saw.sw.com.sg>
>
> +#if defined(__LITTLE_ENDIAN)
> +#define clear_suspend(cmd) ((__u16 *)&(cmd)->cmd_status)[1] &= ~0x4000
> +#elif defined(__BIG_ENDIAN)
> +#define clear_suspend(cmd) ((__u16 *)&(cmd)->cmd_status)[0] &= ~0x4000
>
> The big endian version is wrong, think about it, the correct version
> is:
>
> #if defined(__LITTLE_ENDIAN)
> #define clear_suspend(cmd) ((__u16 *)&(cmd)->cmd_status)[1] &= ~0x4000
> #elif defined(__BIG_ENDIAN)
> #define clear_suspend(cmd) ((__u16 *)&(cmd)->cmd_status)[1] &= ~0x0040
> #else
>
> It seems very non-intuitive, but if you do all the byte swaps in
> your head, it makes complete sense, and what's more this is tested
> :-)

Ahmmm... Uhmmm...

Got it! I did "&= 1<<31" while we should clear the highest bit of the forth
byte. Thank you.

Linus, please apply the following patch on top of the previous one.

Best regards
                Andrey

--- drivers/net/eepro100.c 2000/03/27 10:59:38
+++ drivers/net/eepro100.c 2000/03/27 12:37:59
@@ -38,7 +38,7 @@
 
 static const char *version =
 "eepro100.c:v1.09j-t 9/29/99 Donald Becker http://cesdis.gsfc.nasa.gov/linux/drivers/eepro100.html\n"
-"eepro100.c: $Revision: 1.25 $ 2000/03/27 Modified by Andrey V. Savochkin <saw@saw.sw.com.sg> and others\n";
+"eepro100.c: $Revision: 1.27 $ 2000/03/27 Modified by Andrey V. Savochkin <saw@saw.sw.com.sg> and others\n";
 
 /* A few user-configurable values that apply to all boards.
    First set is undocumented and spelled per Intel recommendations. */
@@ -399,7 +399,7 @@
 #if defined(__LITTLE_ENDIAN)
 #define clear_suspend(cmd) ((__u16 *)&(cmd)->cmd_status)[1] &= ~0x4000
 #elif defined(__BIG_ENDIAN)
-#define clear_suspend(cmd) ((__u16 *)&(cmd)->cmd_status)[0] &= ~0x4000
+#define clear_suspend(cmd) ((__u16 *)&(cmd)->cmd_status)[1] &= ~0x0040
 #else
 #error Unsupported byteorder
 #endif

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Mar 31 2000 - 21:00:19 EST