aboutsummaryrefslogtreecommitdiff
path: root/kernel/inc/drivers/rtl8139.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/inc/drivers/rtl8139.h')
-rw-r--r--kernel/inc/drivers/rtl8139.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/kernel/inc/drivers/rtl8139.h b/kernel/inc/drivers/rtl8139.h
new file mode 100644
index 0000000..0d748af
--- /dev/null
+++ b/kernel/inc/drivers/rtl8139.h
@@ -0,0 +1,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