mirror of
https://github.com/ipxe/ipxe
synced 2025-12-15 09:04:37 +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:
@@ -7,6 +7,7 @@ ISOLINUX_BIN = /usr/lib/syslinux/isolinux.bin
|
|||||||
SRCDIRS += arch/i386/core arch/i386/transitions arch/i386/prefix
|
SRCDIRS += arch/i386/core arch/i386/transitions arch/i386/prefix
|
||||||
SRCDIRS += arch/i386/firmware/pcbios
|
SRCDIRS += arch/i386/firmware/pcbios
|
||||||
SRCDIRS += arch/i386/image
|
SRCDIRS += arch/i386/image
|
||||||
|
SRCDIRS += arch/i386/drivers
|
||||||
SRCDIRS += arch/i386/drivers/bus
|
SRCDIRS += arch/i386/drivers/bus
|
||||||
SRCDIRS += arch/i386/drivers/net
|
SRCDIRS += arch/i386/drivers/net
|
||||||
SRCDIRS += arch/i386/drivers/disk
|
SRCDIRS += arch/i386/drivers/disk
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "realmode.h"
|
#include <realmode.h>
|
||||||
#include "timer.h"
|
#include <bios.h>
|
||||||
#include "latch.h"
|
#include <gpxe/timer.h>
|
||||||
#include "bios.h"
|
|
||||||
|
|
||||||
#define K_RDWR 0x60 /* keyboard data & cmds (read/write) */
|
#define K_RDWR 0x60 /* keyboard data & cmds (read/write) */
|
||||||
#define K_STATUS 0x64 /* keyboard status */
|
#define K_STATUS 0x64 /* keyboard status */
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
#ifndef LATCH_H
|
|
||||||
#define LATCH_H
|
|
||||||
|
|
||||||
#define TICKS_PER_SEC 18
|
|
||||||
|
|
||||||
/* For different calibrators of the TSC move the declaration of
|
|
||||||
* sleep_latch and the definitions of it's length here...
|
|
||||||
*/
|
|
||||||
|
|
||||||
extern unsigned long currticks ( void );
|
|
||||||
|
|
||||||
#endif /* LATCH_H */
|
|
||||||
@@ -17,9 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <console.h>
|
#include <console.h>
|
||||||
#include <latch.h>
|
|
||||||
#include <gpxe/process.h>
|
#include <gpxe/process.h>
|
||||||
#include <gpxe/keys.h>
|
#include <gpxe/keys.h>
|
||||||
|
#include <gpxe/timer.h>
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ MISC Support Routines
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
#include <latch.h>
|
|
||||||
#include <gpxe/in.h>
|
#include <gpxe/in.h>
|
||||||
|
#include <gpxe/timer.h>
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
INET_ATON - Convert an ascii x.x.x.x to binary form
|
INET_ATON - Convert an ascii x.x.x.x to binary form
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <latch.h>
|
#include <gpxe/timer.h>
|
||||||
|
|
||||||
static int32_t rnd_seed = 0;
|
static int32_t rnd_seed = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include <gpxe/init.h>
|
#include <gpxe/init.h>
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "timer.h"
|
#include <unistd.h>
|
||||||
#include "config/serial.h"
|
#include "config/serial.h"
|
||||||
|
|
||||||
/* Set default values if none specified */
|
/* Set default values if none specified */
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <timer.h>
|
|
||||||
#include <gpxe/bitbash.h>
|
#include <gpxe/bitbash.h>
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <timer.h>
|
#include <unistd.h>
|
||||||
#include <gpxe/bitbash.h>
|
#include <gpxe/bitbash.h>
|
||||||
#include <gpxe/i2c.h>
|
#include <gpxe/i2c.h>
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <timer.h>
|
#include <unistd.h>
|
||||||
#include <gpxe/bitbash.h>
|
#include <gpxe/bitbash.h>
|
||||||
#include <gpxe/spi_bit.h>
|
#include <gpxe/spi_bit.h>
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <timer.h>
|
#include <unistd.h>
|
||||||
#include <gpxe/eisa.h>
|
#include <gpxe/eisa.h>
|
||||||
|
|
||||||
static struct eisa_driver eisa_drivers[0]
|
static struct eisa_driver eisa_drivers[0]
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <timer.h>
|
#include <unistd.h>
|
||||||
#include <gpxe/isapnp.h>
|
#include <gpxe/isapnp.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <timer.h>
|
|
||||||
#include <gpxe/mca.h>
|
#include <gpxe/mca.h>
|
||||||
|
|
||||||
static struct mca_driver mca_drivers[0]
|
static struct mca_driver mca_drivers[0]
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <timer.h>
|
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/malloc.h>
|
#include <gpxe/malloc.h>
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <timer.h>
|
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/malloc.h>
|
#include <gpxe/malloc.h>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <timer.h>
|
#include <unistd.h>
|
||||||
#include <gpxe/device.h>
|
#include <gpxe/device.h>
|
||||||
#include <gpxe/isa.h>
|
#include <gpxe/isa.h>
|
||||||
#include "3c509.h"
|
#include "3c509.h"
|
||||||
|
|||||||
@@ -50,7 +50,6 @@
|
|||||||
#include "nic.h"
|
#include "nic.h"
|
||||||
#include <gpxe/isapnp.h>
|
#include <gpxe/isapnp.h>
|
||||||
#include <gpxe/isa.h> /* for ISA_ROM */
|
#include <gpxe/isa.h> /* for ISA_ROM */
|
||||||
#include "timer.h"
|
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
|
|
||||||
static void t3c515_wait(unsigned int nticks)
|
static void t3c515_wait(unsigned int nticks)
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include "3c595.h"
|
#include "3c595.h"
|
||||||
#include "timer.h"
|
|
||||||
|
|
||||||
static struct nic_operations t595_operations;
|
static struct nic_operations t595_operations;
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,6 @@ $Id$
|
|||||||
#include "etherboot.h"
|
#include "etherboot.h"
|
||||||
#include "nic.h"
|
#include "nic.h"
|
||||||
#include <gpxe/isa.h>
|
#include <gpxe/isa.h>
|
||||||
#include "timer.h"
|
|
||||||
#include "3c509.h"
|
#include "3c509.h"
|
||||||
|
|
||||||
static enum { none, bnc, utp } connector = none; /* for 3C509 */
|
static enum { none, bnc, utp } connector = none; /* for 3C509 */
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
#include "nic.h"
|
#include "nic.h"
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include "timer.h"
|
|
||||||
|
|
||||||
static struct nic_operations a3c90x_operations;
|
static struct nic_operations a3c90x_operations;
|
||||||
|
|
||||||
@@ -498,6 +497,7 @@ a3c90x_transmit(struct nic *nic __unused, const char *d, unsigned int t,
|
|||||||
|
|
||||||
unsigned char status;
|
unsigned char status;
|
||||||
unsigned i, retries;
|
unsigned i, retries;
|
||||||
|
tick_t ct;
|
||||||
|
|
||||||
for (retries=0; retries < XMIT_RETRIES ; retries++)
|
for (retries=0; retries < XMIT_RETRIES ; retries++)
|
||||||
{
|
{
|
||||||
@@ -540,9 +540,10 @@ a3c90x_transmit(struct nic *nic __unused, const char *d, unsigned int t,
|
|||||||
;
|
;
|
||||||
|
|
||||||
/** Wait for NIC Transmit to Complete **/
|
/** Wait for NIC Transmit to Complete **/
|
||||||
load_timer2(10*TICKS_PER_MS); /* Give it 10 ms */
|
ct = currticks();
|
||||||
|
|
||||||
while (!(inw(INF_3C90X.IOAddr + regCommandIntStatus_w)&0x0004) &&
|
while (!(inw(INF_3C90X.IOAddr + regCommandIntStatus_w)&0x0004) &&
|
||||||
timer2_running())
|
ct + 10*USECS_IN_MSEC < currticks());
|
||||||
;
|
;
|
||||||
|
|
||||||
if (!(inw(INF_3C90X.IOAddr + regCommandIntStatus_w)&0x0004))
|
if (!(inw(INF_3C90X.IOAddr + regCommandIntStatus_w)&0x0004))
|
||||||
|
|||||||
@@ -33,7 +33,6 @@
|
|||||||
#include "mii.h"
|
#include "mii.h"
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include "timer.h"
|
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "stdint.h"
|
#include "stdint.h"
|
||||||
#include "amd8111e.h"
|
#include "amd8111e.h"
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include "timer.h"
|
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "bnx2.h"
|
#include "bnx2.h"
|
||||||
#include "bnx2_fw.h"
|
#include "bnx2_fw.h"
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
/* to get the PCI support functions, if this is a PCI NIC */
|
/* to get the PCI support functions, if this is a PCI NIC */
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include "timer.h"
|
|
||||||
|
|
||||||
/* #define EDEBUG 1 */
|
/* #define EDEBUG 1 */
|
||||||
#ifdef EDEBUG
|
#ifdef EDEBUG
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <timer.h>
|
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/malloc.h>
|
#include <gpxe/malloc.h>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <timer.h>
|
#include <unistd.h>
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/if_ether.h>
|
#include <gpxe/if_ether.h>
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ has 34 pins, the top row of 2 are not used.
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "nic.h"
|
#include "nic.h"
|
||||||
#include <gpxe/isa.h>
|
#include <gpxe/isa.h>
|
||||||
#include "timer.h"
|
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
|
|
||||||
/* Different 82595 chips */
|
/* Different 82595 chips */
|
||||||
|
|||||||
@@ -107,7 +107,6 @@
|
|||||||
#include "nic.h"
|
#include "nic.h"
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include "timer.h"
|
|
||||||
|
|
||||||
static int ioaddr;
|
static int ioaddr;
|
||||||
|
|
||||||
@@ -408,6 +407,7 @@ static void eepro100_transmit(struct nic *nic, const char *d, unsigned int t, un
|
|||||||
} hdr;
|
} hdr;
|
||||||
unsigned short status;
|
unsigned short status;
|
||||||
int s1, s2;
|
int s1, s2;
|
||||||
|
tick_t ct;
|
||||||
|
|
||||||
status = inw(ioaddr + SCBStatus);
|
status = inw(ioaddr + SCBStatus);
|
||||||
/* Acknowledge all of the current interrupt sources ASAP. */
|
/* 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);
|
wait_for_cmd_done(ioaddr + SCBCmd);
|
||||||
|
|
||||||
s1 = inw (ioaddr + SCBStatus);
|
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 */;
|
/* Wait */;
|
||||||
s2 = inw (ioaddr + SCBStatus);
|
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 read_cmd, ee_size;
|
||||||
int options;
|
int options;
|
||||||
int rx_mode;
|
int rx_mode;
|
||||||
|
tick_t ct;
|
||||||
|
|
||||||
/* we cache only the first few words of the EEPROM data
|
/* we cache only the first few words of the EEPROM data
|
||||||
be careful not to access beyond this array */
|
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).");
|
whereami ("started TX thingy (config, iasetup).");
|
||||||
|
|
||||||
load_timer2(10*TICKS_PER_MS);
|
ct = currticks();
|
||||||
while (!txfd.status && timer2_running())
|
while (!txfd.status && ct + 10*USECS_IN_MSEC < currticks())
|
||||||
/* Wait */;
|
/* Wait */;
|
||||||
|
|
||||||
/* Read the status register once to disgard stale data */
|
/* Read the status register once to disgard stale data */
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include "nic.h"
|
#include "nic.h"
|
||||||
#include "timer.h"
|
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "epic100.h"
|
#include "epic100.h"
|
||||||
|
|
||||||
@@ -310,6 +309,7 @@ epic100_transmit(struct nic *nic, const char *destaddr, unsigned int type,
|
|||||||
unsigned short nstype;
|
unsigned short nstype;
|
||||||
unsigned char *txp;
|
unsigned char *txp;
|
||||||
int entry;
|
int entry;
|
||||||
|
tick_t ct;
|
||||||
|
|
||||||
/* Calculate the next Tx descriptor entry. */
|
/* Calculate the next Tx descriptor entry. */
|
||||||
entry = cur_tx % TX_RING_SIZE;
|
entry = cur_tx % TX_RING_SIZE;
|
||||||
@@ -339,18 +339,20 @@ epic100_transmit(struct nic *nic, const char *destaddr, unsigned int type,
|
|||||||
* set the base address with the "ownership"
|
* set the base address with the "ownership"
|
||||||
* bits last.
|
* bits last.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
tx_ring[entry].buflength |= cpu_to_le32(len);
|
tx_ring[entry].buflength |= cpu_to_le32(len);
|
||||||
tx_ring[entry].status = cpu_to_le32(len << 16) |
|
tx_ring[entry].status = cpu_to_le32(len << 16) |
|
||||||
cpu_to_le32(TRING_OWN); /* Pass ownership to the chip. */
|
cpu_to_le32(TRING_OWN); /* Pass ownership to the chip. */
|
||||||
|
|
||||||
cur_tx++;
|
cur_tx++;
|
||||||
|
|
||||||
/* Trigger an immediate transmit demand. */
|
/* Trigger an immediate transmit demand. */
|
||||||
outl(CR_QUEUE_TX, command);
|
outl(CR_QUEUE_TX, command);
|
||||||
|
|
||||||
load_timer2(10*TICKS_PER_MS); /* timeout 10 ms for transmit */
|
ct = currticks();
|
||||||
while ((le32_to_cpu(tx_ring[entry].status) & (TRING_OWN)) && timer2_running())
|
/* timeout 10 ms for transmit */
|
||||||
|
while ((le32_to_cpu(tx_ring[entry].status) & (TRING_OWN)) &&
|
||||||
|
ct + 10*USECS_IN_MSEC < currticks())
|
||||||
/* Wait */;
|
/* Wait */;
|
||||||
|
|
||||||
if ((le32_to_cpu(tx_ring[entry].status) & TRING_OWN) != 0)
|
if ((le32_to_cpu(tx_ring[entry].status) & TRING_OWN) != 0)
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
#include <gpxe/i2c.h>
|
#include <gpxe/i2c.h>
|
||||||
#include <gpxe/spi.h>
|
#include <gpxe/spi.h>
|
||||||
#include <gpxe/nvo.h>
|
#include <gpxe/nvo.h>
|
||||||
#include "timer.h"
|
|
||||||
#define dma_addr_t unsigned long
|
#define dma_addr_t unsigned long
|
||||||
#include "etherfabric.h"
|
#include "etherfabric.h"
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,6 @@
|
|||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
/* Include timer support functions */
|
/* Include timer support functions */
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include "timer.h"
|
|
||||||
#include "mii.h"
|
#include "mii.h"
|
||||||
|
|
||||||
#define drv_version "v1.2"
|
#define drv_version "v1.2"
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "timer.h"
|
|
||||||
#include <gpxe/if_arp.h>
|
#include <gpxe/if_arp.h>
|
||||||
#include <gpxe/iobuf.h>
|
#include <gpxe/iobuf.h>
|
||||||
#include <gpxe/netdevice.h>
|
#include <gpxe/netdevice.h>
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ static void be_to_cpu_buf(void *buf, int size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "timer.h"
|
|
||||||
#include "cmdif_mt23108.c"
|
#include "cmdif_mt23108.c"
|
||||||
#include "cmdif_comm.c"
|
#include "cmdif_comm.c"
|
||||||
#include "ib_mt23108.c"
|
#include "ib_mt23108.c"
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ static void be_to_cpu_buf(void *buf, int size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "timer.h"
|
|
||||||
#include "cmdif_mt25218.c"
|
#include "cmdif_mt25218.c"
|
||||||
#include "cmdif_comm.c"
|
#include "cmdif_comm.c"
|
||||||
#include "ib_mt25218.c"
|
#include "ib_mt25218.c"
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
#include <gpxe/umalloc.h>
|
#include <gpxe/umalloc.h>
|
||||||
#include <bits/byteswap.h>
|
#include <bits/byteswap.h>
|
||||||
#include <little_bswap.h>
|
#include <little_bswap.h>
|
||||||
#include <timer.h>
|
#include <unistd.h>
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include <gpxe/netdevice.h>
|
#include <gpxe/netdevice.h>
|
||||||
|
|||||||
@@ -63,8 +63,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <timer.h>
|
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/if_ether.h>
|
#include <gpxe/if_ether.h>
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
|
|||||||
@@ -43,7 +43,6 @@
|
|||||||
#include "nic.h"
|
#include "nic.h"
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include "timer.h"
|
|
||||||
#include "mii.h"
|
#include "mii.h"
|
||||||
|
|
||||||
/* void hex_dump(const char *data, const unsigned int len); */
|
/* void hex_dump(const char *data, const unsigned int len); */
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ static const char hardcoded_ssid[] = "";
|
|||||||
* quicker to convert code from the Linux Prism2 driver.
|
* quicker to convert code from the Linux Prism2 driver.
|
||||||
*/
|
*/
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include "timer.h"
|
|
||||||
#define __le16_to_cpu(x) (x)
|
#define __le16_to_cpu(x) (x)
|
||||||
#define __le32_to_cpu(x) (x)
|
#define __le32_to_cpu(x) (x)
|
||||||
#define __cpu_to_le16(x) (x)
|
#define __cpu_to_le16(x) (x)
|
||||||
|
|||||||
@@ -49,7 +49,6 @@
|
|||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include <gpxe/malloc.h>
|
#include <gpxe/malloc.h>
|
||||||
#include "timer.h"
|
|
||||||
|
|
||||||
#define drv_version "v1.6"
|
#define drv_version "v1.6"
|
||||||
#define drv_date "03-27-2004"
|
#define drv_date "03-27-2004"
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <timer.h>
|
#include <unistd.h>
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/if_ether.h>
|
#include <gpxe/if_ether.h>
|
||||||
|
|||||||
@@ -46,7 +46,6 @@
|
|||||||
#include "etherboot.h"
|
#include "etherboot.h"
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include "nic.h"
|
#include "nic.h"
|
||||||
#include "timer.h"
|
|
||||||
|
|
||||||
#include "sis900.h"
|
#include "sis900.h"
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
#include "etherboot.h"
|
#include "etherboot.h"
|
||||||
#include "nic.h"
|
#include "nic.h"
|
||||||
#include <gpxe/isa.h>
|
#include <gpxe/isa.h>
|
||||||
#include "timer.h"
|
|
||||||
#include "smc9000.h"
|
#include "smc9000.h"
|
||||||
|
|
||||||
# define _outb outb
|
# define _outb outb
|
||||||
|
|||||||
@@ -46,7 +46,6 @@
|
|||||||
#include "nic.h"
|
#include "nic.h"
|
||||||
/* to get the PCI support functions, if this is a PCI NIC */
|
/* to get the PCI support functions, if this is a PCI NIC */
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include "timer.h"
|
|
||||||
#include "mii.h"
|
#include "mii.h"
|
||||||
|
|
||||||
#define drv_version "v1.12"
|
#define drv_version "v1.12"
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include "timer.h"
|
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "tg3.h"
|
#include "tg3.h"
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,6 @@
|
|||||||
#include "nic.h"
|
#include "nic.h"
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include "timer.h"
|
|
||||||
#include "tlan.h"
|
#include "tlan.h"
|
||||||
|
|
||||||
#define drv_version "v1.4"
|
#define drv_version "v1.4"
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ static const char *version = "rhine.c v1.0.2 2004-10-29\n";
|
|||||||
#include "nic.h"
|
#include "nic.h"
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include "timer.h"
|
|
||||||
|
|
||||||
/* define all ioaddr */
|
/* define all ioaddr */
|
||||||
|
|
||||||
@@ -785,6 +784,7 @@ ReadMII (int byMIIIndex, int ioaddr)
|
|||||||
char byMIIAdrbak;
|
char byMIIAdrbak;
|
||||||
char byMIICRbak;
|
char byMIICRbak;
|
||||||
char byMIItemp;
|
char byMIItemp;
|
||||||
|
tick_t ct;
|
||||||
|
|
||||||
byMIIAdrbak = inb (byMIIAD);
|
byMIIAdrbak = inb (byMIIAD);
|
||||||
byMIICRbak = inb (byMIICR);
|
byMIICRbak = inb (byMIICR);
|
||||||
@@ -799,8 +799,8 @@ ReadMII (int byMIIIndex, int ioaddr)
|
|||||||
byMIItemp = inb (byMIICR);
|
byMIItemp = inb (byMIICR);
|
||||||
byMIItemp = byMIItemp & 0x40;
|
byMIItemp = byMIItemp & 0x40;
|
||||||
|
|
||||||
load_timer2(2*TICKS_PER_MS);
|
ct = currticks();
|
||||||
while (byMIItemp != 0 && timer2_running())
|
while (byMIItemp != 0 && ct + 2*USECS_IN_MSEC < currticks())
|
||||||
{
|
{
|
||||||
byMIItemp = inb (byMIICR);
|
byMIItemp = inb (byMIICR);
|
||||||
byMIItemp = byMIItemp & 0x40;
|
byMIItemp = byMIItemp & 0x40;
|
||||||
@@ -825,6 +825,7 @@ WriteMII (char byMIISetByte, char byMIISetBit, char byMIIOP, int ioaddr)
|
|||||||
char byMIIAdrbak;
|
char byMIIAdrbak;
|
||||||
char byMIICRbak;
|
char byMIICRbak;
|
||||||
char byMIItemp;
|
char byMIItemp;
|
||||||
|
tick_t ct;
|
||||||
|
|
||||||
|
|
||||||
byMIIAdrbak = inb (byMIIAD);
|
byMIIAdrbak = inb (byMIIAD);
|
||||||
@@ -840,8 +841,8 @@ WriteMII (char byMIISetByte, char byMIISetBit, char byMIIOP, int ioaddr)
|
|||||||
byMIItemp = inb (byMIICR);
|
byMIItemp = inb (byMIICR);
|
||||||
byMIItemp = byMIItemp & 0x40;
|
byMIItemp = byMIItemp & 0x40;
|
||||||
|
|
||||||
load_timer2(2*TICKS_PER_MS);
|
ct = currticks();
|
||||||
while (byMIItemp != 0 && timer2_running())
|
while (byMIItemp != 0 && ct + 2*USECS_IN_MSEC < currticks())
|
||||||
{
|
{
|
||||||
byMIItemp = inb (byMIICR);
|
byMIItemp = inb (byMIICR);
|
||||||
byMIItemp = byMIItemp & 0x40;
|
byMIItemp = byMIItemp & 0x40;
|
||||||
@@ -870,8 +871,8 @@ WriteMII (char byMIISetByte, char byMIISetBit, char byMIIOP, int ioaddr)
|
|||||||
byMIItemp = inb (byMIICR);
|
byMIItemp = inb (byMIICR);
|
||||||
byMIItemp = byMIItemp & 0x20;
|
byMIItemp = byMIItemp & 0x20;
|
||||||
|
|
||||||
load_timer2(2*TICKS_PER_MS);
|
ct = currticks();
|
||||||
while (byMIItemp != 0 && timer2_running())
|
while (byMIItemp != 0 && ct + 2*USECS_IN_MSEC < currticks())
|
||||||
{
|
{
|
||||||
byMIItemp = inb (byMIICR);
|
byMIItemp = inb (byMIICR);
|
||||||
byMIItemp = byMIItemp & 0x20;
|
byMIItemp = byMIItemp & 0x20;
|
||||||
@@ -1345,6 +1346,7 @@ rhine_transmit (struct nic *nic,
|
|||||||
unsigned char CR1bak;
|
unsigned char CR1bak;
|
||||||
unsigned char CR0bak;
|
unsigned char CR0bak;
|
||||||
unsigned int nstype;
|
unsigned int nstype;
|
||||||
|
tick_t ct;
|
||||||
|
|
||||||
|
|
||||||
/*printf ("rhine_transmit\n"); */
|
/*printf ("rhine_transmit\n"); */
|
||||||
@@ -1385,9 +1387,10 @@ rhine_transmit (struct nic *nic,
|
|||||||
outb (CR1bak, byCR1);
|
outb (CR1bak, byCR1);
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
load_timer2(10*TICKS_PER_MS);
|
ct = currticks();
|
||||||
/* Wait until transmit is finished or timeout*/
|
/* 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)
|
if(tp->tx_ring[entry].tx_status.bits.terr == 0)
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
* Copyright (c) 2006 by Timothy Legge <tlegge@rogers.com>
|
* Copyright (c) 2006 by Timothy Legge <tlegge@rogers.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "timer.h"
|
|
||||||
|
|
||||||
#ifndef VELOCITY_H
|
#ifndef VELOCITY_H
|
||||||
#define VELOCITY_H
|
#define VELOCITY_H
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,6 @@
|
|||||||
#include "nic.h"
|
#include "nic.h"
|
||||||
#include <gpxe/pci.h>
|
#include <gpxe/pci.h>
|
||||||
#include <gpxe/ethernet.h>
|
#include <gpxe/ethernet.h>
|
||||||
#include "timer.h"
|
|
||||||
|
|
||||||
static const char *w89c840_version = "driver Version 0.94 - December 12, 2003";
|
static const char *w89c840_version = "driver Version 0.94 - December 12, 2003";
|
||||||
|
|
||||||
@@ -113,7 +112,7 @@ static const char *w89c840_version = "driver Version 0.94 - December 12, 2003";
|
|||||||
|
|
||||||
/* Operational parameters that usually are not changed. */
|
/* Operational parameters that usually are not changed. */
|
||||||
/* Time in jiffies before concluding the transmitter is hung. */
|
/* Time in jiffies before concluding the transmitter is hung. */
|
||||||
#define TX_TIMEOUT (10*TICKS_PER_MS)
|
#define TX_TIMEOUT (10*USECS_IN_MSEC)
|
||||||
|
|
||||||
#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer.*/
|
#define PKT_BUF_SZ 1536 /* Size of each temporary Rx buffer.*/
|
||||||
|
|
||||||
@@ -487,6 +486,7 @@ static void w89c840_transmit(
|
|||||||
/* send the packet to destination */
|
/* send the packet to destination */
|
||||||
unsigned entry;
|
unsigned entry;
|
||||||
int transmit_status;
|
int transmit_status;
|
||||||
|
tick_t ct;
|
||||||
|
|
||||||
/* Caution: the write order is important here, set the field
|
/* Caution: the write order is important here, set the field
|
||||||
with the "ownership" bits last. */
|
with the "ownership" bits last. */
|
||||||
@@ -535,8 +535,7 @@ static void w89c840_transmit(
|
|||||||
/* Now wait for TX to complete. */
|
/* Now wait for TX to complete. */
|
||||||
transmit_status = w840private.tx_ring[entry].status;
|
transmit_status = w840private.tx_ring[entry].status;
|
||||||
|
|
||||||
load_timer2(TX_TIMEOUT);
|
ct = currticks();
|
||||||
|
|
||||||
{
|
{
|
||||||
#if defined W89C840_DEBUG
|
#if defined W89C840_DEBUG
|
||||||
u32 intr_stat = 0;
|
u32 intr_stat = 0;
|
||||||
@@ -547,7 +546,7 @@ static void w89c840_transmit(
|
|||||||
decode_interrupt(intr_stat);
|
decode_interrupt(intr_stat);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while ( (transmit_status & DescOwn) && timer2_running()) {
|
while ( (transmit_status & DescOwn) && ct + TX_TIMEOUT < currticks()) {
|
||||||
|
|
||||||
transmit_status = w840private.tx_ring[entry].status;
|
transmit_status = w840private.tx_ring[entry].status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <timer.h>
|
#include <unistd.h>
|
||||||
#include <gpxe/spi.h>
|
#include <gpxe/spi.h>
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <timer.h>
|
#include <unistd.h>
|
||||||
#include <gpxe/threewire.h>
|
#include <gpxe/threewire.h>
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <timer.h>
|
#include <unistd.h>
|
||||||
#include "mucurses.h"
|
#include "mucurses.h"
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
|
|||||||
@@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <console.h>
|
#include <console.h>
|
||||||
#include <latch.h>
|
|
||||||
#include <gpxe/features.h>
|
#include <gpxe/features.h>
|
||||||
|
#include <gpxe/timer.h>
|
||||||
#include <gpxe/shell_banner.h>
|
#include <gpxe/shell_banner.h>
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <strings.h>
|
#include <strings.h>
|
||||||
#include <latch.h>
|
|
||||||
#include <console.h>
|
#include <console.h>
|
||||||
|
#include <gpxe/timer.h>
|
||||||
#include <gpxe/if_arp.h>
|
#include <gpxe/if_arp.h>
|
||||||
#include <gpxe/if_ether.h>
|
#include <gpxe/if_ether.h>
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
#include <gpxe/in.h>
|
#include <gpxe/in.h>
|
||||||
#include <gpxe/refcnt.h>
|
#include <gpxe/refcnt.h>
|
||||||
#include <gpxe/tables.h>
|
#include <gpxe/tables.h>
|
||||||
#include <latch.h>
|
|
||||||
|
|
||||||
struct net_device;
|
struct net_device;
|
||||||
struct job_interface;
|
struct job_interface;
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "latch.h"
|
|
||||||
#include <gpxe/tcpip.h>
|
#include <gpxe/tcpip.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
#ifndef TIMER_H
|
|
||||||
#define TIMER_H
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file should be removed as soon as there are no
|
|
||||||
* currticks() abusers.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
/*
|
|
||||||
#warning Please fix me. I'm abusing the deprecated include/timer.h
|
|
||||||
*/
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
/* Duplicates include/gpxe/timer.h */
|
|
||||||
typedef uint32_t tick_t;
|
|
||||||
|
|
||||||
#define MSECS_IN_SEC (1000)
|
|
||||||
#define USECS_IN_SEC (1000*1000)
|
|
||||||
#define USECS_IN_MSEC (1000)
|
|
||||||
|
|
||||||
#define TICKS_PER_SEC USECS_IN_SEC
|
|
||||||
|
|
||||||
tick_t currticks(void);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <latch.h>
|
#include <gpxe/timer.h>
|
||||||
#include <gpxe/list.h>
|
#include <gpxe/list.h>
|
||||||
#include <gpxe/process.h>
|
#include <gpxe/process.h>
|
||||||
#include <gpxe/init.h>
|
#include <gpxe/init.h>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <byteswap.h>
|
#include <byteswap.h>
|
||||||
#include <timer.h>
|
#include <gpxe/timer.h>
|
||||||
#include <gpxe/iobuf.h>
|
#include <gpxe/iobuf.h>
|
||||||
#include <gpxe/malloc.h>
|
#include <gpxe/malloc.h>
|
||||||
#include <gpxe/retry.h>
|
#include <gpxe/retry.h>
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
#include <gpxe/ip.h>
|
#include <gpxe/ip.h>
|
||||||
#include <gpxe/uuid.h>
|
#include <gpxe/uuid.h>
|
||||||
#include <gpxe/dhcp.h>
|
#include <gpxe/dhcp.h>
|
||||||
|
#include <gpxe/timer.h>
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user