Index: uspace/drv/nic/virtio-net/Makefile
===================================================================
--- uspace/drv/nic/virtio-net/Makefile	(revision 69927fab3891b72d92c47cac5ca6786ac7d6cc5e)
+++ uspace/drv/nic/virtio-net/Makefile	(revision 00192cde306d224210f23dbe03b16877c0d01e4d)
@@ -28,5 +28,5 @@
 
 USPACE_PREFIX = ../../..
-LIBS = drv nic
+LIBS = drv nic virtio
 BINARY = virtio-net
 
Index: uspace/drv/nic/virtio-net/virtio-net.c
===================================================================
--- uspace/drv/nic/virtio-net/virtio-net.c	(revision 69927fab3891b72d92c47cac5ca6786ac7d6cc5e)
+++ uspace/drv/nic/virtio-net/virtio-net.c	(revision 00192cde306d224210f23dbe03b16877c0d01e4d)
@@ -37,16 +37,7 @@
 #include <nic.h>
 
+#include <virtio-pci.h>
+
 #define NAME	"virtio-net"
-
-#define VIRTIO_PCI_CAP_TYPE(c)		((c) + 3)
-#define VIRTIO_PCI_CAP_BAR(c)		((c) + 4)
-#define VIRTIO_PCI_CAP_OFFSET(c)	((c) + 8)
-#define VIRTIO_PCI_CAP_LENGTH(c)	((c) + 12)
-
-#define VIRTIO_PCI_CAP_COMMON_CFG	1
-#define VIRTIO_PCI_CAP_NOTIFY_CFG	2
-#define VIRTIO_PCI_CAP_ISR_CFG		3
-#define VIRTIO_PCI_CAP_DEVICE_CFG	4
-#define VIRTIO_PCI_CAP_PCI_CFG		5
 
 static errno_t virtio_net_dev_add(ddf_dev_t *dev)
@@ -55,41 +46,7 @@
 	    ddf_dev_get_name(dev), ddf_dev_get_handle(dev));
 
-	async_sess_t *pci_sess = ddf_dev_parent_sess_get(dev);
-	if (!pci_sess)
-		return ENOENT;
-
-	/*
-	 * Find the VIRTIO PCI Capabilities
-	 */
-	errno_t rc;
-	uint8_t c;
-	uint8_t id;
-	for (rc = pci_config_space_cap_first(pci_sess, &c, &id);
-	    (rc == EOK) && c;
-	    rc = pci_config_space_cap_next(pci_sess, &c, &id)) {
-		if (id == PCI_CAP_VENDORSPECID) {
-			uint8_t type;
-
-			rc = pci_config_space_read_8(pci_sess,
-			    VIRTIO_PCI_CAP_TYPE(c), &type);
-			if (rc != EOK)
-				return rc;
-
-			switch (type) {
-			case VIRTIO_PCI_CAP_COMMON_CFG:
-				break;
-			case VIRTIO_PCI_CAP_NOTIFY_CFG:
-				break;
-			case VIRTIO_PCI_CAP_ISR_CFG:
-				break;
-			case VIRTIO_PCI_CAP_DEVICE_CFG:
-				break;
-			case VIRTIO_PCI_CAP_PCI_CFG:
-				break;
-			default:
-				break;
-			}
-		}
-	}
+	// XXX: this will be part of the nic data
+	virtio_dev_t virtio_dev;
+	errno_t rc = virtio_pci_dev_init(dev, &virtio_dev);
 	if (rc != EOK)
 		return rc;
