mirror of
https://github.com/Fennix-Project/Drivers.git
synced 2025-07-11 15:19:23 +00:00
Update drivers
This commit is contained in:
@ -29,6 +29,8 @@ __attribute__((section(".extended"))) FexExtended ExtendedHeader = {
|
||||
|
||||
KernelAPI *KAPI;
|
||||
|
||||
#define print(msg) KAPI->Util.DebugPrint((char *)(msg), KAPI->Info.DriverUID)
|
||||
|
||||
/* --------------------------------------------------------------------------------------------------------- */
|
||||
|
||||
struct BARData
|
||||
@ -60,16 +62,16 @@ int CallbackHandler(KernelCallback *Data)
|
||||
{
|
||||
case AcknowledgeReason:
|
||||
{
|
||||
KAPI->Util.DebugPrint(((char *)"Kernel acknowledged the driver." + KAPI->Info.Offset), KAPI->Info.DriverUID);
|
||||
print("Kernel acknowledged the driver.");
|
||||
break;
|
||||
}
|
||||
case ConfigurationReason:
|
||||
{
|
||||
KAPI->Util.DebugPrint(((char *)"Kernel received configuration data." + KAPI->Info.Offset), KAPI->Info.DriverUID);
|
||||
print("Kernel received configuration data.");
|
||||
PCIBaseAddress = reinterpret_cast<PCIDeviceHeader *>(Data->RawPtr);
|
||||
if (PCIBaseAddress->VendorID == 0x1AF4 && PCIBaseAddress->DeviceID == 0x1000)
|
||||
{
|
||||
KAPI->Util.DebugPrint(((char *)"Found Virtio Network." + KAPI->Info.Offset), KAPI->Info.DriverUID);
|
||||
print("Found Virtio Network.");
|
||||
return NOT_IMPLEMENTED;
|
||||
}
|
||||
else
|
||||
@ -84,9 +86,15 @@ int CallbackHandler(KernelCallback *Data)
|
||||
{
|
||||
break;
|
||||
}
|
||||
case StopReason:
|
||||
{
|
||||
// TODO: Stop the driver.
|
||||
print("Driver stopped.");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
KAPI->Util.DebugPrint(((char *)"Unknown reason." + KAPI->Info.Offset), KAPI->Info.DriverUID);
|
||||
print("Unknown reason.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user