aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/s2io.c
diff options
context:
space:
mode:
authorSreenivasa Honnur <Sreenivasa.Honnur@neterion.com>2008-01-14 20:23:04 -0500
committerJeff Garzik <jeff@garzik.org>2008-01-18 14:41:50 -0500
commit5f490c9680561e31bf0003693f20e0c7333bbeff (patch)
treeb21e86105014ad182cb7e0259c23319065f739dd /drivers/net/s2io.c
parent2a49128f0a6edee337174ea341c1d6d7565be350 (diff)
S2io: Fixed synchronization between scheduling of napi with card reset and close
- Fixed synchronization between scheduling of napi with card reset and close by moving the enabling and disabling of napi to card up and card down functions respectively instead of open and close. Signed-off-by: Surjit Reang <surjit.reang@neterion.com> Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/s2io.c')
-rw-r--r--drivers/net/s2io.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index fa57c49c0c51..f2ba944e035e 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -84,7 +84,7 @@
84#include "s2io.h" 84#include "s2io.h"
85#include "s2io-regs.h" 85#include "s2io-regs.h"
86 86
87#define DRV_VERSION "2.0.26.10" 87#define DRV_VERSION "2.0.26.17"
88 88
89/* S2io Driver name & version. */ 89/* S2io Driver name & version. */
90static char s2io_driver_name[] = "Neterion"; 90static char s2io_driver_name[] = "Neterion";
@@ -3848,8 +3848,6 @@ static int s2io_open(struct net_device *dev)
3848 netif_carrier_off(dev); 3848 netif_carrier_off(dev);
3849 sp->last_link_state = 0; 3849 sp->last_link_state = 0;
3850 3850
3851 napi_enable(&sp->napi);
3852
3853 if (sp->config.intr_type == MSI_X) { 3851 if (sp->config.intr_type == MSI_X) {
3854 int ret = s2io_enable_msi_x(sp); 3852 int ret = s2io_enable_msi_x(sp);
3855 3853
@@ -3892,7 +3890,6 @@ static int s2io_open(struct net_device *dev)
3892 return 0; 3890 return 0;
3893 3891
3894hw_init_failed: 3892hw_init_failed:
3895 napi_disable(&sp->napi);
3896 if (sp->config.intr_type == MSI_X) { 3893 if (sp->config.intr_type == MSI_X) {
3897 if (sp->entries) { 3894 if (sp->entries) {
3898 kfree(sp->entries); 3895 kfree(sp->entries);
@@ -3932,7 +3929,6 @@ static int s2io_close(struct net_device *dev)
3932 return 0; 3929 return 0;
3933 3930
3934 netif_stop_queue(dev); 3931 netif_stop_queue(dev);
3935 napi_disable(&sp->napi);
3936 /* Reset card, kill tasklet and free Tx and Rx buffers. */ 3932 /* Reset card, kill tasklet and free Tx and Rx buffers. */
3937 s2io_card_down(sp); 3933 s2io_card_down(sp);
3938 3934
@@ -6796,6 +6792,8 @@ static void do_s2io_card_down(struct s2io_nic * sp, int do_io)
6796 struct XENA_dev_config __iomem *bar0 = sp->bar0; 6792 struct XENA_dev_config __iomem *bar0 = sp->bar0;
6797 unsigned long flags; 6793 unsigned long flags;
6798 register u64 val64 = 0; 6794 register u64 val64 = 0;
6795 struct config_param *config;
6796 config = &sp->config;
6799 6797
6800 if (!is_s2io_card_up(sp)) 6798 if (!is_s2io_card_up(sp))
6801 return; 6799 return;
@@ -6807,6 +6805,10 @@ static void do_s2io_card_down(struct s2io_nic * sp, int do_io)
6807 } 6805 }
6808 clear_bit(__S2IO_STATE_CARD_UP, &sp->state); 6806 clear_bit(__S2IO_STATE_CARD_UP, &sp->state);
6809 6807
6808 /* Disable napi */
6809 if (config->napi)
6810 napi_disable(&sp->napi);
6811
6810 /* disable Tx and Rx traffic on the NIC */ 6812 /* disable Tx and Rx traffic on the NIC */
6811 if (do_io) 6813 if (do_io)
6812 stop_nic(sp); 6814 stop_nic(sp);
@@ -6900,6 +6902,11 @@ static int s2io_card_up(struct s2io_nic * sp)
6900 DBG_PRINT(INFO_DBG, "Buf in ring:%d is %d:\n", i, 6902 DBG_PRINT(INFO_DBG, "Buf in ring:%d is %d:\n", i,
6901 atomic_read(&sp->rx_bufs_left[i])); 6903 atomic_read(&sp->rx_bufs_left[i]));
6902 } 6904 }
6905
6906 /* Initialise napi */
6907 if (config->napi)
6908 napi_enable(&sp->napi);
6909
6903 /* Maintain the state prior to the open */ 6910 /* Maintain the state prior to the open */
6904 if (sp->promisc_flg) 6911 if (sp->promisc_flg)
6905 sp->promisc_flg = 0; 6912 sp->promisc_flg = 0;