]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/netxen/netxen_nic_main.c
netxen: fix link status, link speed
[linux-2.6-omap-h63xx.git] / drivers / net / netxen / netxen_nic_main.c
index 91d209a8f6cb8e4997b74f2454bdec94c62b2545..7b8688e7bfa3d6bac8317c6aa7249a52c28af261 100644 (file)
@@ -1410,20 +1410,17 @@ static void netxen_nic_handle_phy_intr(struct netxen_adapter *adapter)
 
        port = adapter->physical_port;
 
-       if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
-               val = adapter->pci_read_normalize(adapter, CRB_XG_STATE);
-               linkup = (val >> port) & 1;
+       if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
+               val = adapter->pci_read_normalize(adapter, CRB_XG_STATE_P3);
+               val = XG_LINK_STATE_P3(adapter->ahw.pci_func, val);
+               linkup = (val == XG_LINK_UP_P3);
        } else {
-               if (adapter->fw_major < 4) {
-                       val = adapter->pci_read_normalize(adapter,
-                                       CRB_XG_STATE);
+               val = adapter->pci_read_normalize(adapter, CRB_XG_STATE);
+               if (adapter->ahw.board_type == NETXEN_NIC_GBE)
+                       linkup = (val >> port) & 1;
+               else {
                        val = (val >> port*8) & 0xff;
                        linkup = (val == XG_LINK_UP);
-               } else {
-                       val = adapter->pci_read_normalize(adapter,
-                               CRB_XG_STATE_P3);
-                       val = XG_LINK_STATE_P3(adapter->ahw.pci_func, val);
-                       linkup = (val == XG_LINK_UP_P3);
                }
        }