Commit 09f5da1b authored by Antoine Ténart's avatar Antoine Ténart Committed by David S. Miller

net: pxa168_eth: fix Ethernet flow control status

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: default avatarAntoine Tenart <antoine.tenart@free-electrons.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 18b4bad3
...@@ -163,7 +163,7 @@ ...@@ -163,7 +163,7 @@
/* Bit definitions for Port status */ /* Bit definitions for Port status */
#define PORT_SPEED_100 (1 << 0) #define PORT_SPEED_100 (1 << 0)
#define FULL_DUPLEX (1 << 1) #define FULL_DUPLEX (1 << 1)
#define FLOW_CONTROL_ENABLED (1 << 2) #define FLOW_CONTROL_DISABLED (1 << 2)
#define LINK_UP (1 << 3) #define LINK_UP (1 << 3)
/* Bit definitions for work to be done */ /* Bit definitions for work to be done */
...@@ -885,7 +885,7 @@ static void handle_link_event(struct pxa168_eth_private *pep) ...@@ -885,7 +885,7 @@ static void handle_link_event(struct pxa168_eth_private *pep)
speed = 10; speed = 10;
duplex = (port_status & FULL_DUPLEX) ? 1 : 0; 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", netdev_info(dev, "link up, %d Mb/s, %s duplex, flow control %sabled\n",
speed, duplex ? "full" : "half", fc ? "en" : "dis"); speed, duplex ? "full" : "half", fc ? "en" : "dis");
if (!netif_carrier_ok(dev)) if (!netif_carrier_ok(dev))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment