diff options
author | Dhananjay Phadke <dhananjay@netxen.com> | 2008-06-16 01:59:45 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-06-17 23:07:00 -0400 |
commit | dcd56fdbaeae1008044687b973c4a3e852e8a726 (patch) | |
tree | b9b10cdf10ceefafe863c2231078a13f1b94923d /drivers/net/netxen/netxen_nic_main.c | |
parent | 3276fbad8385d8e86d85fad4d86dae669a045c65 (diff) |
netxen: cleanup debug messages
o Remove unnecessary debug prints and functions.
o Explicitly specify pci class (0x020000) to avoid enabling
management function.
Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/netxen/netxen_nic_main.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_main.c | 60 |
1 files changed, 25 insertions, 35 deletions
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index f903de0fe9ea..755f4abe2f55 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -72,13 +72,13 @@ static irqreturn_t netxen_msi_intr(int irq, void *data); | |||
72 | 72 | ||
73 | /* PCI Device ID Table */ | 73 | /* PCI Device ID Table */ |
74 | static struct pci_device_id netxen_pci_tbl[] __devinitdata = { | 74 | static struct pci_device_id netxen_pci_tbl[] __devinitdata = { |
75 | {PCI_DEVICE(0x4040, 0x0001)}, | 75 | {PCI_DEVICE(0x4040, 0x0001), PCI_DEVICE_CLASS(0x020000, ~0)}, |
76 | {PCI_DEVICE(0x4040, 0x0002)}, | 76 | {PCI_DEVICE(0x4040, 0x0002), PCI_DEVICE_CLASS(0x020000, ~0)}, |
77 | {PCI_DEVICE(0x4040, 0x0003)}, | 77 | {PCI_DEVICE(0x4040, 0x0003), PCI_DEVICE_CLASS(0x020000, ~0)}, |
78 | {PCI_DEVICE(0x4040, 0x0004)}, | 78 | {PCI_DEVICE(0x4040, 0x0004), PCI_DEVICE_CLASS(0x020000, ~0)}, |
79 | {PCI_DEVICE(0x4040, 0x0005)}, | 79 | {PCI_DEVICE(0x4040, 0x0005), PCI_DEVICE_CLASS(0x020000, ~0)}, |
80 | {PCI_DEVICE(0x4040, 0x0024)}, | 80 | {PCI_DEVICE(0x4040, 0x0024), PCI_DEVICE_CLASS(0x020000, ~0)}, |
81 | {PCI_DEVICE(0x4040, 0x0025)}, | 81 | {PCI_DEVICE(0x4040, 0x0025), PCI_DEVICE_CLASS(0x020000, ~0)}, |
82 | {0,} | 82 | {0,} |
83 | }; | 83 | }; |
84 | 84 | ||
@@ -286,10 +286,11 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
286 | int pci_func_id = PCI_FUNC(pdev->devfn); | 286 | int pci_func_id = PCI_FUNC(pdev->devfn); |
287 | DECLARE_MAC_BUF(mac); | 287 | DECLARE_MAC_BUF(mac); |
288 | 288 | ||
289 | printk(KERN_INFO "%s \n", netxen_nic_driver_string); | 289 | if (pci_func_id == 0) |
290 | printk(KERN_INFO "%s \n", netxen_nic_driver_string); | ||
290 | 291 | ||
291 | if (pdev->class != 0x020000) { | 292 | if (pdev->class != 0x020000) { |
292 | printk(KERN_ERR"NetXen function %d, class %x will not " | 293 | printk(KERN_DEBUG "NetXen function %d, class %x will not " |
293 | "be enabled.\n",pci_func_id, pdev->class); | 294 | "be enabled.\n",pci_func_id, pdev->class); |
294 | return -ENODEV; | 295 | return -ENODEV; |
295 | } | 296 | } |
@@ -448,8 +449,12 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
448 | */ | 449 | */ |
449 | adapter->curr_window = 255; | 450 | adapter->curr_window = 255; |
450 | 451 | ||
451 | /* initialize the adapter */ | 452 | if (netxen_nic_get_board_info(adapter) != 0) { |
452 | netxen_initialize_adapter_hw(adapter); | 453 | printk("%s: Error getting board config info.\n", |
454 | netxen_nic_driver_name); | ||
455 | err = -EIO; | ||
456 | goto err_out_iounmap; | ||
457 | } | ||
453 | 458 | ||
454 | /* | 459 | /* |
455 | * Adapter in our case is quad port so initialize it before | 460 | * Adapter in our case is quad port so initialize it before |
@@ -621,7 +626,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
621 | 626 | ||
622 | /* clear the register for future unloads/loads */ | 627 | /* clear the register for future unloads/loads */ |
623 | writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); | 628 | writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); |
624 | printk(KERN_INFO "State: 0x%0x\n", | 629 | printk(KERN_DEBUG "State: 0x%0x\n", |
625 | readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE))); | 630 | readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE))); |
626 | 631 | ||
627 | /* | 632 | /* |
@@ -643,6 +648,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
643 | /* | 648 | /* |
644 | * See if the firmware gave us a virtual-physical port mapping. | 649 | * See if the firmware gave us a virtual-physical port mapping. |
645 | */ | 650 | */ |
651 | adapter->physical_port = adapter->portnum; | ||
646 | i = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_V2P(adapter->portnum))); | 652 | i = readl(NETXEN_CRB_NORMALIZE(adapter, CRB_V2P(adapter->portnum))); |
647 | if (i != 0x55555555) | 653 | if (i != 0x55555555) |
648 | adapter->physical_port = i; | 654 | adapter->physical_port = i; |
@@ -658,22 +664,9 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
658 | goto err_out_free_dev; | 664 | goto err_out_free_dev; |
659 | } | 665 | } |
660 | 666 | ||
667 | netxen_nic_flash_print(adapter); | ||
661 | pci_set_drvdata(pdev, adapter); | 668 | pci_set_drvdata(pdev, adapter); |
662 | 669 | ||
663 | switch (adapter->ahw.board_type) { | ||
664 | case NETXEN_NIC_GBE: | ||
665 | printk(KERN_INFO "%s: QUAD GbE board initialized\n", | ||
666 | netxen_nic_driver_name); | ||
667 | break; | ||
668 | |||
669 | case NETXEN_NIC_XGBE: | ||
670 | printk(KERN_INFO "%s: XGbE board initialized\n", | ||
671 | netxen_nic_driver_name); | ||
672 | break; | ||
673 | } | ||
674 | |||
675 | adapter->driver_mismatch = 0; | ||
676 | |||
677 | return 0; | 670 | return 0; |
678 | 671 | ||
679 | err_out_free_dev: | 672 | err_out_free_dev: |
@@ -781,9 +774,6 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
781 | 774 | ||
782 | /* clear the register for future unloads/loads */ | 775 | /* clear the register for future unloads/loads */ |
783 | writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); | 776 | writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); |
784 | printk(KERN_INFO "State: 0x%0x\n", | ||
785 | readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE))); | ||
786 | |||
787 | /* leave the hw in the same state as reboot */ | 777 | /* leave the hw in the same state as reboot */ |
788 | writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE)); | 778 | writel(0, NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE)); |
789 | netxen_pinit_from_rom(adapter, 0); | 779 | netxen_pinit_from_rom(adapter, 0); |
@@ -794,7 +784,7 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev) | |||
794 | 784 | ||
795 | /* clear the register for future unloads/loads */ | 785 | /* clear the register for future unloads/loads */ |
796 | writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); | 786 | writel(0, NETXEN_CRB_NORMALIZE(adapter, NETXEN_CAM_RAM(0x1fc))); |
797 | printk(KERN_INFO "State: 0x%0x\n", | 787 | printk(KERN_DEBUG "State: 0x%0x\n", |
798 | readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE))); | 788 | readl(NETXEN_CRB_NORMALIZE(adapter, CRB_CMDPEG_STATE))); |
799 | 789 | ||
800 | i = 100; | 790 | i = 100; |
@@ -844,13 +834,15 @@ static int netxen_nic_open(struct net_device *netdev) | |||
844 | irq_handler_t handler; | 834 | irq_handler_t handler; |
845 | unsigned long flags = IRQF_SAMPLE_RANDOM; | 835 | unsigned long flags = IRQF_SAMPLE_RANDOM; |
846 | 836 | ||
837 | if (adapter->driver_mismatch) | ||
838 | return -EIO; | ||
839 | |||
847 | if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC) { | 840 | if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC) { |
848 | err = netxen_init_firmware(adapter); | 841 | err = netxen_init_firmware(adapter); |
849 | if (err != 0) { | 842 | if (err != 0) { |
850 | printk(KERN_ERR "Failed to init firmware\n"); | 843 | printk(KERN_ERR "Failed to init firmware\n"); |
851 | return -EIO; | 844 | return -EIO; |
852 | } | 845 | } |
853 | netxen_nic_flash_print(adapter); | ||
854 | 846 | ||
855 | /* setup all the resources for the Phantom... */ | 847 | /* setup all the resources for the Phantom... */ |
856 | /* this include the descriptors for rcv, tx, and status */ | 848 | /* this include the descriptors for rcv, tx, and status */ |
@@ -899,14 +891,12 @@ static int netxen_nic_open(struct net_device *netdev) | |||
899 | if (adapter->set_mtu) | 891 | if (adapter->set_mtu) |
900 | adapter->set_mtu(adapter, netdev->mtu); | 892 | adapter->set_mtu(adapter, netdev->mtu); |
901 | 893 | ||
902 | if (!adapter->driver_mismatch) | 894 | mod_timer(&adapter->watchdog_timer, jiffies); |
903 | mod_timer(&adapter->watchdog_timer, jiffies); | ||
904 | 895 | ||
905 | napi_enable(&adapter->napi); | 896 | napi_enable(&adapter->napi); |
906 | netxen_nic_enable_int(adapter); | 897 | netxen_nic_enable_int(adapter); |
907 | 898 | ||
908 | if (!adapter->driver_mismatch) | 899 | netif_start_queue(netdev); |
909 | netif_start_queue(netdev); | ||
910 | 900 | ||
911 | return 0; | 901 | return 0; |
912 | } | 902 | } |