socsvn commit: r307227 - soc2016/vincenzo/head/usr.sbin/bhyve

vincenzo at FreeBSD.org vincenzo at FreeBSD.org
Fri Aug 5 14:02:21 UTC 2016


Author: vincenzo
Date: Fri Aug  5 14:02:19 2016
New Revision: 307227
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=307227

Log:
   bhyve: ptnet: ptnet_bar_read()

Modified:
  soc2016/vincenzo/head/usr.sbin/bhyve/pci_ptnetmap_netif.c

Modified: soc2016/vincenzo/head/usr.sbin/bhyve/pci_ptnetmap_netif.c
==============================================================================
--- soc2016/vincenzo/head/usr.sbin/bhyve/pci_ptnetmap_netif.c	Fri Aug  5 14:01:41 2016	(r307226)
+++ soc2016/vincenzo/head/usr.sbin/bhyve/pci_ptnetmap_netif.c	Fri Aug  5 14:02:19 2016	(r307227)
@@ -98,8 +98,21 @@
 	if (sc == NULL)
 		return 0;
 
-	if (baridx == PTNETMAP_IO_PCI_BAR) {
+	offset = offset & PTNET_IO_MASK;
+
+	if (baridx == PTNETMAP_IO_PCI_BAR && offset < PTNET_IO_END) {
 		switch (offset) {
+		case PTNET_IO_NIFP_OFS:
+		case PTNET_IO_NUM_TX_RINGS:
+		case PTNET_IO_NUM_RX_RINGS:
+		case PTNET_IO_NUM_TX_SLOTS:
+		case PTNET_IO_NUM_RX_SLOTS:
+			/* Fill in device registers with information about
+			 * nifp_offset, num_*x_rings, and num_*x_slots. */
+			ptnet_get_netmap_if(sc);
+
+		default:
+			return sc->ioregs[offset >> 2];
 		}
 	}
 


More information about the svn-soc-all mailing list