e1000: use new libnetdriver
Change-Id: I111750d2ca27f01039d0b427b1314aea861e2074
This commit is contained in:
parent
91c4db251e
commit
1ad10e3ae0
3 changed files with 325 additions and 620 deletions
|
@ -6,7 +6,7 @@ FILES=$(PROG).conf
|
|||
FILESNAME=$(PROG)
|
||||
FILESDIR= /etc/system.conf.d
|
||||
|
||||
DPADD+= ${LIBNETDRIVER} ${LIBSYS} ${LIBTIMERS}
|
||||
LDADD+= -lnetdriver -lsys -ltimers
|
||||
DPADD+= ${LIBNETDRIVER} ${LIBSYS}
|
||||
LDADD+= -lnetdriver -lsys
|
||||
|
||||
.include <minix.service.mk>
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -18,13 +18,6 @@
|
|||
#ifndef __E1000_H
|
||||
#define __E1000_H
|
||||
|
||||
#include <minix/drivers.h>
|
||||
#include <stdlib.h>
|
||||
#include <net/hton.h>
|
||||
#include <net/gen/ether.h>
|
||||
#include <net/gen/eth_io.h>
|
||||
#include <machine/pci.h>
|
||||
#include <minix/ds.h>
|
||||
#include "e1000_hw.h"
|
||||
|
||||
/**
|
||||
|
@ -38,14 +31,11 @@
|
|||
/** Number of transmit descriptors per card. */
|
||||
#define E1000_TXDESC_NR 256
|
||||
|
||||
/** Number of I/O vectors to use. */
|
||||
#define E1000_IOVEC_NR 16
|
||||
|
||||
/** Size of each I/O buffer per descriptor. */
|
||||
#define E1000_IOBUF_SIZE 2048
|
||||
|
||||
/** Debug verbosity. */
|
||||
#define E1000_VERBOSE 1
|
||||
#define E1000_VERBOSE 0
|
||||
|
||||
/** MAC address override variable. */
|
||||
#define E1000_ENVVAR "E1000ETH"
|
||||
|
@ -59,24 +49,6 @@
|
|||
* @{
|
||||
*/
|
||||
|
||||
/** Card has been detected on the PCI bus. */
|
||||
#define E1000_DETECTED (1 << 0)
|
||||
|
||||
/** Card is enabled. */
|
||||
#define E1000_ENABLED (1 << 1)
|
||||
|
||||
/** Client has requested to receive packets. */
|
||||
#define E1000_READING (1 << 2)
|
||||
|
||||
/** Client has requested to write packets. */
|
||||
#define E1000_WRITING (1 << 3)
|
||||
|
||||
/** Received some packets on the card. */
|
||||
#define E1000_RECEIVED (1 << 4)
|
||||
|
||||
/** Transmitted some packets on the card. */
|
||||
#define E1000_TRANSMIT (1 << 5)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
@ -141,36 +113,25 @@
|
|||
typedef struct e1000
|
||||
{
|
||||
char name[8]; /**< String containing the device name. */
|
||||
int status; /**< Describes the card's current state. */
|
||||
int irq; /**< Interrupt Request Vector. */
|
||||
int irq_hook; /**< Interrupt Request Vector Hook. */
|
||||
int revision; /**< Hardware Revision Number. */
|
||||
u8_t *regs; /**< Memory mapped hardware registers. */
|
||||
u8_t *flash; /**< Optional flash memory. */
|
||||
u32_t flash_base_addr; /**< Flash base address. */
|
||||
ether_addr_t address; /**< Ethernet MAC address. */
|
||||
u16_t (*eeprom_read)(void *, int reg); /**< Function to read
|
||||
the EEPROM. */
|
||||
u16_t (*eeprom_read)(struct e1000 *, int reg);
|
||||
/**< Function to read the EEPROM. */
|
||||
int eeprom_done_bit; /**< Offset of the EERD.DONE bit. */
|
||||
int eeprom_addr_off; /**< Offset of the EERD.ADDR field. */
|
||||
|
||||
e1000_rx_desc_t *rx_desc; /**< Receive Descriptor table. */
|
||||
phys_bytes rx_desc_p; /**< Physical Receive Descriptor Address. */
|
||||
int rx_desc_count; /**< Number of Receive Descriptors. */
|
||||
char *rx_buffer; /**< Receive buffer returned by malloc(). */
|
||||
int rx_buffer_size; /**< Size of the receive buffer. */
|
||||
|
||||
e1000_tx_desc_t *tx_desc; /**< Transmit Descriptor table. */
|
||||
phys_bytes tx_desc_p; /**< Physical Transmit Descriptor Address. */
|
||||
int tx_desc_count; /**< Number of Transmit Descriptors. */
|
||||
char *tx_buffer; /**< Transmit buffer returned by malloc(). */
|
||||
int tx_buffer_size; /**< Size of the transmit buffer. */
|
||||
|
||||
int client; /**< Process ID being served by e1000. */
|
||||
message rx_message; /**< Read message received from client. */
|
||||
message tx_message; /**< Write message received from client. */
|
||||
size_t rx_size; /**< Size of one packet received. */
|
||||
}
|
||||
e1000_t;
|
||||
} e1000_t;
|
||||
|
||||
#endif /* __E1000_H */
|
||||
|
|
Loading…
Reference in a new issue