From 92b84437a6cddf5dc00ab179e38d2baa2264d46a Mon Sep 17 00:00:00 2001 From: Sivakumar Subramani Date: Thu, 6 Sep 2007 06:51:14 -0400 Subject: S2io: Check for device state before handling traffic - Added check to return from the traffic handling function, if the card status is DOWN. - Implemented Jeff's comments on incorrect return value in s2io_poll function. Signed-off-by: Sivakumar Subramani Signed-off-by: Santosh Rastapur Signed-off-by: Ramkrishna Vepa Signed-off-by: Jeff Garzik --- drivers/net/s2io.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'drivers/net/s2io.h') diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index c01abc1d89a..33e812ea7d1 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h @@ -802,6 +802,13 @@ struct lro { u8 saw_ts; }; +/* These flags represent the devices temporary state */ +enum s2io_device_state_t +{ + __S2IO_STATE_LINK_TASK=0, + __S2IO_STATE_CARD_UP +}; + /* Structure representing one instance of the NIC */ struct s2io_nic { int rxd_mode; @@ -880,10 +887,6 @@ struct s2io_nic { int task_flag; unsigned long long start_time; -#define CARD_DOWN 1 -#define CARD_UP 2 - atomic_t card_state; - volatile unsigned long link_state; struct vlan_group *vlgrp; #define MSIX_FLG 0xA5 struct msix_entry *entries; @@ -906,6 +909,7 @@ struct s2io_nic { unsigned long sending_both; u8 lro; u16 lro_max_aggr_per_sess; + volatile unsigned long state; spinlock_t rx_lock; atomic_t isr_cnt; u64 general_int_mask; -- cgit v1.2.3