diff options
| author | Miguel <m.i@gmx.at> | 2018-09-26 10:22:37 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-26 10:22:37 +0200 |
| commit | ae33cc6557790a502a01b380b0926944ca2f3cfa (patch) | |
| tree | e72632052d1c6f6830c40d10d26c04b73aac74c6 /driver | |
| parent | daf374435560861681c3e4d14a2d44141aa11abc (diff) | |
ntp and udp
Diffstat (limited to 'driver')
| -rw-r--r-- | driver/e1000.c | 4 | ||||
| -rw-r--r-- | driver/keyboard.c | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/driver/e1000.c b/driver/e1000.c index 31e1b45..2f50df4 100644 --- a/driver/e1000.c +++ b/driver/e1000.c @@ -137,7 +137,8 @@ // TODO: move all global stuff to some struct so we can run multiple e1000 cards! // -struct netdev dev; ///TODO not global! +struct netdev e1000_dev; ///TODO not global! +static struct netdev dev; struct e1000_rx_desc { volatile uint32_t addr_lo; // 4 @@ -518,6 +519,7 @@ struct netdev e1000_init(uint32_t base) rxinit(); klog("E1000 initialized"); + e1000_dev=dev; return dev; } diff --git a/driver/keyboard.c b/driver/keyboard.c index d201882..b9a1dad 100644 --- a/driver/keyboard.c +++ b/driver/keyboard.c @@ -7,6 +7,8 @@ #include <stdbool.h> +#include "inet.h" + static bool ctrl_l=false; static bool shift_l=false; static bool shift_r=false; @@ -21,8 +23,11 @@ int hex_to_dec(char c) return c+10-'a'; } + +extern struct netdev e1000_dev; static void put(uint8_t c) { + if(c=='p')net_packet(&e1000_dev); syscall_generic(SYSCALL_WRITE,kb_stream, (char *)&c , 1, 0); } |
