mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 20:10:18 +03:00
Modify gPXE core and drivers to work with the new timer subsystem
Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
This commit is contained in:
@@ -50,7 +50,6 @@ static const char *version = "rhine.c v1.0.2 2004-10-29\n";
|
||||
#include "nic.h"
|
||||
#include <gpxe/pci.h>
|
||||
#include <gpxe/ethernet.h>
|
||||
#include "timer.h"
|
||||
|
||||
/* define all ioaddr */
|
||||
|
||||
@@ -785,6 +784,7 @@ ReadMII (int byMIIIndex, int ioaddr)
|
||||
char byMIIAdrbak;
|
||||
char byMIICRbak;
|
||||
char byMIItemp;
|
||||
tick_t ct;
|
||||
|
||||
byMIIAdrbak = inb (byMIIAD);
|
||||
byMIICRbak = inb (byMIICR);
|
||||
@@ -799,8 +799,8 @@ ReadMII (int byMIIIndex, int ioaddr)
|
||||
byMIItemp = inb (byMIICR);
|
||||
byMIItemp = byMIItemp & 0x40;
|
||||
|
||||
load_timer2(2*TICKS_PER_MS);
|
||||
while (byMIItemp != 0 && timer2_running())
|
||||
ct = currticks();
|
||||
while (byMIItemp != 0 && ct + 2*USECS_IN_MSEC < currticks())
|
||||
{
|
||||
byMIItemp = inb (byMIICR);
|
||||
byMIItemp = byMIItemp & 0x40;
|
||||
@@ -825,6 +825,7 @@ WriteMII (char byMIISetByte, char byMIISetBit, char byMIIOP, int ioaddr)
|
||||
char byMIIAdrbak;
|
||||
char byMIICRbak;
|
||||
char byMIItemp;
|
||||
tick_t ct;
|
||||
|
||||
|
||||
byMIIAdrbak = inb (byMIIAD);
|
||||
@@ -840,8 +841,8 @@ WriteMII (char byMIISetByte, char byMIISetBit, char byMIIOP, int ioaddr)
|
||||
byMIItemp = inb (byMIICR);
|
||||
byMIItemp = byMIItemp & 0x40;
|
||||
|
||||
load_timer2(2*TICKS_PER_MS);
|
||||
while (byMIItemp != 0 && timer2_running())
|
||||
ct = currticks();
|
||||
while (byMIItemp != 0 && ct + 2*USECS_IN_MSEC < currticks())
|
||||
{
|
||||
byMIItemp = inb (byMIICR);
|
||||
byMIItemp = byMIItemp & 0x40;
|
||||
@@ -870,8 +871,8 @@ WriteMII (char byMIISetByte, char byMIISetBit, char byMIIOP, int ioaddr)
|
||||
byMIItemp = inb (byMIICR);
|
||||
byMIItemp = byMIItemp & 0x20;
|
||||
|
||||
load_timer2(2*TICKS_PER_MS);
|
||||
while (byMIItemp != 0 && timer2_running())
|
||||
ct = currticks();
|
||||
while (byMIItemp != 0 && ct + 2*USECS_IN_MSEC < currticks())
|
||||
{
|
||||
byMIItemp = inb (byMIICR);
|
||||
byMIItemp = byMIItemp & 0x20;
|
||||
@@ -1345,6 +1346,7 @@ rhine_transmit (struct nic *nic,
|
||||
unsigned char CR1bak;
|
||||
unsigned char CR0bak;
|
||||
unsigned int nstype;
|
||||
tick_t ct;
|
||||
|
||||
|
||||
/*printf ("rhine_transmit\n"); */
|
||||
@@ -1385,9 +1387,10 @@ rhine_transmit (struct nic *nic,
|
||||
outb (CR1bak, byCR1);
|
||||
do
|
||||
{
|
||||
load_timer2(10*TICKS_PER_MS);
|
||||
ct = currticks();
|
||||
/* Wait until transmit is finished or timeout*/
|
||||
while((tp->tx_ring[entry].tx_status.bits.own_bit !=0) && timer2_running())
|
||||
while((tp->tx_ring[entry].tx_status.bits.own_bit !=0) &&
|
||||
ct + 10*USECS_IN_MSEC < currticks())
|
||||
;
|
||||
|
||||
if(tp->tx_ring[entry].tx_status.bits.terr == 0)
|
||||
|
||||
Reference in New Issue
Block a user