summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/eepro100.c
diff options
context:
space:
mode:
authorAlexey Zaytsev2008-03-02 01:41:10 +0100
committerAlexey Zaytsev2008-03-02 01:41:10 +0100
commita1572e0ab0f5fab9a1f0185ded593bec811aa175 (patch)
treee407d6d0f2b8e93950216268ec0198fff865c6a0 /src/drivers/net/eepro100.c
parentIntroduce the new timer subsystem. (diff)
downloadipxe-a1572e0ab0f5fab9a1f0185ded593bec811aa175.tar.gz
ipxe-a1572e0ab0f5fab9a1f0185ded593bec811aa175.tar.xz
ipxe-a1572e0ab0f5fab9a1f0185ded593bec811aa175.zip
Modify gPXE core and drivers to work with the new timer subsystem
Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
Diffstat (limited to 'src/drivers/net/eepro100.c')
-rw-r--r--src/drivers/net/eepro100.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/drivers/net/eepro100.c b/src/drivers/net/eepro100.c
index bb46d163..f746976a 100644
--- a/src/drivers/net/eepro100.c
+++ b/src/drivers/net/eepro100.c
@@ -107,7 +107,6 @@
#include "nic.h"
#include <gpxe/ethernet.h>
#include <gpxe/pci.h>
-#include "timer.h"
static int ioaddr;
@@ -408,6 +407,7 @@ static void eepro100_transmit(struct nic *nic, const char *d, unsigned int t, un
} hdr;
unsigned short status;
int s1, s2;
+ tick_t ct;
status = inw(ioaddr + SCBStatus);
/* Acknowledge all of the current interrupt sources ASAP. */
@@ -445,8 +445,10 @@ static void eepro100_transmit(struct nic *nic, const char *d, unsigned int t, un
wait_for_cmd_done(ioaddr + SCBCmd);
s1 = inw (ioaddr + SCBStatus);
- load_timer2(10*TICKS_PER_MS); /* timeout 10 ms for transmit */
- while (!txfd.status && timer2_running())
+
+ ct = currticks();
+ /* timeout 10 ms for transmit */
+ while (!txfd.status && ct + 10*USECS_IN_MSEC)
/* Wait */;
s2 = inw (ioaddr + SCBStatus);
@@ -606,6 +608,7 @@ static int eepro100_probe ( struct nic *nic, struct pci_device *pci ) {
int read_cmd, ee_size;
int options;
int rx_mode;
+ tick_t ct;
/* we cache only the first few words of the EEPROM data
be careful not to access beyond this array */
@@ -749,8 +752,8 @@ static int eepro100_probe ( struct nic *nic, struct pci_device *pci ) {
whereami ("started TX thingy (config, iasetup).");
- load_timer2(10*TICKS_PER_MS);
- while (!txfd.status && timer2_running())
+ ct = currticks();
+ while (!txfd.status && ct + 10*USECS_IN_MSEC < currticks())
/* Wait */;
/* Read the status register once to disgard stale data */