aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authordhananjay.phadke@gmail.com <dhananjay.phadke@gmail.com>2007-07-01 14:55:59 -0400
committerJeff Garzik <jeff@garzik.org>2007-07-02 08:24:52 -0400
commit644caeefb3bbf539e74b7098648ff0bfc9e52bb3 (patch)
treeebd1e3c09638190b25576ed970cea3cc0719170c /drivers/net
parentb8f59586cecdb612cd31f4d9e7904f46277ddd64 (diff)
RESEND [PATCH 1/3] NetXen: Fix issue of MSI not working correctly
NetXen driver uses PCI function 0 to provide the functionality of MSI. The patch makes driver check the bus master bit for function 0 and enable it after the card initialization. Signed-off-by: Dhananjay Phadke<dhananjay@netxen.com> Signed-off-by: Milan Bag <mbag@netxen.com> Signed-off-by: Wen Xiong <wenxiong@us.ibm.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/netxen/netxen_nic_main.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 6167b58d2731..663bc47c1f63 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -336,11 +336,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
336 if (pci_using_dac) 336 if (pci_using_dac)
337 netdev->features |= NETIF_F_HIGHDMA; 337 netdev->features |= NETIF_F_HIGHDMA;
338 338
339 if (pci_enable_msi(pdev)) { 339 if (pci_enable_msi(pdev))
340 adapter->flags &= ~NETXEN_NIC_MSI_ENABLED; 340 adapter->flags &= ~NETXEN_NIC_MSI_ENABLED;
341 printk(KERN_WARNING "%s: unable to allocate MSI interrupt" 341 else
342 " error\n", netxen_nic_driver_name);
343 } else
344 adapter->flags |= NETXEN_NIC_MSI_ENABLED; 342 adapter->flags |= NETXEN_NIC_MSI_ENABLED;
345 343
346 netdev->irq = pdev->irq; 344 netdev->irq = pdev->irq;
@@ -355,13 +353,6 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
355 /* initialize the adapter */ 353 /* initialize the adapter */
356 netxen_initialize_adapter_hw(adapter); 354 netxen_initialize_adapter_hw(adapter);
357 355
358#ifdef CONFIG_PPC
359 if ((adapter->ahw.boardcfg.board_type ==
360 NETXEN_BRDTYPE_P2_SB31_10G_IMEZ) &&
361 (pci_func_id == 2))
362 goto err_out_free_adapter;
363#endif /* CONFIG_PPC */
364
365 /* 356 /*
366 * Adapter in our case is quad port so initialize it before 357 * Adapter in our case is quad port so initialize it before
367 * initializing the ports 358 * initializing the ports
@@ -509,16 +500,22 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
509 NETXEN_CAM_RAM(0x1fc))); 500 NETXEN_CAM_RAM(0x1fc)));
510 if (val == 0x55555555) { 501 if (val == 0x55555555) {
511 /* This is the first boot after power up */ 502 /* This is the first boot after power up */
503 netxen_nic_read_w0(adapter, NETXEN_PCIE_REG(0x4), &val);
504 if (!(val & 0x4)) {
505 val |= 0x4;
506 netxen_nic_write_w0(adapter, NETXEN_PCIE_REG(0x4), val);
507 netxen_nic_read_w0(adapter, NETXEN_PCIE_REG(0x4), &val);
508 }
512 val = readl(NETXEN_CRB_NORMALIZE(adapter, 509 val = readl(NETXEN_CRB_NORMALIZE(adapter,
513 NETXEN_ROMUSB_GLB_SW_RESET)); 510 NETXEN_ROMUSB_GLB_SW_RESET));
514 printk(KERN_INFO"NetXen: read 0x%08x for reset reg.\n",val); 511 printk(KERN_INFO"NetXen: read 0x%08x for reset reg.\n",val);
515 if (val != 0x80000f) { 512 if (val != 0x80000f) {
516 /* clear the register for future unloads/loads */ 513 /* clear the register for future unloads/loads */
517 writel(0, NETXEN_CRB_NORMALIZE(adapter, 514 writel(0, NETXEN_CRB_NORMALIZE(adapter,
518 NETXEN_CAM_RAM(0x1fc))); 515 NETXEN_CAM_RAM(0x1fc)));
519 printk(KERN_ERR "ERROR in NetXen HW init sequence.\n"); 516 printk(KERN_ERR "ERROR in NetXen HW init sequence.\n");
520 err = -ENODEV; 517 err = -ENODEV;
521 goto err_out_free_dev; 518 goto err_out_free_dev;
522 } 519 }
523 520
524 /* clear the register for future unloads/loads */ 521 /* clear the register for future unloads/loads */