Commenting for new function
[tpg/acess2.git] / Kernel / drv / pci.c
index c52ab63..9823208 100644 (file)
@@ -2,8 +2,9 @@
  * AcessOS/AcessBasic v0.1\r
  * PCI Bus Driver\r
  */\r
-#define DEBUG  1\r
-#include <common.h>\r
+#define DEBUG  0\r
+#include <acess.h>\r
+#include <modules.h>\r
 #include <vfs.h>\r
 #include <fs_devfs.h>\r
 #include <drv_pci.h>\r
@@ -89,7 +90,6 @@ int PCI_Install(char **Arguments)
                gaPCI_PortBitmap[i] = -1;\r
        for( i = 0; i < MAX_RESERVED_PORT % 32; i ++ )\r
                gaPCI_PortBitmap[MAX_RESERVED_PORT / 32] = 1 << i;\r
-       //LogF("Done.\n");\r
        \r
        // Scan Busses\r
        for( bus = 0; bus < giPCI_BusCount; bus++ )\r
@@ -140,11 +140,14 @@ int PCI_Install(char **Arguments)
                if(tmpPtr != gPCI_Devices)\r
                        break;\r
        }\r
+       \r
+       if(giPCI_DeviceCount == 0)\r
+               return MODULE_ERR_NOTNEEDED;\r
+       \r
        tmpPtr = realloc(gPCI_Devices, giPCI_DeviceCount*sizeof(t_pciDevice));\r
        if(tmpPtr == NULL)\r
-               return 0;\r
+               return MODULE_ERR_MALLOC;\r
        gPCI_Devices = tmpPtr;\r
-       //LogF("Done.\n");\r
        \r
        // Complete Driver Structure    \r
        gPCI_DriverStruct.RootNode.Size = giPCI_DeviceCount;\r
@@ -152,7 +155,7 @@ int PCI_Install(char **Arguments)
        // And add to DevFS\r
        DevFS_AddDevice(&gPCI_DriverStruct);\r
        \r
-       return 1;\r
+       return MODULE_ERR_OK;\r
 }\r
 \r
 /**\r
@@ -553,9 +556,10 @@ Uint8 PCI_CfgReadByte(Uint16 bus, Uint16 dev, Uint16 func, Uint16 offset)
 \r
 \r
 // === EXPORTS ===\r
-/*\r
+//*\r
 EXPORT(PCI_CountDevices);\r
 EXPORT(PCI_GetDevice);\r
+EXPORT(PCI_GetDeviceByClass);\r
 EXPORT(PCI_AssignPort);\r
 EXPORT(PCI_GetIRQ);\r
-*/\r
+//*/\r

UCC git Repository :: git.ucc.asn.au