From 25be4cb5371962eb6453c5e12ebc888dd1976c6b Mon Sep 17 00:00:00 2001 From: John Hodge Date: Thu, 19 Jul 2012 18:33:50 +0800 Subject: [PATCH] Kernel - Added stub E1000 driver --- BuildConf/x86/default.mk | 1 + KernelLand/Modules/Network/E1000/e1000.c | 60 ++++++++++++++++++++++++ KernelLand/Modules/Network/E1000/e1000.h | 14 ++++++ 3 files changed, 75 insertions(+) create mode 100644 KernelLand/Modules/Network/E1000/e1000.c create mode 100644 KernelLand/Modules/Network/E1000/e1000.h diff --git a/BuildConf/x86/default.mk b/BuildConf/x86/default.mk index d9237ca4..759953cf 100644 --- a/BuildConf/x86/default.mk +++ b/BuildConf/x86/default.mk @@ -3,6 +3,7 @@ MODULES += Storage/ATA MODULES += Storage/FDDv2 MODULES += Network/NE2000 Network/RTL8139 MODULES += Network/VIARhineII +MODULES += Network/E1000 MODULES += Display/VESA MODULES += Display/BochsGA #MODULES += Display/VIAVideo diff --git a/KernelLand/Modules/Network/E1000/e1000.c b/KernelLand/Modules/Network/E1000/e1000.c new file mode 100644 index 00000000..b225d3dd --- /dev/null +++ b/KernelLand/Modules/Network/E1000/e1000.c @@ -0,0 +1,60 @@ +/* + * Acess2 E1000 Network Driver + * - By John Hodge (thePowersGang) + * + * e1000.c + * - Intel E1000 Network Card Driver (core) + */ +#define DEBUG 1 +#define VERSION VER2(0,1) +#include +#include "e1000.h" +#include +#include +#include + +// === PROTOTYPES === + int E1000_Install(char **Arguments); + int E1000_Cleanup(void); +tIPStackBuffer *E1000_WaitForPacket(void *Ptr); + int E1000_SendPacket(void *Ptr, tIPStackBuffer *Buffer); +void E1000_IRQHandler(int Num, void *Ptr); + +// === GLOBALS === +MODULE_DEFINE(0, VERSION, E1000, E1000_Install, E1000_Cleanup, NULL); +tIPStack_AdapterType gE1000_AdapterType = { + .Name = "E1000", + .Type = 0, // TODO: Differentiate differnet wire protos and speeds + .Flags = 0, // TODO: IP checksum offloading, MAC checksum offloading etc + .SendPacket = E1000_SendPacket, + .WaitForPacket = E1000_WaitForPacket + }; + +// === CODE === +int E1000_Install(char **Arguments) +{ + for( int id = -1; (id = PCI_GetDevice(0x8086, 0x100E, id)) != -1; ) + { + + } + return MODULE_ERR_NOTNEEDED; +} + +int E1000_Cleanup(void) +{ + return 0; +} + +tIPStackBuffer *E1000_WaitForPacket(void *Ptr) +{ + return NULL; +} + +int E1000_SendPacket(void *Ptr, tIPStackBuffer *Buffer) +{ + return -1; +} + +void E1000_IRQHandler(int Num, void *Ptr) +{ +} diff --git a/KernelLand/Modules/Network/E1000/e1000.h b/KernelLand/Modules/Network/E1000/e1000.h new file mode 100644 index 00000000..d8b864ff --- /dev/null +++ b/KernelLand/Modules/Network/E1000/e1000.h @@ -0,0 +1,14 @@ +/* + * Acess2 E1000 Network Driver + * - By John Hodge (thePowersGang) + * + * e1000.h + * - Driver core header + */ +#ifndef _E1000_H_ +#define _E1000_H_ + + + +#endif + -- 2.20.1