]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
netxen: fix physical port mapping
authorDhananjay Phadke <dhananjay@netxen.com>
Tue, 24 Feb 2009 11:42:59 +0000 (03:42 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 24 Feb 2009 11:42:59 +0000 (03:42 -0800)
The PCI function to physical port mapping is valid only for
old firmware. New firmware (4.0.0+) abstracts this.
So driver should never try to access phy using invalid
mapping. The behavior is unpredictable when PCI functions
4-7 are enabled on the same NIC.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/netxen/netxen_nic_main.c

index 9f33e442f40339f0d4d862c05c7be39f29502694..f42581157f4e29cfb2bb2549dad419cd134e9520 100644 (file)
@@ -795,9 +795,12 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
         * See if the firmware gave us a virtual-physical port mapping.
         */
        adapter->physical_port = adapter->portnum;
-       i = adapter->pci_read_normalize(adapter, CRB_V2P(adapter->portnum));
-       if (i != 0x55555555)
-               adapter->physical_port = i;
+       if (adapter->fw_major < 4) {
+               i = adapter->pci_read_normalize(adapter,
+                               CRB_V2P(adapter->portnum));
+               if (i != 0x55555555)
+                       adapter->physical_port = i;
+       }
 
        adapter->flags &= ~(NETXEN_NIC_MSI_ENABLED | NETXEN_NIC_MSIX_ENABLED);