#include <assert.h>
#include <byteorder.h>
#include <errno.h>
#include <stdio.h>
#include <libarch/ddi.h>
#include <net/packet.h>
#include <packet_client.h>
#include "dp8390.h"
Go to the source code of this file.
Data Structures | |
struct | recv_header_t |
Type definition of the receive header. More... | |
Defines | |
#define | DP_PAGE 256 |
Page size. | |
#define | ETH_MAX_PACK_SIZE_TAGGED 1518 |
Maximum Ethernet packet size in bytes. | |
#define | ETH_MIN_PACK_SIZE 60 |
Minimum Ethernet packet size in bytes. | |
#define | NE2K_DATA 0x0010 |
NE2000 Data Register. | |
#define | NE2K_ERL 10 |
NE2000 error messages rate limiting. | |
#define | NE2K_RESET 0x001f |
NE2000 Reset register. | |
#define | NE2K_RETRY 0x1000 |
NE2000 retry count. | |
#define | NE2K_SIZE 0x4000 |
NE2000 data size. | |
#define | NE2K_START 0x4000 |
NE2000 data start. | |
#define | SQ_PAGES 6 |
6 * DP_PAGE >= 1514 bytes | |
Functions | |
void | ne2k_down (ne2k_t *ne2k) |
Stop the network interface. | |
static void | ne2k_download (ne2k_t *ne2k, void *buf, size_t addr, size_t size) |
static void | ne2k_init (ne2k_t *ne2k) |
link_t * | ne2k_interrupt (ne2k_t *ne2k, uint8_t isr, uint8_t tsr) |
int | ne2k_probe (ne2k_t *ne2k, void *port, int irq) |
Probe and initialize the network interface. | |
static link_t * | ne2k_receive (ne2k_t *ne2k) |
static frame_t * | ne2k_receive_frame (ne2k_t *ne2k, uint8_t page, size_t length) |
static void | ne2k_reset (ne2k_t *ne2k) |
void | ne2k_send (ne2k_t *ne2k, packet_t *packet) |
Send a frame. | |
int | ne2k_up (ne2k_t *ne2k) |
Start the network interface. | |
static void | ne2k_upload (ne2k_t *ne2k, void *buf, size_t addr, size_t size) |
static void | pio_read_buf_16 (void *port, void *buf, size_t size) |
Read a memory block word by word. | |
static void | pio_write_buf_16 (void *port, void *buf, size_t size) |
Write a memory block word by word. |
Only the basic NE2000 PIO (ISA) interface is supported, remote DMA is completely absent from this code for simplicity.
Definition in file dp8390.c.