net: pxa168_eth: fix Ethernet flow control status
authorAntoine Ténart <antoine.tenart@free-electrons.com>
Tue, 30 Sep 2014 14:28:10 +0000 (16:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 Sep 2014 20:36:12 +0000 (16:36 -0400)
IEEE 802.3x Ethernet flow control is disabled when bit (1 << 2) is set
in the port status register. Fix the flow control detection in the link
event handling function which was relying on the opposite assumption.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/pxa168_eth.c

index c9920c322c8f81967a1b89be85d1b752dabc2587..46b86714e9d77d2737cf2f6939d223bae57417c1 100644 (file)
 /* Bit definitions for Port status */
 #define PORT_SPEED_100         (1 << 0)
 #define FULL_DUPLEX            (1 << 1)
-#define FLOW_CONTROL_ENABLED   (1 << 2)
+#define FLOW_CONTROL_DISABLED  (1 << 2)
 #define LINK_UP                        (1 << 3)
 
 /* Bit definitions for work to be done */
@@ -885,7 +885,7 @@ static void handle_link_event(struct pxa168_eth_private *pep)
                speed = 10;
 
        duplex = (port_status & FULL_DUPLEX) ? 1 : 0;
-       fc = (port_status & FLOW_CONTROL_ENABLED) ? 1 : 0;
+       fc = (port_status & FLOW_CONTROL_DISABLED) ? 0 : 1;
        netdev_info(dev, "link up, %d Mb/s, %s duplex, flow control %sabled\n",
                    speed, duplex ? "full" : "half", fc ? "en" : "dis");
        if (!netif_carrier_ok(dev))