Commit a4188ba8 authored by Jeff Garzik's avatar Jeff Garzik

Merge mandrakesoft.com:/home/jgarzik/vanilla/linus-2.5

into mandrakesoft.com:/home/jgarzik/repo/net-drivers-2.5
parents ace5d474 21d5fc57
...@@ -128,12 +128,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ...@@ -128,12 +128,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define E100_DEFAULT_TCB MAX_TCB #define E100_DEFAULT_TCB MAX_TCB
#define E100_MIN_TCB 2*TX_FRAME_CNT + 3 /* make room for at least 2 interrupts */ #define E100_MIN_TCB 2*TX_FRAME_CNT + 3 /* make room for at least 2 interrupts */
#ifdef __ia64__
/* We can't use too many DMAble buffers on IA64 machines with >4 GB mem */
#define E100_MAX_TCB 64
#else
#define E100_MAX_TCB 1024 #define E100_MAX_TCB 1024
#endif /* __ia64__ */
#define E100_DEFAULT_RFD MAX_RFD #define E100_DEFAULT_RFD MAX_RFD
#define E100_MIN_RFD 8 #define E100_MIN_RFD 8
...@@ -766,6 +761,8 @@ typedef enum _non_tx_cmd_state_t { ...@@ -766,6 +761,8 @@ typedef enum _non_tx_cmd_state_t {
#define IPCB_INSERTVLAN_ENABLE BIT_1 #define IPCB_INSERTVLAN_ENABLE BIT_1
#define IPCB_IP_ACTIVATION_DEFAULT IPCB_HARDWAREPARSING_ENABLE #define IPCB_IP_ACTIVATION_DEFAULT IPCB_HARDWAREPARSING_ENABLE
#define FOLD_CSUM(_XSUM) ((((_XSUM << 16) | (_XSUM >> 16)) + _XSUM) >> 16)
/* Transmit Buffer Descriptor (TBD)*/ /* Transmit Buffer Descriptor (TBD)*/
typedef struct _tbd_t { typedef struct _tbd_t {
u32 tbd_buf_addr; /* Physical Transmit Buffer Address */ u32 tbd_buf_addr; /* Physical Transmit Buffer Address */
...@@ -1008,6 +1005,11 @@ struct e100_private { ...@@ -1008,6 +1005,11 @@ struct e100_private {
u32 wolopts; u32 wolopts;
u16 ip_lbytes; u16 ip_lbytes;
#endif #endif
#ifdef CONFIG_PM
u32 pci_state[16];
#endif
}; };
#define E100_AUTONEG 0 #define E100_AUTONEG 0
...@@ -1030,4 +1032,9 @@ extern unsigned char e100_selftest(struct e100_private *bdp, u32 *st_timeout, ...@@ -1030,4 +1032,9 @@ extern unsigned char e100_selftest(struct e100_private *bdp, u32 *st_timeout,
extern unsigned char e100_get_link_state(struct e100_private *bdp); extern unsigned char e100_get_link_state(struct e100_private *bdp);
extern unsigned char e100_wait_scb(struct e100_private *bdp); extern unsigned char e100_wait_scb(struct e100_private *bdp);
extern void e100_deisolate_driver(struct e100_private *bdp,
u8 recover, u8 full_reset);
extern unsigned char e100_hw_reset_recover(struct e100_private *bdp,
u32 reset_cmd);
#endif #endif
...@@ -69,6 +69,10 @@ ANY LOSS OF USE; DATA, OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER CAUSED ...@@ -69,6 +69,10 @@ ANY LOSS OF USE; DATA, OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER CAUSED
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*******************************************************************************
Portions (C) 2002 Red Hat, Inc. under the terms of the GNU GPL v2.
*******************************************************************************/ *******************************************************************************/
/********************************************************************** /**********************************************************************
...@@ -152,7 +156,7 @@ eeprom_set_semaphore(struct e100_private *adapter) ...@@ -152,7 +156,7 @@ eeprom_set_semaphore(struct e100_private *adapter)
} }
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1); schedule_timeout(1+(HZ-1)/100);
} }
return false; return false;
} }
...@@ -252,19 +256,12 @@ e100_eeprom_size(struct e100_private *adapter) ...@@ -252,19 +256,12 @@ e100_eeprom_size(struct e100_private *adapter)
// Returns: bits in an address for that size eeprom // Returns: bits in an address for that size eeprom
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
static u16 static inline int
eeprom_address_size(u16 size) eeprom_address_size(u16 size)
{ {
switch (size) { int isize = size;
case 64:
return 6; return ffs(isize);
case 128:
return 7;
case 256:
return 8;
}
return 0; //fix compiler warning or error!
} }
//---------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------
...@@ -348,6 +345,7 @@ shift_out_bits(struct e100_private *adapter, u16 data, u16 count) ...@@ -348,6 +345,7 @@ shift_out_bits(struct e100_private *adapter, u16 data, u16 count)
x |= EEDI; x |= EEDI;
writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter)); writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
readw(&(adapter->scb->scb_status)); /* flush command to card */
udelay(EEPROM_STALL_TIME); udelay(EEPROM_STALL_TIME);
raise_clock(adapter, &x); raise_clock(adapter, &x);
lower_clock(adapter, &x); lower_clock(adapter, &x);
...@@ -374,6 +372,7 @@ raise_clock(struct e100_private *adapter, u16 *x) ...@@ -374,6 +372,7 @@ raise_clock(struct e100_private *adapter, u16 *x)
{ {
*x = *x | EESK; *x = *x | EESK;
writew(*x, &CSR_EEPROM_CONTROL_FIELD(adapter)); writew(*x, &CSR_EEPROM_CONTROL_FIELD(adapter));
readw(&(adapter->scb->scb_status)); /* flush command to card */
udelay(EEPROM_STALL_TIME); udelay(EEPROM_STALL_TIME);
} }
...@@ -393,6 +392,7 @@ lower_clock(struct e100_private *adapter, u16 *x) ...@@ -393,6 +392,7 @@ lower_clock(struct e100_private *adapter, u16 *x)
{ {
*x = *x & ~EESK; *x = *x & ~EESK;
writew(*x, &CSR_EEPROM_CONTROL_FIELD(adapter)); writew(*x, &CSR_EEPROM_CONTROL_FIELD(adapter));
readw(&(adapter->scb->scb_status)); /* flush command to card */
udelay(EEPROM_STALL_TIME); udelay(EEPROM_STALL_TIME);
} }
...@@ -498,7 +498,7 @@ e100_eeprom_write_word(struct e100_private *adapter, u16 reg, u16 data) ...@@ -498,7 +498,7 @@ e100_eeprom_write_word(struct e100_private *adapter, u16 reg, u16 data)
x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter)); x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter));
x &= ~(EEDI | EEDO | EESK); x &= ~(EEDI | EEDO | EESK);
writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter)); writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
wmb(); readw(&(adapter->scb->scb_status)); /* flush command to card */
udelay(EEPROM_STALL_TIME); udelay(EEPROM_STALL_TIME);
x |= EECS; x |= EECS;
writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter)); writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
...@@ -587,7 +587,7 @@ eeprom_wait_cmd_done(struct e100_private *adapter) ...@@ -587,7 +587,7 @@ eeprom_wait_cmd_done(struct e100_private *adapter)
return true; return true;
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1); schedule_timeout(1+(HZ-1)/100);
} }
return false; return false;
...@@ -606,9 +606,10 @@ eeprom_stand_by(struct e100_private *adapter) ...@@ -606,9 +606,10 @@ eeprom_stand_by(struct e100_private *adapter)
x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter)); x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter));
x &= ~(EECS | EESK); x &= ~(EECS | EESK);
writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter)); writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
wmb(); readw(&(adapter->scb->scb_status)); /* flush command to card */
udelay(EEPROM_STALL_TIME); udelay(EEPROM_STALL_TIME);
x |= EECS; x |= EECS;
writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter)); writew(x, &CSR_EEPROM_CONTROL_FIELD(adapter));
readw(&(adapter->scb->scb_status)); /* flush command to card */
udelay(EEPROM_STALL_TIME); udelay(EEPROM_STALL_TIME);
} }
This diff is collapsed.
...@@ -769,7 +769,7 @@ e100_set_fc(struct e100_private *bdp) ...@@ -769,7 +769,7 @@ e100_set_fc(struct e100_private *bdp)
* Arguments: bdp - Pointer to the e100_private structure for the board * Arguments: bdp - Pointer to the e100_private structure for the board
* *
* Returns: true if link state was changed * Returns: true if link state was changed
* B_FLASE otherwise * false otherwise
* *
*/ */
unsigned char unsigned char
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment