]> xenbits.xensource.com Git - xen.git/commitdiff
pci: introduce a devfn field to pci_sbdf_t
authorRoger Pau Monné <roger.pau@citrix.com>
Tue, 11 Jun 2019 15:16:59 +0000 (17:16 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 11 Jun 2019 15:16:59 +0000 (17:16 +0200)
This is equivalent to the current extfunc field in term of contents.

Switch the two current users of extfunc to use devfn instead for
correctness.

No functional change.

Requested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/vpci/vpci.c
xen/include/xen/pci.h

index b03232fe3059611565c3c4d8703241bc07609e84..ca598675eabc0046963ec84ed5c47944946ca9f2 100644 (file)
@@ -327,7 +327,7 @@ uint32_t vpci_read(pci_sbdf_t sbdf, unsigned int reg, unsigned int size)
     }
 
     /* Find the PCI dev matching the address. */
-    pdev = pci_get_pdev_by_domain(d, sbdf.seg, sbdf.bus, sbdf.extfunc);
+    pdev = pci_get_pdev_by_domain(d, sbdf.seg, sbdf.bus, sbdf.devfn);
     if ( !pdev )
         return vpci_read_hw(sbdf, reg, size);
 
@@ -432,7 +432,7 @@ void vpci_write(pci_sbdf_t sbdf, unsigned int reg, unsigned int size,
      * Find the PCI dev matching the address.
      * Passthrough everything that's not trapped.
      */
-    pdev = pci_get_pdev_by_domain(d, sbdf.seg, sbdf.bus, sbdf.extfunc);
+    pdev = pci_get_pdev_by_domain(d, sbdf.seg, sbdf.bus, sbdf.devfn);
     if ( !pdev )
     {
         vpci_write_hw(sbdf, reg, size, data);
index dab1a86dd4c7d7442555af0688d4739c227fc536..c61fd7e2628997fbe478b9cf467fa4fc3ce65d0b 100644 (file)
@@ -49,7 +49,8 @@ typedef union {
                         uint8_t fn   : 3,
                                 dev  : 5;
                     };
-                    uint8_t     extfunc;
+                    uint8_t     devfn,
+                                extfunc;
                 };
                 uint8_t         bus;
             };