starfire VLAN fix
authorAl Viro <viro@ftp.linux.org.uk>
Sun, 9 Dec 2007 17:00:54 +0000 (17:00 +0000)
committerJeff Garzik <jeff@garzik.org>
Fri, 14 Dec 2007 20:26:04 +0000 (15:26 -0500)
Recognized VLAN ids are set via writew(), should go in host-endian.
That's a long-standing bug, BTW - see http://lkml.org/lkml/2004/2/27/180
for example.  What happens is that card gets VLAN id table populated by
byteswapped values on little-endian boxen (so 257 works as expected, 256
and 258 do not, etc.).  Bug is easily reproduced, patch fixes it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/starfire.c

index bcc430bd9e493b0f89d0f0c85cae54debfcb9d86..6e00dc857afabf6b2d5ef3a20ae900d8083b622b 100644 (file)
@@ -1742,7 +1742,7 @@ static void set_rx_mode(struct net_device *dev)
                        if (vlan_group_get_device(np->vlgrp, i)) {
                                if (vlan_count >= 32)
                                        break;
-                               writew(cpu_to_be16(i), filter_addr);
+                               writew(i, filter_addr);
                                filter_addr += 16;
                                vlan_count++;
                        }