qlge: Fix carrier on condition.
authorRon Mercer <ron.mercer@qlogic.com>
Thu, 2 Jul 2009 06:06:08 +0000 (06:06 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 4 Jul 2009 02:10:26 +0000 (19:10 -0700)
We were turning on the carrier without verifying the link was up.
This adds link up to the link initialize check before turning carrier
on.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/qlge/qlge_main.c

index 1da831e99422286b3691bd374f0a8d1e815bc1b1..c226257dc432d4900a04569eaa86ca00bcd76226 100644 (file)
@@ -3343,7 +3343,11 @@ static int ql_adapter_up(struct ql_adapter *qdev)
        }
        set_bit(QL_ADAPTER_UP, &qdev->flags);
        ql_alloc_rx_buffers(qdev);
-       if ((ql_read32(qdev, STS) & qdev->port_init))
+       /* If the port is initialized and the
+        * link is up the turn on the carrier.
+        */
+       if ((ql_read32(qdev, STS) & qdev->port_init) &&
+                       (ql_read32(qdev, STS) & qdev->port_link_up))
                netif_carrier_on(qdev->ndev);
        ql_enable_interrupts(qdev);
        ql_enable_all_completion_interrupts(qdev);