]> Zhao Yanbai Git Server - minix.git/commitdiff
Small fix, implemented getvid/did
authorDirk Vogt <dirk@minix3.org>
Mon, 7 Mar 2011 13:31:48 +0000 (13:31 +0000)
committerDirk Vogt <dirk@minix3.org>
Mon, 7 Mar 2011 13:31:48 +0000 (13:31 +0000)
lib/libddekit/src/pci.c

index aaa01d0d0799db267d9ef4459a19551a93ef6d49..3768a4f20caee2bf101175c55812fac93f89fb7b 100644 (file)
@@ -10,7 +10,6 @@
 #include <ddekit/panic.h>
 #include <minix/syslib.h>
 
-
 #ifdef DDEBUG_LEVEL_PCI
 #undef DDEBUG
 #define DDEBUG DDEBUG_LEVEL_PCI
@@ -297,7 +296,7 @@ PUBLIC struct ddekit_pci_dev *ddekit_pci_find_device
 { 
        int i,search=0;
 
-       if(!start)
+       if(start)
                search = 1;
 
        for(i=0; i < PCI_MAX_DEVS ; i++) 
@@ -311,6 +310,9 @@ PUBLIC struct ddekit_pci_dev *ddekit_pci_find_device
                        if ((*slot==dev->slot || *slot == DDEKIT_PCI_ANY_ID)
                                && (*func==dev->func || *func == DDEKIT_PCI_ANY_ID))
                        {
+                               *bus  = 0;
+                               *slot = dev->slot;
+                               *func = dev->func; 
                                return dev;
                        }
                }
@@ -318,6 +320,22 @@ PUBLIC struct ddekit_pci_dev *ddekit_pci_find_device
        return 0;
 }
 
+/****************************************************************************/
+/*      ddekit_pci_get_vendor                                               */
+/****************************************************************************/
+PUBLIC unsigned short ddekit_pci_get_vendor(struct ddekit_pci_dev *dev)
+{ 
+       return dev->vid;
+}
+
+/****************************************************************************/
+/*      ddekit_pci_get_device_id                                            */
+/****************************************************************************/
+PUBLIC unsigned short ddekit_pci_get_device_id(struct ddekit_pci_dev *dev)
+{ 
+       return dev->did;
+}
+
 /*
  * XXX: Those are neither used be DDEFBSD or DDELinux implement them 
  *      when you need them  
@@ -349,23 +367,6 @@ PUBLIC void ddekit_pci_set_master(struct ddekit_pci_dev *dev)
        WARN_UNIMPL;
 }
 
-/****************************************************************************/
-/*      ddekit_pci_get_vendor                                               */
-/****************************************************************************/
-PUBLIC unsigned short ddekit_pci_get_vendor(struct ddekit_pci_dev *dev)
-{ 
-       WARN_UNIMPL;
-       return 0;
-}
-
-/****************************************************************************/
-/*      ddekit_pci_get_device_id                                            */
-/****************************************************************************/
-PUBLIC unsigned short ddekit_pci_get_device_id(struct ddekit_pci_dev *dev)
-{ 
-       WARN_UNIMPL;
-       return 0;
-}
 
 /****************************************************************************/
 /*      ddekit_pci_get_sub_vendor                                           */