aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc/rtl8139.h
blob: 0d748afcd4d2ff221dc208e53f632d778201837b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// MIT License, Copyright (c) 2020 Marvin Borner

#ifndef RTL8139_H
#define RTL8139_H

#include <def.h>

#define RX_BUF_SIZE 0x2000

#define RTL8139_VENDOR_ID 0x10ec
#define RTL8139_DEVICE_ID 0x8139

#define RTL_ROK (1 << 0)
#define RTL_TOK (1 << 2)

#define RTL_PORT_MAC 0x00
#define RTL_PORT_MAR 0x08
#define RTL_PORT_TXSTAT 0x10
#define RTL_PORT_TXBUF 0x20
#define RTL_PORT_RBSTART 0x30
#define RTL_PORT_CMD 0x37
#define RTL_PORT_RXPTR 0x38
#define RTL_PORT_RXADDR 0x3A
#define RTL_PORT_IMR 0x3C
#define RTL_PORT_ISR 0x3E
#define RTL_PORT_TCR 0x40
#define RTL_PORT_RCR 0x44
#define RTL_PORT_RXMISS 0x4C
#define RTL_PORT_CONFIG 0x52

int rtl8139_install(void);
int rtl8139_installed(void);
void rtl8139_send_packet(void *data, u32 len) NONNULL;
u8 *rtl8139_get_mac(void);

#endif