]> xenbits.xen.org Git - xenclient/kernel.git/commitdiff
FLR - intermediate checkin 4 3/26 - fix dev id show and remove to
authorRoss Philipson <ross.philipson@citrix.com>
Thu, 26 Mar 2009 12:07:28 +0000 (08:07 -0400)
committerRoss Philipson <ross.philipson@citrix.com>
Thu, 26 Mar 2009 12:07:28 +0000 (08:07 -0400)
use the type field.

 Changes to be committed:
modified:   drivers/xen/pciback/pci_stub.c

drivers/xen/pciback/pci_stub.c

index a17f24dbcc31a61366ca97b3fe4cb0f82b9494ad..06496666b009fbe3ba58138d1dd7a781e836ddaa 100644 (file)
@@ -643,7 +643,7 @@ static int pcistub_device_id_add(int domain, int bus, int slot, int func, int ty
        return 0;
 }
 
-static int pcistub_device_id_remove(int domain, int bus, int slot, int func)
+static int pcistub_device_id_remove(int domain, int bus, int slot, int func, int type)
 {
        struct pcistub_device_id *pci_dev_id, *t;
        int devfn = PCI_DEVFN(slot, func);
@@ -653,7 +653,7 @@ static int pcistub_device_id_remove(int domain, int bus, int slot, int func)
        spin_lock_irqsave(&device_ids_lock, flags);
        list_for_each_entry_safe(pci_dev_id, t, &pcistub_device_ids, slot_list) {
 
-               if (pci_dev_id->domain == domain
+               if (pci_dev_id->type == type && pci_dev_id->domain == domain
                    && pci_dev_id->bus == bus && pci_dev_id->devfn == devfn) {
                        /* Don't break; here because it's possible the same
                         * slot could be in the list more than once
@@ -765,7 +765,7 @@ static ssize_t pcistub_slot_remove(struct device_driver *drv, const char *buf,
        if (err)
                goto out;
 
-       err = pcistub_device_id_remove(domain, bus, slot, func);
+       err = pcistub_device_id_remove(domain, bus, slot, func, PCIBACK_ID_TYPE_HIDE);
 
 out:
        if (!err)
@@ -783,6 +783,10 @@ static ssize_t pcistub_slot_show(struct device_driver *drv, char *buf)
 
        spin_lock_irqsave(&device_ids_lock, flags);
        list_for_each_entry(pci_dev_id, &pcistub_device_ids, slot_list) {
+               /* only want devices set for hid, not reset entries */
+               if (pci_dev_id->type != PCIBACK_ID_TYPE_HIDE)
+                       continue;
+
                if (count >= PAGE_SIZE)
                        break;