Author: neel
Date: Wed Dec 18 03:58:51 2013
New Revision: 259537
URL: http://svnweb.freebsd.org/changeset/base/259537

Log:
  Rename the ambiguously named 'vm_setup_msi()' and 'vm_setup_msix()' to
  'vm_setup_pptdev_msi()' and 'vm_setup_pptdev_msix()' respectively.
  
  It should now be clear that these functions operate on passthru devices.

Modified:
  head/lib/libvmmapi/vmmapi.c
  head/lib/libvmmapi/vmmapi.h
  head/usr.sbin/bhyve/pci_passthru.c

Modified: head/lib/libvmmapi/vmmapi.c
==============================================================================
--- head/lib/libvmmapi/vmmapi.c Wed Dec 18 03:51:04 2013        (r259536)
+++ head/lib/libvmmapi/vmmapi.c Wed Dec 18 03:58:51 2013        (r259537)
@@ -563,8 +563,8 @@ vm_map_pptdev_mmio(struct vmctx *ctx, in
 }
 
 int
-vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func,
-            uint64_t addr, uint64_t msg, int numvec)
+vm_setup_pptdev_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func,
+    uint64_t addr, uint64_t msg, int numvec)
 {
        struct vm_pptdev_msi pptmsi;
 
@@ -581,8 +581,8 @@ vm_setup_msi(struct vmctx *ctx, int vcpu
 }
 
 int    
-vm_setup_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func,
-             int idx, uint64_t addr, uint64_t msg, uint32_t vector_control)
+vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func,
+    int idx, uint64_t addr, uint64_t msg, uint32_t vector_control)
 {
        struct vm_pptdev_msix pptmsix;
 

Modified: head/lib/libvmmapi/vmmapi.h
==============================================================================
--- head/lib/libvmmapi/vmmapi.h Wed Dec 18 03:51:04 2013        (r259536)
+++ head/lib/libvmmapi/vmmapi.h Wed Dec 18 03:58:51 2013        (r259537)
@@ -82,10 +82,11 @@ int vm_assign_pptdev(struct vmctx *ctx, 
 int    vm_unassign_pptdev(struct vmctx *ctx, int bus, int slot, int func);
 int    vm_map_pptdev_mmio(struct vmctx *ctx, int bus, int slot, int func,
                           vm_paddr_t gpa, size_t len, vm_paddr_t hpa);
-int    vm_setup_msi(struct vmctx *ctx, int vcpu, int bus, int slot, int func,
-           uint64_t addr, uint64_t msg, int numvec);
-int    vm_setup_msix(struct vmctx *ctx, int vcpu, int bus, int slot, int func,
-           int idx, uint64_t addr, uint64_t msg, uint32_t vector_control);
+int    vm_setup_pptdev_msi(struct vmctx *ctx, int vcpu, int bus, int slot,
+           int func, uint64_t addr, uint64_t msg, int numvec);
+int    vm_setup_pptdev_msix(struct vmctx *ctx, int vcpu, int bus, int slot,
+           int func, int idx, uint64_t addr, uint64_t msg,
+           uint32_t vector_control);
 
 /*
  * Return a pointer to the statistics buffer. Note that this is not MT-safe.

Modified: head/usr.sbin/bhyve/pci_passthru.c
==============================================================================
--- head/usr.sbin/bhyve/pci_passthru.c  Wed Dec 18 03:51:04 2013        
(r259536)
+++ head/usr.sbin/bhyve/pci_passthru.c  Wed Dec 18 03:58:51 2013        
(r259537)
@@ -345,12 +345,10 @@ msix_table_write(struct vmctx *ctx, int 
                /* If the entry is masked, don't set it up */
                if ((entry->vector_control & PCIM_MSIX_VCTRL_MASK) == 0 ||
                    (vector_control & PCIM_MSIX_VCTRL_MASK) == 0) {
-                       error = vm_setup_msix(ctx, vcpu, sc->psc_sel.pc_bus,
-                                             sc->psc_sel.pc_dev, 
-                                             sc->psc_sel.pc_func,
-                                             index, entry->addr,
-                                             entry->msg_data, 
-                                             entry->vector_control);
+                       error = vm_setup_pptdev_msix(ctx, vcpu,
+                           sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, 
+                           sc->psc_sel.pc_func, index, entry->addr,
+                           entry->msg_data, entry->vector_control);
                }
        }
 }
@@ -652,12 +650,12 @@ passthru_cfgwrite(struct vmctx *ctx, int
        if (msicap_access(sc, coff)) {
                msicap_cfgwrite(pi, sc->psc_msi.capoff, coff, bytes, val);
 
-               error = vm_setup_msi(ctx, vcpu, sc->psc_sel.pc_bus,
+               error = vm_setup_pptdev_msi(ctx, vcpu, sc->psc_sel.pc_bus,
                        sc->psc_sel.pc_dev, sc->psc_sel.pc_func,
                        pi->pi_msi.addr, pi->pi_msi.msg_data,
                        pi->pi_msi.maxmsgnum);
                if (error != 0) {
-                       printf("vm_setup_msi returned error %d\r\n", errno);
+                       printf("vm_setup_pptdev_msi error %d\r\n", errno);
                        exit(1);
                }
                return (0);
@@ -668,7 +666,7 @@ passthru_cfgwrite(struct vmctx *ctx, int
                if (pi->pi_msix.enabled) {
                        msix_table_entries = pi->pi_msix.table_count;
                        for (i = 0; i < msix_table_entries; i++) {
-                               error = vm_setup_msix(ctx, vcpu,
+                               error = vm_setup_pptdev_msix(ctx, vcpu,
                                    sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, 
                                    sc->psc_sel.pc_func, i, 
                                    pi->pi_msix.table[i].addr,
@@ -676,8 +674,8 @@ passthru_cfgwrite(struct vmctx *ctx, int
                                    pi->pi_msix.table[i].vector_control);
                
                                if (error) {
-                                       printf("vm_setup_msix error %d\r\n",
-                                           errno);
+                                       printf("vm_setup_pptdev_msix error "
+                                           "%d\r\n", errno);
                                        exit(1);        
                                }
                        }
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to