From: David S. Miller Date: Fri, 14 Aug 2009 02:59:44 +0000 (-0700) Subject: Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5c16807d3d196203d2d3c9fae51ac7e422091904;p=openwrt%2Fstaging%2Fblogic.git Merge branch 'master' of /linux/kernel/git/davem/net-2.6 Conflicts: drivers/net/netxen/netxen_nic_main.c --- 5c16807d3d196203d2d3c9fae51ac7e422091904 diff --cc drivers/net/netxen/netxen_nic_main.c index 98271f962ae4,28f270f5ac78..4e3fb30d66fe --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c @@@ -923,15 -905,19 +935,17 @@@ netxen_nic_attach(struct netxen_adapte struct nx_host_rds_ring *rds_ring; struct nx_host_tx_ring *tx_ring; + if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) + return 0; + err = netxen_init_firmware(adapter); - if (err != 0) { - printk(KERN_ERR "Failed to init firmware\n"); - return -EIO; - } + if (err) + return err; + + err = netxen_napi_add(adapter, netdev); + if (err) + return err; - if (adapter->fw_major < 4) - adapter->max_rds_rings = 3; - else - adapter->max_rds_rings = 2; - err = netxen_alloc_sw_resources(adapter); if (err) { printk(KERN_ERR "%s: Error in setting sw resources\n", @@@ -1245,13 -1189,17 +1260,15 @@@ static void __devexit netxen_nic_remove unregister_netdev(netdev); + cancel_work_sync(&adapter->watchdog_task); + cancel_work_sync(&adapter->tx_timeout_task); + - if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) { - netxen_nic_detach(adapter); - } + netxen_nic_detach(adapter); if (adapter->portnum == 0) - netxen_free_adapter_offload(adapter); + netxen_free_dummy_dma(adapter); netxen_teardown_intr(adapter); - netxen_free_sds_rings(&adapter->recv_ctx); netxen_cleanup_pci_map(adapter); @@@ -1277,7 -1225,11 +1294,10 @@@ netxen_nic_suspend(struct pci_dev *pdev if (netif_running(netdev)) netxen_nic_down(adapter, netdev); + cancel_work_sync(&adapter->watchdog_task); + cancel_work_sync(&adapter->tx_timeout_task); + - if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) - netxen_nic_detach(adapter); + netxen_nic_detach(adapter); pci_save_state(pdev); @@@ -1746,15 -1686,11 +1783,13 @@@ void netxen_watchdog_task(struct work_s static void netxen_tx_timeout(struct net_device *netdev) { - struct netxen_adapter *adapter = (struct netxen_adapter *) - netdev_priv(netdev); + struct netxen_adapter *adapter = netdev_priv(netdev); + + dev_err(&netdev->dev, "transmit timeout, resetting.\n"); - - SCHEDULE_WORK(&adapter->tx_timeout_task); + schedule_work(&adapter->tx_timeout_task); } -static void netxen_tx_timeout_task(struct work_struct *work) +static void netxen_reset_task(struct work_struct *work) { struct netxen_adapter *adapter = container_of(work, struct netxen_adapter, tx_timeout_task); @@@ -2025,14 -1844,6 +2060,11 @@@ static int __init netxen_init_module(vo { printk(KERN_INFO "%s\n", netxen_nic_driver_string); - if ((netxen_workq = create_singlethread_workqueue("netxen")) == NULL) - return -ENOMEM; - +#ifdef CONFIG_INET + register_netdevice_notifier(&netxen_netdev_cb); + register_inetaddr_notifier(&netxen_inetaddr_cb); +#endif + return pci_register_driver(&netxen_driver); } @@@ -2041,12 -1852,6 +2073,11 @@@ module_init(netxen_init_module) static void __exit netxen_exit_module(void) { pci_unregister_driver(&netxen_driver); + +#ifdef CONFIG_INET + unregister_inetaddr_notifier(&netxen_inetaddr_cb); + unregister_netdevice_notifier(&netxen_netdev_cb); +#endif - destroy_workqueue(netxen_workq); } module_exit(netxen_exit_module);