introduce a stable NTL_DDK driver ABI to replace direct HAL_API and kernel-header access in drivers, add code/kernel/io_ddk.c and code/public/ntlite/ddk/ headers, change DriverEntry to take (const NTL_DDK*, NTL_DRIVER_INIT*), update kmain to build the DDK once via IoInitializeDdk/IoGetDdk and hand it to both boot and runtime drivers, downgrade code/public/ntlite/ddi/io_driver.h to a legacy I/O model header pulling from ntlite/ddk instead of kernel internals, move code/third_party/lwip into code/drivers/net/lwip/third_party, fix up lwip_sources.txt and build.c include paths to match, split build.c's single CFLAGS macro into COMMON/KERNEL/USER/BOOT/DRIVER cflags.
This commit is contained in:
1 parent
08329516ba
commit
485a6bbfe7
385 files changed
+1822
-1079
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "rtl8139.h"
|
||||
|
||||
const HAL_API* gHal;
|
||||
const NTL_DDK* gRtl8139Ddk;
|
||||
static DRIVER_OBJECT gRtl8139Driver;
|
||||
static RTL8139_DEVICE* gRtl8139Devices[RTL8139_MAX_DEVICES];
|
||||
static uint32_t gRtl8139DeviceCount;
|
||||
@@ -69,8 +69,8 @@ static KSTATUS Rtl8139Reset(RTL8139_DEVICE* r) {
|
||||
for (uint32_t i = 0; i < 1000; i++) {
|
||||
if ((Rtl8139Read8(r, RTL8139_REG_CMD) & RTL8139_CMD_RST) == 0)
|
||||
return NTLSTATUS_SUCCESS;
|
||||
if (gHal->Timer.Stall)
|
||||
gHal->Timer.Stall(1000);
|
||||
if (gRtl8139Ddk->Timer->Stall)
|
||||
gRtl8139Ddk->Timer->Stall(1000);
|
||||
}
|
||||
return NTLSTATUS_TIMEOUT;
|
||||
}
|
||||
@@ -97,8 +97,8 @@ static KSTATUS Rtl8139AllocateDma(RTL8139_DEVICE* r) {
|
||||
return NTLSTATUS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
r->RxBuffer = (uint8_t*)gHal->PhysToVirt(r->RxPhys);
|
||||
r->TxBuffers = (uint8_t*)gHal->PhysToVirt(r->TxPhys);
|
||||
r->RxBuffer = (uint8_t*)gRtl8139Ddk->Memory->PhysToVirt(r->RxPhys);
|
||||
r->TxBuffers = (uint8_t*)gRtl8139Ddk->Memory->PhysToVirt(r->TxPhys);
|
||||
memset(r->RxBuffer, 0, PAGE_SIZE * RTL8139_RX_PAGES);
|
||||
memset(r->TxBuffers, 0, PAGE_SIZE * RTL8139_TX_PAGES);
|
||||
|
||||
@@ -553,12 +553,13 @@ KSTATUS Rtl8139AddDevice(DRIVER_OBJECT* driver, DEVICE_OBJECT* physicalDeviceObj
|
||||
}
|
||||
|
||||
// Implements the driver Entry operation.
|
||||
KSTATUS DriverEntry(const HAL_API* hal) {
|
||||
if (!hal)
|
||||
KSTATUS DriverEntry(const NTL_DDK* ddk, NTL_DRIVER_INIT* init) {
|
||||
(void)init;
|
||||
if (!ddk || !ddk->Memory || !ddk->Memory->PhysToVirt || !ddk->Timer)
|
||||
return NTLSTATUS_INVALID_PARAMETER;
|
||||
|
||||
DbgPrint("RTL8139: driver loading...\n");
|
||||
gHal = hal;
|
||||
gRtl8139Ddk = ddk;
|
||||
gRtl8139DeviceCount = 0;
|
||||
|
||||
memset(&gRtl8139Driver, 0, sizeof(gRtl8139Driver));
|
||||
|
||||
Reference in new issue
Block a user