Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jun 2014 04:16:31 +0000 (UTC)
From:      Bryan Venteicher <bryanv@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r267521 - head/sys/dev/virtio/pci
Message-ID:  <201406160416.s5G4GV0n051664@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bryanv
Date: Mon Jun 16 04:16:31 2014
New Revision: 267521
URL: http://svnweb.freebsd.org/changeset/base/267521

Log:
  Remove kernel specific macro out of the VirtIO PCI header file
  
  The eventual goal is to share this file with userland, so
  remove the macro that is only specific for virtio_pci(4).
  Instead, add the VIRTIO_PCI_CONFIG_OFF macro from Linux to
  get the config size whether MSIX is enabled or not.
  
  MFC after:	1 week

Modified:
  head/sys/dev/virtio/pci/virtio_pci.c
  head/sys/dev/virtio/pci/virtio_pci.h

Modified: head/sys/dev/virtio/pci/virtio_pci.c
==============================================================================
--- head/sys/dev/virtio/pci/virtio_pci.c	Mon Jun 16 04:12:33 2014	(r267520)
+++ head/sys/dev/virtio/pci/virtio_pci.c	Mon Jun 16 04:16:31 2014	(r267521)
@@ -170,6 +170,9 @@ static void	vtpci_config_intr(void *);
 
 #define vtpci_setup_msi_interrupt vtpci_setup_legacy_interrupt
 
+#define VIRTIO_PCI_CONFIG(_sc) \
+    VIRTIO_PCI_CONFIG_OFF((((_sc)->vtpci_flags & VTPCI_FLAG_MSIX)) != 0)
+
 /*
  * I/O port read/write wrappers.
  */

Modified: head/sys/dev/virtio/pci/virtio_pci.h
==============================================================================
--- head/sys/dev/virtio/pci/virtio_pci.h	Mon Jun 16 04:12:33 2014	(r267520)
+++ head/sys/dev/virtio/pci/virtio_pci.h	Mon Jun 16 04:16:31 2014	(r267521)
@@ -72,8 +72,7 @@
  * The remaining space is defined by each driver as the per-driver
  * configuration space.
  */
-#define VIRTIO_PCI_CONFIG(sc) \
-    (((sc)->vtpci_flags & VTPCI_FLAG_MSIX) ? 24 : 20)
+#define VIRTIO_PCI_CONFIG_OFF(msix_enabled)     ((msix_enabled) ? 24 : 20)
 
 /*
  * How many bits to shift physical queue address written to QUEUE_PFN.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406160416.s5G4GV0n051664>